MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
fvmbzonal.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 COUPLERFVMBZONAL_H_
8#define COUPLERFVMBZONAL_H_
9
10#include <map>
11#include <vector>
13#include "INCLUDE/maiatypes.h"
14#include "coupling.h"
15
16// Forward declarations
17class Solver;
18template <MInt nDim, class SysEqn>
20namespace maia {
21namespace grid {
22template <MInt nDim>
23class Proxy;
24} // namespace grid
25} // namespace maia
26template <MInt nDim>
27class CartesianGrid;
28
29
30template <MInt nDim, class SysEqn>
31class CouplerFvMbZonal final : public CouplingFvMb<nDim, SysEqn> {
32 public:
35
36
39
40 // empty main functions
41 void init() override{};
43 void postCouple(MInt) override;
44 void cleanUp(){};
45 void checkProperties() override{};
46
47 // initialisation functions
48 void readProperties() override;
50 void finalizeBalance(const MInt) override;
51 void finalizeAdaptation(const MInt) override;
52
53 // update functions
54 void subCouple(MInt, MInt, std::vector<MBool>&);
55 void preCouple(MInt) override;
56
57 private:
58 FvMbSolver& upStream() const { return *m_solverUp; }
59 FvMbSolver& downStream() const { return *m_solverDown; }
60 MInt couplerId() const { return m_couplingId; }
61
64
68
72
74
75 std::vector<std::pair<MInt, MInt>> m_upDown;
76 std::vector<std::pair<MInt, MInt>> m_downUp;
77
82
83 void createZonalMapping();
84 void updateZonalMapping();
85 void exchangeZonalValues(const MInt);
86 void unifyTimeStep();
87
88 MInt up2downId(MInt, const MBool);
89 MInt down2upId(MInt, const MBool);
90};
91
92#endif // #ifndef COUPLERFVMULTILEVEL_H_
MInt m_downStreamId
Definition: fvmbzonal.h:66
void unifyTimeStep()
set the same timeStep both FvMb-solvers
Definition: fvmbzonal.cpp:509
MString m_zonalMethod
Definition: fvmbzonal.h:69
MFloat m_zonalCoordinate
Definition: fvmbzonal.h:71
void readProperties() override
void finalizeBalance(const MInt) override
update zonal mapping after balance
Definition: fvmbzonal.cpp:134
MInt m_downStreamOffset
Definition: fvmbzonal.h:79
void preCouple(MInt) override
exchange zonal variables before each runge-Kutta Step
Definition: fvmbzonal.cpp:171
MInt m_upStreamOffset
Definition: fvmbzonal.h:78
FvMbSolver & upStream() const
Definition: fvmbzonal.h:58
MBool m_zonalDualTimeStepping
Definition: fvmbzonal.h:73
std::vector< std::pair< MInt, MInt > > m_downUp
Definition: fvmbzonal.h:76
void exchangeZonalValues(const MInt)
exchange zonal variables around the zonal coordinate from upstream to downstream solver and the other...
Definition: fvmbzonal.cpp:326
void postCouple(MInt) override
unify the time-Step
Definition: fvmbzonal.cpp:185
MInt up2downId(MInt, const MBool)
conversion from upStream solverId to the downStream solverId NOTE: also handles bndry-ghost cell conv...
Definition: fvmbzonal.cpp:367
void subCouple(MInt, MInt, std::vector< MBool > &)
exchange zonal variables each runge-Kutta Step
Definition: fvmbzonal.cpp:144
std::vector< std::pair< MInt, MInt > > m_upDown
Definition: fvmbzonal.h:75
void init() override
Definition: fvmbzonal.h:41
void checkProperties() override
Definition: fvmbzonal.h:45
FvMbSolver * m_solverUp
Definition: fvmbzonal.h:62
void finalizeAdaptation(const MInt) override
update zonal mapping after adaptation
Definition: fvmbzonal.cpp:123
MInt down2upId(MInt, const MBool)
conversion from downStream to upStream cellId NOTE: also handles bndry-ghost cells
Definition: fvmbzonal.cpp:438
void createZonalMapping()
create the cell mapping which allows for a faster exchange during each RK-Step. This requires little ...
Definition: fvmbzonal.cpp:201
FvMbSolver * m_solverDown
Definition: fvmbzonal.h:63
void finalizeCouplerInit()
create first zonal mapping for the zonal exchange
Definition: fvmbzonal.cpp:113
void cleanUp()
Definition: fvmbzonal.h:44
void updateZonalMapping()
update the zonal mapping before the FVMb-timeStep as the bndryCell order might have changed!...
Definition: fvmbzonal.cpp:266
MInt couplerId() const
Definition: fvmbzonal.h:60
void finalizeSubCoupleInit(MInt)
Definition: fvmbzonal.h:42
FvMbSolver & downStream() const
Definition: fvmbzonal.h:59
Parent class of all solvers This class is the base for all solvers. I.e. all solver class (e....
Definition: solver.h:29
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
double MFloat
Definition: maiatypes.h:52
bool MBool
Definition: maiatypes.h:58
Namespace for auxiliary functions/classes.