22
MULTLAB FEM-UNICAMP UNICAMP SETTING SOURCES & BOUNDARY CONDITIONS USING INFORM Section 3.7 of TR003 brings a set of examples in ‘sources and sinks’ . A full set of solved cases is in Apendix 4 ‘In-Form Examples’ This lecture introduces In-Form by means of examples to the user get acquainted with the syntax. The first section shows a summary of the syntax to the user get acquainted with the ways to set sources on the transport equations using In-Form. A sequence of workshops presents distinct features of In-Form for setting sources.

MULTLAB FEM-UNICAMP UNICAMP SETTING SOURCES & BOUNDARY CONDITIONS USING INFORM Section 3.7 of TR003 brings a set of examples in ‘sources and sinks’. A

Embed Size (px)

Citation preview

MULTLABFEM-UNICAMP

UNICAMP

SETTING SOURCES & BOUNDARY CONDITIONS USING INFORM

• Section 3.7 of TR003 brings a set of examples in ‘sources and sinks’ . A full set of solved cases is in Apendix 4 ‘In-Form Examples’

• This lecture introduces In-Form by means of examples to the user get acquainted with the syntax.

• The first section shows a summary of the syntax to the user get acquainted with the ways to set sources on the transport equations using In-Form.

• A sequence of workshops presents distinct features of In-Form for setting sources.

MULTLABFEM-UNICAMP

UNICAMP SYNTAX

(SOUR[CE] of Var at PatchName is Formula [with Options])• Sets a source by Formula calculated for Var variable at region described by PATCH command with PatchName name.

• Var is 3D-stored solved variable. • The "with Options" element contains options which specify the action of statement:

FIXFLU (by default) FIXV LINE INFOB_n IMAT=iprp IF(condition)

MULTLABFEM-UNICAMP

UNICAMP EXAMPLES

PATCH(I,CELL,1,NX,1,NY,1,NZ,1,LSTEP)

(SOURCE of U1 at I is 1.E5*(VEL*(YIC-YG)-U1) with IMAT>=90!LINE)

(SOURCE of V1 at I is 1.E5*(VEL*(XG-XIC)-V1) with IMAT>=90!LINE)

• which signify that, over the patch indicated, both x-direction first-phase velocity U1 and y-direction first-phase velocity V1 experience sources.

• The former are proportional to the difference between the prevailing velocity at the point and the position-dependent quantity:VEL*(YIC-YG).

• The proportionality constant is large, which causes U1 to be close to the latter value when the equations have been solved.

MULTLABFEM-UNICAMP

UNICAMP EXAMPLES

(SOURCE of U1 at I is 1.E5*(VEL*(YIC-YG)-U1) with IMAT>=90!LINE)

Of especial interest is what follows the word with: •The condition IMAT>=90, signifies that the source is to be applied only to those cells for which the PRPS-value, IMAT, is in excess of 90.

• Following the delimiter is a second condition, namely "LINE", which is an abbreviation of "LINEARISED". This is an instruction which requires that the source is introduced in the linearised manner which ensures that it becomes zero when the velocity equals the desired value.

• Without this condition, the source would have been created in the "fixed-flux" manner, which, in COVAL statements, is specified by setting FIXFLU as the third argument.

MULTLABFEM-UNICAMP

UNICAMP EXAMPLES

(SOURCE of AUX1 at IEXACT is 1.+XG+(XG)^2 with FIXV)

(SOURCE of AUX2 at IEXACT is EXP(-PE*(1.-XG)) with FIXV)

(SOURCE of AUX3 at IEXACT is SIN(PI*XG) with FIXV)

(SOURCE of EXCT at IEXACT is AUX1+AUX2+AUX3 with FIXV)

(STORED of EXAC is 1.+XG+(XG)^2+EXP(-PE*(1.-XG))+SIN(PI*XG))

• In this case, an exact-solution variable, EXCT, is being computed from the values of three solved-for variables AUX1, AUX2, AUX3.

•The "with FIXV" condition in the source statements, is the equivalent of the FIXVAL argument of COVAL.

MULTLABFEM-UNICAMP

UNICAMP WORKSHOP ON SETTING AN INLET VELOCITY PROFILE IN A PIPE FLOW

The workshop consists of setting a parabolic velocity profile in a pipe flow. The flow parameters are described below:

• The pipe radius and length are 0.05m and 7.5m with 30x30 grid. The fluid is air using Ideal Gas Law (IMAT = 2). Consider the reference pressure and temperature of 105Pa, 273K.

• The inlet velocity and temperature is 0.15m/s and 20C. The north wall is held at constant temperature of 100C.

A q1 file ready to write the In-Form programming lines is available for download (wksh_if_souc1)

MULTLABFEM-UNICAMP

UNICAMP

WORKSHOP ON SETTING AN INLET VELOCITY PROFILE IN A PIPE FLOW

The first step to assembly the q1 file is to remove the INLET object because it will be defined with the help of In-Form.

