Files
openfoam/applications/solvers/heatTransfer/chtMultiRegionFoam/include/createCoupledRegions.H
2021-08-03 20:08:49 +00:00

52 lines
1.0 KiB
C

fvSolution solutionDict(runTime);
bool coupled(solutionDict.getOrDefault("coupledEnergyField", false));
autoPtr<fvMatrix<scalar>> fvMatrixAssemblyPtr;
forAll(fluidRegions, i)
{
const rhoThermo& thermo = refCast<const rhoThermo>(thermoFluid[i]);
const auto& bpsi = thermo.T().boundaryField();
forAll (bpsi, patchI)
{
if (bpsi[patchI].useImplicit())
{
coupled = true;
}
}
}
forAll(solidRegions, i)
{
solidThermo& thermo = thermos[i];
const auto& bpsi = thermo.T().boundaryField();
forAll (bpsi, patchI)
{
if (bpsi[patchI].useImplicit())
{
coupled = true;
}
}
}
forAll(fluidRegions, i)
{
const rhoThermo& thermo = refCast<const rhoThermo>(thermoFluid[i]);
if (coupled)
{
Info << "Create fvMatrixAssembly." << endl;
fvMatrixAssemblyPtr.reset
(
new fvMatrix<scalar>
(
thermo.he(),
dimEnergy/dimTime
)
);
break;
}
}