HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat...

18

Click here to load reader

Transcript of HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat...

Page 1: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM

The PARTIAL DIFFERENTIAL EQUATIONS (PDE) of the UNSTEADYHEAT TRANFER PROBLEM :

Let

- a bounded polyhedral domain Ω in Rm(1 ≤ m ≤ 3) and Γ its boundary ;

- Γ = ΓD

⋃ΓN

⋃ΓF , a subdivision of the boundary with measure(ΓD ∪ ΓF ) > 0

- find at every time t, at every point X , the TEMPERATURE θ(t, X) solution of

ρ C(t, X, θ)∂θ

∂t(t, X)−

m∑

i=1

∂xi

(

m∑

j=1

ai,j(t, X, θ)∂θ

∂xj

(t, X)) +

m∑

i=1

Vi(t, X, θ)∂θ

∂xi

(t, X)

+ CT (t, X, θ) θ(t, X) = FΩ(t, X, θ) ∀X ∈ Ω ∀t ∈]T0, T [

with the initial condition

θ(T0, X) = θ0(X) ∀X ∈ Ω

with the boundary conditions of DIRICHLET on ΓD, NEUMAN on ΓN and FOURIER-ROBIN on ΓF

θ(t, γ) = θD(t, γ) ∀γ ∈ ΓD ∀t ∈]T0, T [

m∑

i,j=1

ai,j(t, γ, θ)∂θ

∂xj

(t, γ) νi(γ) = FΓ(t, γ, θ) ∀γ ∈ ΓN ∀t ∈]T0, T [

m∑

i,j=1

ai,j(t, γ, θ)∂θ

∂xj

(t, γ) νi(γ) + g(t, γ, θ) θ(t, γ) = g(t, γ, θ) θF (t, γ)) = FΓ(t, γ, θ)

∀γ ∈ ΓF ∀t ∈]T0, T [

where

- θ(t, X) is the TEMPERATURE at time t and point X of Ω

- ρ(t, X) is the MASS DENSITY at time t and point X of Ω

- C(X, θ) is the SPECIFIC HEAT at point X of Ω and eventually θ(X)

- ρ(t, X) C(X, θ) is the SPECIFIC HEAT CAPACITY at time t and point X of Ω.The specific heat capacity of a solid or liquid is defined as the heat required to raiseunit mass of substance by one degree of temperature. This can be stated by the following

Page 2: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

2 HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem

equation δQ = ρ C δθ where, δQ= Heat supplied to material, ρ= Mass of the substance,C= Specific heat capacity, δθ = Temperature rise.

- ai,j(t, X, θ) are the CONDUCTIVITY tensor coefficients which can be dependent of timet and point X and temperature θ(t, X)

- Vi(t, X, θ) is the Fluid Velocity for TRANSPORT in front of the gradient of temperature

- CT (t, X, θ) is the Coefficient in front of the Temperature

- FΩ(t, X, θ) is the HEAT SOURCE (named SOURCE in Mefisto) which can be dependentof time t and point X and eventually the temperature θ(t, X)

- θ0(X) is the INITIAL TEMPERATURE at the initial time T0 and point X

- θD is the IMPOSED TEMPERATURE or CONTACT on the boundary ΓD

- νi is the i-th coordinate of the NORMAL VECTOR on Γ pointed to the exterior of Ω

-

m∑

i,j=1

ai,j

∂θ

∂xj

νi is the NORMAL FLUX of TEMPERATURE (named SOURCE in

Mefisto) on Γ

- FΓ is the IMPOSED FLUX or exterior SOURCE on the boundary ΓN

- g is the SURFACE CONVECTIVE HEAT TRANSFER COEFFICIENT (namedECHANGE in Mefisto) on the boundary ΓF

- θF is the TEMPERATURE of the EXTERIOR FLUID on the boundary ΓF .

Remark : The Units MKSA (as Meter Kilogram Second Ampere)

VELOCITY V : m s−1

ACCELERATION γ : m s−2

NEWTON : FORCE accelerating 1 Kg of 1 meter by s−2 : Kg m s−2

JOULE : ENERGY or WORK or HEAT QUANTITY able to do a displacement of 1Newton on 1 meter : Kg m2 s−2

WATT : POWER or HEAT TRANSFER of 1 joule during 1 second : Kg m2 s−3

PASCAL : PRESSURE of a 1 Newton force on 1 m2 : Kg m−1 s−2

KELVIN : −273.15 CELSIUS degrees or ZERO ABSOLUTE TEMPERATURECONDUCTIVITY a : w m−1 K−1

VOLUMIC MASS ρ : Kg m−3

SPECIFIC HEAT CT : J Kg−1 K−1

VOLUMIC SPECIFIC HEAT CAPACITYρCT : J K−1 m−3

HEAT TRANSFER COEFFICIENT g : w m−2 K−1

HEAT FLUX DENSITY fΓ : w m−2

After the FINITE ELEMENT APPROXIMATION in SPACE, the problemconsists to find the vector θ(t) (values of θ(t) at the mesh nodes), solution of thedifferential system

θ(0) = θ0(0)

13 novembre 2009

Page 3: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem 3

[M(t)]∂

∂tθ(t) + [K(t)] θ(t) = f(t) ∀t ∈]0, T [

The DISCRETIZATION in TIME by a 1-STEP METHOD :

With a time step δ, a coefficient α, the problem is solved as

θ(tn+1) − θ(tn)

δ= α ([M(tn+1)]

−1 (f(tn+1) − [K(tn+1)] θ(tn+1))

+ (1 − α) [M(tn)]−1 ( f(tn) − [K(tn)] θ(tn) )

Remarks :

- With 1/2 ≤ α ≤ 1, this scheme is UNCONDITIONALLY STABLE.NO condition between the time space and the minimal lenght of finite elements is necessaryto obtain the convergence.

- But, it is recommended to use the value α = 1 which gives the MOST STABLE scheme,rather than the value α = 1/2 (CRANK-NICOLSON scheme) which produces sometimesstrange oscillations !...

- In fact, if the coefficients are or are not dependent of time and/or temperature it isobtained 2 different schemes :

1) The coefficients are not dependent of time and temperature : (cf theilc.f)

At time 0, computation or recovery of θ(0)

At time step n+1, θn+1 is the solution of

( [M ] + αδ[K] ) θn+1 = αδfn+1 + ([M ] − (1 − α)δ[K])θn

with a storage of 2 matrices [M+αδK] and [M−(1−α)δK] and 4 vectors θn, θn+1, fn, fn+1

2) The coefficients are dependent of time and/or temperature : (cf theinl.f)

