BoundaryConditions< dim, number > Class Template Reference

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

Helper class taking care of all boundary condition related computations for the compressible flow solver. More...

#include <boundary_conditions.hpp>

Public Types

using ConservedVariables = ConservedVariablesType< dim, number >
 
using ConservedVariablesGradient = ConservedVariablesGradientType< dim, number >
 
using BoundaryType = BoundaryConditionType
 
using VectorizedArrayType = dealii::VectorizedArray< number >
 

Public Member Functions

void update_boundary_conditions (number time)
 Update the boundary conditions.
 
void set_boundary_conditions (const std::shared_ptr< SimulationCaseBase< dim, number > > &simulation_case, const std::string &operation_name)
 Set the compressible flow boundary conditions.
 
void set_boundary_condition (BoundaryType boundary_condition, std::map< dealii::types::boundary_id, std::shared_ptr< dealii::Function< dim > > > boundary_condition_function={})
 Set a specific boundary condition and store it internally.
 
BoundaryType get_boundary_type (const dealii::types::boundary_id boundary_id) const
 Get the type of the boundary condition at a specific domain boundary.
 
dealii::VectorizedArray< number > get_boundary_value (dealii::types::boundary_id boundary_id, BoundaryType boundary_condition, const dealii::Point< dim, dealii::VectorizedArray< number > > &location, unsigned component) const
 Compute the prescribed boundary value at a specific location on the boundary.
 
std::tuple< ConservedVariables, ConservedVariablesGradientget_boundary_face_value_and_gradient (const dealii::Point< dim, dealii::VectorizedArray< number > > &q_point, const dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > &normal, dealii::types::boundary_id boundary_id, const ConservedVariables &w_m, const ConservedVariablesGradient &grad_w_m, const Material< dim, number > &material, bool is_gas_phase=true) const
 This function sets the corresponding values on the fictional outer face if the face is located at a boundary.
 
template<typename DofReadView , typename DofWriteView >
void set_conserved_variables_boundary_value_and_gradient (const dealii::Point< dim, dealii::VectorizedArray< number > > &q_point, const dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > &normal, dealii::types::boundary_id boundary_id, const DofReadView &w_m, const DofWriteView &w_p) const
 
template<int n_species, typename DofReadView , typename DofWriteView >
void set_partial_density_boundary_value_and_gradient (const dealii::Point< dim, dealii::VectorizedArray< number > > &q_point, dealii::types::boundary_id boundary_id, const DofReadView &w_m, const DofWriteView &w_p) const
 
std::tuple< ConservedVariables, ConservedVariablesGradient, ConservedVariables, ConservedVariablesGradientget_jacobian_boundary_face_value_and_gradient (const dealii::Point< dim, dealii::VectorizedArray< number > > &q_point, const dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > &normal, dealii::types::boundary_id boundary_id, const ConservedVariables &w_m, const ConservedVariables &delta_w_m, const ConservedVariablesGradient &grad_w_m, const ConservedVariablesGradient &grad_delta_w_m, number gamma) const
 Compute boundary values and gradients, as well as their linearizations for the Jacobian.
 

Static Public Attributes

static const std::map< BoundaryType, std::string > boundary_type_to_string_map
 

Private Member Functions

template<typename DofReadView , typename DofWriteView >
void apply_slip_wall_boundary (DofReadView w_m, DofWriteView w_p, const dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > &normal) const
 
template<typename DofReadView , typename DofWriteView >
void apply_no_slip_wall_boundary (DofReadView w_m, DofWriteView w_p) const
 
template<typename DofReadView , typename DofWriteView , typename DirichletValueInterpretation = InflowValueInterpretation<dim>>
void apply_inflow_boundary (const dealii::types::boundary_id boundary_id, const dealii::Point< dim, dealii::VectorizedArray< number > > &q_point, DofReadView w_m, DofWriteView w_p, const BoundaryType bc_value_type=BoundaryType::inflow) const
 
