ABLATE Source Documentation  0.12.34
ablate::eos::TChemSoot Class Reference
+ Inheritance diagram for ablate::eos::TChemSoot:

Public Types

using ThermodynamicStaticFunction = PetscErrorCode(*)(const PetscReal conserved[], PetscReal *property, void *ctx)
 
using ThermodynamicTemperatureStaticFunction = PetscErrorCode(*)(const PetscReal conserved[], PetscReal temperature, PetscReal *property, void *ctx)
 

Public Member Functions

 TChemSoot (std::filesystem::path mechanismFile, std::shared_ptr< ablate::monitors::logs::Log >={}, const std::shared_ptr< ablate::parameters::Parameters > &options={})
 
ThermodynamicFunction GetThermodynamicFunction (ThermodynamicProperty property, const std::vector< domain::Field > &fields) const override
 
ThermodynamicTemperatureFunction GetThermodynamicTemperatureFunction (ThermodynamicProperty property, const std::vector< domain::Field > &fields) const override
 
EOSFunction GetFieldFunctionFunction (const std::string &field, ThermodynamicProperty property1, ThermodynamicProperty property2, std::vector< std::string > otherProperties) const override
 
const std::vector< std::string > & GetProgressVariables () const override
 
std::map< std::string, double > GetElementInformation () const override
 
std::map< std::string, std::map< std::string, int > > GetSpeciesElementalInformation () const override
 
std::map< std::string, double > GetSpeciesMolecularMass () const override
 
void View (std::ostream &stream) const override
 
std::shared_ptr< SourceCalculatorCreateSourceCalculator (const std::vector< domain::Field > &fields, const ablate::domain::Range &cellRange) override
 
std::shared_ptr< FunctionContextBuildFunctionContext (ablate::eos::ThermodynamicProperty property, const std::vector< domain::Field > &fields) const
 
- Public Member Functions inherited from ablate::eos::TChemBase
 TChemBase (const std::string &eosName, std::filesystem::path mechanismFile, const std::shared_ptr< ablate::monitors::logs::Log > &={}, const std::shared_ptr< ablate::parameters::Parameters > &options={})
 
tChemLib::KineticModelData & GetKineticModelData ()
 
real_type_1d_view GetEnthalpyOfFormation ()
 
const std::vector< std::string > & GetSpeciesVariables () const override
 
double GetEnthalpyOfFormation (std::string_view speciesName) const override
 
- Public Member Functions inherited from ablate::eos::ChemistryModel
 ChemistryModel (std::string name)
 
virtual std::vector< std::tuple< ablate::solver::CellSolver::SolutionFieldUpdateFunction, void *, std::vector< std::string > > > GetSolutionFieldUpdates ()
 
virtual ThermodynamicTemperatureMassFractionFunction GetThermodynamicTemperatureMassFractionFunction (ThermodynamicProperty property, const std::vector< domain::Field > &fields) const
 
- Public Member Functions inherited from ablate::eos::EOS
 EOS (std::string typeIn)
 
virtual std::vector< std::string > GetFieldTags () const
 
virtual std::vector< std::shared_ptr< domain::FieldDescriptor > > GetAdditionalFields () const
 
virtual const std::vector< std::string > & GetFieldFunctionProperties () const
 

Static Public Member Functions

static void FillWorkingVectorFromDensityMassFractions (double density, double temperature, const double *densityYi, const tChemSoot::StateVectorSoot< real_type_1d_view_host > &stateVector)
 
static real_type CarbonEnthalpy_R_T (const real_type &Temp)
 
static double CarbonCp_R (const double &Temp)
 
static double ComputeSolidCarbonSensibleEnthalpy (double temperature)
 
Direct Thermodynamic Properties Functions

These functions are used to compute the direct thermodynamic properties (without temperature). They are not called directly but a pointer to them is returned

Parameters
conserved
property
ctx
Returns
static PetscErrorCode DensityFunction (const PetscReal conserved[], PetscReal *property, void *ctx)
 