At time step n+1, for the m-th iteration of fix point, θn+1,m+1 is the solution of

(1) ( [Mn+1,m] + αδ[Kn+1,m] )θn+1,m+1 = αδfn+1,m

+([Mn+1,m] ( θn + (1 − α)δ[Mn,∗]−1(fn,∗ − [Kn,∗]θn) )

up to convergence of the fix point iterations m and this implies θn+1,m+1 with acomputation of 2 matrices [Mn+1,m] and [Mn+1,m + αδKn+1,m] and the vector fn+1,mat each time n + 1 and fix point iteration m.

Remark :After the convergence of the fix point iterations, the equality is done with m = ∗ in (1)which implies for

Vn = θn + (1 − α)δ[Mn]−1(fn − [Kn]θn)

gives

[Mn+1] (θn+1 − Vn) = αδ(fn+1 − [Kn+1]θn+1)

13 novembre 2009

Page 4: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

4 HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem

or

(1 − α)/α (θn+1 − Vn) = (1 − α)δ [Mn+1]−1(fn+1 − [Kn+1]θn+1)

and

Vn+1 = θn+1 + (1 − α)δ[Mn+1]−1 (fn+1 − [Kn+1]θn+1) = θn+1 + (1 − α)/α (θn+1 − Vn)

and

(2) Vn+1 = θn+1/α − (1 − α)/α Vn

Finally, the algorithm is :

From the initial computation

V0 = θ0 + (1 − α) [M0]−1 (f0 − [K0])θ0)

the time iterations from n to n+1 are obtained with

(2)Vn+1 = θn+1/α − (1 − α)/α Vn

which leads to the storage of θn, then, θn+1,m in U0, θn+1,m+1 in U1, fn in F0, fn+1 in F1

and Vn in V0.

- In these 2 cases, the temperature is IMPOSED by a PENALISATION.In fact, this is a FOURIER-ROBIN condition with a heat transfer coefficient of 1/ǫand a fluid temperature of the imposed temperature. The chosen value of ǫ = 10−20

Of course, [M ] and [K] are SPARSE MATRICES and an ADAPTED STORAGE isnecessary.

2 possibilities :- a SKYLINE storage for a CHOLESKY or CROUT complete factorization and resolution ;- a CONDENSED storage for a preconditioned conjuguate gradient method.

The first method use many more memories than the second method which is iterative, butis very sure.

13 novembre 2009

Page 5: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem 5

The Mefisto INPUT DATA :

With the command MESHER :

- Construction of the mesh of the object from the meshes of its Points, Lines, Surfaces,Volumes.- Definition of the Mefisto object :. its type of finite elements used (degree 1 or 2 of polynomials) ;. its volumes and their thermal characteristics ρ, C, [a], V, CT , FΩ ;. its boundary conditions on Points or Lines or Surfaces θD, FΓ, g, θF ;. its initial condition of temperature θ0 on the object, or/and its volumes, or/and itssurfaces, or/and its lines, or/and its points.

With the command HEATER :

The options of the root menu of HEATER arevariable DebuTHER ’PB with -div(A grad*) OPERATOR’ entier(1 : ’OBJECT NAME to treat’,2 : ’HEAT TRANSFER INPUT DATA’,3 : ’STEADY HEAT TRANSFER solver’,4 : ’UNSTEADY HEAT TRANSFER solver’,5 : ’2D WAVE solver’,6 : ’EIGENVALUE & VECTORS solver’,7 : ’DRAWING of EIGENVALUE & VECTORS’,8 : ’DRAWING of TEMPERATURES and FLUX’,9 : ’DRAWING of a WAVE’,10 : ’DRAWING of PLSVO meshes’,11 : ’DRAWING of ISO-SURFACES f(x,y,z)=Ctes’,13 : ’ENERGY of SOLUTIONS’,18 : ’L1 NORM of SOLUTIONS**EXPONENT’,20 : ’PRECISION to INVERSE A x = b’,38 : ’WINDOW PIXELS WIDTH & HEIGHT’,39 : ’BACKGROUND COLOR’,71 : ’TOOLS on TMS’,72 : ’TOOLS on FILES of the MS’,73 : ’TOOLS on I/O units’,74 : ’DELETE TMS of PLSVO’,97 : ’MEFISTO VERSION NAME’,99 : ’SAVE DATA and QUIT’ ) ;