template<typename DofReadView , typename DofWriteView >
void apply_subsonic_outflow_with_fixed_pressure_boundary (const dealii::types::boundary_id boundary_id, const dealii::Point< dim, dealii::VectorizedArray< number > > &q_point, DofReadView w_m, DofWriteView w_p) const
 
template<typename DofReadView , typename DofWriteView >
void apply_subsonic_outflow_with_fixed_energy_boundary (const dealii::types::boundary_id boundary_id, const dealii::Point< dim, dealii::VectorizedArray< number > > &q_point, DofReadView w_m, DofWriteView w_p) const
 
template<typename DofReadView , typename DofWriteView >
void apply_combined_inflow_no_slip_wall_boundary (const dealii::types::boundary_id boundary_id, const dealii::Point< dim, dealii::VectorizedArray< number > > &q_point, DofReadView w_m, DofWriteView w_p) const
 

Private Attributes

std::map< dealii::types::boundary_id, std::shared_ptr< dealii::Function< dim > > > inflow_boundaries
 Maps boundary IDs to the specific boundary functions.
 
std::map< dealii::types::boundary_id, std::shared_ptr< dealii::Function< dim > > > subsonic_outflow_fixed_pressure
 
std::map< dealii::types::boundary_id, std::shared_ptr< dealii::Function< dim > > > subsonic_outflow_fixed_energy
 
std::map< dealii::types::boundary_id, std::shared_ptr< dealii::Function< dim > > > combined_inflow_no_slip_wall_boundaries
 
std::set< dealii::types::boundary_id > slip_wall_boundaries
 Sets of boundary IDs.
 
std::set< dealii::types::boundary_id > no_slip_adiabatic_wall_boundaries
 

Detailed Description

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

Helper class taking care of all boundary condition related computations for the compressible flow solver.

This class provides an interface to set, manage, and evaluate a variety of physical boundary conditions that may arise in simulations of compressible Navier-Stokes flows.

Supported boundary condition types:

  • Inflow
  • Slip wall
  • No-slip adiabatic wall
  • Subsonic outflow with fixed pressure
  • Subsonic outflow with fixed energy
  • Combined inflow and no-slip wall boundary condition, which can be used to apply a free jet inflow.

Member Typedef Documentation

◆ BoundaryType

template<int dim, typename number >
using MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::BoundaryType = BoundaryConditionType

◆ ConservedVariables

template<int dim, typename number >
using MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::ConservedVariables = ConservedVariablesType<dim, number>

◆ ConservedVariablesGradient

template<int dim, typename number >
using MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::ConservedVariablesGradient = ConservedVariablesGradientType<dim, number>

◆ VectorizedArrayType

template<int dim, typename number >
using MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::VectorizedArrayType = dealii::VectorizedArray<number>

Member Function Documentation

◆ apply_combined_inflow_no_slip_wall_boundary()

template<int dim, typename number >
template<typename DofReadView , typename DofWriteView >
void MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::apply_combined_inflow_no_slip_wall_boundary ( const dealii::types::boundary_id  boundary_id,
const dealii::Point< dim, dealii::VectorizedArray< number > > &  q_point,
DofReadView  w_m,
DofWriteView  w_p 
) const
private

Apply the combined inflow and no-slip wall boundary condition by setting the corresponding values in w_p based on the values in w_m and the boundary function corresponding to the boundary. For points located in the inflow region of the boundary, the values are set based on the boundary function, while for points located in the wall region, the no-slip wall condition is applied.

Parameters
boundary_idID of the boundary at which the combined inflow and no-slip wall boundary condition is applied.
q_pointCoordinates at which the boundary function is evaluated.
w_mView for the conserved variables on the inner face.
w_pView for the conserved variables on the outer face, which shall be set by this function.

◆ apply_inflow_boundary()

template<int dim, typename number >
template<typename DofReadView , typename DofWriteView , typename DirichletValueInterpretation >
void MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::apply_inflow_boundary ( const dealii::types::boundary_id  boundary_id,
const dealii::Point< dim, dealii::VectorizedArray< number > > &  q_point,
DofReadView  w_m,
DofWriteView  w_p,
const BoundaryType  bc_value_type = BoundaryType::inflow 
) const
private