For laminar pipe flow, the inlet velocity profile is parabolic and follows the equation:

2

AVG R

y1W2yW

Where Wavg is the cross section averaged velocity, Wavg = 0.15m/s and R is the tube radius, R = 0.05

MULTLABFEM-UNICAMP

UNICAMP

IN_FORM LINES TO SET INLET VELOCITY PROFILE

Inform13begin

Define the averaged velocity and tube radius:REAL(WAVG,RTUBE,TIN);WAVG=0.15RTUBE=0.05;TIN=20 Define a patch for the inletPATCH(ENT,CELL,1,1,1,NY,1,1,1,1) Define sources for P1, W1 and TEM1(SOURCE OF P1 at ENT is RHO1*2*WAVG*(1-(RG/RTUBE)^2)*AHIGH with

FIXFLU) (SOURCE OF W1 at ENT is RHO1*(2*WAVG*(1-(RG/RTUBE)^2))^2*AHIGH

with FIXFLU) (SOURCE OF TEM1 at ENT is

RHO1*(2*WAVG*(1-(RG/RTUBE)^2))*TIN*CP1*AHIGH with FIXFLU) Inform13end

MULTLABFEM-UNICAMP

UNICAMP RESULTS WKSH_IF_SOUC(1)

• Axial velocity profile at the 2nd (continuous line) and 25th ( open circle) slabs.

• If you got trouble in obtaining this solution download wksh_if_souc(1)

MULTLABFEM-UNICAMP

UNICAMP

IN_FORM LINES TO SET INLET VELOCITY PROFILE

One could transmit the area using the patch command instead of employing AHIGH. In this case the modifications are:

PATCH(ENT,HIGH,1,1,1,NY,1,1,1,1)

(SOURCE OF P1 at ENT is RHO1*2*WAVG*(1-(RG/RTUBE)^2) with FIXFLU)

(SOURCE OF W1 at ENT is RHO1*(2*WAVG*(1-(RG/RTUBE)^2))^2 with FIXFLU)

(SOURCE OF TEM1 at ENT is RHO1*(2*WAVG*(1-(RG/RTUBE)^2))*TIN*CP1 with FIXFLU)

Modify your q1 and check if the results are coincident with the previous version

MULTLABFEM-UNICAMP

UNICAMP 2nd WORKSHOP: WKSH_IF_SOU(2)

• This workshop deals with the dispersion of a contaminant in air. It has applications on environmental flows.

• The case studied here is quite simple. It deals with the dispersion of CO2 in air in an isothermal flow.

• It will be done in two steps. The first one will solve for the concentration of the species but not will allow buoyancy forces due to the gases density differences. The second step is addressed on a homework where you are asked to set up the buoyancy force as a source term.

• A brief review of two component transport of a gas mixture is given before getting into details of the first step.

MULTLABFEM-UNICAMP

UNICAMP PROPERTIES OF A MIXTURE OF GASES

• F is the mass fraction of the gases: CO2 and AIR

1FF AIR2CO

• The molecular mass of the mixture, MMIX is:

where MCO2 = 44.01 kg/kmol and MAIR = 28.97 kg/kmol.• The gas constant of the mixture is:

where RCO2 = 188.9 J/kgK and RAIR = 287.0 J/kgK.• Finally the mixture density is:

AIRAIR2CO2COMIX MFMFM1

AIRAIR2CO2COMIXUMIX FRFRMRR

TRP MIXMIX

MULTLABFEM-UNICAMP

UNICAMP TRANSPORT MODELING EQUATION

SVt

SMIXTURE MASS 1 0 0MOMENTUM Y V1 (L+T) -(dp/dy)MOMENTUM Z W1 (L+T) -(dp/dz) CO2 TRANSPORT FCO2 (L/PRCO2 +T /PRTCO2 ) 0

• The transport model is isothermal with no buoyancy force along y direction due to density differences between gases.

• FCO2 is the solved variable while FAIR is deduced from FAIR=1-FCO2

• The laminar and turbulent Prandtl numbers for CO2 are, respectively: 0.965 and 0.9.

MULTLABFEM-UNICAMP

UNICAMP WKSH_IF_SOU(2) DEFINITIONS

• The domain is 2D along the y and z directions. The (y,z) lengths are 8m and 20m with 22 volumes in each direction.

• There is a blockage placed at (y,z) of (2.4, 9) whose size is of 1.6m by 1.0m along the (y,z) directions respectively.

• The north and high boundaries are held at constant pressure of 100000 Pa. The south boundary is a plate with no-slip.

• The low boundary is an inlet. The CO2 has a velocity of 2m/s at volumes IY =9 and 10, in this region FCO2 is unity. The has a velocity of 1m/s excluding volumes IY = 9 and 10, along these regions, FCO2 is zero!

• A Q1 file with the domain definitions but not with the In_Form lines is available at wksh_if_souc(2)_basic

MULTLABFEM-UNICAMP

