[Getdp] Why this irrelevant result ?
Olivier Castany
castany at quatramaran.ens.fr
Wed Aug 16 16:54:13 CEST 2006
Hello,
I am trying to use GetDP. This is a bit difficult and out of my usual
field.
I succeeded in solving simple situations but I face a problem with that
one : a metal rod conducting heat, the temperature is imposed at one end
and there is convection on the other faces.
I get an irrelevant result.
The corresponding files are at the end of this message (they are short) :
barre.geo and barre.pro
Could someone tell what exactly is wrong in my files ?
I believe this has to do with how convection is taken into account at the
surface... but can't see what is wrong.
Have a nice day,
Olivier C.
----------------------------
barre.geo
-------------
/*
Metal rod
*/
lc_ext = 0.03;
rayon = 0.05;
longueur = 0.5;
Point(1) = {0,0,0,1};// longueur caractéristique du centre sans utilité
Point(2) = {rayon,0,0,lc_ext};
Point(3) = {-rayon,0,0,lc_ext};
Point(4) = {0,-rayon,0,lc_ext};
Point(5) = {0,rayon,0,lc_ext};
Circle(1) = {2,1,5};
Circle(2) = {5,1,3};
Circle(3) = {3,1,4};
Circle(4) = {4,1,2};
Line Loop(5) = {1,2,3,4};
Plane Surface(6) = {5};
Extrude {0,0,longueur} {
Surface{6}; Layers{ 30,1 }; Recombine;
}
Physical Surface(31) = {6};
Physical Surface(32) = {27,15,19,23,28};
Physical Volume(33) = {1};
/* Remark : gmsh statistics show :
Geometry : 24 lines... it should be : 12
Mesh : 296 nodes on lines... it should be : 132
400 nodes on surfaces... it should be : 260
*/
-----------------------
barre.pro
-------
/*
Temperature in a metal rod :
- the temperature is imposed at one end (surface SV)
- convection happens on all other surfaces (surface SA) (j.n = h(T-T_ext))
- conduction of heat in the material (volume D) (j = - lambda Grad(T))
- equilibrium situation (Div(j)=0)
*/
Group{
D = Region[33];// Entire volume
SV = Region[31];// Surface with imposed temperature
SA = Region[32];// Other surfaces with air convection
}
Function {
h[] = 30.;// Wm-2K-1 (strong natural air convection)
lambda[] = 20.;// Wm-1K-1 (some highly allied steel)
T_ext[] = 30.;// °C (air temperature)
}
// Temperature imposed on surface SV :200°C
Constraint {
{ Name temperature_sur_SV ; Type Assign;
Case {
{ Region SV ; Value 200. ; }
}
}
}
FunctionSpace {
{ Name temperature_dans_barre ; Type Form0 ;
BasisFunction {
{ Name w_n ; NameOfCoef T_n ; Function BF_Node ;
Support D ; Entity NodesOf[ All ] ; }
}
Constraint {
{ NameOfCoef T_n ; EntityType NodesOf ;
NameOfConstraint temperature_sur_SV ; }
}
}
}
Jacobian {
{ Name JVol ;
Case {
{ Region All ; Jacobian Vol ; }
}
}
{ Name JSur ;
Case {
{ Region All ; Jacobian Sur ; }
}
}
}
Integration {
{ Name I ;
Case {
{ Type Gauss ;
Case {
{ GeoElement Point ; NumberOfPoints 1 ; }
{ GeoElement Line ; NumberOfPoints 3 ; }
{ GeoElement Triangle ; NumberOfPoints 4 ; }
{ GeoElement Quadrangle ; NumberOfPoints 4 ; }
{ GeoElement Tetrahedron ; NumberOfPoints 4 ; }
{ GeoElement Hexahedron ; NumberOfPoints 6 ; }
{ GeoElement Prism ; NumberOfPoints 6 ; }
}
}
}
}
}
/****************** Integral formulation to solve :
find T such that :
\int_D lambda Grad(T).Grad(T') + \int_SA h (T - T_ext) T' = 0
holds for all T' with T' = 0 on SV
******************************************/
Formulation {
{ Name formulation_du_probleme ; Type FemEquation ;
Quantity {
{ Name T ; Type Local ; NameOfSpace temperature_dans_barre ; }
}
Equation {
Galerkin { [ lambda[] * Dof{d T} , {d T} ] ;
In D ; Jacobian JVol ; Integration I ; }
Galerkin { [ h[] * (Dof{T} - T_ext[]) , {T} ] ;
In SA ; Jacobian JSur ; Integration I ; }
}
}
}
Resolution {
{ Name resolution_du_probleme ;
System {
{ Name A ; NameOfFormulation formulation_du_probleme ; }
}
Operation {
Generate[A] ; Solve[A] ; SaveSolution[A] ;
}
}
}
PostProcessing {
{ Name post_processing ; NameOfFormulation formulation_du_probleme ;
Quantity {
{ Name T; Value { Local { [ {T} ] ; In SA ; Jacobian JSur ; }}}
}
}
}
PostOperation {
{ Name post_operations ; NameOfPostProcessing post_processing;
Operation {
Print[ T, OnElementsOf SA, File "T.pos"] ;
}
}
}
------------------------