Apply the inflow boundary condition by setting the corresponding values in w_p based on the values in w_m and the boundary function corresponding to the inflow boundary with id boundary_id evaluated at the coordinates q_point.

Parameters
boundary_idID of the boundary at which the inflow boundary condition is applied.
q_pointCoordinates at which the boundary function is evaluated.
w_mView for the conserved variables on the inner face.
w_pView for the conserved variables on the outer face, which shall be set by this function.
bc_value_typeType of the boundary condition, from which the Dirichlet boundary values are obtained.
Template Parameters
DirichletValueInterpretationA struct defining an enum to interpret the components of the vector returned by the boundary function. This allows to use the same function for different types of boundary conditions, where the interpretation of the returned vector can differ.

◆ apply_no_slip_wall_boundary()

template<int dim, typename number >
template<typename DofReadView , typename DofWriteView >
void MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::apply_no_slip_wall_boundary ( DofReadView  w_m,
DofWriteView  w_p 
) const
private

Apply the no-slip adiabatic wall boundary condition by setting the corresponding values in w_p based on the values in w_m.

Parameters
w_mView for the conserved variables on the inner face.
w_pView for the conserved variables on the outer face, which shall be set by this function.

◆ apply_slip_wall_boundary()

template<int dim, typename number >
template<typename DofReadView , typename DofWriteView >
void MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::apply_slip_wall_boundary ( DofReadView  w_m,
DofWriteView  w_p,
const dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > &  normal 
) const
private

Apply the slip wall boundary condition by setting the corresponding values in w_p based on the values in w_m and the normal vector normal.

Parameters
w_mView for the conserved variables on the inner face.
w_pView for the conserved variables on the outer face, which shall be set by this function.
normalOuter facing normal vector.

◆ apply_subsonic_outflow_with_fixed_energy_boundary()

template<int dim, typename number >
template<typename DofReadView , typename DofWriteView >
void MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::apply_subsonic_outflow_with_fixed_energy_boundary ( const dealii::types::boundary_id  boundary_id,
const dealii::Point< dim, dealii::VectorizedArray< number > > &  q_point,
DofReadView  w_m,
DofWriteView  w_p 
) const
private

Apply the subsonic outflow boundary condition with fixed energy by setting the corresponding values in w_p based on the values in w_m and the boundary function corresponding to the boundary.

Parameters
boundary_idID of the boundary at which the subsonic outflow with fixed energy boundary condition is applied.
q_pointCoordinates at which the boundary function is evaluated.
w_mView for the conserved variables on the inner face.
w_pView for the conserved variables on the outer face, which shall be set by this function.

◆ apply_subsonic_outflow_with_fixed_pressure_boundary()

template<int dim, typename number >
template<typename DofReadView , typename DofWriteView >
void MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::apply_subsonic_outflow_with_fixed_pressure_boundary ( const dealii::types::boundary_id  boundary_id,
const dealii::Point< dim, dealii::VectorizedArray< number > > &  q_point,
DofReadView  w_m,
DofWriteView  w_p 
) const
private

Apply the subsonic outflow boundary condition with fixed pressure by setting the corresponding values in w_p based on the values in w_m and the boundary function corresponding to the boundary.

Parameters
boundary_idID of the boundary at which the subsonic outflow with fixed pressure boundary condition is applied.
q_pointCoordinates at which the boundary function is evaluated.
w_mView for the conserved variables on the inner face.
w_pView for the conserved variables on the outer face, which shall be set by this function.

◆ get_boundary_face_value_and_gradient()

template<int dim, typename number >
auto MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::get_boundary_face_value_and_gradient ( const dealii::Point< dim, dealii::VectorizedArray< number > > &  q_point,
const dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > &  normal,
dealii::types::boundary_id  boundary_id,
const ConservedVariables w_m,
const ConservedVariablesGradient grad_w_m,
const Material< dim, number > &  material,
bool  is_gas_phase = true 
) const