Option 1 ; Object Name to treatType the name of the interpolated object.This option is not necessary. Mefisto recovers the last declared object and may be the goodchoice.

13 novembre 2009

Page 6: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

6 HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem

Option 2 ; HEAT TRANSFER INPUT DATA

. The thermal characteristics and boundary conditions must be input under 2 forms :CONSTANTS or FUNCTIONS.. The data are REMANENT. Once given, the values are used. To do NOT use them, it isnecessary to DELETE them !. Mefisto prompt the input data :- The thermal characteristics for every volume in 3d or every surface in 2d, or every linein 1d ;- The boundary conditions for every Point in 1d 2d 3d, Line in 2d 3d, Surface in 3d, of theobject.

- INPUT of THERMAL CHARACTERISTICS of every volume (Finished byEscape) :

variable COEFTHER ’Operator divAgrad INPUT’ entier

( 1 : ’Rho MASS Density’

, 2 : ’[A] HEAT CONDUCTIVITY’

, 3 : ’DILATATION & TEMPERATURE REFERENCE’

, 4 : ’FOmega INTERNAL HEAT SOURCE’

, 5 : ’Vf Coefficient of GradTEMPERATURE’

, 6 : ’CT Coefficient of TEMPERATURE’

, 7 : ’C MASSIC HEAT Density’

, 8 : ’INITIAL TEMPERATURE’

, 9 : ’Vo INITIAL WAVE SPEED’ ) ;

Choose the option :

1 ; ’Rho MASS density’ leads to different possibilities

deftms ~>>>MASSE ’Density of MASS’

variable muet DATE ’date of creation of the TMS’ reel2 ;

variable muet NUTD ’number of the descriptor array TD’ entier ;

variable LTDMAS ’Type of the mass density’ entier

( 1 : ’constant mass density’

, -1 : ’function mass density’

, 0 : ’delete the actual mass density’ ) ;

cas LTDMAS

1 : variable DMASSE ’value of the density of MASS’ reel ;

-1 : variable NFDMAS ’name of the function MASS’ ^~>FONCTION ;

fincas ;

fintms ;

The Mass density may be given as a constant ora function NFMass( t, X, Y, Z, NoTypeVSL, NoVSL, TEMPER ) programmed- at time t,- at point X,Y,Z,- to a volume (in 3d) or surface (in 2d) or line (in 1d) of type number NoTypeVSL (resp.3, 2, 1)- of a No in this directory NoVSL- at the temperature TEMPER (may be a value at a precedent iteration or time).

13 novembre 2009

Page 7: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem 7

2 ; ’[A] HEAT CONDUCTIVITY’ leads to different possibilities

deftms ~>>>CONDUCTIVITE ’Conductivity of a SV’variable muet DATE ’date of creation of the TMS’ reel2 ;variable muet NUTD ’number of the descriptor array TD’ entier ;variable LTCOND ’type of conductivity’ entier( 1 : ’3D HOMOGENOUS ISOTROPIC material’ ,

2 : ’AXISYMETRIC HOMOGENOUS ISOTROPIC material’ ,3 : ’1D or 2D HOMOGENOUS ISOTROPIC material’ ,10 : ’Constant ANISOTROPIC tensor of Conductivity C11 C12 C22...’ ,-1 : ’Function ISOTROPIC Conductivity’ ,-2 : ’Function ANISOTROPIC Conductivity’ ,0 : ’Delete the actual Conductivity’ ) ;

cas LTCOND1..3 : variable CONDUC ’constant material conductivity’ reel ;10 : variable NVCOND

’Number of constant coefficients of conductivity tensor C11 C12 C22...’entier ;tableau TECOND(1..NVCOND)

’constant coefficients C11,C21,C22,... of conductivity tensor’ reel ;-1 : variable NFCOND ’name of ISOTROPIC conductivity function’ ^~>FONCTION ;-2 : variable NVCOAN

’Number of coefficients of ANISOTROPIC conductivity tensor C11 C12 C22...’entier ;variable NFCOAN ’name of ANISOTROPIC conductivity function’ ^~>FONCTION ;

fincas ;fintms ;

The symmetric conductivity tensor may be given as a constant or 3 constants in 2d or 6constants in 3d or as a function NFIsoCond( t, X, Y, Z, NoTypeVSL, NoVSL, TEMPER) for the homogenous isotropic case programmed with the parameters- at time t,- at point X,Y,Z,- to a volume (in 3d) or surface (in 2d) or line (in 1d) of type number NoTypeVSL (resp.3, 2, 1)- of a NoVSL No. in this directory- at the temperature TEMPER (may be a value at a precedent iteration or time).

EXAMPLE : For an object volume

