CompressibleFlow Namespace Reference

Developer Documentation: MeltPoolDG::CompressibleFlow Namespace Reference
Developer Documentation
MeltPoolDG::CompressibleFlow Namespace Reference

This file contains various functions that can be used to set and evaluate boundary conditions for the compressible flow solver. The functions can be directly used with the BoundaryConditions class, which provides an interface to manage and evaluate the different boundary conditions in the solver. More...

Classes

class  BoundaryConditions
 Helper class taking care of all boundary condition related computations for the compressible flow solver. More...
 
struct  CombinedInflowNoSlipWallValueInterpretation
 
struct  ConcreteConvectiveFluxImpl
 
struct  ConcreteConvectiveFluxImpl< dim, 1, number, Value, Flux >
 
struct  ConcreteDiffusiveFluxImpl
 
struct  ConcreteDiffusiveFluxImpl< dim, 1, number, Value, Gradient, Flux >
 
class  ConservativeVariablesFunction
 
struct  ConservedVariableIndex
 
class  ConservedVariablesPostProcessor
 
struct  ConvectiveFlux
 
struct  ConvectiveKernels
 Convective kernel operations for compressible flow solvers. More...
 
class  CutDGOperation
 Operation that performs a full time step for the compressible single-phase Navier-Stokes equations in a cutDG context. More...
 
class  CutDGOperator
 Operator for the matrix-free evaluation of a compressible single-phase flow cutDG formulation. More...
 
struct  CutSolverData
 Collection of cut-related solver parameters required by the cut single-phase and multiphase compressible Navier-Stokes operators. More...
 
class  DGOperation
 
class  DGOperatorExplicit
 Operator for the matrix-free evaluation of a compressible single-phase flow cutDG formulation for explicit time integration. More...
 
class  DGOperatorImplicit
 Operator for the matrix-free evaluation of a compressible single-phase flow cutDG formulation for implicit time integration. More...
 
class  DGOperatorImplicitExplicit
 Operator for the matrix-free evaluation of a compressible single-phase flow cutDG formulation for implicit-explicit time integration. More...
 
struct  DiffusiveFlux
 
struct  DofGradientMixin
 
struct  DofGradientView
 
struct  DofPrimitiveStateView
 
struct  DofPrimitiveValueMixin
 
struct  DofPrimitiveValueView
 
struct  DofStateView
 
struct  DofValueAndGradientStateView
 
struct  DofValueMixin
 
struct  DofValueView
 
struct  ExternalFlowForce
 An abstract interface for defining external forces acting on the fluid that must be evaluated and incorporated during the cell loop of an explicit time integration scheme. More...
 
struct  ExternalFlowForceJacobian
 
struct  FluxMixin
 
struct  FluxView
 
class  FreeJetInflow
 
class  FreeJetVelocityFunction
 Enum for the type of velocity profile of a free jet inflow. More...
 
struct  InflowValueInterpretation
 
struct  InputDefinedBoundaryCondition
 
struct  InputDefinedFreeJetInflow
 
struct  InputDefinedInitialCondition
 
struct  InputDefinedSubdividedHyperRectangleDomain
 
struct  MaterialMixin
 
struct  MaterialPhaseData
 Collection of material parameters for a specific fluid phase. More...
 
struct  MaterialSpeciesData
 Collection of material parameters for a specific species. More...
 
class  MaterialVariablesPostProcessor
 
struct  MaterialView
 
struct  MultiphaseOperationScratchData
 Scratch data structure for compressible multiphase flow solvers. More...
 
struct  MultiSpeciesDofStateView
 
struct  MultiSpeciesDofValueAndGradientStateView
 
struct  MultiSpeciesDofValueView
 
struct  MultiSpeciesFluxView
 
struct  MultiSpeciesMaterialMixin
 
struct  OperationData
 Collection of parameters required by the compressible Navier-Stokes operator. More...
 
struct  OperationScratchData
 Scratch data structure for compressible single-phase flow solvers. More...
 
class  OperationTypeErasure
 Common interface class for compressible flow operation classes based on the type erasure idiom. More...
 
struct  OutputManager
 
struct  PrimitiveVariableIndex
 
class  PrimitiveVariablesPostProcessor
 
struct  SpeciesTransportConvectiveFlux
 
struct  SpeciesTransportDiffusiveFlux
 
struct  ViscousKernels
 Viscous kernel operations for compressible flow solvers. More...
 

Concepts

concept  IsConservedStateCompatible
 
concept  IsPrimitiveStateCompatible
 
concept  IsConservedGradientCompatible
 
concept  IsConservedView
 
concept  IsPrimitiveView
 
concept  IsMaterialView
 
concept  IsValueView
 
concept  IsGradientView
 
concept  IsFluxKernel
 
concept  CellEvaluatorType
 Concept to check whether a given type conforms to a valid cell evaluator interface.
 
concept  FaceEvaluatorType
 Concept to check whether a given type conforms to a valid face evaluator interface.
 

Typedefs

template<int dim, typename number , int n_species = 1, typename VectorizedArrayType = dealii::VectorizedArray<number>>
using ConservedVariablesType = dealii::Tensor< 1, n_conserved_variables< dim, n_species >, VectorizedArrayType >
 
