Skip to content
This repository was archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #17 from AMReX-Combustion/splash_model
Browse files Browse the repository at this point in the history
Breakup, splashing, and wall film models
  • Loading branch information
marchdf authored Dec 4, 2023
2 parents 3eed313 + 81ae98e commit 88358e2
Show file tree
Hide file tree
Showing 32 changed files with 5,991 additions and 197 deletions.
38 changes: 38 additions & 0 deletions Exec/SprayTests/PeleC/SprayA_wbreakup/GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# AMReX
DIM = 3
COMP = gnu
PRECISION = DOUBLE

# Profiling
PROFILE = FALSE
TINY_PROFILE = TRUE
COMM_PROFILE = FALSE
TRACE_PROFILE = FALSE
MEM_PROFILE = FALSE
USE_GPROF = FALSE

# Performance
USE_MPI = TRUE
USE_OMP = FALSE
USE_CUDA = FALSE
USE_HIP = FALSE
PELE_USE_MAGMA = TRUE

# Debugging
DEBUG = FALSE
FSANITIZER = FALSE
THREAD_SANITIZER = FALSE

# PeleC
Eos_Model := Fuego
Chemistry_Model := dodecane_lu
Transport_Model := Simple

# PeleMP
USE_PARTICLES = TRUE
SPRAY_FUEL_NUM = 1

# GNU Make
Bpack := ./Make.package
Blocs := .
include $(PELEC_HOME)/Exec/Make.PeleC
3 changes: 3 additions & 0 deletions Exec/SprayTests/PeleC/SprayA_wbreakup/Make.package
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CEXE_sources += prob.cpp
CEXE_headers += prob.H
CEXE_headers += prob_parm.H
6 changes: 6 additions & 0 deletions Exec/SprayTests/PeleC/SprayA_wbreakup/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Spray A Problem
---------------

This is a Spray A test problem based on a configuration from ECN. This problem uses the KHRT breakup model and provides good comparisons with the experimental liquid and vapor penetrations.

In order to run this problem, create a new directory called `PelePhysics/Support/Mechanism/multi_dechep` and move the mechanism files in the local `chem_files` directory into it.
42 changes: 42 additions & 0 deletions Exec/SprayTests/PeleC/SprayA_wbreakup/SprayParticlesInitInsert.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

#include "SprayParticles.H"
#include "SprayInjection.H"
#include "prob.H"

bool
SprayParticleContainer::injectParticles(
amrex::Real time,
amrex::Real dt,
int nstep,
int lev,
int finest_level,
ProbParmHost const& prob_parm,
ProbParmDevice const& prob_parm_d)
{
amrex::ignore_unused(nstep, finest_level, prob_parm_d);
if (lev != 0) {
return false;
}
SprayJet* js = m_sprayJets[0].get();
if (!js->jet_active(time)) {
return false;
}

sprayInjection(time, js, dt, lev);

// Redistribute is done outside of this function
return true;
}

void
SprayParticleContainer::InitSprayParticles(
const bool init_parts,
ProbParmHost const& prob_parm,
ProbParmDevice const& prob_parm_d)
{
amrex::ignore_unused(prob_parm_d, init_parts);
m_sprayJets.resize(1);
std::string jet_name = "jet1";
m_sprayJets[0] = std::make_unique<SprayJet>(jet_name, Geom(0));
return;
}
91 changes: 91 additions & 0 deletions Exec/SprayTests/PeleC/SprayA_wbreakup/prob.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#ifndef PROB_H
#define PROB_H

#include <AMReX_Print.H>
#include <AMReX_ParmParse.H>
#include <AMReX_Geometry.H>
#include <AMReX_FArrayBox.H>

#include "mechanism.H"

#include "IndexDefines.H"
#include "Constants.H"
#include "PelePhysics.H"
#include "Tagging.H"
#include "ProblemDerive.H"
#include "prob_parm.H"

