DGOperation< dim, number, n_species > Class Template Reference

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

#include <dg_operation.hpp>

Public Types

using VectorType = dealii::LinearAlgebra::distributed::Vector< number >
 

Public Member Functions

 DGOperation (const ScratchData< dim, dim, number > &scratch_data, const OperationData< number > &flow_data, const MaterialPhaseData< number > &material_data_in, unsigned int flow_dof_idx=0, unsigned int flow_quad_idx=0)
 
void reinit ()
 Set up the required internal data structures.
 
void solve (const number current_time, const number time_step)
 Solves the compressible Navier-Stokes equations for a single time step.
 
void distribute_dofs (dealii::DoFHandler< dim > &dof_handler) const
 Distribute the degrees of freedom to the passed dof handler object.
 
void set_boundary_conditions (const std::shared_ptr< SimulationCaseBase< dim, number > > &simulation_case, const std::string &operation_name)
 Set the boundary conditions.
 
void set_body_force (std::unique_ptr< dealii::Function< dim > > body_force_in)
 Set a body force, e.g. gravity, specified by the passed function.
 
void add_external_force (std::shared_ptr< ExternalFlowForce< dim, number, n_species > > external_force_residuum, std::shared_ptr< ExternalFlowForceJacobian< dim, number, n_species > > external_force_jacobian)
 
number compute_time_step_size (bool do_print=false) const
 Compute the maximum time step size.
 
void set_initial_condition (const dealii::Function< dim > &function)
 Set the solution vector to the passed initial flow field state.
 
void attach_output_vectors (GenericDataOut< dim, number > &data_out) const
 Attach the solution to the passed data out object.
 
const VectorTypeget_solution () const
 Constant getter function for the current solution vector.
 
VectorTypeget_solution ()
 Getter function for the current solution vector.
 
const dealii::DoFHandler< dim > & get_dof_handler () const
 Constant getter function for the DoFHandler.
 

Private Member Functions

number compute_convective_time_step_limit () const
 Compute the convective time step limit for the current mesh and flow field.
 
number compute_minimum_density () const
 Compute the minimum density currently occurring in the flow field.
 
void setup_time_integrator ()
 

Static Private Member Functions

static std::variant< DGOperatorExplicit< dim, number, n_species >, DGOperatorImplicit< dim, number >, DGOperatorImplicitExplicit< dim, number > > setup_operator (OperationScratchData< dim, number > &flow_scratch_data)
 

Private Attributes

OperationScratchData< dim, number > flow_scratch_data
 Scratch data for compressible flows.
 
std::unique_ptr< TimeIntegration::TimeIntegratorBase< number > > time_integrator
 
std::variant< DGOperatorExplicit< dim, number, n_species >, DGOperatorImplicit< dim, number >, DGOperatorImplicitExplicit< dim, number > > flow_operator
 
OutputManager< dim, number > output_manager
 Object containing the data post processor for the different output options.
 

Detailed Description

template<int dim, typename number, int n_species = 1>
class MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >

This operation solves, i.e., perform a full time step for the compressible Navier-Stokes equations, comprising the primary variables

  • density (ρ)
  • momentum (ρ u)
  • volume-specific energy (ρ E)

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

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.

Member Typedef Documentation

◆ VectorType

template<int dim, typename number , int n_species = 1>
using MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::VectorType = dealii::LinearAlgebra::distributed::Vector<number>

Constructor & Destructor Documentation

◆ DGOperation()

template<int dim, typename number , int n_species>
MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::DGOperation ( const ScratchData< dim, dim, number > &  scratch_data,
const OperationData< number > &  flow_data,
const MaterialPhaseData< number > &  material_data_in,
unsigned int  flow_dof_idx = 0,
unsigned int  flow_quad_idx = 0 
)
explicit

Initializes all internal data structures required to simulate compressible Navier-Stokes flows.

Parameters
scratch_dataReference to the used ScratchData object.
flow_dataReference to the compressible flow data struct used.
material_data_inReference to the material data struct.
flow_dof_idxIndex of the used dof handler in scratch_data_in.
flow_quad_idxIndex of the used quadrature object in scratch_data_in.

Member Function Documentation

◆ add_external_force()

template<int dim, typename number , int n_species>
void MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::add_external_force ( std::shared_ptr< ExternalFlowForce< dim, number, n_species > >  external_force_residuum,
std::shared_ptr< ExternalFlowForceJacobian< dim, number, n_species > >  external_force_jacobian 
)

Adds an external force to the right-hand side of the governing equations. The external force can be specified by providing a pointer to an object implementing the external flow force. To see what is expected from the interface of the external flow force, please refer to the ExternalFlowForce and ExternalFlowForceJacobian classes.

Independent of the time integration scheme, the external force residuum must be provided. If the time integration scheme is implicit or implicit-explicit, the external force jacobian must also be provided. In the case of an explicit time integration scheme, the external force jacobian is not required and can be set to nullptr.

Parameters
external_force_residuumPointer to an object implementing the external force residuum, i.e., the contribution of the external force to the right-hand side of the compressible flow governing equations.
external_force_jacobianPointer to an object implementing the external force jacobian, i.e., the contribution of the external force to the jacobian of the compressible flow governing equations. This parameter can be set to nullptr if the time integration scheme is explicit.