2 ; heat conductivity -1 ; heat conductivity defined by a function

DefFunc conductivity( t, x, y, z, notypesouv, material, temper ) ;

If material=nuobjt( ’volume’ , ’StainlessSteel’ )

Then conductivity = 16.2 + (temper-400) * 0.1 ; w m**-1 K**-1 Else If material=nuobjt( ’volume’ , ’Uranium’ )

Then conductivity=12.5+(temper-400)*0.02 ; w m**-1 K**-1 Else conductivity=1.0 ;

EndIf ;

EndIf ;

EndFunc ;

conductivity ; DO NOT FORGET the Function Name before Escape !

For an anisotropic tensor, the parameter list of the function becomesNFAnIsoCOND( t, X, Y, Z, NoTypeVSL, NoVSL, TEMPER, k ) where k is the No. of thecoefficient 1 :A11, 2 :A12, 3 :A22, ... of the symmetric tensor.

13 novembre 2009

Page 8: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

8 HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem

4 ; ’FOmega INTERNAL HEAT SOURCE’ may be a constant or

deftms ~>>>SOURCE ’Source of heat’variable muet DATE ’date of creation of the TMS’ reel2 ;variable muet NUTD ’number of the descriptor array TD’ entier ;variable LTSOUR ’type of source’ entier( 1 : ’constant source’

, -1 : ’function source’, 0 : ’delete this source’ ) ;cas LTSOUR

1 : variable SOURCE ’value of the source’ reel ;-1 : variable NFSOUR ’name of the function source’ ^~>FONCTION ;

fincas ;fintms ;

The function NFOMEGA( t, X, Y, Z, NoTypeVSL, NoVSL, TEMPER ) must beprogrammed- at time t,- at point X,Y,Z,- to a volume (in 3d) or surface (in 2d) or line (in 1d) of type number NoTypeVSL (resp.3, 2, 1)- of a No in this directory NoVSL- at the temperature TEMPER (may be a value at a precedent iteration or time).

EXAMPLE : For a volume of an object

4 ; FOmega SOURCE -1 ; FOmega source defined by a FUNCTION deffunc FomegaSource( t, x, y, z, notypeVSL, material, temper ) ;

FomegaSource=0.0 ;

if material=nuobjt( ’volume’ , ’uranium’ )

then FomegaSource=80E12 / 19100 ; J / Kg endif ;

endfunc ;

FomegaSource ; DO NOT FORGET the Function Name before Escape !

5 ; ’Vf Coefficient of GradTEMPERATURE’ may be a constant or a function.

deftms ~>>>VITESSEFLUIDE ’Velocity of fluid’variable muet DATE ’date of creation of the TMS’ reel2 ;variable muet NUTD ’number of the descriptor array TD’ entier ;variable LTVIFL ’type of Velocity of fluid’ entier( 1 : ’constant Velocity of fluid’, -1 : ’function Velocity of fluid’, 0 : ’delete the Velocity of fluid’ ) ;cas LTVIFL1 : variable NBVIFL ’number of Velocity Components (1 or 2 or 3)’ entier ;

tableau VAVIFL(1..NBVIFL) ’Velocity of fluid’ reel ;-1 : variable NFVIFL ’name of function Velocity of fluid’ ^~>FONCTION ;fincas ;fintms ;

The function NFSPEED( t, X, Y, Z, NoTypeVSL, NoVSL, TEMPER, nc ) must beprogrammed- at time t,

13 novembre 2009

Page 9: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem 9

- at point X,Y,Z,- to a volume (in 3d) or surface (in 2d) or line (in 1d) of type number NoTypeVSL (resp.3, 2, 1)- of a No in this directory NoVSL- at the temperature TEMPER (may be a value at a precedent iteration or time)- to the nc component.

EXAMPLE : For a volume of an object

5 ; Fluid Velocity -1 ; Fluid Velocity defined by a FUNCTION deffunc FluidVelocity( t, x, y, z, notypeVSL, material, temper, nc ) ;

FluidVelocity=0.0 ;

if material=nuobjt( ’volume’ , ’river’ )

then if nc=1

thenFluidVelocity=0.5 ;

else if nc=2

then FluidVelocity=0.2 ; m s**-1 EndIf ;

endif ;

endif ;

endfunc ;

FluidVelocity ; DO NOT FORGET the Function Name before Escape !

6 ; ’CT Coefficient in front of TEMPERATURE’ may be a constant or a function.

deftms ~>>>COEFTEMPERATURE ’Coefficient in front of the Temperature’variable muet DATE ’date of creation of the TMS’ reel2 ;variable muet NUTD ’number of the descriptor array TD’ entier ;variable LTCOET ’Type of Coefficient of Temperature’ entier( 1 : ’constant coefficient of temperature’, -1 : ’function coefficient of temperature’, 0 : ’delete the coefficient of temperature’ ) ;cas LTCOET1 : variable COEFTE ’value of temperature coefficient’ reel ;

-1 : variable NFCOET ’name of function of temperature coefficient’ ^~>FONCTION ;fincas ;fintms ;