UNICAMP WKSH_IF_SOUC(2) DEFINITIONS

20m (NZ = 22)

8m (

NY

= 2

2)

ATMOSPHERIC PRESSURE: 105 Pa

SOLID BLOCK

SIZE IN METERS (Y,Z) = (1.6 , 1.0)

POSITION IN METERS (Y,Z) =( 2.4, 9)

SWALL: PLATECO2 (2 m/s)

FCO2 = 1

AIR (1 m/s)

FCO2 = 0

11 ≤ IY ≤22

AIR (1 m/s)

FCO2 = 0

1≤IY≤8

MULTLABFEM-UNICAMP

UNICAMP WKSH_IF_SOUC(2) Q1 SETTINGS

• Group 7. Variables: STOREd,SOLVEd,NAMEd• ONEPHS = T

* Non-default variable names• NAME(144) =ENUT ; NAME(146) =WDIS• NAME(147) =DEN1 ; NAME(148) =RMIX• NAME(149) =FAIR ; NAME(150) =FCO2

* Solved variables list, request FCO2 to be solved• SOLVE(P1 ,V1 ,W1 ,FCO2)

* Stored variables list, provide storage for auxiliary variables• STORE(FAIR,RMIX,DEN1,WDIS,ENUT)

* Activates the LVEL turbulence model• TURMOD(LVEL)

MULTLABFEM-UNICAMP

UNICAMP WKSH_IF_SOUC(2) Q1 SETTINGS

Group 9. Properties

* Define reference pressure @ temperature and the CO2 laminar and turbulent Prandtl numbers

PRESS0 = 1.000000E+05 ;TEMP0 = 3.000000E+02

PRNDTL(FCO2) = 9.650000E-01

PRT (FCO2) = 9.000000E-01

************************************************************

* Echo InForm settings for Group 9

Inform9Begin

* RHO1 is the mixture density evaluate by the ideal gas law

(PROPERTY RHO1 IS (:PRESS0:+P1)/(RMIX*(:TEMP0:)))

Inform9End

MULTLABFEM-UNICAMP

UNICAMP WKSH_IF_SOUC(2) Q1 SETTINGS

Group 13. Boundary & Special Sources INLET (INCO21 ,LOW ,1,1,1,8,1,1,1,1) VALUE (INCO21 ,P1 , 1.160000E+00) ! Air density is 1.16 kg/m3 at 105Pa@300K VALUE (INCO21 ,V1 , 0.000000E+00) VALUE (INCO21 ,W1 , 1.000000E+00) COVAL (INCO21 ,FCO2, FIXVAL , 0.000000E+00) INLET (INCO22 ,LOW ,1,1,9,10,1,1,1,1) VALUE (INCO22 ,P1 , 3.530000E+00) ! CO2 density is 1.76 kg/m3 at 105Pa@300K VALUE (INCO22 ,V1 , 0.000000E+00) VALUE (INCO22 ,W1 , 2.000000E+00) COVAL (INCO22 ,FCO2, FIXVAL , 1.000000E+00) INLET (INCO23 ,LOW ,1,1,11,22,1,1,1,1) VALUE (INCO23 ,P1 , 1.160000E+00) ! Air density is 1.16 kg/m3 at 105Pa@300K VALUE (INCO23 ,V1 , 0.000000E+00) VALUE (INCO23 ,W1 , 1.000000E+00) COVAL (INCO23 ,FCO2, FIXVAL , 0.000000E+00)

MULTLABFEM-UNICAMP

UNICAMP WKSH_IF_SOUC(2) Q1 SETTINGS

Group 19. EARTH Calls To GROUND Station USEGRD = T ;USEGRX = T ASAP = T; PARSOL = T RG( 1) = 1.889500E+02 ! CO2 gas constant RG( 2) = 2.869900E+02 ! air gas constant ************************************************************ * Echo InForm settings for Group 19 Inform19Begin * Evaluates auxiliary variables FAIR and RMIX(STORED OF FAIR IS (1-FCO2) WITH ZSLSTR)(STORED OF RMIX IS FCO2*:RG(1):+FAIR*:RG(2): WITH ZSLSTR)

INFORM19END

MULTLABFEM-UNICAMP

UNICAMP

CO2 CONCENTRATION, WKSH_IF_SOUC(2) PROBE (Y,Z) AT (2,11)

MULTLABFEM-UNICAMP

UNICAMP A NOTE ON INTRODUCING BUOYANCY TERM

• The 2nd exercise assigned on the In Form Home Work practice proposes the insertion of the buoyancy term on the Y momentum equation due to the gases density difference.

• For reference to the user there is available a Q1 file with the buoyancy term written in the ‘old fashion way’, that is, using GREX routines: wksh_if_souc(2)_2

•The user may find it helpful to get to know other way to achieve the same result and also use it for comparison purposes against the In Form programming requested by the home work.

MULTLABFEM-UNICAMP

UNICAMP

END OF THE SOURCES WORKSHOP