Loading...
Searching...
No Matches
UnsteadyBB.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ██╗████████╗██╗ ██╗ █████╗ ██████╗ █████╗ ███████╗██╗ ██╗
3 ██║╚══██╔══╝██║ ██║██╔══██╗██╔════╝██╔══██╗ ██╔════╝██║ ██║
4 ██║ ██║ ███████║███████║██║ ███████║█████╗█████╗ ██║ ██║
5 ██║ ██║ ██╔══██║██╔══██║██║ ██╔══██║╚════╝██╔══╝ ╚██╗ ██╔╝
6 ██║ ██║ ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ╚████╔╝
7 ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═══╝
8
9 * In real Time Highly Advanced Computational Applications for Finite Volumes
10 * Copyright (C) 2017 by the ITHACA-FV authors
11-------------------------------------------------------------------------------
12License
13 This file is part of ITHACA-FV
14 ITHACA-FV is free software: you can redistribute it and/or modify
15 it under the terms of the GNU Lesser General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18 ITHACA-FV is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22 You should have received a copy of the GNU Lesser General Public License
23 along with ITHACA-FV. If not, see <http://www.gnu.org/licenses/>.
24Class
25 UnsteadyBB
26Description
27 Reduction class for a Stationary Navier-Stokes problem.
28SourceFiles
29 UnsteadyBB.C
30\*---------------------------------------------------------------------------*/
31
36
37#ifndef UnsteadyBB_H
38#define UnsteadyBB_H
39#include "fvCFD.H"
40#include "singlePhaseTransportModel.H"
41#include "turbulentTransportModel.H"
42#include "pimpleControl.H"
43#include "pisoControl.H"
44#include "fvOptions.H"
45#include "unsteadyNS.H"
46#include <iostream>
47
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51/*---------------------------------------------------------------------------*\
52 Class SteadyBB Declaration
53\*---------------------------------------------------------------------------*/
54
56
60{
61 public:
62 // Constructors
64 UnsteadyBB();
65
67 UnsteadyBB(int argc, char* argv[]);
69
70 // Member Functions
71
73 PtrList<volScalarField> Prghfield;
74
76 PtrList<volScalarField> Tmodes;
77
79 PtrList<volScalarField> Prghmodes;
80
82 PtrList<volScalarField> Tfield;
83
85 PtrList<volScalarField> Tfield_on;
86
88 PtrList<volScalarField> Pfield_on;
89
91 PtrList<volVectorField> Ufield_on;
92
94 PtrList<volScalarField> liftfieldT;
95
97 PtrList<volScalarField> Tomfield;
98
100 PtrList<volScalarField> L_T_modes;
101
102 // Dummy variables to transform simplefoam into a class
103 autoPtr<volScalarField> _UliftBC;
104
106 label NTmodes;
107
110
112 Eigen::MatrixXd H_matrix;
113
115 Eigen::MatrixXd HP_matrix;
116
118 Eigen::MatrixXd Y_matrix;
119
121 List <Eigen::MatrixXd> Q_matrix;
122 Eigen::Tensor<double, 3 > Q_tensor;
123
125 Eigen::MatrixXd W_matrix;
126
128 mutable autoPtr<fvMesh> _mesh;
129
131 autoPtr<volScalarField> _p_rgh;
132
134 autoPtr<volScalarField> _T;
135
137 autoPtr<dimensionedScalar> _beta;
138
140 autoPtr<dimensionedScalar> _TRef;
141
143 autoPtr<dimensionedScalar> _Pr;
144
146 autoPtr<dimensionedScalar> _Prt;
147
149 autoPtr<volScalarField> _alphat;
150
152 autoPtr<volScalarField> _nut;
153
155 autoPtr<volScalarField> _rhok;
156
158 autoPtr<dimensionedScalar> _nu;
159
161 autoPtr<volScalarField> _gh;
162
164 autoPtr<surfaceScalarField> _ghf;
165
166 autoPtr<dimensionedVector> _g;
167
169 autoPtr<dimensionedScalar> _hRef;
170
172 autoPtr<dimensionedScalar> _ghRef;
173
175 autoPtr<volScalarField> _S;
176
179 PtrList<volVectorField> UModesWeighted;
180
182 PtrList<volScalarField> PModesWeighted;
183
185 PtrList<volScalarField> TModesWeighted;
186
188 PtrList<volScalarField> NUTModesWeighted;
189
190 // Functions
192 void truthSolve(List<scalar> mu_now);
193
195 void truthSolve(fileName folder = "./ITHACAOutput/Offline");
196
202 void solvesupremizer(word type = "snapshots");
203
205 void liftSolveT();
206
208 void liftSolve();
209
210 // Wrapped Proj. Methods;
211
212 //--------------------------------------------------------------------------
220 void projectSUP(fileName folder, label NUmodes, label NPmodes, label NTmodes,
221 label NSUPmodes);
222
223 //--------------------------------------------------------------------------
231 void projectPPE(fileName folder, label NUmodes, label NPrghmodes, label NTmodes,
232 label NSUPmodes);
233 //--------------------------------------------------------------------------
242 Eigen::MatrixXd pressure_gradient_term(label NUmodes, label NPrghmodes,
243 label NSUPmodes);
244
245 //--------------------------------------------------------------------------
254 Eigen::MatrixXd diffusive_term_temperature(label NUmodes, label NTmodes,
255 label NSUPmodes);
256 //--------------------------------------------------------------------------
257
266 Eigen::MatrixXd divergence_term(label NUmodes, label NPrghmodes,
267 label NSUPmodes);
268
269 //--------------------------------------------------------------------------
278 List< Eigen::MatrixXd > convective_term_temperature(label NUmodes,
279 label NTmodes, label NSUPmodes);
280
281 //--------------------------------------------------------------------------
290 Eigen::MatrixXd mass_term_temperature(label NUmodes, label NTmodes,
291 label NSUPmodes);
292
293 //--------------------------------------------------------------------------
302 Eigen::MatrixXd buoyant_term(label NUmodes, label NTmodes, label NSUPmodes);
303
304 //--------------------------------------------------------------------------
312 Eigen::MatrixXd buoyant_term_poisson(label NPrghmodes, label NTmodes);
313
314 //--------------------------------------------------------------------------
321 bool checkWrite(Time& timeObject);
322
323 //--------------------------------------------------------------------------
328 void change_viscosity(double mu);
329
330 //--------------------------------------------------------------------------
339 Eigen::Tensor<double, 3 > convective_term_tens_temperature(label NUmodes,
340 label NTmodes, label NSUPmodes);
341};
342
343#endif
344
345
346
347
348
349
350
351
352
353
Implementation of a parametrized full order unsteady Boussinesq problem and preparation of the the ...
Definition UnsteadyBB.H:60
autoPtr< volScalarField > _p_rgh
Shifted Pressure field.
Definition UnsteadyBB.H:131
Eigen::MatrixXd mass_term_temperature(label NUmodes, label NTmodes, label NSUPmodes)
Mass Term Energy Equation.
Eigen::Tensor< double, 3 > convective_term_tens_temperature(label NUmodes, label NTmodes, label NSUPmodes)
Export convective term energy equation as a tensor.
autoPtr< volScalarField > _nut
dimensionedScalar nut;
Definition UnsteadyBB.H:152
void liftSolveT()
Perform a lift solve for temperature.
Definition UnsteadyBB.C:422
void solvesupremizer(word type="snapshots")
solve the supremizer either with the use of the pressure snaphots or the pressure modes
Definition UnsteadyBB.C:281
Eigen::MatrixXd HP_matrix
Buoyancy term - PPE equation.
Definition UnsteadyBB.H:115
Eigen::MatrixXd Y_matrix
Diffusive term - energy equation.
Definition UnsteadyBB.H:118
autoPtr< volScalarField > _UliftBC
Definition UnsteadyBB.H:103
Eigen::MatrixXd diffusive_term_temperature(label NUmodes, label NTmodes, label NSUPmodes)
Diffusive Term Energy Equation.
PtrList< volScalarField > NUTModesWeighted
List of pointers used to form the Weighted nested-POD modes for nut-field.
Definition UnsteadyBB.H:188
Eigen::Tensor< double, 3 > Q_tensor
Definition UnsteadyBB.H:122
PtrList< volScalarField > Prghmodes
List of pointers used to form the shifted pressure modes.
Definition UnsteadyBB.H:79
autoPtr< volScalarField > _T
Temperature field.
Definition UnsteadyBB.H:134
autoPtr< dimensionedScalar > _Prt
dimensionedScalar Prt;
Definition UnsteadyBB.H:146
Eigen::MatrixXd W_matrix
Mass Matrix - energy equation.
Definition UnsteadyBB.H:125
autoPtr< dimensionedScalar > _Pr
dimensionedScalar Pr;
Definition UnsteadyBB.H:143
PtrList< volScalarField > Tomfield
List of pointers used to form the homogeneous velocity snapshots.
Definition UnsteadyBB.H:97
List< Eigen::MatrixXd > convective_term_temperature(label NUmodes, label NTmodes, label NSUPmodes)
Convective Term Energy Equation.
Definition UnsteadyBB.C:991
Eigen::MatrixXd pressure_gradient_term(label NUmodes, label NPrghmodes, label NSUPmodes)
Gradient of pressure.
Definition UnsteadyBB.C:835
PtrList< volScalarField > Prghfield
List of pointers used to form the shifted pressure snapshots matrix.
Definition UnsteadyBB.H:73
Eigen::MatrixXd divergence_term(label NUmodes, label NPrghmodes, label NSUPmodes)
Divergence Term (supremizer approach)
Definition UnsteadyBB.C:873
autoPtr< dimensionedVector > _g
Definition UnsteadyBB.H:166
PtrList< volScalarField > PModesWeighted
List of pointers used to form the Weighted nested-POD modes for pressure field.
Definition UnsteadyBB.H:182
autoPtr< dimensionedScalar > _hRef
dimensionedScalar hRef;
Definition UnsteadyBB.H:169
autoPtr< dimensionedScalar > _nu
dimensionedScalar nu;
Definition UnsteadyBB.H:158
void change_viscosity(double mu)
Function to change the viscosity.
autoPtr< dimensionedScalar > _ghRef
dimensionedScalar ghRef;
Definition UnsteadyBB.H:172
UnsteadyBB()
Null constructor.
Definition UnsteadyBB.C:41
PtrList< volVectorField > Ufield_on
List of pointers used to form the temperature snapshots matrix.
Definition UnsteadyBB.H:91
void projectSUP(fileName folder, label NUmodes, label NPmodes, label NTmodes, label NSUPmodes)
Project using a supremizer approach.
Definition UnsteadyBB.C:488
PtrList< volVectorField > UModesWeighted
Pointers for perfoming Nested-POD Method List of pointers used to form the Weighted nested-POD modes ...
Definition UnsteadyBB.H:179
Eigen::MatrixXd H_matrix
Buoyancy term - momentum equation.
Definition UnsteadyBB.H:112
void liftSolve()
Perform a lift solve for velocity field.
autoPtr< volScalarField > _gh
List of pointers used to form the gravitational acceleration.
Definition UnsteadyBB.H:161
PtrList< volScalarField > Pfield_on
List of pointers used to form the temperature snapshots matrix.
Definition UnsteadyBB.H:88
autoPtr< fvMesh > _mesh
Mesh.
Definition UnsteadyBB.H:128
label NPrghmodes
Number of pressure modes used for the projection.
Definition UnsteadyBB.H:109
Eigen::MatrixXd buoyant_term_poisson(label NPrghmodes, label NTmodes)
Buoyant Term PPE Equation.
Definition UnsteadyBB.C:947
PtrList< volScalarField > L_T_modes
List of pointers containing the lift for temperature and the temperature field.
Definition UnsteadyBB.H:100
List< Eigen::MatrixXd > Q_matrix
Non linear convective term - energy equation.
Definition UnsteadyBB.H:121
autoPtr< dimensionedScalar > _TRef
dimensionedScalar Tref;
Definition UnsteadyBB.H:140
PtrList< volScalarField > Tmodes
List of pointers used to form the temperature modes.
Definition UnsteadyBB.H:76
bool checkWrite(Time &timeObject)
Function to check if the solution must be exported.
Definition UnsteadyBB.C:264
autoPtr< dimensionedScalar > _beta
dimensionedScalar beta;
Definition UnsteadyBB.H:137
autoPtr< volScalarField > _rhok
dimensionedScalar rhok;
Definition UnsteadyBB.H:155
autoPtr< volScalarField > _alphat
dimensionedScalar alphat;
Definition UnsteadyBB.H:149
PtrList< volScalarField > Tfield_on
List of pointers used to form the temperature snapshots matrix.
Definition UnsteadyBB.H:85
PtrList< volScalarField > liftfieldT
List of pointers used to form the list of lifting functions.
Definition UnsteadyBB.H:94
PtrList< volScalarField > TModesWeighted
List of pointers used to form the Weighted nested-POD modes for temperature field.
Definition UnsteadyBB.H:185
Eigen::MatrixXd buoyant_term(label NUmodes, label NTmodes, label NSUPmodes)
Buoyant Term Momentum Equation.
Definition UnsteadyBB.C:906
PtrList< volScalarField > Tfield
List of pointers used to form the temperature snapshots matrix.
Definition UnsteadyBB.H:82
void projectPPE(fileName folder, label NUmodes, label NPrghmodes, label NTmodes, label NSUPmodes)
Project using a PPE approach.
Definition UnsteadyBB.C:652
autoPtr< surfaceScalarField > _ghf
List of pointers used to form the gravitational acceleration.
Definition UnsteadyBB.H:164
autoPtr< volScalarField > _S
Source Term Heat.
Definition UnsteadyBB.H:175
label NTmodes
Number of temperature modes used for the projection.
Definition UnsteadyBB.H:106
Eigen::MatrixXd mu
Row matrix of parameters.
void truthSolve()
Perform a TruthSolve.
label NPmodes
Number of pressure modes used for the projection.
Definition steadyNS.H:143
label NUmodes
Number of velocity modes used for the projection.
Definition steadyNS.H:140
label NSUPmodes
Number of supremizer modes used for the projection.
Definition steadyNS.H:146
Implementation of a parametrized full order unsteady NS problem and preparation of the the reduced ...
Definition unsteadyNS.H:62
Header file of the unsteadyNS class.