Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added spray derive vars #79

Merged
merged 4 commits into from
May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Exec/RegTests/SprayTest/input.2d
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ nodal_proj.verbose = 0

#--------------------SPRAY PARTICLE DATA-----------------------
peleLM.do_spray_particles = 1
particles.derive_plot_vars = 1
particles.fuel_species = NC10H22
# Properties for decane, in MKS
particles.fuel_crit_temp = 617.8 # K
Expand Down
1 change: 1 addition & 0 deletions Source/PeleLM.H
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ class PeleLM : public amrex::AmrCore {
static bool do_spray_particles;
static int plot_spray_src;
static std::string spray_fuel_names[SPRAY_FUEL_NUM];
static amrex::Vector<std::string> spray_derive_vars;
static SprayParticleContainer* theSprayPC();
static SprayParticleContainer* theVirtPC();
static SprayParticleContainer* theGhostPC();
Expand Down
37 changes: 35 additions & 2 deletions Source/PeleLMPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ void PeleLM::WritePlotFile() {
deriveEntryCount += rec->numDerive();
}
ncomp += deriveEntryCount;
#ifdef PELELM_USE_SPRAY
if (do_spray_particles) {
ncomp += spray_derive_vars.size();
}
#endif

//----------------------------------------------------------------
// Plot MultiFabs
Expand Down Expand Up @@ -172,6 +177,15 @@ void PeleLM::WritePlotFile() {
plt_VarsName.push_back(rec->variableName(dvar));
}
}
#ifdef PELELM_USE_SPRAY
if (spray_derive_vars.size() > 0) {
// We need virtual particles for the lower levels
setupVirtualParticles(0);
for (int ivar = 0; ivar < spray_derive_vars.size(); ivar++) {
plt_VarsName.push_back(spray_derive_vars[ivar]);
}
}
#endif

//----------------------------------------------------------------
// Fill the plot MultiFabs
Expand Down Expand Up @@ -238,6 +252,22 @@ void PeleLM::WritePlotFile() {
MultiFab::Copy(mf_plt[lev], *mf, 0, cnt, mf->nComp(), 0);
cnt += mf->nComp();
}
#ifdef PELELM_USE_SPRAY
if (spray_derive_vars.size() > 0) {
int num_spray_derive = spray_derive_vars.size();
mf_plt[lev].setVal(0., cnt, num_spray_derive);
theSprayPC()->computeDerivedVars(
mf_plt[lev], lev, cnt, spray_derive_vars, spray_fuel_names);
if (lev < finest_level) {
MultiFab tmp_plt(grids[lev], dmap[lev], num_spray_derive, 0, MFInfo(), Factory(lev));
tmp_plt.setVal(0.);
theVirtPC()->computeDerivedVars(
tmp_plt, lev, 0, spray_derive_vars, spray_fuel_names);
MultiFab::Add(mf_plt[lev], tmp_plt, 0, cnt, num_spray_derive, 0);
}
cnt += num_spray_derive;
}
#endif
#ifdef AMREX_USE_EB
EB_set_covered(mf_plt[lev],0.0);
#endif
Expand All @@ -255,7 +285,9 @@ void PeleLM::WritePlotFile() {
bool is_spraycheck = false;
for (int lev = 0; lev <= finest_level; ++lev) {
theSprayPC()->SprayParticleIO(
lev, is_spraycheck, write_spray_ascii_files, plotfilename, PeleLM::spray_fuel_names);
lev, is_spraycheck, write_spray_ascii_files, plotfilename, spray_fuel_names);
// Remove virtual particles that were made for derived variables
removeVirtualParticles(lev);
}
}
#endif
Expand Down Expand Up @@ -370,7 +402,8 @@ void PeleLM::WriteCheckPointFile()
int write_ascii = 0; // Not for checkpoints
bool is_spraycheck = true;
for (int lev = 0; lev <= finest_level; ++lev) {
theSprayPC()->SprayParticleIO(lev, is_spraycheck, write_ascii, checkpointname, PeleLM::spray_fuel_names);
theSprayPC()->SprayParticleIO(
lev, is_spraycheck, write_ascii, checkpointname, spray_fuel_names);
}
}
#endif
Expand Down
3 changes: 2 additions & 1 deletion Source/Spray/PeleLMSprayParticles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ int PeleLM::num_spray_src = AMREX_SPACEDIM + 2 + SPRAY_FUEL_NUM;
int PeleLM::write_spray_ascii_files = 0;
int PeleLM::plot_spray_src = 0;
std::string PeleLM::spray_fuel_names[SPRAY_FUEL_NUM];
Vector<std::string> PeleLM::spray_derive_vars;

SprayParticleContainer*
PeleLM::theSprayPC()
Expand Down Expand Up @@ -112,7 +113,7 @@ PeleLM::readSprayParameters()
SprayParticleContainer::readSprayParams(
spray_verbose, max_spray_cfl, wall_temp, mass_trans, mom_trans,
write_spray_ascii_files, plot_spray_src, init_function, init_file,
sprayData, spray_fuel_names, temp_cfl);
sprayData, spray_fuel_names, spray_derive_vars, temp_cfl);
}

void
Expand Down
2 changes: 1 addition & 1 deletion Submodules/PeleMP
Submodule PeleMP updated 28 files
+1 −0 Exec/SprayTests/Ctests/HPC_spray_test/node-input
+1 −0 Exec/SprayTests/Ctests/abramzon_test/inputs_2d
+1 −0 Exec/SprayTests/Ctests/heptane_evap/input2d
+2 −2 Exec/SprayTests/Ctests/jet_spray/GNUmakefile
+12 −13 Exec/SprayTests/Ctests/jet_spray/SprayParticlesInitInsert.cpp
+1 −1 Exec/SprayTests/Ctests/jet_spray/inputs-2d
+2 −1 Exec/SprayTests/Ctests/jet_spray/prob.cpp
+1 −1 Exec/SprayTests/Ctests/jet_spray/prob_parm.H
+1 −0 Exec/SprayTests/Ctests/multi_comp_drop/first-input
+1 −0 Exec/SprayTests/LMtests/Multijet/first-input
+1 −0 Exec/SprayTests/LMtests/abramzon_test/input_2d
+1 −0 Exec/SprayTests/LMtests/marco_spray/inputs.3d.cuda
+1 −0 Exec/SprayTests/LMtests/spray_flame/inputs.3d
+1 −0 Exec/SprayTests/xLMtest/abramzon_test/inputs_2d
+1 −0 Exec/SprayTests/xLMtest/dist_test/first-input
+6 −3 Exec/SprayTests/xLMtest/marco_spray/inputs.3d.cuda
+28 −0 Exec/SprayTests/xLMtest/spray_flame/GNUmakefile
+292 −0 Exec/SprayTests/xLMtest/spray_flame/SprayParticlesInitInsert.cpp
+124 −0 Exec/SprayTests/xLMtest/spray_flame/input.2d
+124 −0 Exec/SprayTests/xLMtest/spray_flame/input.3d
+118 −0 Exec/SprayTests/xLMtest/spray_flame/pelelm_prob.H
+45 −0 Exec/SprayTests/xLMtest/spray_flame/pelelm_prob.cpp
+37 −0 Exec/SprayTests/xLMtest/spray_flame/pelelm_prob_parm.H
+120 −140 Source/PP_Spray/Drag.H
+1 −1 Source/PP_Spray/Make.package
+106 −0 Source/PP_Spray/SprayDerive.cpp
+30 −16 Source/PP_Spray/SprayParticles.H
+28 −0 Source/PP_Spray/SprayParticles.cpp