AMREX_GPU_DEVICE
AMREX_FORCE_INLINE
void
pc_initdata(
int i,
int j,
int k,
amrex::Array4<amrex::Real> const& state,
amrex::GeometryData const& /*geomdata*/,
ProbParmDevice const& prob_parm)
{

amrex::Real u[3] = {0.0};
u[1] = prob_parm.v0;
const amrex::Real p = prob_parm.p0;
amrex::Real rho, eint;

amrex::Real Tval = prob_parm.T0;
auto eos = pele::physics::PhysicsType::eos();
amrex::Real massfrac[NUM_SPECIES] = {0.0};
if (prob_parm.mol_fracs) {
amrex::Real molfrac[NUM_SPECIES] = {0.0};
molfrac[O2_ID] = prob_parm.YX_O2;
molfrac[N2_ID] = prob_parm.YX_N2;
molfrac[CO2_ID] = prob_parm.YX_CO2;
molfrac[H2O_ID] = prob_parm.YX_H2O;
eos.X2Y(molfrac, massfrac);
} else {
massfrac[O2_ID] = prob_parm.YX_O2;
massfrac[N2_ID] = prob_parm.YX_N2;
massfrac[CO2_ID] = prob_parm.YX_CO2;
massfrac[H2O_ID] = prob_parm.YX_H2O;
}
eos.PYT2RE(p, massfrac, Tval, rho, eint);

// Set the state
state(i, j, k, URHO) = rho;
state(i, j, k, UMX) = rho * u[0];
state(i, j, k, UMY) = rho * u[1];
state(i, j, k, UMZ) = rho * u[2];
state(i, j, k, UEINT) = rho * eint;
state(i, j, k, UEDEN) =
rho * (eint + 0.5 * (u[0] * u[0] + u[1] * u[1] + u[2] * u[2]));
state(i, j, k, UTEMP) = Tval;
for (int n = 0; n < NUM_SPECIES; n++) {
state(i, j, k, UFS + n) = rho * massfrac[n];
}
}

AMREX_GPU_DEVICE
AMREX_FORCE_INLINE
void
bcnormal(
const amrex::Real* /*x[AMREX_SPACEDIM]*/,
const amrex::Real s_int[NVAR],
amrex::Real s_ext[NVAR],
const int /*idir*/,
const int /*sgn*/,
const amrex::Real /*time*/,
amrex::GeometryData const& /*geomdata*/,
ProbParmDevice const& /*prob_parm*/)
{
// This sets the values at the boundary equal to the
// adjacent interior values
for (int i = 0; i < NVAR; ++i) {
s_ext[i] = s_int[i];
}
}

void pc_prob_close();

using ProblemTags = EmptyProbTagStruct;
using ProblemDerives = EmptyProbDeriveStruct;
#endif
51 changes: 51 additions & 0 deletions Exec/SprayTests/PeleC/SprayA_wbreakup/prob.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#include "prob.H"

extern "C" {
void
amrex_probinit(
const int* /*init*/,
const int* /*name*/,
const int* /*namelen*/,
const amrex_real* /*problo*/,
const amrex_real* /*probhi*/)
{
// Parse params
amrex::ParmParse pp("prob");
pp.query("init_v", PeleC::h_prob_parm_device->v0);
pp.get("ref_p", PeleC::h_prob_parm_device->p0);
pp.get("ref_T", PeleC::h_prob_parm_device->T0);
if (pp.contains("X_N2")) {
pp.query("X_N2", PeleC::h_prob_parm_device->YX_N2);
pp.query("X_O2", PeleC::h_prob_parm_device->YX_O2);
pp.query("X_H2O", PeleC::h_prob_parm_device->YX_H2O);
pp.query("X_CO2", PeleC::h_prob_parm_device->YX_CO2);
PeleC::h_prob_parm_device->mol_fracs = true;
} else {
pp.query("Y_N2", PeleC::h_prob_parm_device->YX_N2);
pp.query("Y_O2", PeleC::h_prob_parm_device->YX_O2);
pp.query("Y_H2O", PeleC::h_prob_parm_device->YX_H2O);
pp.query("Y_CO2", PeleC::h_prob_parm_device->YX_CO2);
}

}
}

void
pc_prob_close()
{
}

void
PeleC::problem_post_timestep()
{
}

void
PeleC::problem_post_init()
{
}

void
PeleC::problem_post_restart()
{
}
24 changes: 24 additions & 0 deletions Exec/SprayTests/PeleC/SprayA_wbreakup/prob_parm.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef PROB_PARM_H
#define PROB_PARM_H

#include <AMReX_REAL.H>
#include <AMReX_GpuQualifiers.H>
#include <AMReX_GpuMemory.H>

struct ProbParmDevice
{
amrex::Real p0 = 1.013e6; // [erg cm^-3]
amrex::Real T0 = 300.0;
amrex::Real v0 = 0.;
amrex::Real YX_O2 = 0.233;
amrex::Real YX_N2 = 0.767;
amrex::Real YX_H2O = 0.;
amrex::Real YX_CO2 = 0.;
bool mol_fracs = false;
};

struct ProbParmHost
{
};

#endif
Loading

0 comments on commit 88358e2

Please sign in to comment.