include/meltpooldg/compressible_flow/dg_operation.hpp Source File

Developer Documentation: include/meltpooldg/compressible_flow/dg_operation.hpp Source File
Developer Documentation
dg_operation.hpp
Go to the documentation of this file.
1
17#pragma once
18
19#include <deal.II/base/function.h>
20
21#include <deal.II/lac/la_parallel_vector.h>
22
32
33#include <memory>
34
36{
40 template <int dim, typename number, int n_species = 1>
42 {
43 public:
44 using VectorType = dealii::LinearAlgebra::distributed::Vector<number>;
45
59 explicit DGOperation(const ScratchData<dim, dim, number> &scratch_data,
60 const OperationData<number> &flow_data,
61 const MaterialPhaseData<number> &material_data_in,
62 unsigned int flow_dof_idx = 0,
63 unsigned int flow_quad_idx = 0);
64
70 void
71 reinit();
72
79 void
80 solve(const number current_time, const number time_step);
81
87 void
88 distribute_dofs(dealii::DoFHandler<dim> &dof_handler) const;
89
99 void
100 set_boundary_conditions(const std::shared_ptr<SimulationCaseBase<dim, number>> &simulation_case,
101 const std::string &operation_name);
102
110 void
111 set_body_force(std::unique_ptr<dealii::Function<dim>> body_force_in);
112
113 void
115 std::shared_ptr<ExternalFlowForce<dim, number, n_species>> external_force_residuum,
116 std::shared_ptr<ExternalFlowForceJacobian<dim, number, n_species>> external_force_jacobian);
117
128 number
129 compute_time_step_size(bool do_print = false) const;
130
136 void
137 set_initial_condition(const dealii::Function<dim> &function);
138
144 void
146
150 const VectorType &
151 get_solution() const;
152
156 VectorType &
157 get_solution();
158
162 const dealii::DoFHandler<dim> &
163 get_dof_handler() const;
164
165 private:
168
170 std::unique_ptr<DGOperatorBase<dim, number, n_species>> comp_flow_operator;
171
174
180 number
182
188 number
190
196 void
198 };
199
200
202 template <int dim, typename number, int n_species>
203 const dealii::LinearAlgebra::distributed::Vector<number> &
205 {
206 return flow_scratch_data.solution_history.get_current_solution();
207 }
208
209 template <int dim, typename number, int n_species>
210 dealii::LinearAlgebra::distributed::Vector<number> &
212 {
213 return flow_scratch_data.solution_history.get_current_solution();
214 }
215
216 template <int dim, typename number, int n_species>
217 const dealii::DoFHandler<dim> &
219 {
220 return flow_scratch_data.scratch_data.get_dof_handler(flow_scratch_data.dof_idx);
221 }
222
223} // namespace MeltPoolDG::CompressibleFlow
Operation that performs a full time step for the compressible Navier-Stokes.
Definition dg_operation.hpp:42
void setup_operator()
Set up the operator to suit the specified time integration scheme.
Definition dg_operation.cpp:326
void solve(const number current_time, const number time_step)
Solves the compressible Navier-Stokes equations for a single time step.
Definition dg_operation.cpp:99
number compute_minimum_density() const
Compute the minimum density currently occurring in the flow field.
Definition dg_operation.cpp:169
void attach_output_vectors(GenericDataOut< dim, number > &data_out) const
Attach the solution to the passed data out object.
Definition dg_operation.cpp:314
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)
Definition dg_operation.cpp:159
number compute_convective_time_step_limit() const
Compute the convective time step limit for the current mesh and flow field.
Definition dg_operation.cpp:207
const dealii::DoFHandler< dim > & get_dof_handler() const
Constant getter function for the DoFHandler.
Definition dg_operation.hpp:218
const VectorType & get_solution() const
Constant getter function for the current solution vector.
Definition dg_operation.hpp:204
void set_initial_condition(const dealii::Function< dim > &function)
Set the solution vector to the passed initial flow field state.
Definition dg_operation.cpp:126
void set_boundary_conditions(const std::shared_ptr< SimulationCaseBase< dim, number > > &simulation_case, const std::string &operation_name)
Set the boundary conditions.
Definition dg_operation.cpp:109
OutputManager< dim, number > output_manager
Object containing the data post processor for the different output options.
Definition dg_operation.hpp:173
dealii::LinearAlgebra::distributed::Vector< number > VectorType
Definition dg_operation.hpp:44
OperationScratchData< dim, number > flow_scratch_data
Scratch data for compressible flows.
Definition dg_operation.hpp:167
void distribute_dofs(dealii::DoFHandler< dim > &dof_handler) const
Distribute the degrees of freedom to the passed dof handler object.
Definition dg_operation.cpp:91
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.
Definition dg_operation.cpp:118
void reinit()
Set up the required internal data structures.
Definition dg_operation.cpp:84
std::unique_ptr< DGOperatorBase< dim, number, n_species > > comp_flow_operator
Compressible flow operator object.
Definition dg_operation.hpp:170
number compute_time_step_size(bool do_print=false) const
Compute the maximum time step size.
Definition dg_operation.cpp:281
A generic utility for managing simulation output data in the MeltPoolDG context.
Definition generic_data_out.hpp:32
Container for shared scratch data between operations/operators.
Definition scratch_data.hpp:61
Base class for managing a simulation case in a parallel computing environment.
Definition simulation_case_base.hpp:44
This file contains various functions that can be used to set and evaluate boundary conditions for the...
Definition boundary_condition_functions.hpp:17
An abstract interface for defining external forces acting on the fluid that must be evaluated and inc...
Definition utils.hpp:117
Collection of material parameters for a specific fluid phase.
Definition material.hpp:119
Collection of parameters required by the compressible Navier-Stokes operator.
Definition operation_data.hpp:35
Scratch data structure for compressible single-phase flow solvers.
Definition operation_scratch_data.hpp:33
Definition output_post_processor.hpp:318