Files | |
| 11UnsteadyBBOpen.C | |
The problem consists of an unsteady Buoyant Boussinesq (BB) problem for open flows where pressure cannot be neglected. The setup involves parameterized temperature and velocity boundary conditions in an open flow configuration, demonstrating ROM for buoyant flows with pressure effects.
This is the description of the code for tutorial 11.
First of all let's have a look into the header files which have to be included, indicating what they are responsible for:
<UnsteadyBB.H> is the base class for unsteady Buoyant Boussinesq problems. <ITHACAPOD.H> is for the computation of the POD modes. <ReducedUnsteadyBB.H> is for the reduced-order unsteady BB problem. <ITHACAstream.H> is responsible for reading and exporting the fields and other sorts of data.
Additional standard libraries: Chrono to compute execution times, math.h for mathematical functions, iomanip for output formatting.
We define the tutorial11 class as a child of the UnsteadyBB class. The constructor is defined with members that are the fields required to be manipulated during the resolution of the full order problem. Such fields are also initialized with the same initial conditions in the solver.
Inside the tutorial11 class we define the offlineSolve method with parameterized boundary conditions. If the offline solve has been previously performed then the method just reads the existing snapshots including pressure fields. If not, it loops over the parameter samples and boundary condition parameters to perform the full-order simulations.
The other functions (onlineSolveFull, onlineSolveRead, liftSolveT) are introduced to solve the FOM problem for the novel online parameters, to read the online pre-saved solutions, and to compute the lifting function, respectively. For more details on these functions, refer to the documentation of tutorial 10.
The main function sets up the problem parameters, performs the offline phase including supremizer stabilization, computes POD modes for velocity, pressure, p_rgh, and temperature, evaluates projection errors, and solves the online reduced problem.
First, the tutorial object is constructed and parameters are configured. Note that the parameters are read from the files par_offline_BC (for the offline stage), and par_online_BC (for online parameters).
The offline solve, lift functions, POD modes, and supremizer are computed:
Projection errors are then calculated, reduced matrices are obtained, and online solutions are performed with error evaluation against full-order solutions. Everything repeats the same procedure of tutorial 10, for more details refer to the documentation of tutorial 10.
This completes the tutorial for open buoyant flows with pressure effects.
The plain code is available here.
1.16.1