ExaDG
Toggle main menu visibility
Loading...
Searching...
No Matches
include
exadg
incompressible_navier_stokes
postprocessor
output_generator.h
1
/* ______________________________________________________________________
2
*
3
* ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4
*
5
* Copyright (C) 2021 by the ExaDG authors
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <https://www.gnu.org/licenses/>.
19
* ______________________________________________________________________
20
*/
21
22
#ifndef EXADG_INCOMPRESSIBLE_NAVIER_STOKES_POSTPROCESSOR_OUTPUT_GENERATOR_H_
23
#define EXADG_INCOMPRESSIBLE_NAVIER_STOKES_POSTPROCESSOR_OUTPUT_GENERATOR_H_
24
25
// ExaDG
26
#include <exadg/postprocessor/output_data_base.h>
27
#include <exadg/postprocessor/solution_field.h>
28
#include <exadg/postprocessor/time_control.h>
29
30
namespace
ExaDG
31
{
32
namespace
IncNS
33
{
34
struct
OutputData :
public
OutputDataBase
35
{
36
OutputData()
37
: write_vorticity(
false
),
38
write_divergence(
false
),
39
write_shear_rate(
false
),
40
write_viscosity(
false
),
41
write_velocity_magnitude(
false
),
42
write_vorticity_magnitude(
false
),
43
write_streamfunction(
false
),
44
write_q_criterion(
false
),
45
mean_velocity(
TimeControlData
()),
46
write_cfl(
false
)
47
{
48
}
49
50
void
51
print(dealii::ConditionalOStream & pcout,
bool
unsteady)
52
{
53
OutputDataBase::print(pcout, unsteady);
54
55
print_parameter(pcout,
"Write vorticity"
, write_vorticity);
56
print_parameter(pcout,
"Write divergence"
, write_divergence);
57
print_parameter(pcout,
"Write shear rate"
, write_shear_rate);
58
print_parameter(pcout,
"Write viscosity"
, write_viscosity);
59
print_parameter(pcout,
"Write velocity magnitude"
, write_velocity_magnitude);
60
print_parameter(pcout,
"Write vorticity magnitude"
, write_vorticity_magnitude);
61
print_parameter(pcout,
"Write streamfunction"
, write_streamfunction);
62
print_parameter(pcout,
"Write Q criterion"
, write_q_criterion);
63
print_parameter(pcout,
"Write CFL number"
, write_cfl);
64
65
mean_velocity.print(pcout, unsteady);
66
}
67
68
// write vorticity of velocity field
69
bool
write_vorticity;
70
71
// write divergence of velocity field
72
bool
write_divergence;
73
74
// write shear rate of velocity field
75
bool
write_shear_rate;
76
77
// write viscosity depending on viscosity field
78
bool
write_viscosity;
79
80
// write velocity magnitude
81
bool
write_velocity_magnitude;
82
83
// write vorticity magnitude
84
bool
write_vorticity_magnitude;
85
86
// Calculate streamfunction in order to visualize streamlines!
87
// Note that this option is only available in 2D!
88
// To calculate the streamfunction Psi, a Poisson equation is solved
89
// with homogeneous Dirichlet BC's. Accordingly, this approach can only be
90
// used for flow problems where the whole boundary is one streamline, e.g.,
91
// cavity-type flow problems where the velocity is tangential to the boundary
92
// on one part of the boundary and 0 (no-slip) on the rest of the boundary.
93
bool
write_streamfunction;
94
95
// write Q criterion
96
bool
write_q_criterion;
97
98
// Average velocity field over time for statistically steady, turbulent
99
// flow problems in order to visualize the time-averaged velocity field.
100
// Of course, this module can also be used for statistically unsteady problems,
101
// but in this case the mean velocity field is probably not meaningful.
102
TimeControlData
mean_velocity;
103
104
105
// write cfl
106
bool
write_cfl;
107
};
108
109
template
<
int
dim,
typename
Number>
110
class
SpatialOperatorBase
;
111
112
template
<
int
dim,
typename
Number>
113
class
OutputGenerator
114
{
115
public
:
116
typedef
dealii::LinearAlgebra::distributed::Vector<Number> VectorType;
117
118
OutputGenerator(MPI_Comm
const
& comm);
119
120
void
121
setup(dealii::DoFHandler<dim>
const
& dof_handler_velocity_in,
122
dealii::DoFHandler<dim>
const
& dof_handler_pressure_in,
123
dealii::Mapping<dim>
const
& mapping_in,
124
OutputData
const
& output_data_in);
125
126
void
127
evaluate(
128
VectorType
const
& velocity,
129
VectorType
const
& pressure,
130
std::vector<dealii::ObserverPointer<
SolutionField<dim, Number>
>>
const
& additional_fields,
131
double
const
time,
132
bool
const
unsteady)
const
;
133
134
TimeControl
time_control;
135
136
private
:
137
MPI_Comm
const
mpi_comm;
138
139
OutputData
output_data;
140
141
dealii::ObserverPointer<dealii::DoFHandler<dim>
const
> dof_handler_velocity;
142
dealii::ObserverPointer<dealii::DoFHandler<dim>
const
> dof_handler_pressure;
143
dealii::ObserverPointer<dealii::Mapping<dim>
const
> mapping;
144
};
145
146
}
// namespace IncNS
147
}
// namespace ExaDG
148
149
#endif
/* EXADG_INCOMPRESSIBLE_NAVIER_STOKES_POSTPROCESSOR_OUTPUT_GENERATOR_H_ */
ExaDG::IncNS::SpatialOperatorBase
Definition
spatial_operator_base.h:68
ExaDG::SolutionField
Definition
solution_field.h:40
ExaDG::TimeControl
Definition
time_control.h:64
ExaDG
Definition
driver.cpp:33
ExaDG::IncNS::OutputData
Definition
output_generator.h:35
ExaDG::TimeControlData
Definition
time_control.h:40
Generated by
1.17.0