ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_ImmersedProjection.cpp File Reference
Include dependency graph for ERF_ImmersedProjection.cpp:

Detailed Description

Implicit immersed-forcing drag in the projection of an anelastic or pseudo-incompressible level (erf.if_implicit_projection, erf-model/ERF#4919 for terrain, #4887 for buildings).

The terrain immersed forcing drags the momentum of the solid faces toward zero at the rate rate = beta_face * if_Cd_momentum / (dx dy dz)^(1/3). Applied explicitly, the drag is undone by the projection, which treats the solid as fluid; the post-projection freeze of the solid faces then leaves the surface faces (solid on one side only) unbalanced, so the solid row under the surface becomes a mass sink and source. With the drag inside the projection,

m^{n+1} = (m* - grad phi) / (1 + dt rate) = sigma (m* - grad phi),
div(sigma grad phi) = div(sigma m*),

the projected momenta are divergence free everywhere, the solid included, and no freeze is needed. The faces where the source term applies the wall law instead of the drag keep sigma = 1.

The solve of div(sigma grad phi) (erf-model/ERF#4887): constant dz, map factors of one, FFT build, every region of the level a rectangle: GMRES with the constant-coefficient FFT solve as preconditioner (solve_with_if_gmres); constant dz, map factors of one, otherwise: multigrid with sigma as the face coefficient (solve_with_if_mlmg, amrex::MLABecLaplacian); stretched dz, map factors other than one (on any level) or a pseudo-incompressible level: the terrain Poisson multigrid, with sigma in its face area factors (ERF::project_momenta); a region that is not a rectangle goes to solve_with_flat_mlmg with the same area factors (erf-model/ERF#5332). On a pseudo-incompressible level the projected momentum is m = beta_pi (rho u) with beta_pi = rho0 theta0 / rho on the faces (pi_beta in ERF::project_momenta; not the solid fraction beta_face of the rate above), and the two coefficients multiply:

m^{n+1} = sigma (m* - beta_pi grad phi),
div(sigma beta_pi grad phi) = div(sigma m*) - S,

with phi the pressure correction times dt as above, and S the source term of the pseudo-incompressible constraint, which sigma does not multiply.

A terrain-fitted mesh is not supported.

For buildings (erf.buildings_type = ImmersedForcing, erf-model/ERF#4887) the rate is the linear drag of ImmersedForcingBuildings_{X,Y,Z}mom (partial-wall and interior faces, from the masks of ERF_ImmersedBuildingMasks.H), and the faces between two solid cells take the full rate.