ABLATE Source Documentation  0.12.33
ablate::eos::zerorkEOS Class Reference
+ Inheritance diagram for ablate::eos::zerorkEOS:

Classes

struct  FunctionContext
 
struct  ThermodynamicMassFractionFunction
 

Public Member Functions

 zerorkEOS (std::filesystem::path reactionFile, std::filesystem::path thermoFile, const std::shared_ptr< ablate::parameters::Parameters > &options={})
 
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
 
const std::vector< std::string > & GetSpeciesVariables () const override
 
virtual const std::vector< std::string > & GetProgressVariables () const override
 
ThermodynamicFunction GetThermodynamicFunction (ThermodynamicProperty property, const std::vector< domain::Field > &fields) const override
 
ThermodynamicTemperatureFunction GetThermodynamicTemperatureFunction (ThermodynamicProperty property, const std::vector< domain::Field > &fields) const override
 
ThermodynamicMassFractionFunction GetThermodynamicMassFractionFunction (ThermodynamicProperty property, const std::vector< domain::Field > &fields) const
 
ThermodynamicTemperatureMassFractionFunction GetThermodynamicTemperatureMassFractionFunction (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
 
std::shared_ptr< SourceCalculatorCreateSourceCalculator (const std::vector< domain::Field > &fields, const ablate::domain::Range &cellRange) 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 double GetEnthalpyOfFormation (std::string_view speciesName) 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
 

Public Attributes

zerorkeos::SourceCalculator::ChemistryConstraints constraints
 
std::shared_ptr< zerork::mechanism > mech
 
const std::filesystem::path reactionFile
 
const std::filesystem::path thermoFile
 

Static Public Attributes

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"
 

Protected Types

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

Protected Member Functions

std::shared_ptr< FunctionContextBuildFunctionContext (ablate::eos::ThermodynamicProperty property, const std::vector< domain::Field > &fields, bool checkDensityYi=true) const
 

Static Protected Member Functions

static void FillreactorMassFracVectorFromDensityMassFractions (int nSpc, double density, const double *densityYi, std::vector< double > &reactorYi)
 
static void FillreactorMassFracVectorFromMassFractions (int nSpc, const double *Yi, std::vector< double > &reactorYi)
 
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)
 
static PetscErrorCode DensityMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal *property, void *ctx)
 
static PetscErrorCode TemperatureMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal *property, void *ctx)
 
static PetscErrorCode PressureMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal *property, void *ctx)
 
static PetscErrorCode InternalSensibleEnergyMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal *property, void *ctx)
 
static PetscErrorCode SensibleEnthalpyMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal *property, void *ctx)
 
static PetscErrorCode SpecificHeatConstantVolumeMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal *property, void *ctx)
 
static PetscErrorCode SpecificHeatConstantPressureMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal *property, void *ctx)
 
static PetscErrorCode SpeedOfSoundMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal *property, void *ctx)
 
static PetscErrorCode SpeciesSensibleEnthalpyMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], 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)
 
static PetscErrorCode DensityTemperatureMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode TemperatureTemperatureMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode PressureTemperatureMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode InternalSensibleEnergyTemperatureMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode SensibleEnthalpyTemperatureMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode SpecificHeatConstantVolumeTemperatureMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode SpecificHeatConstantPressureTemperatureMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode SpeedOfSoundTemperatureMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal T, PetscReal *property, void *ctx)
 
static PetscErrorCode SpeciesSensibleEnthalpyTemperatureMassFractionFunction (const PetscReal conserved[], const PetscReal yi[], PetscReal T, PetscReal *property, void *ctx)
 

Protected Attributes

std::vector< std::string > species
 hold a copy of the constrains that can be used for single or batch source calculation
 
int nSpc
 
const char * cklogfilename = "mech.cklog"
 
std::vector< double > stateVector
 
std::map< ThermodynamicProperty, std::tuple< ThermodynamicStaticFunction, ThermodynamicTemperatureStaticFunction > > thermodynamicFunctions
 