The function NFTEMPCOEF( t, X, Y, Z, NoTypeVSL, NoVSL, TEMPER ) must beprogrammed- at time t,- at point X,Y,Z,- to a volume (in 3d) or surface (in 2d) or line (in 1d) of type number NoTypeVSL (resp.4, 3, 2 )- of a No in this directory NoVSL- at the temperature TEMPER (may be a value at a precedent iteration or time)

EXAMPLE : For a volume of an object

6 ; Temperature Coefficient-1 ; Temperature Coefficient defined by a FUNCTION deffunc TempCoef( t, x, y, z, notypeVSL, material, temper ) ;

TempCoef=0.0 ;

13 novembre 2009

Page 10: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

10 HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem

if material=nuobjt( ’volume’ , ’steel’ )

then TempCoef=0.5 ;

else TempCoef=0.2 ;

endif ;

endfunc ;

TempCoef ; DO NOT FORGET the Function Name before Escape !

7 ; ’C SPECIFIC HEAT’ may be a constant or a function.

deftms ~>>>CHALEURMASSIQUE ’Massic Heat of a PLSV’variable muet DATE ’date of creation of the TMS’ reel2 ;variable muet NUTD ’number of the descriptor array TD’ entier ;variable LTCHMA ’type of massic heat’ entier( 1 : ’constant massic heat’ ,-1 : ’function massic heat’ ,0 : ’delete the massic heat’ ) ;

cas LTCHMA1 : variable CHAMAS ’value of the massic heat’ reel ;

-1 : variable NFCHMA ’name of the massic heat function’ ^~>FONCTION ;fincas ;fintms ;

The function NFSpecHeat( t, X, Y, Z, NoTypeVSL, NoVSL, TEMPER ) must beprogrammed- at time t,- at point X,Y,Z,- to a volume (in 3d) or surface (in 2d) or line (in 1d) of type number NoTypeVSL (resp.4, 3, 2 )- of a No in this directory NoVSL- at the temperature TEMPER (may be a value at a precedent iteration or time)

EXAMPLE : For a volume of an object

7 ; SpecificHeat -1 ; SpecificHeat defined by a FUNCTION deffunc SpecificHeat( t, x, y, z, ObjectTypeNumber, material, temper ) ;

if material=nuobjt( ’volume’ , ’steel’ )

then SpecificHeat= 5e8 ; J / Kg / Celsius or Kelvin

else if material=nuobjt( ’volume’ , ’copper’ )

then SpecificHeat=2e7 ;

else SpecificHeat=0 ;

endif ;

endif ;

endfunc ;

SpecificHeat ; DO NOT FORGET the Function Name before Escape !

8 ; ’INITIAL TEMPERATURE’ may be selected in

deftms ~>>>TEMPERINIT ’INITIAL TEMPERATURE at nodes’variable muet DATE ’date of creation of the TMS’ reel2 ;variable muet NUTD ’number of the descriptor array TD’ entier ;variable LTTEM0 ’type of INITIAL TEMPERATURE’ entier( 2 : ’INITIAL TEMPERATURE already EXISTS’

, 1 : ’Constant INITIAL TEMPERATURE’

13 novembre 2009

Page 11: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem 11

, -1 : ’Function INITIAL TEMPERATURE’, 0 : ’Delete the INITIAL TEMPERATURE’ ) ;cas LTTEM01 : variable VATEM0 ’value of the INITIAL TEMPERATURE’ reel ;

-1 : variable NFTEM0 ’name of the function INITIAL TEMPERATURE’ ^~>FONCTION ;fincas ;fintms ;

The 2 ; case means that the initial temperature is already stored in a vector, for instanceas the steady solution computed just before.

The other cases asks to obtain a constant ora function NFInitTemp( t, X, Y, Z, NoTypeVSL, NoVSL ) programmed- at time t,- at point X,Y,Z,- to a volume (in 3d) or surface (in 2d) or line (in 1d) of type number NoTypeVSL (resp.4, 3, 2 )- of a NoVSL in this directory.

In fact, this initial temperature may be given at all levels : Volumes, Surfaces, Lines andPoints.The node values are first initialized from the initial temperature volume value ;Eventually, modified by the initial temperature surface value ;Eventually, modified by the initial temperature line value ;Eventually, modified by the initial temperature point value.The volume values are corrected by those Surface values ; then, those Line values ; then,those Point values.

- INPUT OF THERMAL BOUNDARY CONDITION of every Point or Lineor Surface (Finished by Escape) :

. a Dirichlet condition is said a CONTACT i.e. an IMPOSED TEMPERATURE θD(t, γ)and may be done at a point or on a line or on a surface.

. a Neumann condition FΓ(t, γ, θ) is said an external SOURCE and may be given on asurface (3d case) or on a line (2d case) or on a point (1d case), but also at a point and isconsidered as a flux of heat at this point.

. a Robin-Fourier condition with a HEAT TRANSFER COEFFICIENT g(t, γ, θ) anda SOURCE FΓ(t, γ, θ) = g(t, γ, θ)× θF (t, γ)) and may be given on a surface (3d case) oron a line (2d case) or on a point (1d case).

variable CL_THER ’div A grad Boundary Condition’ entier( 1 : ’g HEAT TRANSFER COEFFICIENT wall<->fluid’, 2 : ’FGamma SOURCE Boundary IMPOSED FLUX’, 3 : ’Theta_D CONTACT IMPOSED TEMPERATURE’, 8 : ’Theta_0 INITIAL TEMPERATURE’, 9 : ’Vo INITIAL WAVE SPEED’ ) ;

Choose the option :

1 ; ’g HEAT TRANSFER between wall and fluid’ may be a constant or a function.

13 novembre 2009

Page 12: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

12 HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem

deftms ~>>>ECHANGE ’heat transfer coefficient’variable muet DATE ’date of creation of the TMS’ reel2 ;variable muet NUTD ’number of the descriptor array TD’ entier ;variable LTECHA ’type of the heat transfer coefficient’ entier( 1 : ’constant heat transfer coefficient’,-1 : ’function heat transfer coefficient’, 0 : ’delete this heat transfer coefficient’ ) ;cas LTECHA1 : variable ECHANG ’heat transfer coefficient value’ reel ;

-1 : variable NFECHA ’name of the heat transfer function’ ^~>FONCTION ;fincas ;fintms ;

The function NFg( t, X, Y, Z, NoTypeSLP, NoSLP, TEMPER ) must be programmed- at time t,- at point X,Y,Z,- to a surface or line or point of type number NoTypeSLP (resp. 3, 2, 1)- of a No in this directory NoSLP- at the temperature TEMPER (may be a value at a precedent iteration or time).

EXAMPLE : For a line

1 ; Heat Transfer Coefficient on the LINE InoxSodium -1 ; Heat Transfer Coefficient is a FUNCTION deffunc HeatTransCoef( x , y , z , notypePLS, material, temper ) ;

if material=nuobjt( ’line’ , ’InoxSodium’ )

then HeatTransCoef=3.e3 ; w m**-2 K**-1 else HeatTransCoef=0 ;

endif ;

endfunc ;

HeatTransCoef ; DO NOT FORGET the Function Name before Escape !

2 ; ’FGamma SOURCE boundary imposed flux’ may be a constant or a function

deftms ~>>>SOURCE ’Source of heat’variable muet DATE ’date of creation of the TMS’ reel2 ;variable muet NUTD ’number of the descriptor array TD’ entier ;variable LTSOUR ’type of source’ entier( 1 : ’constant source’

, -1 : ’function source’, 0 : ’delete this source’ ) ;cas LTSOUR

1 : variable SOURCE ’value of the source’ reel ;-1 : variable NFSOUR ’name of the function source’ ^~>FONCTION ;

fincas ;fintms ;

The function NFGamma( t, X, Y, Z, NoTypePLS, NoPLS, TEMPER ) must be pro-grammedNFGamma( t, X, Y, Z, NoTypePLS, NoPLS, TEMPER )- at time t,- at point X,Y,Z,- to a surface or line or point of type number NoTypeSLP (resp. 3, 2, 1)- of a No in this directory NoSLP

13 novembre 2009

Page 13: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem 13

- at the temperature TEMPER (may be a value at a precedent iteration or time).

EXAMPLE : for a line

2 ;

-1 ; boundary imposed flux defined by a FUNCTION deffunc flux( t, x, y, z, NoTypePLS, material, temper ) ;

if material=nuobjt( ’line’ , ’Interface’ )

then flux=2.e4 ; w m**-1 else flux=0.0 ;

endif ;

endfunc ;

flux ; DO NOT FORGET the Function Name before Escape !

Attention :- For a Robin-Fourier condition, it is necessary to give the 2 values. the heat transfer coefficient g(t, γ, θ). the external source FΓ(t, γ, θ) = g(t, γ, θ)θF(t, γ)).

- For a Neumann condition, it is necessary to give only the second value which is a heatflux.

3 ; ’ΘD CONTACT imposed temperature’ may be a constant or a function

deftms ~>>>CONTACT ’imposed temperature’variable muet DATE ’date of creation of the TMS’ reel2 ;variable muet NUTD ’number of the descriptor array TD’ entier ;variable LTCONT ’type of imposed temperature’ entier( 1 : ’constant imposed temperature’, -1 : ’function imposed temperature’, 0 : ’delete the imposed temperature’ ) ;cas LTCONT

1 : variable CONTAC ’imposed temperature value’ reel ;-1 : variable NFCONT ’name of function imposed temperature’ ^~>FONCTION ;

fincas ;fintms ;

The function NFDIRIC( t, X, Y, Z, NoTypePLS, NoPLS, TEMPER ) must be programmedNFDIRIC( t, X, Y, Z, NoTypePLS, NoPLS, TEMPER )- at time t,- at point X,Y,Z,- to a surface or line or point of type number NoTypeSLP (resp. 3, 2, 1)- of a NoSLP No. in this directory- at the temperature TEMPER (may be a value at a precedent iteration or time).

A vertex may be on a Surface and a Line. In this case, the imposed value on the Line isused.A vertex may be on a Surface and a Line and a Point. In this case, the imposed value onthe Point is used.Understand this order as a refining. The value on the surface is corrected by these on theline, itself corrected by the value at a point.

EXAMPLE : for a line and a surface

3 ; CONTACT on a line ans a surface -1 ; IMPOSED TEMPERATURE by a FUNCTION

13 novembre 2009

