1 #include "physics_post_processor.h" 2 #include "physics/physics_factory.h" 3 #include "physics/model_factory.h" 6 namespace Postprocess {
13 const PDE_enum pde_type = parameters_input->
pde_type;
15 const Model_enum model_type = parameters_input->
model_type;
19 if (pde_type == PDE_enum::advection) {
20 return std::make_unique< PhysicsPostprocessor<dim,1> >(parameters_input);
21 }
else if (pde_type == PDE_enum::advection_vector) {
22 return std::make_unique< PhysicsPostprocessor<dim,2> >(parameters_input);
23 }
else if (pde_type == PDE_enum::diffusion) {
24 return std::make_unique< PhysicsPostprocessor<dim,1> >(parameters_input);
25 }
else if (pde_type == PDE_enum::convection_diffusion) {
26 return std::make_unique< PhysicsPostprocessor<dim,1> >(parameters_input);
27 }
else if (pde_type == PDE_enum::burgers_inviscid) {
28 return std::make_unique< PhysicsPostprocessor<dim,dim> >(parameters_input);
29 }
else if (pde_type == PDE_enum::burgers_viscous) {
30 return std::make_unique< PhysicsPostprocessor<dim,dim> >(parameters_input);
31 }
else if (pde_type == PDE_enum::burgers_rewienski) {
32 return std::make_unique< PhysicsPostprocessor<dim,dim> >(parameters_input);
33 }
else if (pde_type == PDE_enum::euler) {
34 return std::make_unique< PhysicsPostprocessor<dim,dim+2> >(parameters_input);
35 }
else if (pde_type == PDE_enum::navier_stokes) {
36 return std::make_unique< PhysicsPostprocessor<dim,dim+2> >(parameters_input);
37 }
else if ((pde_type == PDE_enum::physics_model) && (model_type == Model_enum::reynolds_averaged_navier_stokes) && (rans_model_type == RANSModel_enum::SA_negative)) {
38 return std::make_unique< PhysicsPostprocessor<dim,dim+3> >(parameters_input);
41 else if ((pde_type == PDE_enum::physics_model) && (model_type == Model_enum::large_eddy_simulation)) {
42 return std::make_unique< PhysicsPostprocessor<dim,dim+2> >(parameters_input);
46 std::cout <<
"Invalid PDE when creating post-processor" << std::endl;
54 : model(Physics::ModelFactory<dim,nstate,double>::create_Model(parameters_input))
55 , physics(Physics::PhysicsFactory<dim,nstate,double>::create_Physics(parameters_input,model))
59 ::evaluate_vector_field (
const dealii::DataPostprocessorInputs::Vector<dim> &inputs, std::vector<dealii::Vector<double>> &computed_quantities)
const 61 const unsigned int n_quadrature_points = inputs.solution_values.size();
62 Assert (computed_quantities.size() == n_quadrature_points, dealii::ExcInternalError());
63 Assert (inputs.solution_values[0].size() == nstate, dealii::ExcInternalError());
64 for (
unsigned int q=0; q<n_quadrature_points; ++q)
66 computed_quantities[q] = this->physics->post_compute_derived_quantities_vector(
67 inputs.solution_values[q],
68 inputs.solution_gradients[q],
69 inputs.solution_hessians[q],
71 inputs.evaluation_points[q]);
76 ::evaluate_scalar_field (
const dealii::DataPostprocessorInputs::Scalar<dim> &inputs, std::vector<dealii::Vector<double>> &computed_quantities)
const 78 const unsigned int n_quadrature_points = inputs.solution_values.size();
79 Assert (computed_quantities.size() == n_quadrature_points, dealii::ExcInternalError());
80 for (
unsigned int q=0; q<n_quadrature_points; ++q)
82 computed_quantities[q] = this->physics->post_compute_derived_quantities_scalar(
83 inputs.solution_values[q],
84 inputs.solution_gradients[q],
85 inputs.solution_hessians[q],
87 inputs.evaluation_points[q]);
92 template <
int dim,
int nstate>
95 return this->physics->post_get_names();
97 template <
int dim,
int nstate>
98 std::vector<dealii::DataComponentInterpretation::DataComponentInterpretation>
101 return this->physics->post_get_data_component_interpretation();
103 template <
int dim,
int nstate>
106 return this->physics->post_get_needed_update_flags();
PartialDifferentialEquation pde_type
Store the PDE type to be solved.
virtual std::vector< dealii::DataComponentInterpretation::DataComponentInterpretation > get_data_component_interpretation() const override
Queries the Physics for the type (scalar/vector) of output data variables.
Postprocessor to output solution and other values computed by associated physics. ...
virtual dealii::UpdateFlags get_needed_update_flags() const override
Queries the Physics for the required update flags to evaluate output data.
PartialDifferentialEquation
Possible Partial Differential Equations to solve.
Files for the baseline physics.
ModelType
Types of models available.
Main parameter class that contains the various other sub-parameter classes.
virtual void evaluate_vector_field(const dealii::DataPostprocessorInputs::Vector< dim > &inputs, std::vector< dealii::Vector< double >> &computed_quantities) const override
Queries the Physics to output data of a vector-valued problem.
virtual void evaluate_scalar_field(const dealii::DataPostprocessorInputs::Scalar< dim > &inputs, std::vector< dealii::Vector< double >> &computed_quantities) const override
Queries the Physics to output data of a scalar-valued problem.
virtual std::vector< std::string > get_names() const override
Queries the Physics for the names of output data variables.
ReynoldsAveragedNavierStokesModel
Types of Reynolds-averaged Navier-Stokes (RANS) models that can be used.
static std::unique_ptr< dealii::DataPostprocessor< dim > > create_Postprocessor(const Parameters::AllParameters *const parameters_input)
Create the post-processor with the correct template parameters.
ReynoldsAveragedNavierStokesModel RANS_model_type
Store the Reynolds-averaged Navier-Stokes (RANS) model type.
PhysicsPostprocessor(const Parameters::AllParameters *const parameters_input)
Constructor.
ModelType model_type
Store the model type.
PhysicsModelParam physics_model_param
Contains parameters for Physics Model.