Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e4ebcae
Tight coupling for macrophysics so the acoustic solver sees these RHS…
AMLattanzi May 4, 2026
08be144
remove unused.
AMLattanzi May 4, 2026
3b2380e
Merge branch 'development' into MacroCouple
AMLattanzi May 4, 2026
406b3bf
Merge branch 'development' into MacroCouple
AMLattanzi May 4, 2026
a67d777
no condensation in relaxation zone.
AMLattanzi May 4, 2026
8fb87b7
Fix tendency.
AMLattanzi May 5, 2026
cc0c0df
macro once per timestep and use operator splitting to do theta tend b…
AMLattanzi May 5, 2026
c50c2b5
Fix access of mac src when not allocated.
AMLattanzi May 5, 2026
2ec27eb
Merge branch 'development' into MacroCouple
AMLattanzi May 6, 2026
6bea033
Merge branch 'development' into MacroCouple
AMLattanzi May 7, 2026
b28143c
Merge branch 'development' into MacroCouple
AMLattanzi May 8, 2026
c28611e
Merge branch 'development' into MacroCouple
AMLattanzi May 11, 2026
7790c41
Remora Coupling (#3164)
AMLattanzi May 11, 2026
5b047a6
Storm Tagging (#3163)
AMLattanzi May 11, 2026
d849808
Theta_m pert is not right in substep T.
AMLattanzi May 12, 2026
125fd5f
compiled in debug. Need to do _NS file.
AMLattanzi May 12, 2026
ec11a65
add fix in other PR.
AMLattanzi May 12, 2026
96c6d05
Merge branch 'development' into MoistSubStepping
AMLattanzi May 12, 2026
606d85e
Merge branch 'development' into MoistSubStepping
AMLattanzi May 12, 2026
c4bb16c
Merge branch 'development' into MoistSubStepping
AMLattanzi May 13, 2026
6e7a95e
Move Qv to pre and implicit diff and protect no moisture in substep T.
AMLattanzi May 13, 2026
d2b260b
Merge branch 'development' into MoistSubStepping
AMLattanzi May 13, 2026
2ec94cf
Merge branch 'development' into MoistSubStepping
AMLattanzi May 14, 2026
18fde01
Merge branch 'development' into MoistSubStepping
AMLattanzi May 15, 2026
1f4e822
Only copy q1 if we have moisture.
AMLattanzi May 15, 2026
a5ea903
Make qc have tendency as well.
AMLattanzi May 18, 2026
8b0bc82
Merge branch 'development' into MoistSubStepping
AMLattanzi May 18, 2026
7e0442c
Merge branch 'development' into MoistSubStepping
AMLattanzi May 19, 2026
ca96518
first pass.
AMLattanzi May 19, 2026
041edc0
Unify theory and code.
AMLattanzi May 20, 2026
670140b
Merge branch 'development' into MoistSubStepping
AMLattanzi May 20, 2026
78dee98
limit qv to zero for safety.
AMLattanzi May 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Source/DataStructs/ERF_DataStruct.H
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ struct SolverChoice {
}

pp.query("moisture_tight_coupling",moisture_tight_coupling);
pp.query("macrophysics_acoustic_coupling",macrophysics_acoustic_coupling);
}

// Which expression (1,2/3 or 4) to use for buoyancy
Expand Down Expand Up @@ -1265,7 +1266,8 @@ struct SolverChoice {
// Microphysics params
MoistureComponentIndices moisture_indices;

bool moisture_tight_coupling {false};
bool moisture_tight_coupling {false};
bool macrophysics_acoustic_coupling {false};

std::string windfarm_loc_table, windfarm_spec_table, windfarm_spec_table_extra;
std::string windfarm_blade_table, windfarm_airfoil_tables;
Expand Down
57 changes: 30 additions & 27 deletions Source/Diffusion/ERF_Diffusion.H
Original file line number Diff line number Diff line change
Expand Up @@ -456,39 +456,42 @@ void ComputeStrain_T (amrex::Box bxcc, amrex::Box tbxxy,

void ImplicitDiffForStateLU_N (const amrex::Box& bx,
const amrex::Box& domain,
const int level,
const int n,
const amrex::Real dt,
const int& level,
const int& n,
const int& qty_index,
const amrex::Real& dt,
const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM*2>& bc_neumann_vals,
const amrex::Array4< amrex::Real>& cell_data,
const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
const amrex::Array4<const amrex::Real>& hfx_z,
const amrex::Array4<const amrex::Real>& mu_turb,
const SolverChoice& solverChoice,
const amrex::BCRec* bc_ptr,
const bool use_SurfLayer,
const amrex::Real implicit_fac);
const bool& use_SurfLayer,
const amrex::Real& implicit_fac);

void ImplicitDiffForStateLU_S (const amrex::Box& bx,
const amrex::Box& domain,
const int level,
const int n,
const amrex::Real dt,
const int& level,
const int& n,
const int& qty_index,
const amrex::Real& dt,
const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM*2>& bc_neumann_vals,
const amrex::Array4< amrex::Real>& cell_data,
const amrex::Gpu::DeviceVector<amrex::Real>& stretched_dz_d,
const amrex::Array4<const amrex::Real>& hfx_z,
const amrex::Array4<const amrex::Real>& mu_turb,
const SolverChoice& solverChoice,
const amrex::BCRec* bc_ptr,
const bool use_SurfLayer,
const amrex::Real implicit_fac);
const bool& use_SurfLayer,
const amrex::Real& implicit_fac);

void ImplicitDiffForStateLU_T (const amrex::Box& bx,
const amrex::Box& domain,
const int level,
const int n,
const amrex::Real dt,
const int& level,
const int& n,
const int& qty_index,
const amrex::Real& dt,
const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM*2>& bc_neumann_vals,
const amrex::Array4< amrex::Real>& cell_data,
const amrex::Array4<const amrex::Real>& z_nd,
Expand All @@ -498,14 +501,14 @@ void ImplicitDiffForStateLU_T (const amrex::Box& bx,
const amrex::Array4<const amrex::Real>& mu_turb,
const SolverChoice& solverChoice,
const amrex::BCRec* bc_ptr,
const bool use_SurfLayer,
const amrex::Real implicit_fac);
const bool& use_SurfLayer,
const amrex::Real& implicit_fac);

template <int stagdir>
void ImplicitDiffForMomLU_N (const amrex::Box& bx,
const amrex::Box& domain,
const int level,
const amrex::Real dt,
const int& level,
const amrex::Real& dt,
const amrex::Array4<const amrex::Real>& cell_data,
const amrex::Array4< amrex::Real>& face_data,
const amrex::Array4<const amrex::Real>& tau,
Expand All @@ -514,14 +517,14 @@ void ImplicitDiffForMomLU_N (const amrex::Box& bx,
const amrex::Array4<const amrex::Real>& mu_turb,
const SolverChoice& solverChoice,
const amrex::BCRec* bc_ptr,
const bool use_SurfLayer,
const amrex::Real implicit_fac);
const bool& use_SurfLayer,
const amrex::Real& implicit_fac);

template <int stagdir>
void ImplicitDiffForMomLU_S (const amrex::Box& bx,
const amrex::Box& domain,
const int level,
const amrex::Real dt,
const int& level,
const amrex::Real& dt,
const amrex::Array4<const amrex::Real>& cell_data,
const amrex::Array4< amrex::Real>& face_data,
const amrex::Array4<const amrex::Real>& tau,
Expand All @@ -530,14 +533,14 @@ void ImplicitDiffForMomLU_S (const amrex::Box& bx,
const amrex::Array4<const amrex::Real>& mu_turb,
const SolverChoice& solverChoice,
const amrex::BCRec* bc_ptr,
const bool use_SurfLayer,
const amrex::Real implicit_fac);
const bool& use_SurfLayer,
const amrex::Real& implicit_fac);

template <int stagdir>
void ImplicitDiffForMomLU_T (const amrex::Box& bx,
const amrex::Box& domain,
const int level,
const amrex::Real dt,
const int& level,
const amrex::Real& dt,
const amrex::Array4<const amrex::Real>& cell_data,
const amrex::Array4< amrex::Real>& face_data,
const amrex::Array4<const amrex::Real>& tau,
Expand All @@ -548,6 +551,6 @@ void ImplicitDiffForMomLU_T (const amrex::Box& bx,
const amrex::Array4<const amrex::Real>& mu_turb,
const SolverChoice& solverChoice,
const amrex::BCRec* bc_ptr,
const bool use_SurfLayer,
const amrex::Real implicit_fac);
const bool& use_SurfLayer,
const amrex::Real& implicit_fac);
#endif
28 changes: 14 additions & 14 deletions Source/Diffusion/ERF_ImplicitDiff_N.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ using namespace amrex;
void
ImplicitDiffForStateLU_N (const Box& bx,
const Box& domain,
const int level,
const int n,
const Real dt,
const int& level,
const int& n,
const int& qty_index,
const Real& dt,
const GpuArray<Real, AMREX_SPACEDIM*2>& bc_neumann_vals,
const Array4< Real>& cell_data,
const GpuArray<Real, AMREX_SPACEDIM>& cellSizeInv,
const Array4<const Real>& scalar_zflux,
const Array4<const Real>& mu_turb,
const SolverChoice &solverChoice,
const BCRec* bc_ptr,
const bool use_SurfLayer,
const Real implicit_fac)
const bool& use_SurfLayer,
const Real& implicit_fac)
{
BL_PROFILE_VAR("ImplicitDiffForState_N()",ImplicitDiffForState_N);

// setup quantities for getRhoAlpha()
#include "ERF_SetupVertDiff.H"
const int qty_index = n;
const int prim_index = qty_index - 1;
const int prim_scal_index = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ? PrimScalar_comp : prim_index;

Expand Down Expand Up @@ -203,8 +203,8 @@ template <int stagdir>
void
ImplicitDiffForMomLU_N (const Box& bx,
const Box& /*domain*/,
const int level,
const Real dt,
const int& level,
const Real& dt,
const Array4<const Real>& cell_data,
const Array4< Real>& face_data,
const Array4<const Real>& tau,
Expand All @@ -213,8 +213,8 @@ ImplicitDiffForMomLU_N (const Box& bx,
const Array4<const Real>& mu_turb,
const SolverChoice &solverChoice,
const BCRec* bc_ptr,
const bool use_SurfLayer,
const Real implicit_fac)
const bool& use_SurfLayer,
const Real& implicit_fac)
{
BL_PROFILE_VAR("ImplicitDiffForMom_N()",ImplicitDiffForMom_N);

Expand Down Expand Up @@ -430,8 +430,8 @@ ImplicitDiffForMomLU_N (const Box& bx,
template void ImplicitDiffForMomLU_N<STAGDIR> ( \
const Box&, \
const Box&, \
const int, \
const Real, \
const int&, \
const Real&, \
const Array4<const Real>&, \
const Array4< Real>&, \
const Array4<const Real>&, \
Expand All @@ -440,8 +440,8 @@ ImplicitDiffForMomLU_N (const Box& bx,
const Array4<const Real>&, \
const SolverChoice&, \
const BCRec*, \
const bool, \
const Real);
const bool&, \
const Real&);
INSTANTIATE_IMPLICIT_DIFF_FOR_MOM_LU(0)
INSTANTIATE_IMPLICIT_DIFF_FOR_MOM_LU(1)
INSTANTIATE_IMPLICIT_DIFF_FOR_MOM_LU(2)
Expand Down
28 changes: 14 additions & 14 deletions Source/Diffusion/ERF_ImplicitDiff_S.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ using namespace amrex;
void
ImplicitDiffForStateLU_S (const Box& bx,
const Box& domain,
const int level,
const int n,
const Real dt,
const int& level,
const int& n,
const int& qty_index,
const Real& dt,
const GpuArray<Real, AMREX_SPACEDIM*2>& bc_neumann_vals,
const Array4< Real>& cell_data,
const Gpu::DeviceVector<Real>& stretched_dz_d,
const Array4<const Real>& scalar_zflux,
const Array4<const Real>& mu_turb,
const SolverChoice &solverChoice,
const BCRec* bc_ptr,
const bool use_SurfLayer,
const Real implicit_fac)
const bool& use_SurfLayer,
const Real& implicit_fac)
{
BL_PROFILE_VAR("ImplicitDiffForState_S()",ImplicitDiffForState_S);

// setup quantities for getRhoAlpha()
#include "ERF_SetupVertDiff.H"
const int qty_index = n;
const int prim_index = qty_index - 1;
const int prim_scal_index = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ? PrimScalar_comp : prim_index;

Expand Down Expand Up @@ -213,8 +213,8 @@ template <int stagdir>
void
ImplicitDiffForMomLU_S (const Box& bx,
const Box& /*domain*/,
const int level,
const Real dt,
const int& level,
const Real& dt,
const Array4<const Real>& cell_data,
const Array4< Real>& face_data,
const Array4<const Real>& tau,
Expand All @@ -223,8 +223,8 @@ ImplicitDiffForMomLU_S (const Box& bx,
const Array4<const Real>& mu_turb,
const SolverChoice &solverChoice,
const BCRec* bc_ptr,
const bool use_SurfLayer,
const Real implicit_fac)
const bool& use_SurfLayer,
const Real& implicit_fac)
{
BL_PROFILE_VAR("ImplicitDiffForMom_S()",ImplicitDiffForMom_S);

Expand Down Expand Up @@ -453,8 +453,8 @@ ImplicitDiffForMomLU_S (const Box& bx,
template void ImplicitDiffForMomLU_S<STAGDIR> ( \
const Box&, \
const Box&, \
const int, \
const Real, \
const int&, \
const Real&, \
const Array4<const Real>&, \
const Array4< Real>&, \
const Array4<const Real>&, \
Expand All @@ -463,8 +463,8 @@ ImplicitDiffForMomLU_S (const Box& bx,
const Array4<const Real>&, \
const SolverChoice&, \
const BCRec*, \
const bool, \
const Real);
const bool&, \
const Real&);
INSTANTIATE_IMPLICIT_DIFF_FOR_MOM_LU(0)
INSTANTIATE_IMPLICIT_DIFF_FOR_MOM_LU(1)
INSTANTIATE_IMPLICIT_DIFF_FOR_MOM_LU(2)
Expand Down
28 changes: 14 additions & 14 deletions Source/Diffusion/ERF_ImplicitDiff_T.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ using namespace amrex;
void
ImplicitDiffForStateLU_T (const Box& bx,
const Box& domain,
const int level,
const int n,
const Real dt,
const int& level,
const int& n,
const int& qty_index,
const Real& dt,
const GpuArray<Real, AMREX_SPACEDIM*2>& bc_neumann_vals,
const Array4< Real>& cell_data,
const Array4<const Real>& z_nd,
Expand All @@ -40,14 +41,13 @@ ImplicitDiffForStateLU_T (const Box& bx,
const Array4<const Real>& mu_turb,
const SolverChoice &solverChoice,
const BCRec* bc_ptr,
const bool use_SurfLayer,
const Real implicit_fac)
const bool& use_SurfLayer,
const Real& implicit_fac)
{
BL_PROFILE_VAR("ImplicitDiffForState_T()",ImplicitDiffForState_T);

// setup quantities for getRhoAlpha()
#include "ERF_SetupVertDiff.H"
const int qty_index = n;
const int prim_index = qty_index - 1;
const int prim_scal_index = (qty_index >= RhoScalar_comp && qty_index < RhoScalar_comp+NSCALARS) ? PrimScalar_comp : prim_index;

Expand Down Expand Up @@ -221,8 +221,8 @@ template <int stagdir>
void
ImplicitDiffForMomLU_T (const Box& bx,
const Box& /*domain*/,
const int level,
const Real dt,
const int& level,
const Real& dt,
const Array4<const Real>& cell_data,
const Array4< Real>& face_data,
const Array4<const Real>& tau,
Expand All @@ -233,8 +233,8 @@ ImplicitDiffForMomLU_T (const Box& bx,
const Array4<const Real>& mu_turb,
const SolverChoice &solverChoice,
const BCRec* bc_ptr,
const bool use_SurfLayer,
const Real implicit_fac)
const bool& use_SurfLayer,
const Real& implicit_fac)
{
BL_PROFILE_VAR("ImplicitDiffForMom_T()",ImplicitDiffForMom_T);

Expand Down Expand Up @@ -473,8 +473,8 @@ ImplicitDiffForMomLU_T (const Box& bx,
template void ImplicitDiffForMomLU_T<STAGDIR> ( \
const Box&, \
const Box&, \
const int, \
const Real, \
const int&, \
const Real&, \
const Array4<const Real>&, \
const Array4< Real>&, \
const Array4<const Real>&, \
Expand All @@ -485,8 +485,8 @@ ImplicitDiffForMomLU_T (const Box& bx,
const Array4<const Real>&, \
const SolverChoice&, \
const BCRec*, \
const bool, \
const Real);
const bool&, \
const Real&);
INSTANTIATE_IMPLICIT_DIFF_FOR_MOM_LU(0)
INSTANTIATE_IMPLICIT_DIFF_FOR_MOM_LU(1)
INSTANTIATE_IMPLICIT_DIFF_FOR_MOM_LU(2)
Expand Down
Loading
Loading