MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
fvstructuredbndrycnd3d.h
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
7#ifndef STRUCTUREDBNDRYCND3D
8#define STRUCTUREDBNDRYCND3D
9
11#include "fvstructuredsolver.h"
13
15
19template <MBool isRans>
21 public:
23
25
28
31
32 // void applyDirichletNeumannBC();
34 void updateSpongeLayer();
37
38
39 inline MFloat dist(MFloat* a, MFloat* b);
40
41 void bc1000(MInt); // wall no slip
42 void bc1003(MInt); // isothermal no slip wall
43 void bc1004(MInt); // moving adiabatic wall
44 void bc1006(MInt); // moving isothermal wall
45 void bc1007(MInt); // oscillating wall
46
47 void bc2001(MInt); // subsonic inflow
48 void bc2002(MInt); // supersonic inflow
49 void bc2003(MInt); // simple subsonic in/outflow
50 void bc2004(MInt); // subsonic outflow
51 void bc2005(MInt); // supersonic outflow
52 void bc2009(MInt); // supersonic outflow after shock
53 void bc2012(MInt){}; // characteristic inflow
54 void bc2013(MInt){}; // characteristic outflow
55 void bc2014(MInt); // subsonic rotational inflow
56 void bc2020(MInt); // poiseulle flow inflow
57 void bc2097(MInt); // plenum inflow
58 void bc2099(MInt); // subsonic inflow (u=(y/d)^(1/7))
59 void bc2222(MInt); // subsonic RANS outflow bc //junoh
60 void bc2402(MInt); // channel flow
61 void bc2500(MInt); // Rescaling: recycle station
62 void bc2501(MInt); // Rescaling: inlet station
63 void bc2510(MInt); // Rescaling: recycle station RANS
64 void bc2511(MInt); // Rescaling: inlet station RANS
65 void bc2600(MInt); // Prescribing profile
66 void bc2601(MInt); // Prescribing profile
67 void bc2700(MInt); // mode inflow
68 void bc2730(MInt); // fsc outflow
69 void bc2888(MInt); // fsc inflow
70 void bc2999(MInt); // blasius inflow
71 void bc2900(MInt); // Jet Inlet Freund
72
73 void bc3000(MInt); // symmetry
74 void bc3001(MInt); // streamline symmetry
75
76 void bc6000(MInt); // communication
77 virtual void bc6002(MInt) override; // Fluid-porous interface
78 void bc7909(MInt); // synthetic turbulence generation
79
80 void initBc1000(MInt); // wall no slip
81 void initBc1003(MInt); // isothermal no slip wall
82 void initBc1004(MInt); // moving adiabatic wall
83 void initBc1006(MInt); // moving isothermal wall
84 void initBc1007(MInt); // oscillating wall
85 void initBc2001(MInt){}; // subsonic inflow
86 void initBc2002(MInt){}; // supersonic inflow
87 void initBc2003(MInt){}; // simple subsonic in/outflow
88 void initBc2004(MInt); // subsonic outflow
89 void initBc2005(MInt){}; // supersonic outflow
90 void initBc2009(MInt); // supersonic outflow after shock
91 void initBc2012(MInt){}; // characteristic inflow
92 void initBc2013(MInt){}; // characteristic outflow
93 void initBc2014(MInt){}; // subsonic rotational bc
94 void initBc2020(MInt){}; // poiseulle flow
95 void initBc2222(MInt);
96 void initBc2097(MInt); // plenum inflow
97 void initBc2099(MInt){}; // subsonic inflow (u=(y/d)^(1/7))
98 void initBc2402(MInt); // channel flow
99 void initBc2500(MInt); // Rescaling: recycle station
100 void initBc2501(MInt){}; // Rescaling: inlet station
101 void initBc2600(MInt); // Prescribing profile
102 void initBc2601(MInt); // Prescribing profile
103 void initBc2700(MInt); // mode inflow
104 void initBc2900(MInt){}; // Jet Inlet Freund
105 void initBc3000(MInt){}; // symmetry
106 void initBc3001(MInt){}; // streamline symmetry
107 void initBc6000(MInt){}; // communication
108 void initBc6002(MInt) override{}; // Fluid-porous interface
109 void initBc7909(MInt); // synthetic turbulence generation
110
111 // empty BC if BC==-1
112 void bc9999(MInt){};
114
115 inline void crossProduct(MFloat*, MFloat*, MFloat*);
116 MInt cellIndex(MInt i, MInt j, MInt k);
117 MInt cellIndexBC(MInt i, MInt j, MInt k); // For STG, only the first three rows are used
118
119 virtual void computeFrictionPressureCoef(MBool computePower) override {
120 if(computePower)
121 computeFrictionPressureCoef_<true>();
122 else
123 computeFrictionPressureCoef_<false>();
124 }
125 template <MBool computePower>
126 void computeFrictionPressureCoef_(const MBool auxDataWindows = false);
127 void computeMomentCoef();
128
129 protected:
137
138 // periodic
140
141
142 // 7909 synthetic turbulence generation
143 // MFloat** m_stgEddies;
147 MFloat* m_stgVbEnd = nullptr;
148 MFloat* m_stgMaxVel = nullptr;
150
151 // 2700 mode bc
153 MFloat* m_modeAmp = nullptr; // for mode inflow
155 MInt* m_modeType = nullptr;
156 MFloat* m_modePhi = nullptr;
158 MInt* m_nmbrOfModes = nullptr;
160 MFloat* m_modeOmega = nullptr;
162 MFloat** m_modeK = nullptr;
163
164 // 2601
171
172 // 2500 rescaling bc
174
175 // routine to determine point ID from given cell
176 inline MInt getPointIdFromCell(MInt i, MInt j, MInt k);
177 inline MInt pointIndex(MInt i, MInt j, MInt k);
178 // routine to determine point ID from given point
179 inline MInt getPointIdfromPoint(MInt origin, MInt incI, MInt incJ, MInt incK);
180 inline MFloat pressure(MInt cellId);
181 inline MFloat pressure(MInt i, MInt j, MInt k);
182 inline MFloat temperature(MInt cellId);
183 inline MInt getReverseCellId(MInt i, MInt j, MInt k, MInt face);
184 inline MInt getExtrNghbrId(MInt cellId, MInt face);
185 inline std::pair<MInt, MInt> getMirrorCellIdPair(MInt i, MInt j, MInt k, MInt face);
186
187 static constexpr MInt m_reverseCellIdDim[18] = {-1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1};
188
189 static constexpr MInt m_reverseCellIdGC[18] = {1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0};
190 static constexpr const MInt nDim = 3;
191};
192
193#endif
3D structured solver class
Base class of the structured solver.
Class for the 3D stuctured boundary conditions.
void initBc2500(MInt)
Rescaling inflow.
void initBc7909(MInt)
Synthetic Turbulence Generation.
void bc2730(MInt)
Simple outflow with pressure gradient for FSC boundary layer.
void bc1006(MInt)
Moving rigid isothermal wall functions.
void bc1004(MInt)
Moving rigid wall functions.
void initBc2004(MInt)
Initialize with standard pressure extrapolation at inflow or prescribe p_inf at outflow.
void initBc2009(MInt)
Characteristic boundary condition supersonic after shock.
void bc2097(MInt)
Subsonic Inflow for a plenum.
virtual void bc6002(MInt) override
void bc2601(MInt)
Prescribe given profile BC.
void setRotationalBCProperties()
void bc2999(MInt)
Blasius bl inflow boundary condition.
static constexpr MInt m_reverseCellIdGC[18]
void computeFrictionPressureCoef_(const MBool auxDataWindows=false)
New function to compute the skin friction and pressure coefficient and the part for the force coeffic...
MInt cellIndexBC(MInt i, MInt j, MInt k)
FvStructuredSolver3D * m_solver
MFloat generate_rand()
Random number generator.
void bc2002(MInt)
Supersonic Inflow.
void initBc6002(MInt) override
MInt getPointIdfromPoint(MInt origin, MInt incI, MInt incJ, MInt incK)
void crossProduct(MFloat *, MFloat *, MFloat *)
MFloat generate_rand_weighted()
Weighted random number generator.
void bc1007(MInt)
Oscillating wall.
MInt getPointIdFromCell(MInt i, MInt j, MInt k)
void bc2020(MInt)
Laminar Poiseuille inflow.
void bc2888(MInt)
Falkner-Skan-Cooke inflow boundary condition.
void bc2099(MInt)
Subsonic Inflow with u=(y/delta)^(1/7)
void bc3001(MInt)
Streamline symmetry.
static constexpr const MInt nDim
void initBc2601(MInt)
Prescribe profile BC.
MInt pointIndex(MInt i, MInt j, MInt k)
MInt cellIndex(MInt i, MInt j, MInt k)
void bc2700(MInt)
supersonic inflow with imposed acoustic or entropy waves
std::pair< MInt, MInt > getMirrorCellIdPair(MInt i, MInt j, MInt k, MInt face)
MFloat temperature(MInt cellId)
static constexpr MInt m_reverseCellIdDim[18]
void initBc2600(MInt)
Prescribe profile BC.
void bc2600(MInt)
Prescribe given profile BC.
void bc2001(MInt)
Subsonic Inflow.
void bc2003(MInt)
Subsonic in/outflow simple.
virtual void computeFrictionPressureCoef(MBool computePower) override
void bc2014(MInt)
Subsonic rotational inflow.
MFloat dist(MFloat *a, MFloat *b)
MInt getReverseCellId(MInt i, MInt j, MInt k, MInt face)
void bc2009(MInt)
Outflow condition after shock.
void initBc2402(MInt)
Channel flow / Pipe Flow.
void bc2500(MInt)
Rescaling Boundary Conditions.
void initBc2700(MInt)
Init for the acoustic and entropy waves.
void bc7909(MInt)
Reformulated Synthetic Turbulence Generation.
MInt getExtrNghbrId(MInt cellId, MInt face)
void bc2005(MInt)
Supersonic outflow.
Base class of the structured boundary conditions.
Structured grid class.
int32_t MInt
Definition: maiatypes.h:62
double MFloat
Definition: maiatypes.h:52
bool MBool
Definition: maiatypes.h:58
Definition: contexttypes.h:19