This function sets the corresponding values on the fictional outer face if the face is located at a boundary.

Parameters
q_pointLocation of the quadrature points at which the values shall be computed.
normalOuter facing normal vector.
boundary_idID of the boundary.
w_mConserved variables on the inner face.
grad_w_mGradient of the conserved variables on the inner face.
materialMaterial class, which contains the material parameters and helper functions for thermodynamic relations.
is_gas_phaseBoolean variable to indicate if the gas phase (default for single-phase case) or the liquid phase is considered.
Returns
Tuple containing the corresponding values on the outer face. The first value being the primary variables, the second the gradient of the primary variables.

◆ get_boundary_type()

template<int dim, typename number >
BoundaryType MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::get_boundary_type ( const dealii::types::boundary_id  boundary_id) const
inline

Get the type of the boundary condition at a specific domain boundary.

Parameters
boundary_idBoundary id of the boundary of interest.
Returns
Type of the boundary condition at the boundary with the passed boundary id.
Exceptions
Exceptionif the boundary with the corresponding boundary id has no boundary condition set.

◆ get_boundary_value()

template<int dim, typename number >
dealii::VectorizedArray< number > MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::get_boundary_value ( dealii::types::boundary_id  boundary_id,
BoundaryType  boundary_condition,
const dealii::Point< dim, dealii::VectorizedArray< number > > &  location,
unsigned  component 
) const

Compute the prescribed boundary value at a specific location on the boundary.

Parameters
boundary_idBoundary id of the boundary of interest.
boundary_conditionType of the boundary condition.
locationCoordinates at which the boundary value is computed.
componentIf the boundary value is a vector, the component of the vector which is returned.
Returns
Prescribed boundary value.

◆ get_jacobian_boundary_face_value_and_gradient()

template<int dim, typename number >
auto MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::get_jacobian_boundary_face_value_and_gradient ( const dealii::Point< dim, dealii::VectorizedArray< number > > &  q_point,
const dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > &  normal,
dealii::types::boundary_id  boundary_id,
const ConservedVariables w_m,
const ConservedVariables delta_w_m,
const ConservedVariablesGradient grad_w_m,
const ConservedVariablesGradient grad_delta_w_m,
number  gamma 
) const

Compute boundary values and gradients, as well as their linearizations for the Jacobian.

This function sets the corresponding values on the fictional outer face if the face is located at a boundary. It returns the values and the gradient of the boundary values as well as their linearized version required when for example computing the Jacobian in an implicit scheme.

Parameters
q_pointCoordinates of the quadrature point.
normalOuter facing normal vector.
boundary_idID of the current boundary.
w_mPrimary variables on the inner face.
delta_w_mChange in the primary variables on the inner face.
grad_w_mGradient of the primary variables on the inner face.
grad_delta_w_mGradient of the change in the primary variables on the inner face.
gammaHeat capacity ratio of the flow field.
Returns
Tuple containing the corresponding values on the outer face. The first value being the primary variables, the second the gradient of the primary variables, the third the change in the primary variables and the fourth the change in the primary variables.

◆ set_boundary_condition()

template<int dim, typename number >
void MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::set_boundary_condition ( BoundaryType  boundary_condition,
std::map< dealii::types::boundary_id, std::shared_ptr< dealii::Function< dim > > >  boundary_condition_function = {} 
)

Set a specific boundary condition and store it internally.

Parameters
boundary_conditionType of the boundary condition.
boundary_condition_functionMap containing the boundary id at which the condition applies and an (optional) function describing the possibly time and space dependent boundary condition.

◆ set_boundary_conditions()

template<int dim, typename number >
void MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::set_boundary_conditions ( const std::shared_ptr< SimulationCaseBase< dim, number > > &  simulation_case,
const std::string &  operation_name 
)
inline

Set the compressible flow boundary conditions.

Set the boundary conditions by internally calling the function set_boundary_condition for the currently implemented boundary types.