Page 14: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

14 HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem

deffunc imposedtemper( t, x, y, z, NoTypePLS, material, temper ) ;

si material=nuobjt( ’surface’, ’dirichlet0’ )

alors imposedtemper = 0 ;

sinon

si material=nuobjt( ’line’, ’contact100’ )

alors imposedtemper = 100 ;

finsi ;

finsi ;

finfunc ;

imposedtemper ; DO NOT FORGET the Function Name before Escape !

8 ; ’INITIAL TEMPERATURE’ may be selected for Points, Lines, Surfaces as abovefor the Volumes and its input may be selected in

deftms ~>>>TEMPERINIT ’INITIAL TEMPERATURE at nodes’variable muet DATE ’date of creation of the TMS’ reel2 ;variable muet NUTD ’number of the descriptor array TD’ entier ;variable LTTEM0 ’type of INITIAL TEMPERATURE’ entier( 2 : ’INITIAL TEMPERATURE already EXISTS’

, 1 : ’Constant INITIAL TEMPERATURE’, -1 : ’Function INITIAL TEMPERATURE’, 0 : ’Delete the INITIAL TEMPERATURE’ ) ;cas LTTEM01 : variable VATEM0 ’value of the INITIAL TEMPERATURE’ reel ;

-1 : variable NFTEM0 ’name of the function INITIAL TEMPERATURE’ ^~>FONCTION ;fincas ;fintms ;

The 2 ; case means that the initial temperature is already stored in a vector, for instanceas the steady solution computed just before.

The other cases asks to obtain a constant ora function NFInitTemp( t, X, Y, Z, NoTypeVSL, NoVSL ) programmed- at time t,- at point X,Y,Z,- to a volume (in 3d) or surface (in 2d) or line (in 1d) of type number NoTypeVSL (resp.4, 3, 2 )- of a NoVSL in this directory.

Remark : This initial temperature may be given at all levels : Volumes, Surfaces, Linesand Points.The node values are first initialized from the initial temperature volume value ;Eventually, modified by the initial temperature surface value ;Eventually, modified by the initial temperature line value ;Eventually, modified by the initial temperature point value.

13 novembre 2009

Page 15: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem 15

4 ; Solution of the UNSTEADY HEAT TRANSFER

First, choose the appropriate case among

variable ResoTHIN ’Unstationary Heat Coefficient Types’ entier(1 : ’Rho C, A, V, CT, g INDEPENDENT of t & TEMPERATURE, SOURCE, CONTACT depends t ONLY’,2 : ’Rho C, A, V, CT, g INDEPENDENT of t & TEMPERATURE, SOURCE, CONTACT depends t & TEMP’,3 : ’At least one of Rho C, A, V, CT, g, FOmega, FGamma, TempDir depends of time & TEMP’ ) ;

Option 1 ; leads to one computation of the matrices and at each time the computation ofthe second member of the linear system without iteration.

Option 2 ; leads to one computation of the matrices and at each time the computationof the second member of the linear system with iteration to solve the dependency of FΩ

and/or FΓ of θ(t, X).

Option 3 ; at each time, leads to the computation of the matrices and the second member ofthe not linear problem with iteration to solve the dependency of any coefficient of θ(t, X).

Second, give the INITIAL TIME T0.

Third, give the ’INITIAL TEMPERATURE’ of the whole object.

deftms ~>>>TEMPERINIT ’INITIAL TEMPERATURE at nodes’variable muet DATE ’date of creation of the TMS’ reel2 ;variable muet NUTD ’number of the descriptor array TD’ entier ;variable LTTEM0 ’type of INITIAL TEMPERATURE’ entier( 2 : ’INITIAL TEMPERATURE already EXISTS’

, 1 : ’Constant INITIAL TEMPERATURE’, -1 : ’Function INITIAL TEMPERATURE’, 0 : ’Delete the INITIAL TEMPERATURE’ ) ;cas LTTEM01 : variable VATEM0 ’value of the INITIAL TEMPERATURE’ reel ;

-1 : variable NFTEM0 ’name of the function INITIAL TEMPERATURE’ ^~>FONCTION ;fincas ;fintms ;

The 2 ; case means that the initial temperature is already stored in a vector, for instanceas the steady solution computed just before. If the vectors are computed at different times,that one with the nearest time from the initial time given will be retained.This method permits to extend a study, finished at a time, which becomes the initial timefor the new computations.

The other cases obtain a constant ora function NFInitTemp( t, X, Y, Z, NoTypeVSL, NoVSL ) programmed- at time t,- at point X,Y,Z,- to a volume (in 3d) or surface (in 2d) or line (in 1d) of type number NoTypeVSL (resp.4, 3, 2 )- of a NoVSL in this directory.

In fact, this initial temperature may be given at all levels : Volumes, Surfaces, Lines andPoints.

13 novembre 2009

Page 16: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

16 HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem

The node values are first initialized from the initial temperature object value ;Eventually, modified by the initial temperature volume value ;Eventually, modified by the initial temperature surface value ;Eventually, modified by the initial temperature line value ;Eventually, modified by the initial temperature point value.The volume values are refined by those Surface values ; then, those Line values ; then, thosePoint values.

