Loading...
Searching...
No Matches
SteadyNSTurb.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 SteadyNSTurb
26Description
27 Reduction class for a Stationary turbulent Navier-Stokes problem.
28SourceFiles
29 SteadyNSTurb.C
30\*---------------------------------------------------------------------------*/
31
36
37#ifndef SteadyNSTurb_H
38#define SteadyNSTurb_H
39#include "fvCFD.H"
40#include "singlePhaseTransportModel.H"
41#include "turbulentTransportModel.H"
42#include "simpleControl.H"
43#include "pisoControl.H"
44#include "fvOptions.H"
45#include "reductionProblem.H"
46#include "ITHACAstream.H"
47#include <iostream>
48#include <datatable.h>
49#include <bspline.h>
50#include <bsplinebuilder.h>
51#include <rbfspline.h>
52#include <spline.h>
53#include <Eigen/Dense>
54#include <unsupported/Eigen/NonLinearOptimization>
55#include <unsupported/Eigen/NumericalDiff>
56// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57
58/*---------------------------------------------------------------------------*\
59 Class SteadyNSturb Declaration
60\*---------------------------------------------------------------------------*/
61
63
66{
67
68
69 public:
70 // Constructors
73 SteadyNSTurb(int argc, char* argv[]);
74
75 // Member Functions
77 PtrList<volScalarField> nutFields;
78
81
83 std::vector<SPLINTER::DataTable*> samples;
84
86 std::vector<SPLINTER::RBFSpline*> rbfSplines;
87
89 Eigen::MatrixXd btMatrix;
90
92 List <Eigen::MatrixXd> ct2Matrix;
93 Eigen::Tensor<double, 3 > ct2Tensor;
94
96 List <Eigen::MatrixXd> ct1Matrix;
97 Eigen::Tensor<double, 3 > ct1Tensor;
98
100 Eigen::Tensor<double, 3 > ct1PPETensor;
101
103 Eigen::Tensor<double, 3 > ct2PPETensor;
104
106 List <Eigen::MatrixXd> cTotalMatrix;
107 Eigen::Tensor<double, 3 > cTotalTensor;
108
110 Eigen::Tensor<double, 3 > cTotalPPETensor;
111
113 Eigen::MatrixXd bTotalMatrix;
114
116 Eigen::MatrixXd coeffL2;
117
119 Eigen::VectorXd nutCoeff;
120
123
126
128 autoPtr<volScalarField> _nut;
129 autoPtr<volScalarField> _nuTilda;
130
131 //--------------------------------------------------------------------------
137 void truthSolve(List<scalar> mu_now);
138
139 //--------------------------------------------------------------------------
148 void projectPPE(fileName folder, label NUmodes, label NPmodes, label NSUPmodes,
149 label nNutModes);
150
151 //--------------------------------------------------------------------------
160 void projectSUP(fileName folder, label NUmodes, label NPmodes, label NSUPmodes,
161 label nNutModes);
162
163 //--------------------------------------------------------------------------
172 Eigen::MatrixXd btTurbulence(label NUmodes, label NSUPmodes);
173
174
175 //--------------------------------------------------------------------------
184 List < Eigen::MatrixXd > turbulenceTerm1(label NUmodes, label NSUPmodes,
185 label nNutModes);
186
187 //--------------------------------------------------------------------------
196 Eigen::Tensor<double, 3 > turbulenceTensor1(label NUmodes,
197 label NSUPmodes, label nNutModes);
198
199 //--------------------------------------------------------------------------
208 List < Eigen::MatrixXd > turbulenceTerm2(label NUmodes, label NSUPmodes,
209 label nNutModes);
210
211 //--------------------------------------------------------------------------
220 Eigen::Tensor<double, 3 > turbulenceTensor2(label NUmodes,
221 label NSUPmodes, label nNutModes);
222
223 //--------------------------------------------------------------------------
233 Eigen::Tensor<double, 3 > turbulencePPETensor1(label NUmodes,
234 label NSUPmodes, label NPmodes, label nNutModes);
235
236 //--------------------------------------------------------------------------
246 Eigen::Tensor<double, 3 > turbulencePPETensor2(label NUmodes,
247 label NSUPmodes, label NPmodes, label nNutModes);
248
249};
250
251#endif
252
253
254
255
256
257
258
259
260
Header file of the ITHACAstream class, it contains the implementation of several methods for input ou...
Implementation of a parametrized full order steady turbulent Navier Stokes problem and preparation ...
Eigen::MatrixXd coeffL2
The matrix of L2 projection coefficients for the eddy viscosity.
Eigen::MatrixXd btMatrix
Turbulent viscosity matrix.
Eigen::Tensor< double, 3 > cTotalPPETensor
Turbulent total viscosity tensor in the PPE equation.
label nNutModes
Number of viscoisty modes used for the projection.
Eigen::MatrixXd bTotalMatrix
Total B Matrix.
std::vector< SPLINTER::RBFSpline * > rbfSplines
Create a RBF splines for interpolation.
Eigen::MatrixXd btTurbulence(label NUmodes, label NSUPmodes)
bt added matrix for the turbulence treatement
autoPtr< volScalarField > _nut
Eddy viscosity field.
std::vector< SPLINTER::DataTable * > samples
Create a samples for interpolation.
List< Eigen::MatrixXd > turbulenceTerm1(label NUmodes, label NSUPmodes, label nNutModes)
ct1 added matrix for the turbulence treatement
PtrList< volScalarField > nutFields
List of snapshots for the solution for eddy viscosity.
List< Eigen::MatrixXd > ct2Matrix
Turbulent viscosity tensor.
List< Eigen::MatrixXd > cTotalMatrix
Total Turbulent tensor.
Eigen::Tensor< double, 3 > ct1PPETensor
Turbulent viscosity tensor in the PPE equation.
autoPtr< volScalarField > _nuTilda
Eigen::Tensor< double, 3 > ct1Tensor
List< Eigen::MatrixXd > ct1Matrix
Turbulent viscosity tensor.
List< Eigen::MatrixXd > turbulenceTerm2(label NUmodes, label NSUPmodes, label nNutModes)
Method to compute one of the turbulence eddy viscosity tensors.
void projectSUP(fileName folder, label NUmodes, label NPmodes, label NSUPmodes, label nNutModes)
Project using a supremizer approach.
Eigen::Tensor< double, 3 > ct2PPETensor
Turbulent viscosity tensor in the PPE equation.
Eigen::Tensor< double, 3 > turbulencePPETensor1(label NUmodes, label NSUPmodes, label NPmodes, label nNutModes)
ct1PPE added tensor for the turbulence treatement in the PPE method
Eigen::Tensor< double, 3 > cTotalTensor
Eigen::Tensor< double, 3 > turbulencePPETensor2(label NUmodes, label NSUPmodes, label NPmodes, label nNutModes)
ct2PPE added tensor for the turbulence treatement in the PPE method
Eigen::Tensor< double, 3 > turbulenceTensor1(label NUmodes, label NSUPmodes, label nNutModes)
ct1 tensor for the turbulence treatement
Eigen::Tensor< double, 3 > ct2Tensor
Eigen::Tensor< double, 3 > turbulenceTensor2(label NUmodes, label NSUPmodes, label nNutModes)
Method to compute one of the turbulence eddy viscosity tensors.
void projectPPE(fileName folder, label NUmodes, label NPmodes, label NSUPmodes, label nNutModes)
Project using a PPE approach.
word viscCoeff
The way to compute the eddy viscosity snapshots.
Eigen::VectorXd nutCoeff
The vector of L2 projection coefficients for the eddy viscosity snapshot.
volScalarModes nutModes
List of POD modes for eddy viscosity.
void truthSolve()
Perform a TruthSolve.
Implementation of a parametrized full order steady NS problem and preparation of the the reduced ma...
Definition steadyNS.H:70
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
Header file of the reductionProblem class.