Used for defining block structured body fitted grid by defining the vertices of each cell. Maps a regular Cartesian grid to a more complex grid with curved boundaries. Instructions on generating body fitted meshes are given in Solving Problems on Advanced Structured Meshes in USim.
Vertices
(block)lower
(float vector)upper
(float vector)Defines the upper mapping x, y, z coordinates in the form upper=[XUPPER, YUPPER, ZUPPER]. In 1D only 1 component is required, in 2D 2 components, in 3D 3 components. Extra components are ignored.
When combined with the Vertex, kind = funcVertCalc, the vertex mapping in the x direction ranges from XLOWER to XUPPER and the true x position is xnew = f(x) for x between XLOWER and XUPPER
cells
(integer vector)isRadial
(boolean)ghostLayers
(integer)writeGeom
(boolean)writeConn
(boolean)writeHalos
(boolean)Sample code block
<Grid domain>
kind = bodyFitted2d
lower = [0.0, 0.0]
upper = [1.0, 1.0]
cells = [R_CELLS, $Z_INLET_CELLS+Z_CURVE_CELLS$]
ghostLayers = 2
isRadial = 1
<Vertices vertices>
kind = funcVertCalc
<Function f>
kind = exprFunc
z_inlet = Z_INLET
z_inlet_cells = $Z_INLET_CELLS*1.0$
z_curve_cells = $Z_CURVE_CELLS*1.0$
r_inner = R_INNER
r_outer = R_OUTER
r_cells = $R_CELLS*1.0$
dz_inlet = $Z_INLET/Z_INLET_CELLS$
circ_rad = CIRC_RAD
# cell spacings in computational space
dzc = $1.0/(Z_INLET_CELLS+Z_CURVE_CELLS)$
drc = $1.0/R_CELLS$
zc_inlet = $1.0*Z_INLET_CELLS/(Z_INLET_CELLS+Z_CURVE_CELLS)$
preExprs = [ \
"r = x", \
"z = y", \
"iz = rint(z/dzc)", \
"ir = rint(r/drc)", \
"zp_inlet = if (iz<=z_inlet_cells, dz_inlet*iz, 0.0)", \
"rp_inlet = if (iz<=z_inlet_cells, r_inner+ir*(r_outer-r_inner)/r_cells, 0.0)", \
"rr = r_inner + r*(r_outer-r_inner)", \
"zz = 0.5*_pi*(z-zc_inlet)/(1.0-zc_inlet)", \
"rp_curve = if (iz>z_inlet_cells, rr*cos(zz), 0.0)", \
"zp_curve = if (iz>z_inlet_cells, rr*sin(zz) + z_inlet, 0.0)", \
"rp = rp_curve+rp_inlet", \
"zp = zp_curve+zp_inlet" \
]
exprs = ["rp", "zp"]
</Function>
</Vertices>
</Grid>