template<int dim, typename number , int n_species = 1, typename VectorizedArrayType = dealii::VectorizedArray<number>>
using ConservedVariablesGradientType = dealii::Tensor< 1, n_conserved_variables< dim, n_species >, dealii::Tensor< 1, dim, VectorizedArrayType > >
 
template<int dim, typename number , int n_species = 1>
using FluxType = dealii::Tensor< 1, n_conserved_variables< dim, n_species >, dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > >
 
template<int dim, typename number , int n_species = 1>
using FaceFluxType = dealii::Tensor< 1, n_conserved_variables< dim, n_species >, dealii::VectorizedArray< number > >
 
template<int dim, typename number , int n_species = 1>
using FaceGradientFluxType = dealii::Tensor< 1, n_conserved_variables< dim, n_species >, dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > >
 
template<int dim, typename number , int n_species = 1>
using SourceType = dealii::Tensor< 1, n_conserved_variables< dim, n_species >, dealii::VectorizedArray< number > >
 
template<int dim, int n_species, typename number , typename Value , typename Flux >
using NSpeciesConvectiveFlux = typename ConcreteConvectiveFluxImpl< dim, n_species, number, Value, Flux >::type
 
template<int dim, int n_species, typename number , typename Value , typename Gradient , typename Flux >
using NSpeciesDiffusiveFlux = typename ConcreteDiffusiveFluxImpl< dim, n_species, number, Value, Gradient, Flux >::type
 
template<int dim, int n_species, IsConservedStateCompatible< dim > StateType>
using NSpeciesDofValueView = std::conditional_t< n_species==1, DofValueView< dim, StateType >, MultiSpeciesDofValueView< dim, n_species, StateType > >
 
template<int dim, int n_species, typename number , IsConservedStateCompatible< dim > StateType>
using NSpeciesDofStateView = std::conditional_t< n_species==1, DofStateView< dim, number, StateType >, MultiSpeciesDofStateView< dim, n_species, number, StateType > >
 
template<int dim, int n_species, typename number , IsConservedStateCompatible< dim > Value, IsConservedGradientCompatible< dim > Gradient>
using NSpeciesDofValueAndGradientStateView = std::conditional_t< n_species==1, DofValueAndGradientStateView< dim, number, Value, Gradient >, MultiSpeciesDofValueAndGradientStateView< dim, n_species, number, Value, Gradient > >
 
template<int dim, int n_species, typename FluxType >
using NSpeciesFluxView = std::conditional_t< n_species==1, FluxView< dim, FluxType >, MultiSpeciesFluxView< dim, n_species, FluxType > >
 

Functions

 BETTER_ENUM (RampUpType, char, none, linear, exponential, cosine)
 Enum for the type of ramp up function used for the velocity at an inflow boundary.
 
 BETTER_ENUM (BoundaryConditionType, char, combined_inflow_no_slip_wall, inflow, slip_wall, no_slip_wall, subsonic_outflow_fixed_energy, subsonic_outflow_fixed_pressure)
 
template<int dim, typename number >
void add_hyper_rectangle_custom_boundary_condition_parameters (dealii::ParameterHandler &prm, std::array< InputDefinedBoundaryCondition< dim, number >, 2 *dim > &boundary_conditions)
 
template<int dim, typename number , CellEvaluatorType< dim, dim+2, number, dealii::VectorizedArray< number > > Integrator>
DEAL_II_ALWAYS_INLINE std::tuple< ConservedVariablesType< dim, number >, ConservedVariablesGradientType< dim, number > > rhs_cell_integral_kernel (const Integrator &evaluator, const unsigned int q, const dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > *constant_body_force, const ConvectiveKernels< dim, number > &convective_terms, const ViscousKernels< dim, number > &viscous_terms, const std::unique_ptr< dealii::Function< dim > > &body_force, const bool is_viscous)
 Computes the right-hand side cell integral kernels at a quadrature point.
 
template<int dim, typename number , FaceEvaluatorType< dim, dim+2, number, dealii::VectorizedArray< number > > Integrator>
DEAL_II_ALWAYS_INLINE std::tuple< ConservedVariablesType< dim, number >, ConservedVariablesType< dim, number >, ConservedVariablesGradientType< dim, number >, ConservedVariablesGradientType< dim, number > > rhs_face_integral_kernel (const Integrator &evaluator_m, const Integrator &evaluator_p, const unsigned int q, dealii::VectorizedArray< number > penalty_parameter, const ConvectiveKernels< dim, number > &convective_terms, const ViscousKernels< dim, number > &viscous_terms, const bool is_viscous)
 Computes the right-hand side face integral kernels at a face quadrature point.
 
template<int dim, typename number , FaceEvaluatorType< dim, dim+2, number, dealii::VectorizedArray< number > > Integrator, bool is_gas_phase = true>
DEAL_II_ALWAYS_INLINE std::tuple< ConservedVariablesType< dim, number >, ConservedVariablesGradientType< dim, number > > rhs_boundary_face_integral_kernel (const Integrator &evaluator_m, const unsigned int q, const dealii::types::boundary_id boundary_id, const dealii::VectorizedArray< number > penalty_parameter, const ConvectiveKernels< dim, number > &convective_terms, const ViscousKernels< dim, number > &viscous_terms, const MaterialPhaseData< number > &material, const BoundaryConditions< dim, number > &boundary_conditions, const bool is_viscous)
 Computes the right-hand side boundary face integral kernels at a boundary face quadrature point.
 
