ConservativeVariablesFunction< dim, number > Class Template Reference

Developer Documentation: MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number > Class Template Reference
Developer Documentation
MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number > Class Template Reference

#include <boundary_condition_functions.hpp>

Inheritance diagram for MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number >:
[legend]
Collaboration diagram for MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number >:
[legend]

Classes

struct  RampUpParameters
 

Public Member Functions

 ConservativeVariablesFunction (const number initial_time, const std::shared_ptr< dealii::Function< dim, number > > density, const std::shared_ptr< dealii::Function< dim, number > > velocity, const std::shared_ptr< dealii::Function< dim, number > > inner_energy, const std::shared_ptr< dealii::Function< dim, number > > mass_fractions)
 
 ConservativeVariablesFunction (const number initial_time, const std::shared_ptr< dealii::Function< dim, number > > density, const std::shared_ptr< dealii::Function< dim, number > > velocity, const std::shared_ptr< dealii::Function< dim, number > > inner_energy)
 
 ConservativeVariablesFunction (const number initial_time, const std::string &density_function_string, const std::string &velocity_function_string, const std::string &inner_energy_function_string, const std::string &mass_fraction_functions_string, const unsigned n_mass_fractions)
 
 ConservativeVariablesFunction (const number initial_time, const std::string &density_function_string, const std::string &velocity_function_string, const std::string &inner_energy_function_string)
 
void set_velocity_ramp_up (const number duration, const RampUpType type)
 
void set_time (const number new_time) override
 
number value (const dealii::Point< dim, number > &loc, const unsigned int component) const override
 Evaluates the conservative variable value for a given component at a specified location.
 

Private Attributes

const std::shared_ptr< dealii::Function< dim, number > > density
 Function describing the density field.
 
const std::shared_ptr< dealii::Function< dim, number > > velocity
 Vectorial function describing the velocity field.
 
const std::shared_ptr< dealii::Function< dim, number > > inner_energy
 Function describing the field of the specific total energy.
 
const std::shared_ptr< dealii::Function< dim, number > > mass_fractions
 Function describing the mass fractions for multi-component flow cases.
 
RampUpParameters velocity_ramp_up
 Ramp-up parameters for the velocity function.
 

Detailed Description

template<int dim, typename number>
class MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number >

A function class that computes the conservative variable values for the compressible Navier–Stokes equations based on provided functions for the primitive variables: density, velocity, specific inner energy and species mass fractions.

Optionally, a time-dependent ramp-up can be applied to the velocity.

Constructor & Destructor Documentation

◆ ConservativeVariablesFunction() [1/4]

template<int dim, typename number >
MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number >::ConservativeVariablesFunction ( const number  initial_time,
const std::shared_ptr< dealii::Function< dim, number > >  density,
const std::shared_ptr< dealii::Function< dim, number > >  velocity,
const std::shared_ptr< dealii::Function< dim, number > >  inner_energy,
const std::shared_ptr< dealii::Function< dim, number > >  mass_fractions 
)

Constructor, stores the passed arguments internally.

Parameters
initial_timeInitial time used to initialize the function.
densityFunction representing the density field.
velocityFunction representing the velocity field.
inner_energyFunction representing the specific inner energy field.
mass_fractionsFunction representing the species mass fractions.

◆ ConservativeVariablesFunction() [2/4]

template<int dim, typename number >
MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number >::ConservativeVariablesFunction ( const number  initial_time,
const std::shared_ptr< dealii::Function< dim, number > >  density,
const std::shared_ptr< dealii::Function< dim, number > >  velocity,
const std::shared_ptr< dealii::Function< dim, number > >  inner_energy 
)

As above, stores the passed arguments internally but for single-species flow cases.

Parameters
initial_timeInitial time used to initialize the function.
densityFunction representing the density field.
velocityFunction representing the velocity field.
inner_energyFunction representing the specific inner energy field.

◆ ConservativeVariablesFunction() [3/4]

template<int dim, typename number >
MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number >::ConservativeVariablesFunction ( const number  initial_time,
const std::string &  density_function_string,
const std::string &  velocity_function_string,
const std::string &  inner_energy_function_string,
const std::string &  mass_fraction_functions_string,
const unsigned  n_mass_fractions 
)

Constructor for the multi-component case, where the individual primitive variable functions are passed as strings and initialized as FunctionParser objects within the constructor.

Parameters
initial_timeInitial time used to initialize the function.
density_function_stringString representing the function for the density field.
velocity_function_stringString representing the function for the velocity field.
inner_energy_function_stringString representing the function for the specific inner energy field.
mass_fraction_functions_stringString representing the functions for the mass fractions. The mass fractions should be provided as a semicolon-separated list of functions.
n_mass_fractionsThe total number of mass fractions in the simulation.

◆ ConservativeVariablesFunction() [4/4]

template<int dim, typename number >
MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number >::ConservativeVariablesFunction ( const number  initial_time,
const std::string &  density_function_string,
const std::string &  velocity_function_string,
const std::string &  inner_energy_function_string 
)

Constructor for single-species flow cases. As above the individual primitive variable functions are passed as strings and initialized as FunctionParser objects within the constructor.

Parameters
initial_timeInitial time used to initialize the function.
density_function_stringString representing the function for the density field.
velocity_function_stringString representing the function for the velocity field.
inner_energy_function_stringString representing the function for the specific inner energy field.

Member Function Documentation

◆ set_time()

template<int dim, typename number >
void MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number >::set_time ( const number  new_time)
override

Set the time for the function.

Parameters
new_timeTime to be set.

◆ set_velocity_ramp_up()

template<int dim, typename number >
void MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number >::set_velocity_ramp_up ( const number  duration,
const RampUpType  type 
)
inline

Sets the velocity ramp-up parameters. If this function is never called or if a ramp-up duration of zero is specified, no ramp-up is applied and the returned values correspond directly to the fully developed velocity field.

Parameters
durationThe duration of the ramp-up.
typeThe type of ramp-up function.

◆ value()

template<int dim, typename number >
number MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number >::value ( const dealii::Point< dim, number > &  loc,
const unsigned int  component 
) const
override

Evaluates the conservative variable value for a given component at a specified location.

This function returns the value of the conservative variable corresponding to the specified component at the given spatial location loc. The value is computed using the density, velocity, and energy functions provided to the object during construction.

If a ramp-up duration is defined, the velocity components are scaled according to the selected ramp-up function depending on the current time.

If no inflow ramp-up duration is specified (i.e., inflow_ramp_up_duration = 0), the returned value corresponds directly to the fully developed flow field.

Parameters
locCoordinates at which the function value is evaluated.
componentThe index of the conservative variable component to evaluate.
Returns
The value of the specified conservative variable component at loc.

Member Data Documentation

◆ density

template<int dim, typename number >
const std::shared_ptr<dealii::Function<dim, number> > MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number >::density
private

Function describing the density field.

◆ inner_energy

template<int dim, typename number >
const std::shared_ptr<dealii::Function<dim, number> > MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number >::inner_energy
private

Function describing the field of the specific total energy.

◆ mass_fractions

template<int dim, typename number >
const std::shared_ptr<dealii::Function<dim, number> > MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number >::mass_fractions
private

Function describing the mass fractions for multi-component flow cases.

◆ velocity

template<int dim, typename number >
const std::shared_ptr<dealii::Function<dim, number> > MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number >::velocity
private

Vectorial function describing the velocity field.

◆ velocity_ramp_up

template<int dim, typename number >
RampUpParameters MeltPoolDG::CompressibleFlow::ConservativeVariablesFunction< dim, number >::velocity_ramp_up
private

Ramp-up parameters for the velocity function.


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