Loading...
Searching...
No Matches
ReducedSteadyNSTurbIntrusive.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 ReducedSteadyNSTurbIntrusive
26Description
27 A reduced problem for the stationary turbulent NS equations using fully intrusive approach
28SourceFiles
29 ReducedSteadyNSTurbIntrusive.C
30\*---------------------------------------------------------------------------*/
31
36
37#ifndef ReducedSteadyNSTurbIntrusive_H
38#define ReducedSteadyNSTurbIntrusive_H
39
40#include "fvCFD.H"
41#include "IOmanip.H"
42#include "ReducedProblem.H"
43#include "ReducedSteadyNS.H"
45#include "ITHACAutilities.H"
46#include <Eigen/Dense>
47#include <unsupported/Eigen/NonLinearOptimization>
48#include <unsupported/Eigen/NumericalDiff>
49
52{
53 public:
58 Nphi_u(problem.nModesOnline),
59 N_BC(problem.inletIndex.rows())
60 {}
61
62 int operator()(const Eigen::VectorXd& x, Eigen::VectorXd& fvec) const;
63 int df(const Eigen::VectorXd& x, Eigen::MatrixXd& fjac) const;
64
66 int Nphi_u;
67 int N_BC;
68 scalar nu;
69 Eigen::MatrixXd tauU;
70 Eigen::VectorXd bc;
71};
72
73
74/*---------------------------------------------------------------------------*\
75 Class reducedProblem Declaration
76\*---------------------------------------------------------------------------*/
77
78
80
83{
84 private:
85
86 public:
87 // Constructors
95
97
98
100 PtrList<volScalarField> nutFields;
101
103 PtrList<volScalarField> nutModes;
104
106 PtrList<volScalarField> nutRec;
107
110
113
116
126 void solveOnline(Eigen::MatrixXd velNow);
127
134 void reconstruct(fileName folder = "./ITHACAOutput/online_rec",
135 int printEvery = 1);
136
144 Eigen::MatrixXd setOnlineVelocity(Eigen::MatrixXd vel);
145
146 //--------------------------------------------------------------------------
153 fileName folder);
154
155
156};
157
158// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159
160
161
162#endif
163
164
165
166
167
168
Header file of the ITHACAutilities namespace.
Header file of the reducedProblem class.
Header file of the reducedSteadyNS class.
Header file of the SteadyNSTurbIntrusive class.
Class where it is implemented a reduced problem for the steady turbulent Navier-stokes problem.
int nphiNut
Number of viscosity modes.
PtrList< volScalarField > nutRec
Reconstructed eddy viscosity field.
void reconstructLiftAndDrag(SteadyNSTurbIntrusive &problem, fileName folder)
Method to compute the reduced order forces for same number of modes of velocity and pressure.
Eigen::MatrixXd setOnlineVelocity(Eigen::MatrixXd vel)
Sets the online velocity.
newtonSteadyNSTurbIntrusive newtonObject
Newton Object to solve the nonlinear problem.
PtrList< volScalarField > nutModes
List of POD modes for eddy viscosity.
SteadyNSTurbIntrusive * problem
Pointer to the FOM problem.
void reconstruct(fileName folder="./ITHACAOutput/online_rec", int printEvery=1)
Method to reconstruct the solutions from an online solve with a supremizer stabilisation technique.
PtrList< volScalarField > nutFields
List of snapshots for the solution for eddy viscosity.
Implementation of a parametrized full order steady turbulent Navier Stokes problem and preparation ...
Template object created to solve non linear problems using the Eigen library.
virtual void solveOnline()
Virtual Method to perform and online Solve.
Class where it is implemented a reduced problem for the steady Navier-stokes problem.
Structure to implement a newton object for a stationary NS problem.
newtonSteadyNSTurbIntrusive(int Nx, int Ny, SteadyNSTurbIntrusive &problem)
int operator()(const Eigen::VectorXd &x, Eigen::VectorXd &fvec) const
int df(const Eigen::VectorXd &x, Eigen::MatrixXd &fjac) const