Parameters
simulation_casePointer to the considered simulation case class.
operation_nameString for the name of the considered operation.

◆ set_conserved_variables_boundary_value_and_gradient()

template<int dim, typename number >
template<typename DofReadView , typename DofWriteView >
void MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::set_conserved_variables_boundary_value_and_gradient ( const dealii::Point< dim, dealii::VectorizedArray< number > > &  q_point,
const dealii::Tensor< 1, dim, dealii::VectorizedArray< number > > &  normal,
dealii::types::boundary_id  boundary_id,
const DofReadView &  w_m,
const DofWriteView &  w_p 
) const

As above but based on views.

Parameters
q_pointLocation of the quadrature points at which the values shall be computed.
normalOuter facing normal vector.
boundary_idID of the boundary.
w_mView for the conserved variables on the inner face.
w_pView for the conserved variables on the outer face, which shall be set by this function.

◆ set_partial_density_boundary_value_and_gradient()

template<int dim, typename number >
template<int n_species, typename DofReadView , typename DofWriteView >
void MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::set_partial_density_boundary_value_and_gradient ( const dealii::Point< dim, dealii::VectorizedArray< number > > &  q_point,
dealii::types::boundary_id  boundary_id,
const DofReadView &  w_m,
const DofWriteView &  w_p 
) const

This function sets the values of partial density in the case of multi-component flows on the fictional outer face if the face is located at a boundary.

Parameters
q_pointLocation of the quadrature points at which the values shall be computed.
boundary_idID of the boundary.
w_mView for the conserved variables on the inner face.
w_pView for the conserved variables on the outer face, which shall be set by this function.

◆ update_boundary_conditions()

template<int dim, typename number >
void MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::update_boundary_conditions ( number  time)

Update the boundary conditions.

This means if the boundary conditions are time-dependent functions compute and store their values for the given time.

Parameters
timeTime at which the boundary conditions are evaluated.

Member Data Documentation

◆ boundary_type_to_string_map

template<int dim, typename number >
const std::map<BoundaryType, std::string> MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::boundary_type_to_string_map
inlinestatic
Initial value:
= {
{BoundaryType::inflow, "inflow"},
{BoundaryType::subsonic_outflow_fixed_pressure, "outflow_fixed_pressure"},
{BoundaryType::subsonic_outflow_fixed_energy, "outflow_fixed_energy"},
{BoundaryType::slip_wall, "slip_wall"},
{BoundaryType::no_slip_wall, "no_slip_wall"},
{BoundaryType::combined_inflow_no_slip_wall, "combined_inflow_no_slip_wall"},
}

Mapping to translate between the enum used to identify boundary conditions and the corresponding string names used in the simulation case.

◆ combined_inflow_no_slip_wall_boundaries

template<int dim, typename number >
std::map<dealii::types::boundary_id, std::shared_ptr<dealii::Function<dim> > > MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::combined_inflow_no_slip_wall_boundaries
private

◆ inflow_boundaries

template<int dim, typename number >
std::map<dealii::types::boundary_id, std::shared_ptr<dealii::Function<dim> > > MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::inflow_boundaries
private

Maps boundary IDs to the specific boundary functions.

◆ no_slip_adiabatic_wall_boundaries

template<int dim, typename number >
std::set<dealii::types::boundary_id> MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::no_slip_adiabatic_wall_boundaries
private

◆ slip_wall_boundaries

template<int dim, typename number >
std::set<dealii::types::boundary_id> MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::slip_wall_boundaries
private

Sets of boundary IDs.

◆ subsonic_outflow_fixed_energy

template<int dim, typename number >
std::map<dealii::types::boundary_id, std::shared_ptr<dealii::Function<dim> > > MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::subsonic_outflow_fixed_energy
private

◆ subsonic_outflow_fixed_pressure

template<int dim, typename number >
std::map<dealii::types::boundary_id, std::shared_ptr<dealii::Function<dim> > > MeltPoolDG::CompressibleFlow::BoundaryConditions< dim, number >::subsonic_outflow_fixed_pressure
private

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