◆ attach_output_vectors()

template<int dim, typename number , int n_species>
void MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::attach_output_vectors ( GenericDataOut< dim, number > &  data_out) const

Attach the solution to the passed data out object.

Parameters
data_outObject to which the solution vector is attached.

◆ compute_convective_time_step_limit()

template<int dim, typename number , int n_species>
number MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::compute_convective_time_step_limit ( ) const
private

Compute the convective time step limit for the current mesh and flow field.

Returns
Maximum convective time step size.

◆ compute_minimum_density()

template<int dim, typename number , int n_species>
number MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::compute_minimum_density ( ) const
private

Compute the minimum density currently occurring in the flow field.

Returns
Minimum density.

◆ compute_time_step_size()

template<int dim, typename number , int n_species>
number MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::compute_time_step_size ( bool  do_print = false) const

Compute the maximum time step size.

The maximum time step size arises from the convective and viscous time step limits. Optionally, it is printed to the console.

Parameters
do_printIf true, the time step limit is printed to the console.
Returns
The computed maximum time step size.

◆ distribute_dofs()

template<int dim, typename number , int n_species = 1>
void MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::distribute_dofs ( dealii::DoFHandler< dim > &  dof_handler) const

Distribute the degrees of freedom to the passed dof handler object.

Parameters
dof_handlerDof handler object used for the compressible flow solver.

◆ get_dof_handler()

template<int dim, typename number , int n_species>
const dealii::DoFHandler< dim > & MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::get_dof_handler ( ) const

Constant getter function for the DoFHandler.

◆ get_solution() [1/2]

template<int dim, typename number , int n_species>
dealii::LinearAlgebra::distributed::Vector< number > & MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::get_solution ( )

Getter function for the current solution vector.

◆ get_solution() [2/2]

template<int dim, typename number , int n_species>
const dealii::LinearAlgebra::distributed::Vector< number > & MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::get_solution ( ) const

Constant getter function for the current solution vector.

inlined functions

◆ reinit()

template<int dim, typename number , int n_species>
void MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::reinit ( )

Set up the required internal data structures.

After a call to this function the solve() function of the class can be utilized.

◆ set_body_force()

template<int dim, typename number , int n_species = 1>
void MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::set_body_force ( std::unique_ptr< dealii::Function< dim > >  body_force_in)

Set a body force, e.g. gravity, specified by the passed function.

Parameters
body_force_inFunction specifying the body force.
Note
The function simply passes the parameters to the corresponding operator function.

◆ set_boundary_conditions()

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

Set the boundary conditions.

Parameters
simulation_casedealii::Pointer to the considered simulation case class.
operation_nameString for the name of the considered operation.
Note
The function simply passes the parameters to the set_boundary_conditions function in the CompressibleFlowBoundaryConditions class.

◆ set_initial_condition()

template<int dim, typename number , int n_species>
void MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::set_initial_condition ( const dealii::Function< dim > &  function)

Set the solution vector to the passed initial flow field state.

Parameters
functionInitial condition of the flow field.

◆ setup_operator()

template<int dim, typename number , int n_species>
std::variant< DGOperatorExplicit< dim, number, n_species >, DGOperatorImplicit< dim, number >, DGOperatorImplicitExplicit< dim, number > > MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::setup_operator ( OperationScratchData< dim, number > &  flow_scratch_data)
staticprivate

Set up the operator based on the time integration scheme.

Parameters
flow_scratch_dataScratch data for the compressible flow.
Returns
The initialized operator.

◆ setup_time_integrator()

template<int dim, typename number , int n_species>
void MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::setup_time_integrator ( )
private

Set up the time integration schemes as requested by the input data.

◆ solve()

template<int dim, typename number , int n_species>
void MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::solve ( const number  current_time,
const number  time_step 
)

Solves the compressible Navier-Stokes equations for a single time step.

Parameters
current_timeCurrent time at t^n.
time_stepCurrent time step size.

Member Data Documentation

◆ flow_operator

template<int dim, typename number , int n_species = 1>
std::variant<DGOperatorExplicit<dim, number, n_species>, DGOperatorImplicit<dim, number>, DGOperatorImplicitExplicit<dim, number> > MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::flow_operator
private

The flow operator used for the time integration of the compressible flow equations. This includes explicit, implicit, and implicit-explicit flow operators. A variant is used here in order to allow for the use of different flow operators depending on the time integration scheme.

◆ flow_scratch_data

template<int dim, typename number , int n_species = 1>
OperationScratchData<dim, number> MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::flow_scratch_data
private

Scratch data for compressible flows.

◆ output_manager

template<int dim, typename number , int n_species = 1>
OutputManager<dim, number> MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::output_manager
private

Object containing the data post processor for the different output options.

◆ time_integrator

template<int dim, typename number , int n_species = 1>
std::unique_ptr<TimeIntegration::TimeIntegratorBase<number> > MeltPoolDG::CompressibleFlow::DGOperation< dim, number, n_species >::time_integrator
private

A pointer to the time integrator used for the time integration of the compressible flow equations. This includes explicit, implicit, and implicit-explicit time integration schemes.


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