Mapping definition
Let the mapping of stretched mesh to uniform mesh be defined by \({\mathbf X} = \Phi (\Xi) = (x(\chi), y(\eta), z(\xi))\). For demonstration purposes, we assume mapping only in the \(z\)-direction. Note that the normals to faces continue to be aligned with the grid axes.
We define the velocity
where
and
In our case \(T\) is
We can write the mesh spacing in \({\mathbf X}\)-space as
where \((dx,dy,dz)\) are the mesh spacings in \({\mathbf \Xi}\)-space.
Handy identities
for any vector field \(A\)
Governing equations in stretched mesh space
MAC Projection
In the MAC projection we want to solve
then set
Mapping the above to uniform coordinates yields
The MAC projection from AMReX will then return
Nodal Projection
Analogously to the MAC projection we want to solve
where here \(\overline{U}^{n+1,*} = T U^{n+1,*}\) is cell-centered with \(U^{n+1,*} = U^{n+1,*} + \frac{1}{J} T^T \nabla_\Xi p^{n-1/2}\). Note, although \(p\) is defined on the nodes, \(\nabla p\) is cell-centered.
We construct the divergence and gradient operators with a finite element approach, so the mapping enters in here via integrals over cell volumes. Thus we will only need \(z_\xi\) at cell centers; this is the same metric term used in the MAC projector.
As with the MAC projection we want to create \(\overline{U}^{n+1,*} = T U^{n+1,*}\) as the velocity field we will send in to the nodal projector.
The nodal projection will return
Note that – unlike in the MAC projection – we want \(U^{n+1}\) rather than \(\overline{U}^{n+1},\) so after the projection we must define
Initial conditions & computing the timestep
The initial conditions for any problem as well as any other global computations such as evaluating the CFL or the adaptive timestep size should be done so in the stretched coordinates.
Exceptions to the current implementation
As a first pass, the stretched mesh capability is implemented only for the MOL scheme.
The stretched mesh capability has been tested and verified only for single-level AMR meshes.
The mesh stretching capability requires the use of multi-component velocity solves by setting
velocity_diffusion.use_tensor_operator = false
Efforts are underway to extend the capability beyond laminar physics.