template<int dim, typename ConservedVariablesView , typename WritableFluxView >
DEAL_II_ALWAYS_INLINE void convective_flux (const ConservedVariablesView &conserved_variables, const WritableFluxView &flux)
 
template<int dim, typename number >
DEAL_II_ALWAYS_INLINE dealii::Tensor< 1, dim, dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > > viscous_stress_tensor (const dealii::Tensor< 1, dim, dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > > &grad_velocity, const dealii::VectorizedArray< number > dynamic_viscosity)
 
template<int dim, typename VectorizedArrayType , typename DofStateView , typename WritableFluxView >
DEAL_II_ALWAYS_INLINE void diffusive_flux (const DofStateView &conserved_variables, const WritableFluxView &flux)
 
 BETTER_ENUM (EquationOfState, char, ideal_gas, stiffened_gas, noble_abel_stiffened_gas, weakly_compressible) template< typename number > struct EOSData
 Collection of parameters related to the equation of state for a compressible or nearly incompressible fluid.
 
 BETTER_ENUM (NumericalFluxType, char, lax_friedrichs_modified, lax_friedrichs_exact, harten_lax_vanleer) BETTER_ENUM(LinearizedConvectiveFluxJumpType
 
 BETTER_ENUM (JacobianType, char, exact, finite_difference)
 
 BETTER_ENUM (OutputType, char, conserved_variables, primitive_variables, material_quantities)
 
 BETTER_ENUM (Idx1D, char, density, momentum_x, energy)
 Index sets for the components of the compressible Navier-Stokes equations.
 
 BETTER_ENUM (Idx2D, char, density, momentum_x, momentum_y, energy)
 
 BETTER_ENUM (Idx3D, char, density, momentum_x, momentum_y, momentum_z, energy)
 
template<int dim, typename Number >
void calculate_penalty_parameter (dealii::AlignedVector< dealii::VectorizedArray< Number > > &array_penalty_parameter, const dealii::MatrixFree< dim, Number > &matrix_free, const std::string &domain_representation_type, const unsigned int dof_index=0, const Number scaling_factor=1.0)
 This function computes the local values of the internal penalty parameter used in the viscous numerical flux.
 
template<int dim, typename number , typename ConservedVariablesType >
void update_primitive_variables_solution (dealii::LinearAlgebra::distributed::Vector< number > &solution_primitive_variables, const dealii::LinearAlgebra::distributed::Vector< number > &solution, const ScratchData< dim, dim, number > &scratch_data, const unsigned int dof_idx, const unsigned int quad_idx, const MaterialPhaseData< number > *material_liquid, const MaterialPhaseData< number > *material_gas=nullptr)
 Update the primitive variable solution according to the current solution vector.
 
template<int dim, Flow::EOSIsConservativeValueView ConservativeValueView, Flow::EOSIsWritablePrimitiveValueView WritablePrimitiveValueView>
DEAL_II_ALWAYS_INLINE void conservative_to_primitive (const ConservativeValueView &conservative, WritablePrimitiveValueView &primitive)
 Convert a state from conservative (density, momentum, total energy) to primitive (pressure, velocity, temperature) variables.
 
template<int dim, Flow::EOSIsWritableConservativeValueView WritableConservativeValueView, Flow::EOSIsPrimitiveValueView PrimitiveValueView>
DEAL_II_ALWAYS_INLINE void primitive_to_conservative (const PrimitiveValueView &primitive, WritableConservativeValueView &conservative)
 Convert a state from primitive (pressure, velocity, temperature) to conservative (density, momentum, total energy) variables.
 
template<typename DofViewType , typename VectorizedArrayType >
DEAL_II_ALWAYS_INLINE VectorizedArrayType maximum_local_wave_speed (const DofViewType &u_m, const DofViewType &u_p)
 Calculate the maximum local wave speed between two states on a face.
 
template<typename number , int n_species, typename PrimitiveVariablesView >
std::bitset< dealii::VectorizedArray< number >::size()> physical_admissibility_mask (const PrimitiveVariablesView &w_view, const unsigned int n_active_lanes=dealii::VectorizedArray< number >::size())
 
template<int dim, typename number >
DEAL_II_ALWAYS_INLINE dealii::Tensor< 2, dim, dealii::VectorizedArray< number > > calculate_cauchy_stress_tensor (const dealii::VectorizedArray< number > &pressure, const dealii::Tensor< 2, dim, dealii::VectorizedArray< number > > &viscous_stress_tensor)
 Calculate the total stress tensor (Cauchy stress tensor) from pressure contribution and viscous stress contribution.
 
template<typename number , int n_species>
bool is_viscous_flow (const MaterialPhaseData< number > &material_data)
 

Variables

template<int dim, int n_species = 1>
constexpr unsigned int n_conserved_variables = dim + 2 + (n_species - 1)
 
 char
 
 analytic
 
 lambda_fd
 
 complete_fd
 

Detailed Description

This file contains various functions that can be used to set and evaluate boundary conditions for the compressible flow solver. The functions can be directly used with the BoundaryConditions class, which provides an interface to manage and evaluate the different boundary conditions in the solver.

Type definitions and helper functions for the compressible flow implementations.

A collection of helper functions that might be useful when solving the compressible Navier-Stokes equations with an explicit time stepping strategy.

This operator solves the compressible Navier-Stokes equations, comprising the primary variables.

Collection of convective term computations for the compressible Navier-Stokes equations.

  • density (ρ)
  • momentum (ρ u)
  • volume-specific energy (ρ E) using the cutDG method for single-phase problems.

It is an extension of deal.II step-67 and is based on

Fehn, N., Wall, W. A., & Kronbichler, M. (2019). A matrix‐free high‐order discontinuous Galerkin compressible Navier‐Stokes solver: A performance comparison of compressible and incompressible formulations for turbulent incompressible flows. International Journal for Numerical Methods in Fluids, 89(3), 71-102.

and

Ritthaler, A. (2024). A matrix-free cutDG formulation for complex flows, Master's Thesis.

This file contains type aliases for the kernels used in the multi- and single-species compressible flow solver. The main purpose is that the type aliases automatically resolve to the correct kernel type depending on the number of species in the simulation. For example, for single-species simulations, the kernels resolve to the standard ConvectiveFlux and DiffusiveFlux, while for multi-species simulations, they resolve to the corresponding SpeciesTransportConvectiveFlux and SpeciesTransportDiffusiveFlux.

This file contains type aliases for the state views used in the multi- and single-species compressible flow solver. The main purpose is that the type aliases automatically resolve to the correct state view type depending on the number of species in the simulation. For example, for single-species simulations, the state views resolve to the standard DofStateView and DofValueAndGradientStateView, while for multi-species simulations, they resolve to the corresponding MultiSpeciesDofStateView and MultiSpeciesDofValueAndGradientStateView.

Typedef Documentation

◆ ConservedVariablesGradientType

template<int dim, typename number , int n_species = 1, typename VectorizedArrayType = dealii::VectorizedArray<number>>
using MeltPoolDG::CompressibleFlow::ConservedVariablesGradientType = typedef dealii:: Tensor<1, n_conserved_variables<dim, n_species>, dealii::Tensor<1, dim, VectorizedArrayType> >

Type alias for the gradient of the conserved variables in the compressible flow solver given at a vectorized set of coordinates.

◆ ConservedVariablesType

template<int dim, typename number , int n_species = 1, typename VectorizedArrayType = dealii::VectorizedArray<number>>
using MeltPoolDG::CompressibleFlow::ConservedVariablesType = typedef dealii::Tensor<1, n_conserved_variables<dim, n_species>, VectorizedArrayType>

Type alias for the conserved variables in the compressible flow solver given at a vectorized set of coordinates.

◆ FaceFluxType

template<int dim, typename number , int n_species = 1>
using MeltPoolDG::CompressibleFlow::FaceFluxType = typedef dealii::Tensor<1, n_conserved_variables<dim, n_species>, dealii::VectorizedArray<number> >

Type alias for the fluxes at faces in the compressible flow solver given at a vectorized set of coordinates (contracted with normal vector). This includes both convective and diffusive fluxes.

◆ FaceGradientFluxType

template<int dim, typename number , int n_species = 1>
using MeltPoolDG::CompressibleFlow::FaceGradientFluxType = typedef dealii::Tensor<1, n_conserved_variables<dim, n_species>, dealii::Tensor<1, dim, dealii::VectorizedArray<number> >>

◆ FluxType

template<int dim, typename number , int n_species = 1>
using MeltPoolDG::CompressibleFlow::FluxType = typedef dealii::Tensor<1, n_conserved_variables<dim, n_species>, dealii::Tensor<1, dim, dealii::VectorizedArray<number> >>

Type alias for the fluxes in the compressible flow solver given at a vectorized set of coordinates. This includes both convective and diffusive fluxes.

◆ NSpeciesConvectiveFlux

template<int dim, int n_species, typename number , typename Value , typename Flux >
using MeltPoolDG::CompressibleFlow::NSpeciesConvectiveFlux = typedef typename ConcreteConvectiveFluxImpl<dim, n_species, number, Value, Flux>::type

Type alias for the ConvectiveFlux for a specific number of species. This alias resolves to the appropriate kernel type depending on the number of species in the simulation.

◆ NSpeciesDiffusiveFlux

template<int dim, int n_species, typename number , typename Value , typename Gradient , typename Flux >
using MeltPoolDG::CompressibleFlow::NSpeciesDiffusiveFlux = typedef typename ConcreteDiffusiveFluxImpl<dim, n_species, number, Value, Gradient, Flux>::type

Type alias for the DiffusiveFlux for a specific number of species. This alias resolves to the appropriate kernel type depending on the number of species in the simulation.

◆ NSpeciesDofStateView

template<int dim, int n_species, typename number , IsConservedStateCompatible< dim > StateType>
using MeltPoolDG::CompressibleFlow::NSpeciesDofStateView = typedef std::conditional_t<n_species == 1, DofStateView<dim, number, StateType>, MultiSpeciesDofStateView<dim, n_species, number, StateType> >

Type alias for the DofStateView for a specific number of species. This alias resolves to the appropriate state view type depending on the number of species in the simulation.

◆ NSpeciesDofValueAndGradientStateView

template<int dim, int n_species, typename number , IsConservedStateCompatible< dim > Value, IsConservedGradientCompatible< dim > Gradient>
using MeltPoolDG::CompressibleFlow::NSpeciesDofValueAndGradientStateView = typedef std::conditional_t< n_species == 1, DofValueAndGradientStateView<dim, number, Value, Gradient>, MultiSpeciesDofValueAndGradientStateView<dim, n_species, number, Value, Gradient> >

Type alias for the DofValueAndGradientStateView for a specific number of species. This alias resolves to the appropriate state view type depending on the number of species in the simulation.

◆ NSpeciesDofValueView

template<int dim, int n_species, IsConservedStateCompatible< dim > StateType>
using MeltPoolDG::CompressibleFlow::NSpeciesDofValueView = typedef std::conditional_t<n_species == 1, DofValueView<dim, StateType>, MultiSpeciesDofValueView<dim, n_species, StateType> >

Type alias for the DofValueView for a specific number of species. This alias resolves to the appropriate state view type depending on the number of species in the simulation.

◆ NSpeciesFluxView

template<int dim, int n_species, typename FluxType >
using MeltPoolDG::CompressibleFlow::NSpeciesFluxView = typedef std::conditional_t<n_species == 1, FluxView<dim, FluxType>, MultiSpeciesFluxView<dim, n_species, FluxType> >

Type alias for the FluxView for a specific number of species. This alias resolves to the appropriate flux view type depending on the number of species in the simulation.

◆ SourceType

template<int dim, typename number , int n_species = 1>
using MeltPoolDG::CompressibleFlow::SourceType = typedef dealii::Tensor<1, n_conserved_variables<dim, n_species>, dealii::VectorizedArray<number> >

Type alias for source terms in the compressible flow solver given at a vectorized set of coordinates.

Function Documentation

◆ add_hyper_rectangle_custom_boundary_condition_parameters()

template<int dim, typename number >
void MeltPoolDG::CompressibleFlow::add_hyper_rectangle_custom_boundary_condition_parameters ( dealii::ParameterHandler &  prm,
std::array< InputDefinedBoundaryCondition< dim, number >, 2 *dim > &  boundary_conditions 
)

For a hyper-rectangular domain, this function adds the boundary condition parameters for all boundaries to the parameter handler. For this at each boundary the corresponding function of the boundary conditions object is called, which reads the parameters from the user input file and stores them in the corresponding boundary condition struct. The ordering in the passed array is the same as the boundary id provided by deal.II, i.e., for a 2D domain, the first two entries correspond to the boundaries with normal in x-direction (boundary ids 0 and 1), and the second two entries correspond to the boundaries with normal in y-direction (boundary ids 2 and 3). Subsequently, for 3D domains, the last two entries correspond to the boundaries with normal in z-direction (boundary ids 4 and 5).

Parameters
prmParameter handler to which the parameters will be added.
boundary_conditionsArray of boundary condition structs for all boundaries of the domain.

◆ BETTER_ENUM() [1/9]

MeltPoolDG::CompressibleFlow::BETTER_ENUM ( BoundaryConditionType  ,
char  ,
combined_inflow_no_slip_wall  ,
inflow  ,
slip_wall  ,
no_slip_wall  ,
subsonic_outflow_fixed_energy  ,
subsonic_outflow_fixed_pressure   
)

An enum for the various boundary conditions supported by the compressible flow solver.

◆ BETTER_ENUM() [2/9]

MeltPoolDG::CompressibleFlow::BETTER_ENUM ( EquationOfState  ,
char  ,
ideal_gas  ,
stiffened_gas  ,
noble_abel_stiffened_gas  ,
weakly_compressible   
)

Collection of parameters related to the equation of state for a compressible or nearly incompressible fluid.

Enumeration for the currently supported equations of state to model compressible or (nearly) incompressible fluids

Parameter to model molecular attraction within condensed matter (required for stiffened_gas and noble_abel_stiffened_gas)

Parameter to model the covolume of the fluid, i.e., the exclude volume due to the finite size of the molecules (required for noble_abel_stiffened_gas)

Parameter to model the 'heat bound', i.e., the energy due to chemical bounds, hydrogen bondings, latent heat,... (required for noble_abel_stiffened_gas)

Parameters for the weakly compressible equation of state

Parameter for the pressure at the reference point

Parameter for the density at the reference point

Parameter for the sound speed at the reference point

Add EOS-specific material parameters in the parameter handler.

Parameters
prmThe parameter handler to which the parameters are added.

Post-process EOS-specific material data parameters. This function essentially checks that the required parameters for the selected equation of state are set and throws an exception if this is not the case.

Parameters
eos_typeThe type of equation of state for which the parameters should be checked.

◆ BETTER_ENUM() [3/9]

MeltPoolDG::CompressibleFlow::BETTER_ENUM ( Idx1D  ,
char  ,
density  ,
momentum_x  ,
energy   
)

Index sets for the components of the compressible Navier-Stokes equations.

◆ BETTER_ENUM() [4/9]

MeltPoolDG::CompressibleFlow::BETTER_ENUM ( Idx2D  ,
char  ,
density  ,
momentum_x  ,
momentum_y  ,
energy   
)

◆ BETTER_ENUM() [5/9]

MeltPoolDG::CompressibleFlow::BETTER_ENUM ( Idx3D  ,
char  ,
density  ,
momentum_x  ,
momentum_y  ,
momentum_z  ,
energy   
)

◆ BETTER_ENUM() [6/9]

MeltPoolDG::CompressibleFlow::BETTER_ENUM ( JacobianType  ,
char  ,
exact  ,
finite_difference   
)

◆ BETTER_ENUM() [7/9]

MeltPoolDG::CompressibleFlow::BETTER_ENUM ( NumericalFluxType  ,
char  ,
lax_friedrichs_modified  ,
lax_friedrichs_exact  ,
harten_lax_vanleer   
)

◆ BETTER_ENUM() [8/9]

MeltPoolDG::CompressibleFlow::BETTER_ENUM ( OutputType  ,
char  ,
conserved_variables  ,
primitive_variables  ,
material_quantities   
)

◆ BETTER_ENUM() [9/9]

MeltPoolDG::CompressibleFlow::BETTER_ENUM ( RampUpType  ,
char  ,
none  ,
linear  ,
exponential  ,
cosine   
)

Enum for the type of ramp up function used for the velocity at an inflow boundary.

◆ calculate_cauchy_stress_tensor()

template<int dim, typename number >
DEAL_II_ALWAYS_INLINE dealii::Tensor< 2, dim, dealii::VectorizedArray< number > > MeltPoolDG::CompressibleFlow::calculate_cauchy_stress_tensor ( const dealii::VectorizedArray< number > &  pressure,
const dealii::Tensor< 2, dim, dealii::VectorizedArray< number > > &  viscous_stress_tensor 
)
inline

Calculate the total stress tensor (Cauchy stress tensor) from pressure contribution and viscous stress contribution.

\[ \sigma_{ij} = \tau_{ij} - p\,\delta_{ij}, \]

where \(\sigma_{ij}\) is the total stress tensor, \(\tau_{ij}\) is the viscous stress tensor, \(p\) is the pressure, and \(\delta_{ij}\) is the Kronecker delta.

Parameters
pressureCurrent value for the pressure.
viscous_stress_tensorGiven viscous tress tensor.
Returns
Resulting stress tensor.

◆ calculate_penalty_parameter()

template<int dim, typename Number >
void MeltPoolDG::CompressibleFlow::calculate_penalty_parameter ( dealii::AlignedVector< dealii::VectorizedArray< Number > > &  array_penalty_parameter,
const dealii::MatrixFree< dim, Number > &  matrix_free,
const std::string &  domain_representation_type,
const unsigned int  dof_index = 0,
const Number  scaling_factor = 1.0 
)

This function computes the local values of the internal penalty parameter used in the viscous numerical flux.

Parameters
array_penalty_parameterArray in which the values of the penalty parameter are stored.
matrix_freeMatrix-free object providing the required geometrical data.
domain_representation_typeNumerical operator type (cut or fitted_mesh).
dof_indexIndex of the relevant dof handler in the matrix-free object.
scaling_factorAdditional scaling factor to scale the penalty parameter.

◆ conservative_to_primitive()

template<int dim, Flow::EOSIsConservativeValueView ConservativeValueView, Flow::EOSIsWritablePrimitiveValueView WritablePrimitiveValueView>
DEAL_II_ALWAYS_INLINE void MeltPoolDG::CompressibleFlow::conservative_to_primitive ( const ConservativeValueView &  conservative,
WritablePrimitiveValueView &  primitive 
)
inline

Convert a state from conservative (density, momentum, total energy) to primitive (pressure, velocity, temperature) variables.

Parameters
conservativeConservative state view.
primitivePrimitive state view, which state is computed.
Returns
The corresponding primitive state.

◆ convective_flux()

template<int dim, typename ConservedVariablesView , typename WritableFluxView >
DEAL_II_ALWAYS_INLINE void MeltPoolDG::CompressibleFlow::convective_flux ( const ConservedVariablesView &  conserved_variables,
const WritableFluxView &  flux 
)
inline

Calculate the convective flux F_c for the compressible Navier-Stokes equations.

Parameters
conserved_variablesView on the local values of the conserved variables, providing convenient accessor functions for the quantities needed to compute the convective flux.
Template Parameters
value_typeType of the conserved variables.

◆ diffusive_flux()

template<int dim, typename VectorizedArrayType , typename DofStateView , typename WritableFluxView >
DEAL_II_ALWAYS_INLINE void MeltPoolDG::CompressibleFlow::diffusive_flux ( const DofStateView &  conserved_variables,
const WritableFluxView &  flux 
)
inline

Calculate the diffusive (viscous) flux F_d for the compressible Navier-Stokes equations.

Parameters
conserved_variablesA view on the local values of the conserved variables and their gradients, providing convenient accessor functions for the quantities needed to compute the diffusive flux, such as velocity, velocity gradients, temperature gradients, dynamic viscosity, and thermal conductivity.
Template Parameters
value_typeType of the conserved variables.
gradient_typeType of the gradients of the conserved variables.

◆ is_viscous_flow()

template<typename number , int n_species>
bool MeltPoolDG::CompressibleFlow::is_viscous_flow ( const MaterialPhaseData< number > &  material_data)
inline

This function checks whether the flow is viscous or not. This is done by checking the dynamic viscosity of all species in the material data. If any species has a non-zero dynamic viscosity, the flow is considered viscous.

Parameters
material_dataMaterial data struct containing the properties of the fluid.
Returns
True if the flow is viscous, false otherwise.

◆ maximum_local_wave_speed()

template<typename DofViewType , typename VectorizedArrayType >
DEAL_II_ALWAYS_INLINE VectorizedArrayType MeltPoolDG::CompressibleFlow::maximum_local_wave_speed ( const DofViewType &  u_m,
const DofViewType &  u_p 
)
inline

Calculate the maximum local wave speed between two states on a face.

Parameters
u_mState view for the interior side of the face.
u_pState view for the exterior side of the face.
Returns
The maximum local wave speed between the two states on a face.

◆ physical_admissibility_mask()

template<typename number , int n_species, typename PrimitiveVariablesView >
std::bitset< dealii::VectorizedArray< number >::size()> MeltPoolDG::CompressibleFlow::physical_admissibility_mask ( const PrimitiveVariablesView &  w_view,
const unsigned int  n_active_lanes = dealii::VectorizedArray<number>::size() 
)
inline

This function checks whether the given primitive variable state is physically admissible. The check is performed for each lane of the vectorized array, and a bitset is returned indicating which lanes are admissible. For admissible lanes, the corresponding bit is set to 1, while for non-admissible lanes, the bit is set to 0.

A state is considered physically admissible if the density and the pressure are positive. For multi-species flows, the mass fractions of all species must be between 0 and 1, and their sum must be equal to 1.

Parameters
w_viewView of the primitive variable state to be checked.
n_active_lanesNumber of active lanes in the vectorized array to be checked. Non-active lanes are set to zero in the returned bitset.

◆ primitive_to_conservative()

template<int dim, Flow::EOSIsWritableConservativeValueView WritableConservativeValueView, Flow::EOSIsPrimitiveValueView PrimitiveValueView>
DEAL_II_ALWAYS_INLINE void MeltPoolDG::CompressibleFlow::primitive_to_conservative ( const PrimitiveValueView &  primitive,
WritableConservativeValueView &  conservative 
)
inline

Convert a state from primitive (pressure, velocity, temperature) to conservative (density, momentum, total energy) variables.

Parameters
primitivePrimitive state view.
conservativeConservative state view, which state is computed.
Returns
The corresponding conservative state.

◆ rhs_boundary_face_integral_kernel()

template<int dim, typename number , FaceEvaluatorType< dim, dim+2, number, dealii::VectorizedArray< number > > Integrator, bool is_gas_phase = true>
DEAL_II_ALWAYS_INLINE std::tuple< ConservedVariablesType< dim, number >, ConservedVariablesGradientType< dim, number > > MeltPoolDG::CompressibleFlow::rhs_boundary_face_integral_kernel ( const Integrator &  evaluator_m,
const unsigned int  q,
const dealii::types::boundary_id  boundary_id,
const dealii::VectorizedArray< number >  penalty_parameter,
const ConvectiveKernels< dim, number > &  convective_terms,
const ViscousKernels< dim, number > &  viscous_terms,
const MaterialPhaseData< number > &  material,
const BoundaryConditions< dim, number > &  boundary_conditions,
const bool  is_viscous 
)
inline

Computes the right-hand side boundary face integral kernels at a boundary face quadrature point.

Kernel of the local boundary face applier for the right-hand side function. This function computes the face integral contribution of boundary faces to the right hand side for the quadrature point index and the corresponding FE evaluator.

Parameters
evaluator_mFE-evaluator object reinitialized on the current (inner) face batch.
qIndex of the quadrature point.
boundary_idBoundary ID of the considered boundary face.
penalty_parameterValue of the symmetric interior penalty parameter on the face.
convective_termsCollection of convective term computations for the compressible Navier-Stokes equations.
viscous_termsCollection of viscous term computations for the compressible Navier-Stokes equations.
materialStruct providing material data.
boundary_conditionsClass providing boundary condition related computations for the compressible flow solver
is_viscousBoolean flag indicating whether the flow is viscous or not.
Returns
Tuple, containing the flux for the boundary face, weighted with the value of the test function, as first argument, and the flux for the boundary face, weighted with the gradient of the test function, as second argument.

◆ rhs_cell_integral_kernel()

template<int dim, typename number , CellEvaluatorType< dim, dim+2, number, dealii::VectorizedArray< number > > Integrator>
DEAL_II_ALWAYS_INLINE std::tuple< ConservedVariablesType< dim, number >, ConservedVariablesGradientType< dim, number > > MeltPoolDG::CompressibleFlow::rhs_cell_integral_kernel ( const Integrator &  evaluator,
const unsigned int  q,
const dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > *  constant_body_force,
const ConvectiveKernels< dim, number > &  convective_terms,
const ViscousKernels< dim, number > &  viscous_terms,
const std::unique_ptr< dealii::Function< dim > > &  body_force,
const bool  is_viscous 
)
inline

Computes the right-hand side cell integral kernels at a quadrature point.

Kernel of the local cell applier for the right-hand side function. This function computes the cell integral contribution to the right hand side for the quadrature point index and the corresponding FE evaluator.

Parameters
evaluatorFE-evaluator object reinitialized on the current cell batch.
qIndex of the quadrature point.
constant_body_forceValue of the body force. If the body force is not constant the pointer must be set to nullptr.
convective_termsCollection of convective term computations for the compressible Navier-Stokes equations.
viscous_termsCollection of viscous term computations for the compressible Navier-Stokes equations.
body_forcePointer to a body force function.
is_viscousBoolean flag indicating whether the flow is viscous or not.
Returns
Tuple, containing the flux, weighted with the value of the test function, as first argument, and the flux, weighted with the gradient of the test function, as second argument.

◆ rhs_face_integral_kernel()

template<int dim, typename number , FaceEvaluatorType< dim, dim+2, number, dealii::VectorizedArray< number > > Integrator>
DEAL_II_ALWAYS_INLINE std::tuple< ConservedVariablesType< dim, number >, ConservedVariablesType< dim, number >, ConservedVariablesGradientType< dim, number >, ConservedVariablesGradientType< dim, number > > MeltPoolDG::CompressibleFlow::rhs_face_integral_kernel ( const Integrator &  evaluator_m,
const Integrator &  evaluator_p,
const unsigned int  q,
dealii::VectorizedArray< number >  penalty_parameter,
const ConvectiveKernels< dim, number > &  convective_terms,
const ViscousKernels< dim, number > &  viscous_terms,
const bool  is_viscous 
)
inline

Computes the right-hand side face integral kernels at a face quadrature point.

Kernel of the local inner face applier for the right-hand side function. This function computes the face integral contribution of inner faces to the right hand side for the quadrature point index and the corresponding FE evaluator.

Parameters
evaluator_mFE-evaluator object reinitialized on the current (inside) face batch.
evaluator_pFE-evaluator object reinitialized on the current (outside) face batch.
qIndex of the quadrature point.
penalty_parameterValue of the symmetric interior penalty parameter on the face.
convective_termsCollection of convective term computations for the compressible Navier-Stokes equations.
viscous_termsCollection of viscous term computations for the compressible Navier-Stokes equations.
is_viscousBoolean flag indicating whether the flow is viscous or not.
Returns
Tuple, which containing the fluxes for the inside and outside faces, weighted with the value of the test functions, as first two arguments, and the fluxes for the inside and outside faces, weighted with the gradient of the test functions, as the third and fourth argument.

◆ update_primitive_variables_solution()

template<int dim, typename number , typename ConservedVariablesType >
void MeltPoolDG::CompressibleFlow::update_primitive_variables_solution ( dealii::LinearAlgebra::distributed::Vector< number > &  solution_primitive_variables,
const dealii::LinearAlgebra::distributed::Vector< number > &  solution,
const ScratchData< dim, dim, number > &  scratch_data,
const unsigned int  dof_idx,
const unsigned int  quad_idx,
const MaterialPhaseData< number > *  material_liquid,
const MaterialPhaseData< number > *  material_gas = nullptr 
)

Update the primitive variable solution according to the current solution vector.

Parameters
solution_primitive_variablesVector where the solution in primitive variables is stored.
solutionCurrent solution vector in conservative variable formulation.
scratch_dataReference to the used ScratchData object.
dof_idxIndex of the relevant dof handler in the matrix-free object.
quad_idxRelevant quadrature index of the flow solver.
material_liquidPointer to the material object for liquid phase.
material_gasPointer to the material object for the gas phase.
Note
The second material object is only required for the two-phase case.

◆ viscous_stress_tensor()

template<int dim, typename number >
DEAL_II_ALWAYS_INLINE dealii::Tensor< 1, dim, dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > > MeltPoolDG::CompressibleFlow::viscous_stress_tensor ( const dealii::Tensor< 1, dim, dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > > &  grad_velocity,
const dealii::VectorizedArray< number >  dynamic_viscosity 
)
inline

Calculate the viscous stress tensor for the compressible Navier-Stokes equations.

Parameters
grad_velocityGradient of the velocity field.
dynamic_viscosityDynamic viscosity of the fluid.

Variable Documentation

◆ analytic

MeltPoolDG::CompressibleFlow::analytic

◆ char

MeltPoolDG::CompressibleFlow::char

◆ complete_fd

MeltPoolDG::CompressibleFlow::complete_fd

◆ lambda_fd

MeltPoolDG::CompressibleFlow::lambda_fd

◆ n_conserved_variables

template<int dim, int n_species = 1>
constexpr unsigned int MeltPoolDG::CompressibleFlow::n_conserved_variables = dim + 2 + (n_species - 1)
constexpr

Number of independent conserved variables for the compressible Navier-Stokes equations in dim dimensions.