std::map< ThermodynamicProperty, std::tuple< ThermodynamicStaticMassFractionFunction, ThermodynamicTemperatureStaticMassFractionFunction > > thermodynamicMassFractionFunctions
 
const std::set< ThermodynamicProperty > speciesSizedProperties = {ThermodynamicProperty::SpeciesSensibleEnthalpy}
 
- Protected Attributes inherited from ablate::eos::EOS
const std::string type
 

Static Protected Attributes

static const std::array< std::string, 2 > validThermoFileExtensions = {".dat", ".log"}
 

Member Typedef Documentation

◆ ThermodynamicStaticFunction

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

Store a map of functions functions for quick lookup

Constructor & Destructor Documentation

◆ zerorkEOS()

ablate::eos::zerorkEOS::zerorkEOS ( std::filesystem::path  reactionFile,
std::filesystem::path  thermoFile,
const std::shared_ptr< ablate::parameters::Parameters > &  options = {} 
)
explicit

Zerork only takes in chemkin formated reaction files and thermodynamic files.

Parameters
mechFile
optionalThermoFile

Member Function Documentation

◆ BuildFunctionContext()

std::shared_ptr< ablate::eos::zerorkEOS::FunctionContext > ablate::eos::zerorkEOS::BuildFunctionContext ( ablate::eos::ThermodynamicProperty  property,
const std::vector< domain::Field > &  fields,
bool  checkDensityYi = true 
) const
protected

helper function to build the function context needed regardless of function type

Template Parameters
Function
Type
Parameters
fields
optionalargument to check for yi
Returns

◆ CreateSourceCalculator()

std::shared_ptr< ablate::eos::ChemistryModel::SourceCalculator > ablate::eos::zerorkEOS::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
fields
cellRange
Returns

Implements ablate::eos::ChemistryModel.

◆ FillreactorMassFracVectorFromDensityMassFractions()

void ablate::eos::zerorkEOS::FillreactorMassFracVectorFromDensityMassFractions ( int  nSpc,
double  density,
const double *  densityYi,
std::vector< double > &  reactorYi 
)
staticprotected

Fill and Normalize the density species mass fractions

Parameters
numSpec
yi

◆ FillreactorMassFracVectorFromMassFractions()

void ablate::eos::zerorkEOS::FillreactorMassFracVectorFromMassFractions ( int  nSpc,
const double *  Yi,
std::vector< double > &  reactorYi 
)
staticprotected

Fill the working vector from yi

Parameters
numSpec
yi

◆ GetElementInformation()

std::map< std::string, double > ablate::eos::zerorkEOS::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::zerorkEOS::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()

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

Returns a vector of all extra variables required to utilize the equation of state

Returns

Implements ablate::eos::EOS.

◆ GetSpeciesElementalInformation()

std::map< std::string, std::map< std::string, int > > ablate::eos::zerorkEOS::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::zerorkEOS::GetSpeciesMolecularMass ( ) const
overridevirtual

the MW of each species

Returns

Reimplemented from ablate::eos::ChemistryModel.

◆ GetSpeciesVariables()

const std::vector<std::string>& ablate::eos::zerorkEOS::GetSpeciesVariables ( ) const
inlineoverridevirtual

Species supported by this EOS species model functions

Returns

Implements ablate::eos::EOS.

◆ GetThermodynamicFunction()

ablate::eos::ThermodynamicFunction ablate::eos::zerorkEOS::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.

◆ GetThermodynamicMassFractionFunction()

ablate::eos::zerorkEOS::ThermodynamicMassFractionFunction ablate::eos::zerorkEOS::GetThermodynamicMassFractionFunction ( ThermodynamicProperty  property,
const std::vector< domain::Field > &  fields 
) const

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

Parameters
property
fields
Returns

◆ GetThermodynamicTemperatureFunction()

ablate::eos::ThermodynamicTemperatureFunction ablate::eos::zerorkEOS::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.

◆ GetThermodynamicTemperatureMassFractionFunction()

