MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
fvstructuredbndrycnd2d.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 STRUCTUREDBNDRYCND2D
8#define STRUCTUREDBNDRYCND2D
9
11#include "fvstructuredsolver.h"
14
16
20template <MBool isRans>
22 public:
24
27
28
30
31 static constexpr const MInt nDim = 2;
32
35
36 void bc1000(MInt); // wall no slip
37 template <RansMethod ransMethod>
38 void bc1000_(MInt);
39 void bc1001(MInt); // euler wall
40 void bc1003(MInt); // isothermal wall
41 void bc1004(MInt); // moving adiabatic wall
42 void bc2001(MInt); // subsonic inflow
43 void bc2003(MInt); // subsonic outflow
44 void bc2004(MInt); // subsonic outflow
45 void bc2002(MInt); // supersonic inflow
46 void bc2005(MInt); // supersonic outflow
47 void bc2006(MInt); // subsonic zero velocity in/outflow
48 void bc2007(MInt); // subsonic outflow
49 void bc2021(MInt); // shear flow inflow
50 void bc2199(MInt); // subsonic inflow compressible bernoulli (tfs2099)
51 void bc2402(MInt); // channel flow
52 void bc2510(MInt); // rescaling inlet
53 void bc2511(MInt); // rescaling recycling
54 void bc2600(MInt); // prescribing
55 void bc2999(MInt); // blasius inflow
56 void bc3000(MInt); // symmetrie
57 virtual void bc6002(MInt) override; // Fluid-porous interface
58
59 void initBc1000(MInt);
61 void initBc1003(MInt);
62 void initBc1004(MInt);
63 void initBc2001(MInt);
64 void initBc2002(MInt);
66 void initBc2004(MInt);
67 void initBc2005(MInt);
68 void initBc2006(MInt);
69 void initBc2007(MInt);
70 void initBc2021(MInt);
72 void initBc2402(MInt); // channel flow
75 void initBc2510(MInt);
77 void initBc2600(MInt);
78 void initBc3000(MInt);
79 void initBc6002(MInt) override{}; // Fluid-porous interface
80
81 virtual void computeFrictionPressureCoef(MBool computePower) override {
82 computeFrictionPressureCoef_<true, true, true>(false, computePower);
83 }
84 virtual void computeFrictionCoef() override { computeFrictionPressureCoef_<false, true, false>(false, false); };
85 template <MBool calcCp, MBool calcCf, MBool calcIntegrals>
86 void computeFrictionPressureCoef_(const MBool auxDataWindow = false, const MBool computePower = false);
87 template <MBool calcCp, MBool calcCf, MBool interface>
88 void calc_cp_cf(const MInt, const MInt, const MInt, const MInt, MFloat (&)[calcCp + nDim * calcCf]);
89 virtual void distributeWallAndFPProperties() override;
90 void distributeMapProperties(const std::vector<std::unique_ptr<StructuredWindowMap<nDim>>>&,
91 const std::vector<MInt>&,
92 const std::vector<MInt>&,
93 const std::map<MInt, std::tuple<MInt, MInt, MFloat>>& cellId2recvCell,
94 const std::vector<MInt>&,
95 MFloat* const);
96
98 void updateSpongeLayer();
100 virtual void computeLocalWallDistances() override;
101 void computeDistance2Map(const std::vector<std::unique_ptr<StructuredWindowMap<nDim>>>&,
102 MFloat* const,
103 std::vector<std::pair<MInt, MInt>>&,
104 std::vector<MInt>&,
105 std::vector<MFloat>&);
106
107 // Placeholder cellId can be used for more sophisticated comparisions
108 template <typename T>
109 struct comp {
110 MBool operator()(const MInt /*cellId*/, const T& a, const T& b) { return a < b; }
111 };
112 template <typename T = comp<MFloat>>
113 void getCloserMap(const MFloat* const,
114 std::vector<std::pair<MInt, MInt>>&,
115 const MFloat* const,
116 std::vector<std::pair<MInt, MInt>>&,
117 MFloat* const,
118 T comparator = {});
119 void setUpNearMapComm(const std::vector<std::pair<MInt, MInt>>&,
120 const std::vector<MInt>&,
121 const std::vector<MFloat>&,
122 std::map<MInt, std::tuple<MInt, MInt, MFloat>>&,
123 std::vector<MInt>&,
124 std::vector<MInt>&);
125 virtual void computeLocalExtendedDistancesAndSetComm() override;
126 void modifyFPDistance(const std::vector<std::unique_ptr<StructuredWindowMap<nDim>>>&,
127 MFloat* const,
128 std::vector<std::pair<MInt, MInt>>&,
129 const std::vector<MFloat>&);
130 MFloat shortestDistanceToLineElement(const MFloat (&)[nDim], const MFloat (&)[nDim], const MFloat (&)[nDim], MFloat&,
131 MFloat&);
132 inline MInt cellIndex(MInt i, MInt j);
133 inline MInt getPointIdFromCell(MInt i, MInt j);
134 inline MInt getPointIdFromPoint(MInt origin, MInt incI, MInt incJ);
135 inline MFloat pressure(MInt);
136 inline MFloat temperature(MInt);
137
138 protected:
145
146 // periodic
148
149 // 2500 rescaling bc
153};
154
155
156#endif
2D structured solver class
Base class of the structured solver.
Class for the 2D stuctured boundary conditions.
MInt getPointIdFromPoint(MInt origin, MInt incI, MInt incJ)
void bc2006(MInt)
Characteristic in/outflow boundary for zero velocities.
virtual void computeFrictionPressureCoef(MBool computePower) override
void computeFrictionPressureCoef_(const MBool auxDataWindow=false, const MBool computePower=false)
void getCloserMap(const MFloat *const, std::vector< std::pair< MInt, MInt > > &, const MFloat *const, std::vector< std::pair< MInt, MInt > > &, MFloat *const, T comparator={})
void bc2003(MInt)
Subsonic in/outflow simple.
void calc_cp_cf(const MInt, const MInt, const MInt, const MInt, MFloat(&)[calcCp+nDim *calcCf])
virtual void distributeWallAndFPProperties() override
void bc2007(MInt)
Subsonic Outflow extrapolate all but pressure, prescribe p8.
MInt getPointIdFromCell(MInt i, MInt j)
void bc2005(MInt)
Supersonic Outflow,.
void bc2600(MInt)
Prescribe given profile BC.
void initBc6002(MInt) override
void bc2999(MInt)
Blasius bl inflow boundary condition.
MInt cellIndex(MInt i, MInt j)
void bc2002(MInt)
Supersonic Inflow.
static constexpr const MInt nDim
void distributeMapProperties(const std::vector< std::unique_ptr< StructuredWindowMap< nDim > > > &, const std::vector< MInt > &, const std::vector< MInt > &, const std::map< MInt, std::tuple< MInt, MInt, MFloat > > &cellId2recvCell, const std::vector< MInt > &, MFloat *const)
void bc2004(MInt)
Subsonic Outflow, not really non-reflecting for face 0,1,3.
void setUpNearMapComm(const std::vector< std::pair< MInt, MInt > > &, const std::vector< MInt > &, const std::vector< MFloat > &, std::map< MInt, std::tuple< MInt, MInt, MFloat > > &, std::vector< MInt > &, std::vector< MInt > &)
void initBc2510(MInt)
Rescaling inflow.
void bc2001(MInt)
Subsonic Inflow <== tfs2001.
void computeDistance2Map(const std::vector< std::unique_ptr< StructuredWindowMap< nDim > > > &, MFloat *const, std::vector< std::pair< MInt, MInt > > &, std::vector< MInt > &, std::vector< MFloat > &)
Compute shortest distance to given set of maps.
virtual void computeLocalWallDistances() override
void initBc2402(MInt)
Channel flow BC.
MFloat shortestDistanceToLineElement(const MFloat(&)[nDim], const MFloat(&)[nDim], const MFloat(&)[nDim], MFloat &, MFloat &)
virtual void computeFrictionCoef() override
virtual void computeLocalExtendedDistancesAndSetComm() override
FvStructuredSolver2D * m_solver
void bc3000(MInt)
Symmetry plane BC.
void modifyFPDistance(const std::vector< std::unique_ptr< StructuredWindowMap< nDim > > > &, MFloat *const, std::vector< std::pair< MInt, MInt > > &, const std::vector< MFloat > &)
Modifies the fluid-porous distance.
void initBc2600(MInt)
Prescribe profile BC.
virtual void bc6002(MInt) override
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
MBool operator()(const MInt, const T &a, const T &b)
Definition: contexttypes.h:19