ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
surface_layer_stress Namespace Reference

Classes

struct  FaceStressResult
 

Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real conservative_to_kinematic_stress (amrex::Real conservative_stress, amrex::Real rho)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE FaceStressResult combine_lsm_and_most_stress (amrex::Real rho_low, amrex::Real rho_high, amrex::Real kinematic_low, amrex::Real kinematic_high, bool low_valid, bool high_valid, amrex::Real most_face_stress)
 

Function Documentation

◆ combine_lsm_and_most_stress()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE FaceStressResult surface_layer_stress::combine_lsm_and_most_stress ( amrex::Real  rho_low,
amrex::Real  rho_high,
amrex::Real  kinematic_low,
amrex::Real  kinematic_high,
bool  low_valid,
bool  high_valid,
amrex::Real  most_face_stress 
)

Combine cell-centered kinematic LSM stresses with a conservative MOST fallback stress at one face. The returned cache values are always kinematic, while face_stress is always conservative.

Parameters
[in]rho_lowdensity on the low-side cell
[in]rho_highdensity on the high-side cell
[in]kinematic_lowlow-side LSM kinematic stress
[in]kinematic_highhigh-side LSM kinematic stress
[in]low_validwhether the low-side LSM stress is valid
[in]high_validwhether the high-side LSM stress is valid
[in]most_face_stressconservative MOST fallback stress at the face
55 {
56  const amrex::Real half = amrex::Real(0.5);
57  FaceStressResult result{
58  amrex::Real(0.0),
59  low_valid ? kinematic_low
60  : conservative_to_kinematic_stress(most_face_stress, rho_low),
61  high_valid ? kinematic_high
62  : conservative_to_kinematic_stress(most_face_stress, rho_high)};
63 
64  if (low_valid && high_valid) {
65  result.face_stress =
66  half * rho_low * kinematic_low + half * rho_high * kinematic_high;
67  } else if (low_valid) {
68  result.face_stress =
69  half * rho_low * kinematic_low + half * most_face_stress;
70  } else if (high_valid) {
71  result.face_stress =
72  half * rho_high * kinematic_high + half * most_face_stress;
73  } else {
74  result.face_stress = most_face_stress;
75  }
76 
77  return result;
78 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real conservative_to_kinematic_stress(amrex::Real conservative_stress, amrex::Real rho)
Definition: ERF_SurfaceLayerStress.H:18

Referenced by SurfaceLayer::compute_SurfaceLayer_bcs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ conservative_to_kinematic_stress()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real surface_layer_stress::conservative_to_kinematic_stress ( amrex::Real  conservative_stress,
amrex::Real  rho 
)

LSM cache value from a conservative face stress.

Parameters
[in]conservative_stressconservative face stress
[in]rhodensity used to convert to kinematic stress
20 {
21  return conservative_stress / rho;
22 }
@ rho
Definition: ERF_Kessler.H:25

Referenced by combine_lsm_and_most_stress().

Here is the caller graph for this function: