Qualifiers of PLANT statements are of two kinds, namely:
These two kinds will now be described, in turn.
Three examples of the way in which the PATCH and COVAL commands qualify a PLANT statement now follow.
Example 1, extracted from Case 104 of the PLANT Library, which should be examined if the full story is required.
PATCH(START,INIVAL,1,NX,1,NY,1,NZ,1,1) {INIT01} VAL=XG2D+YG2D COVAL(START,C1,0.0,GRND) {INIT02} VAL=XG2D+YG2D+TLAST COVAL(START,EXAC,0.0,GRND)
This example shows how the initial value of the solved-for variable C1 is set to (x + y), while that of the stored-only variable EXAC is set to(x + y + t), where x and y are the cell-centre coordinates, and t is the time.
Both these settings prevail over the three-dimensional PATCH called START, of INIVAL type, which extends over the whole domain of integration for the first time moment only.
The following points should be noted:
Example 2, extracted from Case 131 of the PLANT Library, which should be examined for further information.
PATCH(ERG2,PHASEM,1,NX,1,NY,1,NZ,1,1000) {SORC01} CO=RG(2)*ABS(U1) COVAL(ERG2,U1,GRND,0.0)
This example provides a porous-medium-type momentum sink with a resistance coefficient which is proportional to the absolute value of the x-direction velocity U1.
The following points should be noted:
Example 3, extracted from Case 252 of the PLANT Library, which is concerned with the creation, by means of PLANT-generated GROUND coding of a four-fluid model of turbulent combustion.
PATCH(MICRMIX,VOLUME,1,NX,1,NY,1,NZ,1,1) A {SORC01} CO= :MCONST:*(C+D)*XG2D**(-2)*(1.0+9.0*YG2D) COVAL(MICRMIX,A,GRND,0.0) D {SORC02} VAL= 1-A-BB-C COVAL(MICRMIX,D,fixval,grnd) BB {SORC03} CO= :MCONST:*(D+1.E-6)*XG2D**(-2)*(1.0+9.0*YG2D) {SORC03} VAL= A*(2.0*C/(D+1.E-6)+1.0) COVAL(MICRMIX,BB,GRND,GRND) C {SORC04} CO= :MCONST:*(A+1.E-6)*XG2D**(-2)*(1.0+9.0*YG2D) {SORC04} VAL= D*(2.0*BB/(A+1.E-6)+1.0) COVAL(MICRMIX,C,GRND,GRND)
Here a single patch, called MICRMIX, covers the whole computational domain. It is used for the creation of volumetric sources for four solved-for variables: A, D, BB and C.
These sources depend on the values of those variables in the following ways:
Remarks concerning the three examples:
REGION does for properties and other settings what the eight last arguments of PATCH do for COVAL commands: they limit their range of applicability to a volume in the grid for which the boundaries are defined by the values of those arguments.
Examples now follow.
Example 1. Setting the density in a sub-domain.
The following PLANT statements cause the density of the medium to
equal the reciprocal of the enthalpy over the extents of:
RHO1=GRND {PRPT01} DEN1=1./H1 REGION(fstIX, lstIX, fstIY, lstIY, fstIZ, lstIZ, fSTEP, lSTEP)
Example 2. Setting the interphase transport in a sub-domain.
The following PLANT statements cause the inter-phase friction
coefficient to be equal to a constant (CFIP1) times the in-cell mass
of the first phase times the in-cell volume fraction of the second
phase over the extents of:
first IX (fstIX) to last IX (lstIX),
first IY (fstIY) to last IY (lstIY),
first IZ (fstIZ) to last IZ (lstIZ) and
first time step (fSTEP) last time step (lSTEP).
RG(1)=CFIP1 CFIPS=GRND {PRPT01} INTFRC=RG(1)*MASS1*R2 REGION(fstIX, lstIX, fstIY, lstIY, fstIZ, lstIZ, fSTEP, lSTEP)
Example 3. Calculation of the near-wall Nusselt number.
The following PIL statements do what is needed to calculate the Nusselt number at the south wall for the uniform grid at the finish of IZ-slab:
{SC0601} NU=RG(1)*ABS(TEM-NORTH(TEM))/YG2D REGION(1,1,1,NY,1,NZ,1,1)
It should be noted that NORTH(TEM) denotes the north value of TEMperature.
PLACE does for properties and other settings what REGION does, with the useful difference that the eight arguments are the geometrical distances and time moments not the grid indices.
Real-number arguments cause PLANT to convert them into the corresponding cell indices for specified grid. The latter will be used as the limits of DO loops in the Fortran coding to be created by PLANT.
Examples now follow.
Example 1. Setting the density in a physical sub-domain.
The problem is to apply a specific density formula, namely that the density is proportional to the reciprocal of the enthalpy, over a brick-shaped volume of which:
RHO1=GRND {PRPT01> DEN1=1./H1 PLACE(CXF, CXL, CYF, CYL, CZF, CZL, FT, FL)
Example 2. Setting a discontinuity in the interphase-friction coefficient.
The following statements set a different interphase-friction law for
two distinct parts of the 2D domain.
Specifically, although the
functional form is the same, the multiplying constant is 1.0 for
y-values between 5.0 and 10.0, and 7.0 for y-values between 0.0
and 5.0.
CFIPS=GRNDINTFRC=9.81*(:RHO2:-:RHO1:)/(:FALLVEL:)*MASS1*LIQ PLACE(0.0,24.0, 5.0,10.0, 0.0,1., 0.0,1.0) INTFRC=9.81*(:RHO2:-:RHO1:)/(7.*:FALLVEL:)*MASS1*LIQ PLACE(0.0,24.0, 0.0,5.0, 0.0,1.0, 0.0,1.0)
Remarks concerning the REGION and PLACE examples:
REGION and PLACE qualifiers can make use of some additional information indicating how and when the settings are to be applied. This information may be included by way of optional extensions. They are of two kinds, namely:
These two kinds will now be described, in turn.
A parameter specifies the value of the marker variable, MARK, which must be possessed by cells within the REGION or PLACE volumes, if the setting is to be made.
MARK must, of course, have been declared beforehand by a STORE(MARK) command.
Thus the parameter extension to the REGION or PLACE qualifier provides a further condition to the extent to which the settings are to be made.
Examples now follow.
Example 1, extracted from Case Y620 of the PLANT library, which should be examined if further understanding is required.
ENUL=GRND {PRPT05} VISL=1.*SQRT(U1**2+V1**2)*WDIS REGION() 1 {PRPT06} VISL=0.01 REGION() 2 {PRPT07} VISL=1.*SQRT(U1**2+V1**2)*WDIS REGION() 3
This example shows how, within a a space covering the whole integration domain, the laminar viscosity is set equal to:
Example 2, extracted from Case Y616 of the PLANT library, which should be examined for further information.
U1AD=GRND {SCUF01} VELAD=-3.*RG2D REGION() 1
This example provides the extra velocity, which is proportional to the cell-center radius, to be added to convection fluxes for the cells marked by unity MARK value.
Remarks concerning the two examples:
The Switch extension:
Switches are qualifier extensions which comprise logical expressions following the REGION or PLACE qualifier and preceded by a forward slash, thus:
PLACE(0.,XULAST,0.,10.,0.,ZWLAST,1.,3.) /IX.GT.NX-10.AND..NOT.BFC
REGION(1,NX,1,NY,1,NZ,1,3) /LG(1).AND.ISWEEP.EQ.LSWEEP-10
A switch may occupy the rest of the command line; but no
continuation is allowed; and there may be no more than one switch.
The switch, like the parameter, provides a further condition to be fulfilled before the setting is activated.
Examples now follow.
Example 1. Time-dependent setting of density.
If it is desired to make the first-phase density equal to the reciprocal of the first-phase enthalpy for the whole domain up to and including the third time step, but only when LG(1)=T in Q1, the following does what is needed:
RHO1=GRND
{PRPT01} DEN1=1./H1
REGION(1,NX,1,NY,1,NZ,1,3) /LG(1)
The /LG(1) switch specifies that the relationship, DEN1=1./H1, will be used only if LG(1)=T appears in Q1.
Example 2, extracted from Case Y602 of the PLANT library, which should be examined if the full story is required.
AZYV=GRND
{SCYS01} YRAT=1.+:POWER:*DZ/(ZWADD+ZW)
REGION(1,1,1,1) /IZ.LE.20
{SCYS02} YRAT=1.+:POWER:*(-1.)*DZ/(ZWADD+ZW)
REGION(1,1,1,1) /IZ.GT.20.AND.IZ.LE.40
{SCYS03} YRAT=1.+:POWER:*1.*DZ/(ZWADD+ZW)
REGION(1,1,1,1) /IZ.GT.40
The above three statements make the domain width a power law function of the downstream distance of the current slab (ZW). The power is changed with Z-direction in a step-wise manner. It is positive over the first 20 slabs, negative over the next 20 slabs and positive again for the remainder of the domain.
Note that the first four arguments of REGION are set to unity, in order that the setting of YRAT, which can have only one value for the whole slab (and for all times in this steady-flow example), is computed once only.
The IF qualifier is a convenient alternative to REGION and/or PLACE followed by a switch.
The reason is that it can be placed on the line below the REGION or PLACE statement, and so provides space for longer logical expressions.
It can also be used without any REGION or PLACE qualifier, in which case it applies either to the whole space-time domain, or, if it exists, to a preceding PATCH command.
The syntax is: IF( logical expression )
For example, the following REGION qualifier with switch
REGION(1,NX,1,NY,1,NZ,1,3) /IZ.GT.NZ-10.AND..NOT.BFC
can be expressed by way of IF, as:
REGION(1,NX,1,NY,1,NZ,1,3) IF(IZ.GT.NZ-10.AND..NOT.BFC )
Examples now follow.
Example 1, extracted from Case Y618 of the PLANT library, which should be examined if the full story is required.
{SC0301} TFAL=1/(SQRT(U1**2+W1**2+V1**2)/$
AMIN1(DXU2D*1,AMIN1(DYV2D*1,DZ*1))+$
RG(1)/AMIN1(DXU2D*1,AMIN1(DYV2D*1,DZ*1))**2)
IF(ISWEEP.GT.200)
This example shows how the local self-steering false-time step, TFAL, is set to the reciprocal of the local velocity vector magnitude divided by smallest distance between walls of continuity cell in question plus local diffusivities, i.e. kinematic viscosities, RG(1), divided by the smallest distance squared.
The tag {SC0301} tells that the variable TFAL is calculated right at the start of each IZ-slab. The IF qualifier provides that it will be done for all sweeps greater than 200.
Example 2, modified extraction from Case Y618 of the PLANT library continuing the previous example.
PATCH(RELAX,PHASEM,1,NX,1,NY,1,NZ,1,1)
{SORC97} CO=1./TFAL
COVAL(RELAX,U1,GRND,SAME)
IF(ISWEEP.GT.100)
{SORC98} CO=1./TFAL
COVAL(RELAX,V1,GRND,SAME)
IF(ISWEEP.GT.200)
{SORC99} CO=1./TFAL
COVAL(RELAX,W1,GRND,SAME)
IF(ISWEEP.GT.300)
This example provides the momentum sources for the local false-time
under-relaxations for three components of velocity.
The IF qualifier makes it possible to activate the settings at different calculation stages: these for U1 will start to work after 100 sweeps, for V1 after 200 sweeps, while these for W1 are triggered after 300 sweeps.
Remarks concerning the use of IF qualifier:
The above examples have illustrated only a few aspects of the ways in which the IF qualifier may be used. The followings additional points should also be noted :