static PetscErrorCode TemperatureFunction (const PetscReal conserved[], PetscReal *property, void *ctx)
 
static PetscErrorCode PressureFunction (const PetscReal conserved[], PetscReal *property, void *ctx)
 
static PetscErrorCode InternalSensibleEnergyFunction (const PetscReal conserved[], PetscReal *property, void *ctx)
 
static PetscErrorCode SensibleEnthalpyFunction (const PetscReal conserved[], PetscReal *property, void *ctx)
 
static PetscErrorCode SpecificHeatConstantVolumeFunction (const PetscReal conserved[], PetscReal *property, void *ctx)
 
static PetscErrorCode SpecificHeatConstantPressureFunction (const PetscReal conserved[], PetscReal *property, void *ctx)
 
static PetscErrorCode SpeedOfSoundFunction (const PetscReal conserved[], PetscReal *property, void *ctx)
 
static PetscErrorCode SpeciesSensibleEnthalpyFunction (const PetscReal conserved[], PetscReal *property, void *ctx)
 
Temperature Based Thermodynamic Properties Functions

These functions are used to compute the thermodynamic properties when temperature is known. They are not called directly but a pointer to them is returned and may be faster than the direct calls.

Parameters
conserved
property
ctx
Returns
static PetscErrorCode DensityTemperatureFunction (const PetscReal conserved[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode TemperatureTemperatureFunction (const PetscReal conserved[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode PressureTemperatureFunction (const PetscReal conserved[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode InternalSensibleEnergyTemperatureFunction (const PetscReal conserved[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode SensibleEnthalpyTemperatureFunction (const PetscReal conserved[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode SpecificHeatConstantVolumeTemperatureFunction (const PetscReal conserved[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode SpecificHeatConstantPressureTemperatureFunction (const PetscReal conserved[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode SpeedOfSoundTemperatureFunction (const PetscReal conserved[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode SpeciesSensibleEnthalpyTemperatureFunction (const PetscReal conserved[], PetscReal T, PetscReal *property, void *ctx)
 

Public Attributes

std::map< ThermodynamicProperty, std::tuple< ThermodynamicStaticFunction, ThermodynamicTemperatureStaticFunction, std::function< ordinal_type(ordinal_type)> > > thermodynamicFunctions
 
const std::set< ThermodynamicProperty > speciesSizedProperties = {ThermodynamicProperty::SpeciesSensibleEnthalpy}
 

Static Public Attributes

static std::string CSolidName = "C(S)"
 
static std::string SootNumberDensityName = "SootNumberDensity_Mass"
 
- Static Public Attributes inherited from ablate::eos::TChemBase
static const double TREF = 298.15
 
- Static Public Attributes inherited from ablate::eos::EOS
static const std::string YI = "Yi"
 
static const std::string PROGRESS = "Progress"
 

Additional Inherited Members

- Protected Attributes inherited from ablate::eos::TChemBase
tChem::SourceCalculator::ChemistryConstraints constraints
 hold a copy of the constrains that can be used for single or batch source calculation
 
const std::filesystem::path mechanismFile
 the mechanismFile may be chemkin or yaml based
 
std::shared_ptr< ablate::monitors::logs::Loglog
 an optional log file for tchem echo redirection
 
tChemLib::KineticModelData kineticsModel
 
std::shared_ptr< tChemLib::KineticModelGasConstData< typename Tines::UseThisDevice< host_exec_space >::type > > kineticsModelDataHost
 
std::shared_ptr< tChemLib::KineticModelGasConstData< typename Tines::UseThisDevice< exec_space >::type > > kineticsModelDataDevice
 
std::vector< std::string > species
 
real_type_1d_view enthalpyReferenceDevice
 
real_type_1d_view_host enthalpyReferenceHost
 
- Protected Attributes inherited from ablate::eos::EOS
const std::string type
 
- Static Protected Attributes inherited from ablate::eos::TChemBase
static const std::array< std::string, 2 > validFileExtensions = {".yaml", ".yml"}
 

Member Typedef Documentation

◆ ThermodynamicStaticFunction

using ablate::eos::TChemSoot::ThermodynamicStaticFunction = PetscErrorCode (*)(const PetscReal conserved[], PetscReal* property, void* ctx)

template function to call base tChem function Store a map of functions functions for quick lookup

Constructor & Destructor Documentation

◆ TChemSoot()

ablate::eos::TChemSoot::TChemSoot ( std::filesystem::path  mechanismFile,
std::shared_ptr< ablate::monitors::logs::Log log = {},
const std::shared_ptr< ablate::parameters::Parameters > &  options = {} 
)
explicit

The tChem EOS can utilize either a mechanical & thermo file using the Chemkin file format for a modern yaml file.

Parameters
mechFile
optionalThermoFile

Member Function Documentation

◆ BuildFunctionContext()

std::shared_ptr< ablate::eos::TChemSoot::FunctionContext > ablate::eos::TChemSoot::BuildFunctionContext ( ablate::eos::ThermodynamicProperty  property,
const std::vector< domain::Field > &  fields 
) const

helper function to build the function context needed regardless of function type. This is specialized for soot

Template Parameters
Function
Type
Parameters
fields
Returns

◆ ComputeSolidCarbonSensibleEnthalpy()

static double ablate::eos::TChemSoot::ComputeSolidCarbonSensibleEnthalpy ( double  temperature)
inlinestatic

static call to compute carbon sensible enthalpy

◆ CreateSourceCalculator()

std::shared_ptr< ablate::eos::ChemistryModel::SourceCalculator > ablate::eos::TChemSoot::CreateSourceCalculator ( const std::vector< domain::Field > &  fields,
const ablate::domain::Range cellRange 
)
overridevirtual

Function to create the batch source specific to the provided cell range

Parameters
cellRange
Returns

Implements ablate::eos::ChemistryModel.

◆ FillWorkingVectorFromDensityMassFractions()

void ablate::eos::TChemSoot::FillWorkingVectorFromDensityMassFractions ( double  density,
double  temperature,
const double *  densityYi,
const tChemSoot::StateVectorSoot< real_type_1d_view_host > &  stateVector 
)
static

Fill and Normalize the density species mass fractions

Parameters
numSpec
yi

◆ GetElementInformation()

std::map< std::string, double > ablate::eos::TChemSoot::GetElementInformation ( ) const
overridevirtual

Returns all elements tracked in this mechanism and their molecular mass

Returns

Reimplemented from ablate::eos::ChemistryModel.

◆ GetFieldFunctionFunction()

ablate::eos::EOSFunction ablate::eos::TChemSoot::GetFieldFunctionFunction ( const std::string &  field,
ThermodynamicProperty  property1,
ThermodynamicProperty  property2,
std::vector< std::string >  otherProperties 
) const
overridevirtual

Single function to produce fieldFunction function for any two properties, velocity, and species mass fractions. These calls can be slower and should be used for init/output only

Parameters
field
property1
property2

Implements ablate::eos::EOS.

◆ GetProgressVariables()

const std::vector<std::string>& ablate::eos::TChemSoot::GetProgressVariables ( ) const
inlineoverridevirtual

TThe tChemSoot also need to track the soot number density

Returns

Reimplemented from ablate::eos::TChemBase.

◆ GetSpeciesElementalInformation()

std::map< std::string, std::map< std::string, int > > ablate::eos::TChemSoot::GetSpeciesElementalInformation ( ) const
overridevirtual

no. of atoms of each element in each species

Returns

Reimplemented from ablate::eos::ChemistryModel.

◆ GetSpeciesMolecularMass()

std::map< std::string, double > ablate::eos::TChemSoot::GetSpeciesMolecularMass ( ) const
overridevirtual

the MW of each species

Returns

Reimplemented from ablate::eos::ChemistryModel.

◆ GetThermodynamicFunction()

ablate::eos::ThermodynamicFunction ablate::eos::TChemSoot::GetThermodynamicFunction ( ThermodynamicProperty  property,
const std::vector< domain::Field > &  fields 
) const
overridevirtual

Single function to produce thermodynamic function for any property based upon the available fields

Parameters
property
fields
Returns

Implements ablate::eos::EOS.

◆ GetThermodynamicTemperatureFunction()

ablate::eos::ThermodynamicTemperatureFunction ablate::eos::TChemSoot::GetThermodynamicTemperatureFunction ( ThermodynamicProperty  property,
const std::vector< domain::Field > &  fields 
) const
overridevirtual

Single function to produce thermodynamic function for any property based upon the available fields and temperature

Parameters
property
fields
Returns

Implements ablate::eos::EOS.

◆ View()

void ablate::eos::TChemSoot::View ( std::ostream &  stream) const
overridevirtual

Print the details of this eos

Parameters
stream

Reimplemented from ablate::eos::TChemBase.

Member Data Documentation

◆ CSolidName

std::string ablate::eos::TChemSoot::CSolidName = "C(S)"
inlinestatic

The name of the solid species

◆ SootNumberDensityName

std::string ablate::eos::TChemSoot::SootNumberDensityName = "SootNumberDensity_Mass"
inlinestatic

The name of the Soot Number Density progress variable

◆ speciesSizedProperties

const std::set<ThermodynamicProperty> ablate::eos::TChemSoot::speciesSizedProperties = {ThermodynamicProperty::SpeciesSensibleEnthalpy}

Store a list of properties that are sized by species, everything is assumed to be size one

◆ thermodynamicFunctions

std::map<ThermodynamicProperty, std::tuple<ThermodynamicStaticFunction, ThermodynamicTemperatureStaticFunction, std::function<ordinal_type(ordinal_type)> > > ablate::eos::TChemSoot::thermodynamicFunctions
Initial value:
= {
{ThermodynamicProperty::Density, {DensityFunction, DensityTemperatureFunction, [](auto) { return 0; }}},
{ThermodynamicProperty::Pressure,
{PressureFunction, PressureTemperatureFunction, ablate::eos::tChemSoot::Temperature::getWorkSpaceSize}} ,
{ThermodynamicProperty::Temperature, {TemperatureFunction, TemperatureTemperatureFunction, ablate::eos::tChemSoot::Temperature::getWorkSpaceSize}},
{ThermodynamicProperty::InternalSensibleEnergy, {InternalSensibleEnergyFunction, InternalSensibleEnergyTemperatureFunction, ablate::eos::tChemSoot::SensibleInternalEnergy::getWorkSpaceSize}},
{ThermodynamicProperty::SensibleEnthalpy, {SensibleEnthalpyFunction, SensibleEnthalpyTemperatureFunction, ablate::eos::tChemSoot::SensibleEnthalpy::getWorkSpaceSize}},
{ThermodynamicProperty::SpecificHeatConstantVolume, {SpecificHeatConstantVolumeFunction, SpecificHeatConstantVolumeTemperatureFunction, [](auto nSpec) { return nSpec; }}},
{ThermodynamicProperty::SpecificHeatConstantPressure,
{SpecificHeatConstantPressureFunction,
SpecificHeatConstantPressureTemperatureFunction,
ablate::eos::tChemSoot::Temperature::getWorkSpaceSize}} ,
{ThermodynamicProperty::SpeedOfSound, {SpeedOfSoundFunction, SpeedOfSoundTemperatureFunction, ablate::eos::tChemSoot::SpeedOfSound::getWorkSpaceSize}},
{ThermodynamicProperty::SpeciesSensibleEnthalpy,
{SpeciesSensibleEnthalpyFunction,
SpeciesSensibleEnthalpyTemperatureFunction,
ablate::eos::tChemSoot::Temperature::getWorkSpaceSize}}
}

The documentation for this class was generated from the following files: