Skip to content

Commit 789ac21

Browse files
authored
Read Wbar from table (#619)
* 1. Added a new index for reading molecular mass from table. 2. Updated Y2Wbar function to interpolate Wbar value. To be used with PR#9 of cmlm * Removed fixing Wbar to -1
1 parent 027d599 commit 789ac21

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Source/Eos/EosParams.H

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ struct EosParm<Manifold>
4343
density_lookup_type dens_lookup;
4444
bool compute_temperature{false};
4545
int idx_density{0};
46+
int idx_Wbar{0};
4647
int idx_T{0};
4748
int idx_Wdot[MANIFOLD_DIM];
4849
int is_variance_of[MANIFOLD_DIM];
@@ -146,6 +147,11 @@ struct InitParm<eos::EosParm<eos::Manifold>>
146147

147148
// Get important indices
148149
parm_in->m_h_parm.idx_T = get_var_index("T", h_manf_data_in);
150+
#ifdef PELE_USE_SPRAY
151+
parm_in->m_h_parm.idx_Wbar = get_var_index("WBAR", h_manf_data_in);
152+
#else
153+
parm_in->m_h_parm.idx_Wbar = get_var_index("WBAR", h_manf_data_in, false);
154+
#endif
149155

150156
// For manifold table parameter source terms, assume if index not found,
151157
// source term is 0 For neural net, require a definition to be supplied for

Source/Eos/Manifold.H

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,13 @@ struct Manifold
7878

7979
AMREX_GPU_HOST_DEVICE
8080
AMREX_FORCE_INLINE
81-
static void Y2WBAR(const amrex::Real* /*Y*/, amrex::Real& /*WBAR*/)
81+
void Y2WBAR(const amrex::Real* Y, amrex::Real& WBAR)
8282
{
83-
amrex::Error("Y2WBAR is not yet implemented for Manifold EOS");
83+
if (eosparm->idx_Wbar >= 0) {
84+
manfunc.get_func()->get_value(eosparm->idx_Wbar, Y, WBAR);
85+
} else {
86+
amrex::Error("Wbar not in table");
87+
}
8488
}
8589

8690
AMREX_GPU_HOST_DEVICE

0 commit comments

Comments
 (0)