ablate::eos::zerorkEOS::ThermodynamicTemperatureMassFractionFunction ablate::eos::zerorkEOS::GetThermodynamicTemperatureMassFractionFunction ( ThermodynamicProperty  property,
const std::vector< domain::Field > &  fields 
) const
overridevirtual

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

Parameters
property
fields
Returns

Reimplemented from ablate::eos::ChemistryModel.

◆ View()

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

Print the details of this eos

Parameters
stream

Implements ablate::eos::EOS.

Member Data Documentation

◆ speciesSizedProperties

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

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> > ablate::eos::zerorkEOS::thermodynamicFunctions
protected
Initial value:
= {
{ThermodynamicProperty::Density, {DensityFunction, DensityTemperatureFunction}},
{ThermodynamicProperty::Pressure, {PressureFunction, PressureTemperatureFunction}},
{ThermodynamicProperty::Temperature, {TemperatureFunction, TemperatureTemperatureFunction}},
{ThermodynamicProperty::InternalSensibleEnergy, {InternalSensibleEnergyFunction, InternalSensibleEnergyTemperatureFunction}},
{ThermodynamicProperty::SensibleEnthalpy, {SensibleEnthalpyFunction, SensibleEnthalpyTemperatureFunction}},
{ThermodynamicProperty::SpecificHeatConstantVolume, {SpecificHeatConstantVolumeFunction, SpecificHeatConstantVolumeTemperatureFunction}},
{ThermodynamicProperty::SpecificHeatConstantPressure, {SpecificHeatConstantPressureFunction, SpecificHeatConstantPressureTemperatureFunction}},
{ThermodynamicProperty::SpeedOfSound, {SpeedOfSoundFunction, SpeedOfSoundTemperatureFunction}},
{ThermodynamicProperty::SpeciesSensibleEnthalpy,
{SpeciesSensibleEnthalpyFunction, SpeciesSensibleEnthalpyTemperatureFunction}}
}

◆ thermodynamicMassFractionFunctions

std::map<ThermodynamicProperty, std::tuple<ThermodynamicStaticMassFractionFunction, ThermodynamicTemperatureStaticMassFractionFunction> > ablate::eos::zerorkEOS::thermodynamicMassFractionFunctions
protected
Initial value:
= {
{ThermodynamicProperty::Density, {DensityMassFractionFunction, DensityTemperatureMassFractionFunction}},
{ThermodynamicProperty::Pressure, {PressureMassFractionFunction, PressureTemperatureMassFractionFunction}} ,
{ThermodynamicProperty::Temperature, {TemperatureMassFractionFunction, TemperatureTemperatureMassFractionFunction}},
{ThermodynamicProperty::InternalSensibleEnergy, {InternalSensibleEnergyMassFractionFunction, InternalSensibleEnergyTemperatureMassFractionFunction}},
{ThermodynamicProperty::SensibleEnthalpy, {SensibleEnthalpyMassFractionFunction, SensibleEnthalpyTemperatureMassFractionFunction}},
{ThermodynamicProperty::SpecificHeatConstantVolume, {SpecificHeatConstantVolumeMassFractionFunction, SpecificHeatConstantVolumeTemperatureMassFractionFunction}},
{ThermodynamicProperty::SpecificHeatConstantPressure,
{SpecificHeatConstantPressureMassFractionFunction, SpecificHeatConstantPressureTemperatureMassFractionFunction}} ,
{ThermodynamicProperty::SpeedOfSound, {SpeedOfSoundMassFractionFunction, SpeedOfSoundTemperatureMassFractionFunction}},
{ThermodynamicProperty::SpeciesSensibleEnthalpy,
{SpeciesSensibleEnthalpyMassFractionFunction, SpeciesSensibleEnthalpyTemperatureMassFractionFunction}}
}

◆ validThermoFileExtensions

const std::array<std::string, 2> ablate::eos::zerorkEOS::validThermoFileExtensions = {".dat", ".log"}
inlinestaticprotected

Helper function to get the specific EnthalpyOfFormation

Parameters
species
Returns
only allow chemkin input files

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