Skip to content

Commit 6852fe8

Browse files
committed
with PelePhys, use NUM_SPECIES from PelePhys as MAX_SPECIES during
COMPILE time
1 parent 612d049 commit 6852fe8

3 files changed

Lines changed: 33 additions & 3 deletions

File tree

src_common/common_namespace.H

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#if defined(PELEPHYSICS)
2+
#include "mechanism.H"
3+
#endif
14
namespace common {
25

36
//////////////
@@ -7,6 +10,11 @@ namespace common {
710
#define MAX_BONDS 12
811
//////////////
912

13+
/// MAX_SPECIES and NUM_SPECIES consistency between PELEPHYSICS and FHD /////
14+
#if defined(PELEPHYSICS)
15+
#define MAX_SPECIES (NUM_SPECIES)
16+
#endif
17+
1018
// misc global variables
1119
extern amrex::IntVect nodal_flag;
1220
extern amrex::Vector<amrex::IntVect> nodal_flag_dir;
@@ -326,4 +334,4 @@ namespace common {
326334
extern AMREX_GPU_MANAGED amrex::Real turb_alpha;
327335
extern AMREX_GPU_MANAGED int turbForcing;
328336

329-
}
337+
}

src_compressible/compressible_namespace.H

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace compressible {
1010
extern AMREX_GPU_MANAGED int turbRestartRun;
1111
extern AMREX_GPU_MANAGED bool do_reservoir;
1212
extern AMREX_GPU_MANAGED amrex::Real zeta_ratio;
13+
extern AMREX_GPU_MANAGED amrex::Real p_init;
1314

1415
}
1516

src_compressible_stag/main_driver.cpp

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,26 @@ void main_driver(const char* argv)
8484
}
8585
#endif
8686

87-
int step_start, statsCount;
88-
amrex::Real time;
87+
#if defined(PELEPHYSICS)
88+
// Set nspecies = MAX_SPECIES
89+
nspecies = int(MAX_SPECIES);
90+
nvars = AMREX_SPACEDIM + 2 + nspecies;
91+
nprimvars = AMREX_SPACEDIM + 3 + 2*nspecies;
92+
93+
// Set molmass
94+
for (int i=0; i<MAX_SPECIES; ++i) {
95+
molmass[i] = h_global_mw[i];
96+
}
8997

98+
amrex::Print() << "starting simulation with " << nspecies << "\n";
99+
#else
90100
// if gas heat capacities in the namelist are negative, calculate them using using dofs.
91101
// This will only update the Fortran values.
92102
GetHcGas();
103+
#endif
104+
105+
int step_start, statsCount;
106+
amrex::Real time;
93107

94108
// check bc_vel_lo/hi to determine the periodicity
95109
Vector<int> is_periodic(AMREX_SPACEDIM,0); // set to 0 (not periodic) by default
@@ -771,6 +785,13 @@ void main_driver(const char* argv)
771785
//}
772786
conservedToPrimitiveStag(prim, vel, cu, cumom);
773787

788+
// get transport coefficients
789+
#if defined(PELEPHYSICS)
790+
calculateTransportCoeffs(prim, eta, zeta, kappa, chi, D, trans_parms);
791+
#else
792+
calculateTransportCoeffs(prim, eta, zeta, kappa, chi, D);
793+
#endif
794+
774795
if (n_ads_spec>0) {
775796
init_surfcov(surfcov, geom);
776797
}

0 commit comments

Comments
 (0)