Fourth, type the FINAL TIME T1 (¿T0).

Fifth, type the CONSTANT TIME STEP δ.

Sixth, type the NUMBER of TIME STEPS, to compute, between T0 and T1.

Choose the linear system solver :

variable METHRESO ’Choice of solver A x = b’ entier(1 : ’CHOLESKY with SKYLINE STORAGE’,2 : ’PRECONDITIONNED CONJUGATE GRADIENT’ ) ;

- Option 1 ; CHOLESKY with SKYLINE STORAGE

This method is very efficient if the skyline storage may be contained in main memory. Else,an error is produced and the second method is proposed.

- Option 2 ; PRECONDITIONED CONJUGATE GRADIENT

Only the non zero coefficients are stored in main memory. The accuracy depend of thecutoff EPZERO defined by

‖rk‖ ≤ EPZERO ‖r0‖

where. ‖rk‖ is the residue norm a the k-th iteration ;. ‖r0‖ is the initial residue norm ;. EPZERO may be modified by the user with the option 20 ; and 2 ; of the root menu.

The preconditioning method consists to do an incomplete Cholesky factorization of thematrix from an integer LEV EL (0 or 1 or 2) which leads to store more and more coefficientsof the factorized preconditioned matrix.Greater this level is, greater the storage is, but, smaller the iterations number is. Thevalue 1 seems a good value which will be eventually modified if convergence problems aredetected.

EXAMPLE : From root menu

4 ; SOLVE the UNSTEADY HEAT PROBLEM 1 ; [M] [K] g are INDEPENDENTS of TIME and TEMPERATURE Time0 ; INITIAL TIME of the study 2 ; INITIAL TEMPERATURE is the already computed VECTEUR"TEMPERATURE Time1 ; INTERMEDIATE TIME of the study TimeStep ; Value of the constant STEP OF TIME NbStepT ; Number of VECTEUR"TEMPERATURE to add during the study 1 ; Solution by factorization CHOLESKY on skyline storage

13 novembre 2009

Page 17: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem 17

1 ; Value of 1/2<=coefficient of the method<=1 @ ;

4 ; SOLVE the UNSTEADY HEAT PROBLEM npas STEPS MORE 1 ; [M] [K] g are INDEPENDENTS of TIME and TEMPERATURE Time1 ; INITIAL TIME of the new study = INTERMEDIATE TIME 2 ; INITIAL TEMPERATURE is the already computed VECTEUR"TEMPERATURE Time2 ; FINAL TIME of the study TimeStep ; Value of the constant STEP OF TIME NbStepT ; Number of VECTEUR"TEMPERATURE to add during the study 2 ; 1 ; Solution by PRECONDITIONED CONJUGUATE GRADIENT by 1 LEVEL 1 ; Value of 1/2<=coefficient of the method<=1

@ ;

Example : Cf $MEFISTO/test/habc/habc.mesh and $MEFISTO/test/habc/habc.heat

13 novembre 2009

Page 18: HEATER to solve the UNSTEADY HEAT TRANFER PROBLEM · PDF fileheater to solve the unsteady heat tranfer problem the partial differential equations (pde) of the unsteady ... ’steady

18 HEATER : Mefisto Input Data for UNSTEADY HEAT TRANFER Problem

Option 8 ; DRAWING of TEMPERATURES and FLUXES

After, the results, TEMPERATURES and FLUXES may be drawn with the options

variable TRACTEMP ’Drawings of TEMPERATURES’ entier( 1 : ’ISOTHERMAL LINES or SURFACES’, 2 : ’ZONES of ISOTHERMAL COLORS’, 3 : ’ZONES by CUTTING PLANES X or Y or Z=CT’, 4 : ’PROFILES by CUTTING PLANES X or Y or Z=CT’, 5 : ’ALONG A LINE DEFINED BY 2 POINTS’, 7 : ’2D SURFACE(X,Y,TEMPERATURE(X,Y))’, 8 : ’2D ERROR from EXACT_TEMPERATURE()’, 9 : ’PRINTING of TEMPERATURES’ ) ;

andvariable TRACTEM3 ’Drawings of 3d TEMPERATURES’ entier( 1 : ’ISOTHERMAL SURFACES’, 2 : ’ZONES of ISOTHERMAL COLORS’, 3 : ’ZONES by CUTTING PLANES X or Y or Z=Const’, 4 : ’PROFILES by CUTTING PLANES X or Y or Z=Const’, 5 : ’ALONG A LINE DEFINED BY 2 POINTS’, 8 : ’ABSOLUTE ERROR from EXACT_TEMPERATURE() GIVEN’, 9 : ’PRINTING of NODE TEMPERATURES’ ) ;

andvariable TRACFLUX ’NORMAL FLUX of TEMPERATURE’ entier( 1 : ’NUMBER of CM of the MAX ARROW’, 2 : ’1 CM SCALE of NORMAL FLUX’, 5 : ’COLOR of MESH’’s EDGES’, 6 : ’DRAWING TYPE of EDGES’, 7 : ’COLOR of ARROWS’, 15 : ’FLUXES in ALL FINITE ELEMENTS’, 16 : ’FLUXES in PLANE SECTION of 3D FE’ ) ;

13 novembre 2009