Skip to content

Commit

Permalink
added BC info as an argument to microphysics advance function (#2028)
Browse files Browse the repository at this point in the history
Co-authored-by: David Gardner <[email protected]>
  • Loading branch information
debog and gardner48 authored Dec 17, 2024
1 parent a8e44bf commit 4c6445b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Source/Microphysics/ERF_EulerianMicrophysics.H
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public:
const amrex::Real&, /*!< current time */
const SolverChoice &solverChoice, /*!< Solver choice object */
amrex::Vector<amrex::Vector<amrex::MultiFab>>&, /*!< Dycore state variables */
const amrex::Vector<std::unique_ptr<amrex::MultiFab>>& /*!< terrain */) override
const amrex::Vector<std::unique_ptr<amrex::MultiFab>>&, /*!< terrain */
const amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2>& ) override
{
m_moist_model[lev]->Advance(dt_advance, solverChoice);
}
Expand Down
5 changes: 3 additions & 2 deletions Source/Microphysics/ERF_LagrangianMicrophysics.H
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ public:
const amrex::Real& time, /*!< current time */
const SolverChoice& /*solverChoice*/, /*!< Solver choice object */
amrex::Vector<amrex::Vector<amrex::MultiFab>>& a_vars, /*!< Dycore state variables */
const amrex::Vector<std::unique_ptr<amrex::MultiFab>>& a_z/*!< terrain */) override
const amrex::Vector<std::unique_ptr<amrex::MultiFab>>& a_z/*!< terrain */,
const amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2>& a_phys_bc_types ) override
{
if (lev > 0) return;
m_moist_model->Advance(dt_advance, iter, time, a_vars, a_z);
m_moist_model->Advance(dt_advance, iter, time, a_vars, a_z, a_phys_bc_types);
}

/*! \brief update microphysics variables from ERF state variables */
Expand Down
4 changes: 3 additions & 1 deletion Source/Microphysics/ERF_Microphysics.H
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <vector>
#include <string>
#include "ERF_DataStruct.H"
#include "ERF_IndexDefines.H"

/*! \brief Base class for microphysics interface */
class Microphysics {
Expand Down Expand Up @@ -39,7 +40,8 @@ public:
const amrex::Real&,
const SolverChoice&,
amrex::Vector<amrex::Vector<amrex::MultiFab>>&,
const amrex::Vector<std::unique_ptr<amrex::MultiFab>>& ) = 0;
const amrex::Vector<std::unique_ptr<amrex::MultiFab>>&,
const amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2>& ) = 0;

/*! \brief update microphysics variables from ERF state variables */
virtual void Update_Micro_Vars_Lev (const int&, amrex::MultiFab&) = 0;
Expand Down
4 changes: 3 additions & 1 deletion Source/Microphysics/Null/ERF_NullMoistLagrangian.H
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#ifdef ERF_USE_PARTICLES

#include <AMReX_AmrParGDB.H>
#include "ERF_IndexDefines.H"
#include "ERF_NullMoist.H"

/* forward declaration */
Expand Down Expand Up @@ -53,7 +54,8 @@ public:
const int&, /* iter */
const amrex::Real&, /* time */
amrex::Vector<amrex::Vector<amrex::MultiFab>>&, /* state variables */
const amrex::Vector<std::unique_ptr<amrex::MultiFab>>& /* terrain */) { }
const amrex::Vector<std::unique_ptr<amrex::MultiFab>>&, /* terrain */
const amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2>& ) { }

protected:

Expand Down
2 changes: 1 addition & 1 deletion Source/TimeIntegration/ERF_AdvanceMicrophysics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void ERF::advance_microphysics (int lev,
{
if (solverChoice.moisture_type != MoistureType::None) {
micro->Update_Micro_Vars_Lev(lev, cons);
micro->Advance(lev, dt_advance, iteration, time, solverChoice, vars_new, z_phys_nd);
micro->Advance(lev, dt_advance, iteration, time, solverChoice, vars_new, z_phys_nd, phys_bc_type);
micro->Update_State_Vars_Lev(lev, cons);
}
}

0 comments on commit 4c6445b

Please sign in to comment.