23template <MInt nDim,
class SysEqnOld,
class SysEqnNew>
27 :
Coupling(couplingId), m_oldSolver(oldS), m_newSolver(newS) {
30 m_newSolverId = newSolver().m_solverId;
31 m_oldSolverId = oldSolver().m_solverId;
40 m_nonZonalRestart =
false;
42 m_nonZonalRestart = Context::getBasicProperty<MBool>(
"nonZonalRestart", AT_, &m_nonZonalRestart);
46 if(!newSolver().m_rans) {
47 newSolver().m_noRANSVariables = oldSolver().noVariables();
48 mAlloc(newSolver().m_RANSValues, newSolver().m_noRANSVariables,
"newSolver().m_RANSValues", AT_);
49 for(
MInt i = 0; i < newSolver().m_noRANSVariables; i++) {
50 newSolver().m_RANSValues[i].clear();
53 newSolver().m_noLESVariables = oldSolver().noVariables();
54 mAlloc(newSolver().m_LESValues, newSolver().m_noLESVariables,
"newSolver().m_LESValues", AT_);
55 for(
MInt i = 0; i < newSolver().m_noLESVariables; i++) {
56 newSolver().m_LESValues[i].clear();
62template <MInt nDim,
class SysEqnOld,
class SysEqnNew>
66 if(m_nonZonalRestart) {
71template <MInt nDim,
class SysEqnOld,
class SysEqnNew>
73 if(m_nonZonalRestart) {
74 for(
MInt oldId = 0; oldId < a_noFvGridCellsOld(); oldId++) {
75 oldSolver().reduceData(oldId, &oldSolver().a_pvariable(0, 0), oldSolver().noVariables());
81template <MInt nDim,
class SysEqnOld,
class SysEqnNew>
83 if(m_nonZonalRestart) {
84 for(
MInt oldId = 0; oldId < a_noFvGridCellsOld(); oldId++) {
85 oldSolver().reduceData(oldId, &oldSolver().a_pvariable(0, 0), oldSolver().noVariables());
94template <MInt nDim,
class SysEqnOld,
class SysEqnNew>
98 m_log <<
"starting interpolate (FV)" << endl;
100 if(newSolver().grid().isActive()) {
102 for(
MInt newId = 0; newId < a_noFvGridCellsNew(); newId++) {
106 for(
MInt varId = 0; varId < newSolver().noVariables(); varId++) {
107 newSolver().a_pvariable(newId, varId) = oldSolver().a_pvariable(oldId, varId);
109 IF_CONSTEXPR(SysEqnNew::m_noRansEquations == 0) {
110 for(
MInt s = 0; s < newSolver().m_noSpecies; ++s) {
111 newSolver().a_pvariable(newId, newSolver().PV->Y[s]) =
112 (oldSolver().m_noSpecies > 0) ? oldSolver().a_pvariable(oldId, oldSolver().PV->Y[s]) : F0;
118 newSolver().computeConservativeVariables();
119 newSolver().exchangeAll();
121 m_log <<
"finished interpolate (FV)" << endl;
void mAlloc(T *&a, const MLong N, const MString &objectName, MString function)
allocates memory for one-dimensional array 'a' of size N
static MBool propertyExists(const MString &name, MInt solver=m_noSolvers)
This function checks if a property exists in general.
void postCouple(MInt) override
void transferSolverData()
interpolate variables from old to new
void preCouple(MInt) override
FvCartesianInterpolation(const MInt couplingId, OldFvSolver *oldS, NewFvSolver *newS)
MInt convertIdParent(SolverA &solverA, SolverB &solverB, const MInt solverAId)
Conversion from solverA id to the solverB id If no cell on the same level is found,...