[Getdp] Problem definition of static heat flow
Kenny Erleben
kenny at diku.dk
Thu May 1 15:56:31 CEST 2003
Hi All,
I have been reading the reference manual and looked through the examples,
but I just don't get it. How do I write a formulation for the PDE of
static heat flow? That is
u_xx + u_yy = - q
Below I have attached my .msh and .pro files
Regards
Kenny
-------- heat.msh --------
$NOD
20
1 0 3 0
2 0 2 0
3 0 1 0
4 0 0 0
5 1 3 0
6 1 2 0
7 1 1 0
8 1 0 0
9 2 3 0
10 2 2 0
11 2 1 0
12 2 0 0
13 3 3 0
14 3 2 0
15 3 1 0
16 3 0 0
17 4 3 0
18 4 2 0
19 4 1 0
20 4 0 0
$ENDNOD
$ELM
38
1 1 1001 0 2 17 13
2 1 1001 0 2 13 9
3 1 1001 0 2 9 5
4 1 1001 0 2 5 1
5 1 1002 0 2 4 8
6 1 1002 0 2 8 12
7 1 1002 0 2 12 16
8 1 1002 0 2 16 20
9 1 1003 0 2 1 2
10 1 1003 0 2 2 3
11 1 1003 0 2 3 4
12 1 1004 0 2 20 19
13 1 1004 0 2 19 18
14 1 1004 0 2 18 17
15 2 1000 0 3 5 1 6
16 2 1000 0 3 2 6 1
17 2 1000 0 3 6 2 7
18 2 1000 0 3 3 7 2
19 2 1000 0 3 7 3 8
20 2 1000 0 3 4 8 3
21 2 1000 0 3 9 5 10
22 2 1000 0 3 6 10 5
23 2 1000 0 3 10 6 11
24 2 1000 0 3 7 11 6
25 2 1000 0 3 11 7 12
26 2 1000 0 3 8 12 7
27 2 1000 0 3 13 9 14
28 2 1000 0 3 10 14 9
29 2 1000 0 3 14 10 15
30 2 1000 0 3 11 15 10
31 2 1000 0 3 15 11 16
32 2 1000 0 3 12 16 11
33 2 1000 0 3 17 13 18
34 2 1000 0 3 14 18 13
35 2 1000 0 3 18 14 19
36 2 1000 0 3 15 19 14
37 2 1000 0 3 19 15 20
38 2 1000 0 3 16 20 15
$ENDELM
----- heat.pro -----
Group {
Top = Region[ 1001 ];
Bottom = Region[ 1002 ];
Left = Region[ 1003 ];
Right = Region[ 1004 ];
Boundary = Region[ {Top, Bottom, Left, Right} ];
DirichletBoundary = Region[ {Top, Right} ] ;
NeumannBoundary = Region[ {Left, Bottom} ] ;
Domain = Region[ 1000 ];
}
Function {
lambda1 [ Domain ] = 1.;
lambda2 [ Domain ] = 1.;
qtilde [ Domain ] = 1.;
q [ NeumannBoundary ] = 1.;
f [ DirichletBoundary ] = 0.;
f [ Domain ] = 0.;
}
Constraint {
{ Name DirichletConstraint ;
Case {
{ Region DirichletBoundary ; Value f[] ; }
}
}
{ Name NeumannConstraint ;
Case {
{ Region NeumannBoundary ; Value q[] ; }
}
}
}
Jacobian {
{ Name JacobianVol ;
Case {
{ Region All ; Jacobian Vol ; }
}
}
}
Integration {
{ Name I1 ;
Case {
{ Type Gauss ;
Case {
{ GeoElement Triangle ; NumberOfPoints 4 ; }
}
}
}
}
}
FunctionSpace {
{ Name Temperature ; Type Form0 ;
BasisFunction {
{ Name N ; NameOfCoef uHat ; Function BF_Node ;
Support Domain ; Entity NodesOf[ All ] ; }
}
Constraint {
{ NameOfCoef uHat ; EntityType NodesOf ; NameOfConstraint
DirichletConstraint ; }
}
}
}
Formulation {
{ Name StaticHeatFlow ; Type FemEquation ;
Quantity {
{ Name u ; Type Local ; NameOfSpace Temperature ; }
}
Equation {
Galerkin { [ - lambda1[] * Dof{d u} , {d u} ] ;
In Domain ; Jacobian JacobianVol ; Integration I1 ; }
/* Galerkin { [ - mu[] * hc[] , {d phi} ] ;
In NeumannBoundary ; Jacobian JacobianVol ; Integration
I1 ; }
*/
}
}
}
Resolution {
{ Name StaticHeatSolution ;
System {
{ Name StaticHeatEquations ; NameOfFormulation StaticHeatFlow ; }
}
Operation {
Generate[StaticHeatEquations] ; Solve[StaticHeatEquations] ;
SaveSolution[StaticHeatEquations] ;
}
}
}
PostProcessing {
{ Name StaticHeatPP ; NameOfFormulation StaticHeatFlow ;
Quantity {
{ Name u ; Value { Local { [ { u } ] ; In Domain ; Jacobian
JacobianVol ; } } }
}
}
}
PostOperation {
{ Name magic ; NameOfPostProcessing StaticHeatPP;
Operation {
Print[ u, OnElementsOf Domain, File "u.pos"] ;
}
}
}