mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Implicit treatment of coupled boundary conditions
This commit is contained in:
committed by
Andrew Heather
parent
11e0db96d3
commit
53af23b9fb
@ -21,6 +21,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionFaModels\lnInclude
|
||||
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lfvOptions \
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -54,6 +54,7 @@ Description
|
||||
#include "loopControl.H"
|
||||
#include "pressureControl.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@ -80,6 +81,8 @@ int main(int argc, char *argv[])
|
||||
#include "solidRegionDiffusionNo.H"
|
||||
#include "setInitialMultiRegionDeltaT.H"
|
||||
|
||||
#include "createCoupledRegions.H"
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
@ -109,8 +112,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
Info<< "\nSolving for fluid region "
|
||||
<< fluidRegions[i].name() << endl;
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
#include "solveFluid.H"
|
||||
@ -118,13 +119,35 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(solidRegions, i)
|
||||
{
|
||||
Info<< "\nSolving for solid region "
|
||||
<< solidRegions[i].name() << endl;
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
|
||||
if (coupled)
|
||||
{
|
||||
Info<< "\nSolving energy coupled regions " << endl;
|
||||
fvMatrixAssemblyPtr->solve();
|
||||
#include "correctThermos.H"
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||
Info<< "\nSolving for fluid region "
|
||||
<< fluidRegions[i].name() << endl;
|
||||
// --- PISO loop
|
||||
for (int corr=0; corr<nCorr; corr++)
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
turbulence.correct();
|
||||
rho = thermo.rho();
|
||||
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
||||
<< max(thermo.T()).value() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Additional loops for energy solution only
|
||||
if (!oCorr && nOuterCorr > 1)
|
||||
{
|
||||
@ -152,10 +175,28 @@ int main(int argc, char *argv[])
|
||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
|
||||
if (coupled)
|
||||
{
|
||||
Info<< "\nSolving energy coupled regions " << endl;
|
||||
fvMatrixAssemblyPtr->solve();
|
||||
#include "correctThermos.H"
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
#include "setRegionFluidFields.H"
|
||||
rho = thermo.rho();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (coupled)
|
||||
{
|
||||
fvMatrixAssemblyPtr->clear();
|
||||
}
|
||||
|
||||
runTime.write();
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
|
||||
@ -3,6 +3,7 @@ EXE_INC = \
|
||||
-I./fluid \
|
||||
-I./solid \
|
||||
-I../solid \
|
||||
-I./../include \
|
||||
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
@ -35,3 +36,4 @@ EXE_LIBS = \
|
||||
-lregionModels \
|
||||
-lsampling \
|
||||
-lregionFaModels
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -66,6 +66,7 @@ int main(int argc, char *argv[])
|
||||
#include "createTime.H"
|
||||
#include "createMeshes.H"
|
||||
#include "createFields.H"
|
||||
#include "createCoupledRegions.H"
|
||||
#include "initContinuityErrs.H"
|
||||
|
||||
while (runTime.loop())
|
||||
@ -83,13 +84,27 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(solidRegions, i)
|
||||
{
|
||||
Info<< "\nSolving for solid region "
|
||||
<< solidRegions[i].name() << endl;
|
||||
#include "setRegionSolidFields.H"
|
||||
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
|
||||
|
||||
if (coupled)
|
||||
{
|
||||
Info<< "\nSolving energy coupled regions" << endl;
|
||||
fvMatrixAssemblyPtr->solve();
|
||||
#include "correctThermos.H"
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
#include "setRegionFluidFields.H"
|
||||
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||
#include "pEqn.H"
|
||||
turb.correct();
|
||||
}
|
||||
}
|
||||
|
||||
// Additional loops for energy solution only
|
||||
{
|
||||
loopControl looping(runTime, "SIMPLE", "energyCoupling");
|
||||
@ -116,9 +131,27 @@ int main(int argc, char *argv[])
|
||||
#include "readSolidMultiRegionSIMPLEControls.H"
|
||||
#include "solveSolid.H"
|
||||
}
|
||||
|
||||
if (coupled)
|
||||
{
|
||||
Info<< "\nSolving energy coupled regions.. " << endl;
|
||||
fvMatrixAssemblyPtr->solve();
|
||||
#include "correctThermos.H"
|
||||
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
#include "setRegionFluidFields.H"
|
||||
turb.correct();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (coupled)
|
||||
{
|
||||
fvMatrixAssemblyPtr->clear();
|
||||
}
|
||||
|
||||
runTime.write();
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
|
||||
@ -20,13 +20,20 @@
|
||||
|
||||
fvOptions.constrain(EEqn);
|
||||
|
||||
EEqn.solve();
|
||||
if (coupled)
|
||||
{
|
||||
fvMatrixAssemblyPtr->addFvMatrix(EEqn);
|
||||
}
|
||||
else
|
||||
{
|
||||
EEqn.solve();
|
||||
|
||||
fvOptions.correct(he);
|
||||
fvOptions.correct(he);
|
||||
|
||||
thermo.correct();
|
||||
rad.correct();
|
||||
thermo.correct();
|
||||
rad.correct();
|
||||
|
||||
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
||||
<< max(thermo.T()).value() << endl;
|
||||
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
||||
<< max(thermo.T()).value() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
MRF.correctBoundaryVelocity(U);
|
||||
|
||||
tmp<fvVectorMatrix> tUEqn
|
||||
UEqn =
|
||||
(
|
||||
fvm::div(phi, U)
|
||||
+ MRF.DDt(rho, U)
|
||||
@ -10,7 +10,6 @@
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
);
|
||||
fvVectorMatrix& UEqn = tUEqn.ref();
|
||||
|
||||
UEqn.relax();
|
||||
|
||||
|
||||
@ -21,6 +21,8 @@ PtrList<dimensionedScalar> rhoMin(fluidRegions.size());
|
||||
PtrList<IOMRFZoneList> MRFfluid(fluidRegions.size());
|
||||
PtrList<fv::options> fluidFvOptions(fluidRegions.size());
|
||||
|
||||
PtrList<fvVectorMatrix> UEqFluid(fluidRegions.size());
|
||||
|
||||
const uniformDimensionedVectorField& g = meshObjects::gravity::New(runTime);
|
||||
|
||||
// Populate fluid field pointer lists
|
||||
@ -222,5 +224,11 @@ forAll(fluidRegions, i)
|
||||
new fv::options(fluidRegions[i])
|
||||
);
|
||||
|
||||
UEqFluid.set
|
||||
(
|
||||
i,
|
||||
new fvVectorMatrix(UFluid[i], dimForce)
|
||||
);
|
||||
|
||||
turbulence[i].validate();
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
|
||||
tUEqn.clear();
|
||||
//tUEqn.clear();
|
||||
|
||||
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||
|
||||
|
||||
@ -22,6 +22,8 @@
|
||||
IOMRFZoneList& MRF = MRFfluid[i];
|
||||
fv::options& fvOptions = fluidFvOptions[i];
|
||||
|
||||
fvVectorMatrix& UEqn = UEqFluid[i];
|
||||
|
||||
const dimensionedScalar initialMass
|
||||
(
|
||||
"initialMass",
|
||||
|
||||
@ -12,8 +12,10 @@
|
||||
|
||||
#include "UEqn.H"
|
||||
#include "EEqn.H"
|
||||
#include "pEqn.H"
|
||||
|
||||
turb.correct();
|
||||
if (!coupled)
|
||||
{
|
||||
#include "pEqn.H"
|
||||
turb.correct();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,13 +16,21 @@
|
||||
|
||||
fvOptions.constrain(hEqn);
|
||||
|
||||
hEqn.solve();
|
||||
if (coupled)
|
||||
{
|
||||
fvMatrixAssemblyPtr->addFvMatrix(hEqn);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "\nSolving for solid region "
|
||||
<< solidRegions[i].name() << endl;
|
||||
|
||||
fvOptions.correct(h);
|
||||
hEqn.solve();
|
||||
fvOptions.correct(h);
|
||||
thermo.correct();
|
||||
|
||||
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
||||
<< max(thermo.T()).value() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
thermo.correct();
|
||||
|
||||
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
||||
<< max(thermo.T()).value() << endl;
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ EXE_INC = \
|
||||
-I${phaseSystem}/twoPhaseCompressibleTurbulenceModels/lnInclude \
|
||||
-I${phaseSystem}/multiphaseSystem/lnInclude \
|
||||
-I./fluid \
|
||||
-I./solid \
|
||||
-I../solid \
|
||||
-I../fluid \
|
||||
-I../include \
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
if (finalIter)
|
||||
{
|
||||
mesh.data::add("finalIteration", true);
|
||||
}
|
||||
|
||||
{
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; ++nonOrth)
|
||||
{
|
||||
fvScalarMatrix hEqn
|
||||
(
|
||||
fvm::ddt(betav*rho, h)
|
||||
- (
|
||||
thermo.isotropic()
|
||||
? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)")
|
||||
: fvm::laplacian(betav*taniAlpha(), h, "laplacian(alpha,h)")
|
||||
)
|
||||
==
|
||||
fvOptions(rho, h)
|
||||
);
|
||||
|
||||
hEqn.relax();
|
||||
|
||||
fvOptions.constrain(hEqn);
|
||||
|
||||
hEqn.solve(mesh.solver(h.select(finalIter)));
|
||||
|
||||
fvOptions.correct(h);
|
||||
}
|
||||
|
||||
thermo.correct();
|
||||
|
||||
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
||||
<< max(thermo.T()).value() << endl;
|
||||
}
|
||||
|
||||
if (finalIter)
|
||||
{
|
||||
mesh.data::remove("finalIteration");
|
||||
}
|
||||
@ -27,13 +27,19 @@
|
||||
|
||||
fvOptions.constrain(EEqn);
|
||||
|
||||
EEqn.solve(mesh.solver(he.select(finalIter)));
|
||||
if (coupled)
|
||||
{
|
||||
fvMatrixAssemblyPtr->addFvMatrix(EEqn);
|
||||
}
|
||||
else
|
||||
{
|
||||
EEqn.solve(mesh.solver(he.select(finalIter)));
|
||||
fvOptions.correct(he);
|
||||
|
||||
fvOptions.correct(he);
|
||||
thermo.correct();
|
||||
rad.correct();
|
||||
|
||||
thermo.correct();
|
||||
rad.correct();
|
||||
|
||||
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
||||
<< max(thermo.T()).value() << endl;
|
||||
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
||||
<< max(thermo.T()).value() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
MRF.correctBoundaryVelocity(U);
|
||||
|
||||
tmp<fvVectorMatrix> tUEqn
|
||||
UEqn =
|
||||
(
|
||||
fvm::ddt(rho, U) + fvm::div(phi, U)
|
||||
+ MRF.DDt(rho, U)
|
||||
@ -10,7 +10,6 @@
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
);
|
||||
fvVectorMatrix& UEqn = tUEqn.ref();
|
||||
|
||||
UEqn.relax();
|
||||
|
||||
|
||||
@ -16,6 +16,8 @@ PtrList<multivariateSurfaceInterpolationScheme<scalar>::fieldTable>
|
||||
fieldsFluid(fluidRegions.size());
|
||||
PtrList<volScalarField> QdotFluid(fluidRegions.size());
|
||||
|
||||
PtrList<fvVectorMatrix> UEqFluid(fluidRegions.size());
|
||||
|
||||
List<scalar> initialMassFluid(fluidRegions.size());
|
||||
List<bool> frozenFlowFluid(fluidRegions.size(), false);
|
||||
|
||||
@ -293,6 +295,12 @@ forAll(fluidRegions, i)
|
||||
new fv::options(fluidRegions[i])
|
||||
);
|
||||
|
||||
UEqFluid.set
|
||||
(
|
||||
i,
|
||||
new fvVectorMatrix(UFluid[i], dimForce)
|
||||
);
|
||||
|
||||
turbulenceFluid[i].validate();
|
||||
|
||||
pRefCellFluid[i] = -1;
|
||||
|
||||
@ -49,6 +49,8 @@
|
||||
IOMRFZoneList& MRF = MRFfluid[i];
|
||||
fv::options& fvOptions = fluidFvOptions[i];
|
||||
|
||||
fvVectorMatrix& UEqn = UEqFluid[i];
|
||||
|
||||
const dimensionedScalar initialMass
|
||||
(
|
||||
"initialMass",
|
||||
|
||||
@ -18,15 +18,20 @@ else
|
||||
#include "YEqn.H"
|
||||
#include "EEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr=0; corr<nCorr; corr++)
|
||||
if (!coupled)
|
||||
{
|
||||
#include "pEqn.H"
|
||||
Info<< "\nSolving for fluid region " << fluidRegions[i].name() << endl;
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr=0; corr<nCorr; corr++)
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
turbulence.correct();
|
||||
|
||||
rho = thermo.rho();
|
||||
}
|
||||
|
||||
turbulence.correct();
|
||||
|
||||
rho = thermo.rho();
|
||||
}
|
||||
|
||||
if (finalIter)
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
forAll(fluidRegions, i)
|
||||
{
|
||||
rhoThermo& thermo = thermoFluid[i];
|
||||
radiation::radiationModel& rad = radiation[i];
|
||||
fv::options& fvOptions = fluidFvOptions[i];
|
||||
volScalarField& he = thermo.he();
|
||||
fvOptions.correct(he);
|
||||
thermo.correct();
|
||||
rad.correct();
|
||||
}
|
||||
|
||||
forAll(solidRegions, i)
|
||||
{
|
||||
solidThermo& thermo = thermos[i];
|
||||
fv::options& fvOptions = solidHeatSources[i];
|
||||
volScalarField& h = thermo.he();
|
||||
fvOptions.correct(h);
|
||||
thermo.correct();
|
||||
}
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -1,39 +1,45 @@
|
||||
if (finalIter)
|
||||
{
|
||||
mesh.data::add("finalIteration", true);
|
||||
}
|
||||
fvScalarMatrix hEqn
|
||||
(
|
||||
fvm::ddt(betav*rho, h)
|
||||
- (
|
||||
thermo.isotropic()
|
||||
? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)")
|
||||
: fvm::laplacian(betav*taniAlpha(), h, "laplacian(alpha,h)")
|
||||
)
|
||||
==
|
||||
fvOptions(rho, h)
|
||||
);
|
||||
|
||||
{
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; ++nonOrth)
|
||||
hEqn.relax();
|
||||
|
||||
fvOptions.constrain(hEqn);
|
||||
|
||||
if (coupled)
|
||||
{
|
||||
fvScalarMatrix hEqn
|
||||
(
|
||||
fvm::ddt(betav*rho, h)
|
||||
- (
|
||||
thermo.isotropic()
|
||||
? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)")
|
||||
: fvm::laplacian(betav*taniAlpha(), h, "laplacian(alpha,h)")
|
||||
)
|
||||
==
|
||||
fvOptions(rho, h)
|
||||
);
|
||||
fvMatrixAssemblyPtr->addFvMatrix(hEqn);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "\nSolving for solid region "<< solidRegions[i].name() << endl;
|
||||
|
||||
hEqn.relax();
|
||||
|
||||
fvOptions.constrain(hEqn);
|
||||
if (finalIter)
|
||||
{
|
||||
mesh.data::add("finalIteration", true);
|
||||
}
|
||||
|
||||
hEqn.solve(mesh.solver(h.select(finalIter)));
|
||||
|
||||
fvOptions.correct(h);
|
||||
|
||||
thermo.correct();
|
||||
|
||||
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
||||
<< max(thermo.T()).value() << endl;
|
||||
|
||||
if (finalIter)
|
||||
{
|
||||
mesh.data::remove("finalIteration");
|
||||
}
|
||||
}
|
||||
|
||||
thermo.correct();
|
||||
|
||||
Info<< "Min/max T:" << min(thermo.T()).value() << ' '
|
||||
<< max(thermo.T()).value() << endl;
|
||||
}
|
||||
|
||||
if (finalIter)
|
||||
{
|
||||
mesh.data::remove("finalIteration");
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ else
|
||||
phiHbyA += MRF.zeroFilter(fvc::interpolate(rAU));
|
||||
}
|
||||
|
||||
|
||||
MRF.makeRelative(phiHbyA);
|
||||
|
||||
if (p.needReference())
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
@ -9,6 +10,7 @@ EXE_INC = \
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lgeometricVoF \
|
||||
-ltwoPhaseMixture \
|
||||
-linterfaceProperties \
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
@ -8,4 +9,5 @@ LIB_LIBS = \
|
||||
-ltwoPhaseMixture \
|
||||
-ltwoPhaseProperties \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
|
||||
@ -431,6 +431,7 @@ $(lduAddressing)/lduAddressing.C
|
||||
$(lduAddressing)/lduInterface/lduInterface.C
|
||||
$(lduAddressing)/lduInterface/processorLduInterface.C
|
||||
$(lduAddressing)/lduInterface/cyclicLduInterface.C
|
||||
$(lduAddressing)/lduInterface/lduPrimitiveProcessorInterface.C
|
||||
|
||||
lduInterfaceFields = $(lduAddressing)/lduInterfaceFields
|
||||
$(lduInterfaceFields)/lduInterfaceField/lduInterfaceField.C
|
||||
|
||||
@ -48,8 +48,7 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Forward declarations
|
||||
class lduMatrix;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -101,6 +100,8 @@ public:
|
||||
(
|
||||
Field<Type>&,
|
||||
const bool add,
|
||||
const lduAddressing&,
|
||||
const label interfacei,
|
||||
const Field<Type>&,
|
||||
const scalarField&,
|
||||
const Pstream::commsTypes commsType
|
||||
@ -115,6 +116,8 @@ public:
|
||||
(
|
||||
Field<Type>&,
|
||||
const bool add,
|
||||
const lduAddressing&,
|
||||
const label interfacei,
|
||||
const Field<Type>&,
|
||||
const scalarField&,
|
||||
const Pstream::commsTypes commsType
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -53,6 +54,8 @@ void Foam::LduMatrix<Type, DType, LUType>::initMatrixInterfaces
|
||||
(
|
||||
result,
|
||||
add,
|
||||
lduMesh_.lduAddr(),
|
||||
interfacei,
|
||||
psiif,
|
||||
interfaceCoeffs[interfacei],
|
||||
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
|
||||
@ -80,6 +83,8 @@ void Foam::LduMatrix<Type, DType, LUType>::initMatrixInterfaces
|
||||
(
|
||||
result,
|
||||
add,
|
||||
lduMesh_.lduAddr(),
|
||||
interfacei,
|
||||
psiif,
|
||||
interfaceCoeffs[interfacei],
|
||||
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
|
||||
@ -128,6 +133,8 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
|
||||
(
|
||||
result,
|
||||
add,
|
||||
lduMesh_.lduAddr(),
|
||||
interfacei,
|
||||
psiif,
|
||||
interfaceCoeffs[interfacei],
|
||||
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
|
||||
@ -153,6 +160,8 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
|
||||
(
|
||||
result,
|
||||
add,
|
||||
lduMesh_.lduAddr(),
|
||||
interfacei,
|
||||
psiif,
|
||||
interfaceCoeffs[interfacei],
|
||||
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
|
||||
@ -165,6 +174,8 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
|
||||
(
|
||||
result,
|
||||
add,
|
||||
lduMesh_.lduAddr(),
|
||||
interfacei,
|
||||
psiif,
|
||||
interfaceCoeffs[interfacei],
|
||||
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
|
||||
@ -189,6 +200,8 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces
|
||||
(
|
||||
result,
|
||||
add,
|
||||
lduMesh_.lduAddr(),
|
||||
interfacei,
|
||||
psiif,
|
||||
interfaceCoeffs[interfacei],
|
||||
//Amultiplier<Type, LUType>(interfaceCoeffs[interfacei]),
|
||||
|
||||
@ -72,6 +72,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
//- Return faceCell addressing
|
||||
@ -87,6 +88,14 @@ public:
|
||||
const labelUList& internalData
|
||||
) const = 0;
|
||||
|
||||
//- Return the values of the given internal data adjacent to
|
||||
//- the interface as a field using faceCell mapping
|
||||
virtual tmp<labelField> interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData,
|
||||
const labelUList& faceCells
|
||||
) const = 0;
|
||||
|
||||
//- Initialise transfer of internal field adjacent to the interface
|
||||
virtual void initInternalFieldTransfer
|
||||
(
|
||||
@ -95,12 +104,23 @@ public:
|
||||
) const
|
||||
{}
|
||||
|
||||
//- Initialise transfer of internal field adjacent to the interface
|
||||
//- using faceCells mapping
|
||||
virtual void initInternalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& iF,
|
||||
const labelUList& faceCells
|
||||
) const
|
||||
{}
|
||||
|
||||
//- Transfer and return internal field adjacent to the interface
|
||||
virtual tmp<labelField> internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& iF
|
||||
) const = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -65,11 +65,23 @@ Foam::lduPrimitiveProcessorInterface::interfaceInternalField
|
||||
const labelUList& internalData
|
||||
) const
|
||||
{
|
||||
tmp<labelField> tfld(new labelField(faceCells_.size()));
|
||||
labelField& fld = tfld.ref();
|
||||
forAll(faceCells_, i)
|
||||
return interfaceInternalField(internalData, faceCells_);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::labelField>
|
||||
Foam::lduPrimitiveProcessorInterface::interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData,
|
||||
const labelUList& faceCells
|
||||
) const
|
||||
{
|
||||
auto tfld = tmp<labelField>::New(faceCells.size());
|
||||
auto& fld = tfld.ref();
|
||||
|
||||
forAll(faceCells, i)
|
||||
{
|
||||
fld[i] = internalData[faceCells_[i]];
|
||||
fld[i] = internalData[faceCells[i]];
|
||||
}
|
||||
return tfld;
|
||||
}
|
||||
@ -85,6 +97,21 @@ void Foam::lduPrimitiveProcessorInterface::initInternalFieldTransfer
|
||||
}
|
||||
|
||||
|
||||
void Foam::lduPrimitiveProcessorInterface::initInternalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& iF,
|
||||
const labelUList& faceCells
|
||||
) const
|
||||
{
|
||||
processorLduInterface::send
|
||||
(
|
||||
commsType,
|
||||
interfaceInternalField(iF, faceCells)()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::labelField>
|
||||
Foam::lduPrimitiveProcessorInterface::internalFieldTransfer
|
||||
(
|
||||
@ -95,5 +122,4 @@ Foam::lduPrimitiveProcessorInterface::internalFieldTransfer
|
||||
return processorLduInterface::receive<label>(commsType, faceCells_.size());
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -56,7 +56,7 @@ class lduPrimitiveProcessorInterface
|
||||
public lduInterface,
|
||||
public processorLduInterface
|
||||
{
|
||||
// Private data
|
||||
// Private Data
|
||||
|
||||
const labelList faceCells_;
|
||||
|
||||
@ -126,12 +126,20 @@ public:
|
||||
// Interface transfer functions
|
||||
|
||||
//- Return the values of the given internal data adjacent to
|
||||
// the interface as a field
|
||||
//- the interface as a field
|
||||
virtual tmp<labelField> interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData
|
||||
) const;
|
||||
|
||||
//- Return the values of the given internal data adjacent to
|
||||
//- the interface as a field using faceCells mapping
|
||||
virtual tmp<labelField> interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData,
|
||||
const labelUList& faceCells
|
||||
) const;
|
||||
|
||||
//- Initialise neighbour field transfer
|
||||
virtual void initInternalFieldTransfer
|
||||
(
|
||||
@ -139,6 +147,14 @@ public:
|
||||
const labelUList& iF
|
||||
) const;
|
||||
|
||||
//- Initialise neighbour field transfer using faceCells
|
||||
virtual void initInternalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& iF,
|
||||
const labelUList& faceCells
|
||||
) const;
|
||||
|
||||
//- Transfer and return internal field adjacent to the interface
|
||||
virtual tmp<labelField> internalFieldTransfer
|
||||
(
|
||||
@ -42,14 +42,14 @@ SourceFiles
|
||||
#include "lduInterface.H"
|
||||
#include "primitiveFieldsFwd.H"
|
||||
#include "Pstream.H"
|
||||
#include "lduAddressing.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Forward declarations
|
||||
class lduMatrix;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -58,7 +58,7 @@ class lduMatrix;
|
||||
|
||||
class lduInterfaceField
|
||||
{
|
||||
// Private data
|
||||
// Private Data
|
||||
|
||||
//- Reference to the coupled patch this field is defined for
|
||||
const lduInterface& interface_;
|
||||
@ -140,6 +140,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing&,
|
||||
const label interfacei,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -153,6 +155,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing&,
|
||||
const label interfacei,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -165,6 +169,7 @@ public:
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const labelUList& faceCells,
|
||||
const scalarField& coeffs,
|
||||
const Field<Type>& vals
|
||||
) const;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -32,24 +32,23 @@ void Foam::lduInterfaceField::addToInternalField
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const labelUList& faceCells,
|
||||
const scalarField& coeffs,
|
||||
const Field<Type>& vals
|
||||
) const
|
||||
{
|
||||
const labelUList& faceCells = this->interface().faceCells();
|
||||
|
||||
if (add)
|
||||
{
|
||||
forAll(faceCells, elemI)
|
||||
forAll(faceCells, elemi)
|
||||
{
|
||||
result[faceCells[elemI]] += coeffs[elemI]*vals[elemI];
|
||||
result[faceCells[elemi]] += coeffs[elemi]*vals[elemi];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(faceCells, elemI)
|
||||
forAll(faceCells, elemi)
|
||||
{
|
||||
result[faceCells[elemI]] -= coeffs[elemI]*vals[elemI];
|
||||
result[faceCells[elemi]] -= coeffs[elemi]*vals[elemi];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -325,7 +325,7 @@ void Foam::lduMatrix::setResidualField
|
||||
const bool initial
|
||||
) const
|
||||
{
|
||||
if (!lduMesh_.hasDb())
|
||||
if (!mesh().hasDb())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -341,12 +341,12 @@ void Foam::lduMatrix::setResidualField
|
||||
}
|
||||
|
||||
scalarIOField* residualPtr =
|
||||
lduMesh_.thisDb().getObjectPtr<scalarIOField>(lookupName);
|
||||
mesh().thisDb().getObjectPtr<scalarIOField>(lookupName);
|
||||
|
||||
if (residualPtr)
|
||||
{
|
||||
const IOdictionary* dataPtr =
|
||||
lduMesh_.thisDb().findObject<IOdictionary>("data");
|
||||
mesh().thisDb().findObject<IOdictionary>("data");
|
||||
|
||||
if (dataPtr)
|
||||
{
|
||||
|
||||
@ -86,7 +86,8 @@ class lduMatrix
|
||||
// private data
|
||||
|
||||
//- LDU mesh reference
|
||||
const lduMesh& lduMesh_;
|
||||
//const lduMesh& lduMesh_;
|
||||
std::reference_wrapper<const lduMesh> lduMesh_;
|
||||
|
||||
//- Coefficients (not including interfaces)
|
||||
scalarField *lowerPtr_, *diagPtr_, *upperPtr_;
|
||||
@ -569,10 +570,16 @@ public:
|
||||
return lduMesh_;
|
||||
}
|
||||
|
||||
//- Set the LDU mesh containing the addressing is obtained
|
||||
void setLduMesh(const lduMesh& m)
|
||||
{
|
||||
lduMesh_ = m;
|
||||
}
|
||||
|
||||
//- Return the LDU addressing
|
||||
const lduAddressing& lduAddr() const
|
||||
{
|
||||
return lduMesh_.lduAddr();
|
||||
return mesh().lduAddr();
|
||||
}
|
||||
|
||||
//- Return the patch evaluation schedule
|
||||
|
||||
@ -204,13 +204,13 @@ Foam::solveScalarField::cmptType Foam::lduMatrix::solver::normFactor
|
||||
// --- Calculate A dot reference value of psi
|
||||
matrix_.sumA(tmpField, interfaceBouCoeffs_, interfaces_);
|
||||
|
||||
tmpField *= gAverage(psi, matrix_.lduMesh_.comm());
|
||||
tmpField *= gAverage(psi, matrix_.mesh().comm());
|
||||
|
||||
return
|
||||
gSum
|
||||
(
|
||||
(mag(Apsi - tmpField) + mag(source - tmpField))(),
|
||||
matrix_.lduMesh_.comm()
|
||||
matrix_.mesh().comm()
|
||||
)
|
||||
+ solverPerformance::small_;
|
||||
|
||||
|
||||
@ -54,6 +54,8 @@ void Foam::lduMatrix::initMatrixInterfaces
|
||||
(
|
||||
result,
|
||||
add,
|
||||
mesh().lduAddr(),
|
||||
interfacei,
|
||||
psiif,
|
||||
coupleCoeffs[interfacei],
|
||||
cmpt,
|
||||
@ -81,6 +83,8 @@ void Foam::lduMatrix::initMatrixInterfaces
|
||||
(
|
||||
result,
|
||||
add,
|
||||
mesh().lduAddr(),
|
||||
interfacei,
|
||||
psiif,
|
||||
coupleCoeffs[interfacei],
|
||||
cmpt,
|
||||
@ -120,6 +124,8 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
||||
(
|
||||
result,
|
||||
add,
|
||||
mesh().lduAddr(),
|
||||
interfacei,
|
||||
psiif,
|
||||
coupleCoeffs[interfacei],
|
||||
cmpt,
|
||||
@ -149,6 +155,8 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
||||
(
|
||||
result,
|
||||
add,
|
||||
mesh().lduAddr(),
|
||||
interfacei,
|
||||
psiif,
|
||||
coupleCoeffs[interfacei],
|
||||
cmpt,
|
||||
@ -197,6 +205,8 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
||||
(
|
||||
result,
|
||||
add,
|
||||
mesh().lduAddr(),
|
||||
interfacei,
|
||||
psiif,
|
||||
coupleCoeffs[interfacei],
|
||||
cmpt,
|
||||
@ -210,18 +220,20 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
||||
const lduSchedule& patchSchedule = this->patchSchedule();
|
||||
|
||||
// Loop over all the "normal" interfaces relating to standard patches
|
||||
forAll(patchSchedule, i)
|
||||
for (const auto& sched : patchSchedule)
|
||||
{
|
||||
label interfacei = patchSchedule[i].patch;
|
||||
const label interfacei = sched.patch;
|
||||
|
||||
if (interfaces.set(interfacei))
|
||||
{
|
||||
if (patchSchedule[i].init)
|
||||
if (sched.init)
|
||||
{
|
||||
interfaces[interfacei].initInterfaceMatrixUpdate
|
||||
(
|
||||
result,
|
||||
add,
|
||||
mesh().lduAddr(),
|
||||
interfacei,
|
||||
psiif,
|
||||
coupleCoeffs[interfacei],
|
||||
cmpt,
|
||||
@ -234,6 +246,8 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
||||
(
|
||||
result,
|
||||
add,
|
||||
mesh().lduAddr(),
|
||||
interfacei,
|
||||
psiif,
|
||||
coupleCoeffs[interfacei],
|
||||
cmpt,
|
||||
@ -258,6 +272,8 @@ void Foam::lduMatrix::updateMatrixInterfaces
|
||||
(
|
||||
result,
|
||||
add,
|
||||
mesh().lduAddr(),
|
||||
interfacei,
|
||||
psiif,
|
||||
coupleCoeffs[interfacei],
|
||||
cmpt,
|
||||
|
||||
@ -29,6 +29,7 @@ License
|
||||
#include "GAMGAgglomeration.H"
|
||||
#include "GAMGInterface.H"
|
||||
#include "processorGAMGInterface.H"
|
||||
#include "cyclicLduInterface.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -43,7 +44,7 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
|
||||
const labelUList& upperAddr = fineMeshAddr.upperAddr();
|
||||
const labelUList& lowerAddr = fineMeshAddr.lowerAddr();
|
||||
|
||||
label nFineFaces = upperAddr.size();
|
||||
const label nFineFaces = upperAddr.size();
|
||||
|
||||
// Get restriction map for current level
|
||||
const labelField& restrictMap = restrictAddressing(fineLevelIndex);
|
||||
@ -282,15 +283,29 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
|
||||
const label nReq = Pstream::nRequests();
|
||||
|
||||
// Initialise transfer of restrict addressing on the interface
|
||||
// The finest mesh uses patchAddr from the original lduAdressing.
|
||||
// the coarser levels create their own adressing for faceCells
|
||||
forAll(fineInterfaces, inti)
|
||||
{
|
||||
if (fineInterfaces.set(inti))
|
||||
{
|
||||
fineInterfaces[inti].initInternalFieldTransfer
|
||||
(
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
restrictMap
|
||||
);
|
||||
if (fineLevelIndex == 0)
|
||||
{
|
||||
fineInterfaces[inti].initInternalFieldTransfer
|
||||
(
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
restrictMap,
|
||||
fineMeshAddr.patchAddr(inti)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
fineInterfaces[inti].initInternalFieldTransfer
|
||||
(
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
restrictMap
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -320,6 +335,51 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
|
||||
{
|
||||
if (fineInterfaces.set(inti))
|
||||
{
|
||||
tmp<labelField> restrictMapInternalField;
|
||||
|
||||
// The finest mesh uses patchAddr from the original lduAdressing.
|
||||
// the coarser levels create thei own adressing for faceCells
|
||||
if (fineLevelIndex == 0)
|
||||
{
|
||||
restrictMapInternalField =
|
||||
fineInterfaces[inti].interfaceInternalField
|
||||
(
|
||||
restrictMap,
|
||||
fineMeshAddr.patchAddr(inti)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
restrictMapInternalField =
|
||||
fineInterfaces[inti].interfaceInternalField
|
||||
(
|
||||
restrictMap
|
||||
);
|
||||
}
|
||||
|
||||
tmp<labelField> nbrRestrictMapInternalField =
|
||||
fineInterfaces[inti].internalFieldTransfer
|
||||
(
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
restrictMap
|
||||
);
|
||||
|
||||
coarseInterfaces.set
|
||||
(
|
||||
inti,
|
||||
GAMGInterface::New
|
||||
(
|
||||
inti,
|
||||
meshLevels_[fineLevelIndex].rawInterfaces(),
|
||||
fineInterfaces[inti],
|
||||
restrictMapInternalField(),
|
||||
nbrRestrictMapInternalField(),
|
||||
fineLevelIndex,
|
||||
fineMesh.comm()
|
||||
).ptr()
|
||||
);
|
||||
|
||||
/* Same as below:
|
||||
coarseInterfaces.set
|
||||
(
|
||||
inti,
|
||||
@ -338,6 +398,7 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
|
||||
fineMesh.comm()
|
||||
).ptr()
|
||||
);
|
||||
*/
|
||||
|
||||
nPatchFaces[inti] = coarseInterfaces[inti].faceCells().size();
|
||||
patchFineToCoarse[inti] = refCast<const GAMGInterface>
|
||||
|
||||
@ -295,13 +295,17 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
|
||||
const dictionary& controlDict
|
||||
)
|
||||
{
|
||||
if
|
||||
(
|
||||
!mesh.thisDb().foundObject<GAMGAgglomeration>
|
||||
const GAMGAgglomeration* agglomPtr =
|
||||
mesh.thisDb().cfindObject<GAMGAgglomeration>
|
||||
(
|
||||
GAMGAgglomeration::typeName
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if (agglomPtr)
|
||||
{
|
||||
return *agglomPtr;
|
||||
}
|
||||
|
||||
{
|
||||
const word agglomeratorType
|
||||
(
|
||||
@ -331,13 +335,6 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
|
||||
|
||||
return store(cstrIter()(mesh, controlDict).ptr());
|
||||
}
|
||||
else
|
||||
{
|
||||
return mesh.thisDb().lookupObject<GAMGAgglomeration>
|
||||
(
|
||||
GAMGAgglomeration::typeName
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -349,13 +346,17 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
|
||||
{
|
||||
const lduMesh& mesh = matrix.mesh();
|
||||
|
||||
if
|
||||
(
|
||||
!mesh.thisDb().foundObject<GAMGAgglomeration>
|
||||
const GAMGAgglomeration* agglomPtr =
|
||||
mesh.thisDb().cfindObject<GAMGAgglomeration>
|
||||
(
|
||||
GAMGAgglomeration::typeName
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if (agglomPtr)
|
||||
{
|
||||
return *agglomPtr;
|
||||
}
|
||||
|
||||
{
|
||||
const word agglomeratorType
|
||||
(
|
||||
@ -385,17 +386,10 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
|
||||
return store(cstrIter()(matrix, controlDict).ptr());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return mesh.thisDb().lookupObject<GAMGAgglomeration>
|
||||
(
|
||||
GAMGAgglomeration::typeName
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::autoPtr<Foam::GAMGAgglomeration> Foam::GAMGAgglomeration::New
|
||||
const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New
|
||||
(
|
||||
const lduMesh& mesh,
|
||||
const scalarField& cellVolumes,
|
||||
@ -403,40 +397,54 @@ Foam::autoPtr<Foam::GAMGAgglomeration> Foam::GAMGAgglomeration::New
|
||||
const dictionary& controlDict
|
||||
)
|
||||
{
|
||||
const word agglomeratorType
|
||||
(
|
||||
controlDict.getOrDefault<word>("agglomerator", "faceAreaPair")
|
||||
);
|
||||
|
||||
mesh.thisDb().time().libs().open
|
||||
(
|
||||
controlDict,
|
||||
"geometricGAMGAgglomerationLibs",
|
||||
geometryConstructorTablePtr_
|
||||
);
|
||||
const GAMGAgglomeration* agglomPtr =
|
||||
mesh.thisDb().cfindObject<GAMGAgglomeration>
|
||||
(
|
||||
GAMGAgglomeration::typeName
|
||||
);
|
||||
|
||||
auto cstrIter = geometryConstructorTablePtr_->cfind(agglomeratorType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (agglomPtr)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown GAMGAgglomeration type "
|
||||
<< agglomeratorType << ".\n"
|
||||
<< "Valid geometric GAMGAgglomeration types :"
|
||||
<< geometryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
return *agglomPtr;
|
||||
}
|
||||
|
||||
return autoPtr<GAMGAgglomeration>
|
||||
(
|
||||
cstrIter()
|
||||
{
|
||||
const word agglomeratorType
|
||||
(
|
||||
mesh,
|
||||
cellVolumes,
|
||||
faceAreas,
|
||||
controlDict
|
||||
)
|
||||
);
|
||||
controlDict.lookupOrDefault<word>("agglomerator", "faceAreaPair")
|
||||
);
|
||||
|
||||
const_cast<Time&>(mesh.thisDb().time()).libs().open
|
||||
(
|
||||
controlDict,
|
||||
"geometricGAMGAgglomerationLibs",
|
||||
geometryConstructorTablePtr_
|
||||
);
|
||||
|
||||
auto cstrIter = geometryConstructorTablePtr_->cfind(agglomeratorType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown GAMGAgglomeration type "
|
||||
<< agglomeratorType << ".\n"
|
||||
<< "Valid geometric GAMGAgglomeration types :"
|
||||
<< geometryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return store
|
||||
(
|
||||
cstrIter()
|
||||
(
|
||||
mesh,
|
||||
cellVolumes,
|
||||
faceAreas,
|
||||
controlDict
|
||||
).ptr()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -609,8 +617,8 @@ bool Foam::GAMGAgglomeration::checkRestriction
|
||||
|
||||
forAll(lower, facei)
|
||||
{
|
||||
label own = lower[facei];
|
||||
label nei = upper[facei];
|
||||
const label own = lower[facei];
|
||||
const label nei = upper[facei];
|
||||
|
||||
if (restriction[own] == restriction[nei])
|
||||
{
|
||||
@ -683,7 +691,7 @@ bool Foam::GAMGAgglomeration::checkRestriction
|
||||
{
|
||||
const label coarseI = restriction[celli];
|
||||
|
||||
label index = coarseToMasters[coarseI].find(master[celli]);
|
||||
const label index = coarseToMasters[coarseI].find(master[celli]);
|
||||
newRestrict[celli] = coarseToNewCoarse[coarseI][index];
|
||||
}
|
||||
|
||||
|
||||
@ -306,7 +306,7 @@ public:
|
||||
);
|
||||
|
||||
//- Return the selected geometric agglomerator
|
||||
static autoPtr<GAMGAgglomeration> New
|
||||
static const GAMGAgglomeration& New
|
||||
(
|
||||
const lduMesh& mesh,
|
||||
const scalarField& cellVolumes,
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -107,6 +107,8 @@ void Foam::cyclicGAMGInterfaceField::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -114,14 +116,20 @@ void Foam::cyclicGAMGInterfaceField::updateInterfaceMatrix
|
||||
) const
|
||||
{
|
||||
// Get neighbouring field
|
||||
solveScalarField pnf
|
||||
(
|
||||
cyclicInterface_.neighbPatch().interfaceInternalField(psiInternal)
|
||||
);
|
||||
|
||||
const labelList& nbrFaceCells =
|
||||
lduAddr.patchAddr
|
||||
(
|
||||
cyclicInterface_.neighbPatchID()
|
||||
);
|
||||
|
||||
solveScalarField pnf(psiInternal, nbrFaceCells);
|
||||
|
||||
transformCoupleField(pnf, cmpt);
|
||||
|
||||
this->addToInternalField(result, !add, coeffs, pnf);
|
||||
const labelList& faceCells = lduAddr.patchAddr(patchId);
|
||||
|
||||
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -150,6 +150,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
|
||||
@ -91,6 +91,8 @@ void Foam::processorGAMGInterfaceField::initInterfaceMatrixUpdate
|
||||
(
|
||||
solveScalarField&,
|
||||
const bool,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField&,
|
||||
const direction,
|
||||
@ -142,6 +144,8 @@ void Foam::processorGAMGInterfaceField::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField&,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -153,6 +157,8 @@ void Foam::processorGAMGInterfaceField::updateInterfaceMatrix
|
||||
return;
|
||||
}
|
||||
|
||||
const labelUList& faceCells = lduAddr.patchAddr(patchId);
|
||||
|
||||
if
|
||||
(
|
||||
commsType == Pstream::commsTypes::nonBlocking
|
||||
@ -178,7 +184,7 @@ void Foam::processorGAMGInterfaceField::updateInterfaceMatrix
|
||||
transformCoupleField(scalarReceiveBuf_, cmpt);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
addToInternalField(result, !add, coeffs, scalarReceiveBuf_);
|
||||
addToInternalField(result, !add, faceCells, coeffs, scalarReceiveBuf_);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -192,7 +198,7 @@ void Foam::processorGAMGInterfaceField::updateInterfaceMatrix
|
||||
);
|
||||
transformCoupleField(pnf, cmpt);
|
||||
|
||||
addToInternalField(result, !add, coeffs, pnf);
|
||||
addToInternalField(result, !add, faceCells, coeffs, pnf);
|
||||
}
|
||||
|
||||
const_cast<processorGAMGInterfaceField&>(*this).updatedMatrix() = true;
|
||||
|
||||
@ -142,6 +142,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -153,6 +155,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -77,13 +78,23 @@ Foam::tmp<Foam::labelField> Foam::GAMGInterface::interfaceInternalField
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::labelField> Foam::GAMGInterface::interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData,
|
||||
const labelUList& faceCells
|
||||
) const
|
||||
{
|
||||
return interfaceInternalField<label>(internalData, faceCells);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::GAMGInterface::agglomerateCoeffs
|
||||
(
|
||||
const scalarField& fineCoeffs
|
||||
) const
|
||||
{
|
||||
tmp<scalarField> tcoarseCoeffs(new scalarField(size(), Zero));
|
||||
scalarField& coarseCoeffs = tcoarseCoeffs.ref();
|
||||
auto tcoarseCoeffs = tmp<scalarField>::New(size(), Zero);
|
||||
auto& coarseCoeffs = tcoarseCoeffs.ref();
|
||||
|
||||
if (fineCoeffs.size() != faceRestrictAddressing_.size())
|
||||
{
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -27,7 +28,7 @@ Class
|
||||
Foam::GAMGInterface
|
||||
|
||||
Description
|
||||
Abstract base class for GAMG agglomerated interfaces.
|
||||
Abstract base class for GAMG agglomerated interfaces.
|
||||
|
||||
SourceFiles
|
||||
GAMGInterface.C
|
||||
@ -55,7 +56,6 @@ class GAMGInterface
|
||||
:
|
||||
public lduInterface
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
@ -73,9 +73,7 @@ protected:
|
||||
labelList faceRestrictAddressing_;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
// Protected Member Functions
|
||||
|
||||
//- No copy construct
|
||||
GAMGInterface(const GAMGInterface&) = delete;
|
||||
@ -245,6 +243,15 @@ public:
|
||||
const UList<Type>& internalData
|
||||
) const;
|
||||
|
||||
//- Return the interface internal field of the given field
|
||||
//- using faceCell mapping
|
||||
template<class Type>
|
||||
tmp<Field<Type>> interfaceInternalField
|
||||
(
|
||||
const UList<Type>& internalData,
|
||||
const labelUList& faceCells
|
||||
) const;
|
||||
|
||||
//- Get the interface internal field of the given field
|
||||
template<class Type>
|
||||
void interfaceInternalField
|
||||
@ -260,6 +267,14 @@ public:
|
||||
const labelUList& internalData
|
||||
) const;
|
||||
|
||||
//- Return the values of the given internal data adjacent to
|
||||
//- the interface as a field using faceCell mapping
|
||||
virtual tmp<labelField> interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData,
|
||||
const labelUList& faceCells
|
||||
) const;
|
||||
|
||||
|
||||
// Agglomeration
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -35,12 +36,30 @@ Foam::tmp<Foam::Field<Type>> Foam::GAMGInterface::interfaceInternalField
|
||||
const UList<Type>& iF
|
||||
) const
|
||||
{
|
||||
tmp<Field<Type>> tresult(new Field<Type>(size()));
|
||||
auto tresult = tmp<Field<Type>>::New(size());
|
||||
interfaceInternalField(iF, tresult.ref());
|
||||
return tresult;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>> Foam::GAMGInterface::interfaceInternalField
|
||||
(
|
||||
const UList<Type>& iF,
|
||||
const labelUList& faceCells
|
||||
) const
|
||||
{
|
||||
auto tresult = tmp<Field<Type>>::New(faceCells.size());
|
||||
auto& result = tresult.ref();
|
||||
|
||||
forAll(result, elemi)
|
||||
{
|
||||
result[elemi] = iF[faceCells[elemi]];
|
||||
}
|
||||
return tresult;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::GAMGInterface::interfaceInternalField
|
||||
(
|
||||
@ -48,11 +67,11 @@ void Foam::GAMGInterface::interfaceInternalField
|
||||
List<Type>& result
|
||||
) const
|
||||
{
|
||||
result.setSize(size());
|
||||
result.resize(size());
|
||||
|
||||
forAll(result, elemI)
|
||||
forAll(result, elemi)
|
||||
{
|
||||
result[elemI] = iF[faceCells_[elemI]];
|
||||
result[elemi] = iF[faceCells_[elemi]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -166,7 +166,7 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
|
||||
|
||||
Foam::tmp<Foam::labelField> Foam::cyclicGAMGInterface::internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes,
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& iF
|
||||
) const
|
||||
{
|
||||
|
||||
@ -162,7 +162,7 @@ public:
|
||||
// I/O
|
||||
|
||||
//- Write to stream
|
||||
virtual void write(Ostream&) const;
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -191,13 +191,24 @@ void Foam::processorGAMGInterface::initInternalFieldTransfer
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorGAMGInterface::initInternalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& iF,
|
||||
const labelUList& faceCells
|
||||
) const
|
||||
{
|
||||
send(commsType, interfaceInternalField(iF, faceCells)());
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::labelField> Foam::processorGAMGInterface::internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& iF
|
||||
) const
|
||||
{
|
||||
tmp<Field<label>> tfld(receive<label>(commsType, this->size()));
|
||||
tmp<labelField> tfld(receive<label>(commsType, this->size()));
|
||||
|
||||
return tfld;
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from fine-level interface,
|
||||
// local and neighbour restrict addressing
|
||||
//- local and neighbour restrict addressing
|
||||
processorGAMGInterface
|
||||
(
|
||||
const label index,
|
||||
@ -140,6 +140,15 @@ public:
|
||||
const labelUList& iF
|
||||
) const;
|
||||
|
||||
|
||||
//- Initialise neighbour field transfer using faceCells mapping
|
||||
virtual void initInternalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& iF,
|
||||
const labelUList& faceCells
|
||||
) const;
|
||||
|
||||
//- Transfer and return internal field adjacent to the interface
|
||||
virtual tmp<labelField> internalFieldTransfer
|
||||
(
|
||||
@ -184,7 +193,7 @@ public:
|
||||
// I/O
|
||||
|
||||
//- Write to stream
|
||||
virtual void write(Ostream&) const;
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ public:
|
||||
virtual const lduAddressing& lduAddr() const = 0;
|
||||
|
||||
//- Return a list of pointers for each patch
|
||||
// with only those pointing to interfaces being set
|
||||
//- with only those pointing to interfaces being set
|
||||
virtual lduInterfacePtrsList interfaces() const = 0;
|
||||
|
||||
//- Return communicator used for parallel communication
|
||||
|
||||
@ -41,23 +41,24 @@ namespace Foam
|
||||
//- Less operator for pairs of \<processor\>\<index\>
|
||||
class procLess
|
||||
{
|
||||
const labelPairList& lst_;
|
||||
const labelPairList& list_;
|
||||
|
||||
public:
|
||||
|
||||
procLess(const labelPairList& lst)
|
||||
procLess(const labelPairList& list)
|
||||
:
|
||||
lst_(lst)
|
||||
list_(list)
|
||||
{}
|
||||
|
||||
bool operator()(const label a, const label b)
|
||||
{
|
||||
return lst_[a].first() < lst_[b].first();
|
||||
return list_[a].first() < list_[b].first();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::lduPrimitiveMesh::checkUpperTriangular
|
||||
@ -85,7 +86,7 @@ void Foam::lduPrimitiveMesh::checkUpperTriangular
|
||||
}
|
||||
}
|
||||
|
||||
for (label facei=1; facei < l.size(); facei++)
|
||||
for (label facei=1; facei < l.size(); ++facei)
|
||||
{
|
||||
if (l[facei-1] > l[facei])
|
||||
{
|
||||
@ -113,6 +114,132 @@ void Foam::lduPrimitiveMesh::checkUpperTriangular
|
||||
}
|
||||
|
||||
|
||||
Foam::labelListList Foam::lduPrimitiveMesh::globalCellCells
|
||||
(
|
||||
const lduMesh& mesh,
|
||||
const globalIndex& globalNumbering
|
||||
)
|
||||
{
|
||||
const lduAddressing& addr = mesh.lduAddr();
|
||||
lduInterfacePtrsList interfaces = mesh.interfaces();
|
||||
|
||||
const labelList globalIndices
|
||||
(
|
||||
identity
|
||||
(
|
||||
addr.size(),
|
||||
globalNumbering.localStart(UPstream::myProcNo(mesh.comm()))
|
||||
)
|
||||
);
|
||||
|
||||
// Get the interface cells
|
||||
PtrList<labelList> nbrGlobalCells(interfaces.size());
|
||||
{
|
||||
// Initialise transfer of restrict addressing on the interface
|
||||
forAll(interfaces, inti)
|
||||
{
|
||||
if (interfaces.set(inti))
|
||||
{
|
||||
interfaces[inti].initInternalFieldTransfer
|
||||
(
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
globalIndices
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
Pstream::waitRequests();
|
||||
}
|
||||
|
||||
forAll(interfaces, inti)
|
||||
{
|
||||
if (interfaces.set(inti))
|
||||
{
|
||||
nbrGlobalCells.set
|
||||
(
|
||||
inti,
|
||||
new labelList
|
||||
(
|
||||
interfaces[inti].internalFieldTransfer
|
||||
(
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
globalIndices
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Scan the neighbour list to find out how many times the cell
|
||||
// appears as a neighbour of the face. Done this way to avoid guessing
|
||||
// and resizing list
|
||||
labelList nNbrs(addr.size(), Zero);
|
||||
|
||||
const labelUList& nbr = addr.upperAddr();
|
||||
const labelUList& own = addr.lowerAddr();
|
||||
|
||||
{
|
||||
forAll(nbr, facei)
|
||||
{
|
||||
nNbrs[nbr[facei]]++;
|
||||
nNbrs[own[facei]]++;
|
||||
}
|
||||
|
||||
forAll(interfaces, inti)
|
||||
{
|
||||
if (interfaces.set(inti))
|
||||
{
|
||||
for (const label celli : interfaces[inti].faceCells())
|
||||
{
|
||||
nNbrs[celli]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Create cell-cells addressing
|
||||
labelListList cellCells(addr.size());
|
||||
|
||||
forAll(cellCells, celli)
|
||||
{
|
||||
cellCells[celli].setSize(nNbrs[celli], -1);
|
||||
}
|
||||
|
||||
// Reset the list of number of neighbours to zero
|
||||
nNbrs = 0;
|
||||
|
||||
// Scatter the neighbour faces
|
||||
forAll(nbr, facei)
|
||||
{
|
||||
const label c0 = own[facei];
|
||||
const label c1 = nbr[facei];
|
||||
|
||||
cellCells[c0][nNbrs[c0]++] = globalIndices[c1];
|
||||
cellCells[c1][nNbrs[c1]++] = globalIndices[c0];
|
||||
}
|
||||
forAll(interfaces, inti)
|
||||
{
|
||||
if (interfaces.set(inti))
|
||||
{
|
||||
const labelUList& faceCells = interfaces[inti].faceCells();
|
||||
|
||||
forAll(faceCells, facei)
|
||||
{
|
||||
const label c0 = faceCells[facei];
|
||||
cellCells[c0][nNbrs[c0]++] = nbrGlobalCells[inti][facei];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return cellCells;
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::lduPrimitiveMesh::totalSize
|
||||
(
|
||||
const PtrList<lduPrimitiveMesh>& meshes
|
||||
@ -164,7 +291,7 @@ Foam::labelList Foam::lduPrimitiveMesh::upperTriOrder
|
||||
labelList cellToFaces(offsets.last());
|
||||
forAll(upper, facei)
|
||||
{
|
||||
label celli = lower[facei];
|
||||
const label celli = lower[facei];
|
||||
cellToFaces[nNbrs[celli]++] = facei;
|
||||
}
|
||||
|
||||
@ -172,17 +299,19 @@ Foam::labelList Foam::lduPrimitiveMesh::upperTriOrder
|
||||
|
||||
labelList oldToNew(lower.size());
|
||||
|
||||
labelList order;
|
||||
labelList nbr;
|
||||
DynamicList<label> order;
|
||||
DynamicList<label> nbr;
|
||||
|
||||
label newFacei = 0;
|
||||
|
||||
for (label celli = 0; celli < nCells; celli++)
|
||||
for (label celli = 0; celli < nCells; ++celli)
|
||||
{
|
||||
label startOfCell = offsets[celli];
|
||||
label nNbr = offsets[celli+1] - startOfCell;
|
||||
const label startOfCell = offsets[celli];
|
||||
const label nNbr = offsets[celli+1] - startOfCell;
|
||||
|
||||
nbr.resize(nNbr);
|
||||
order.resize(nNbr);
|
||||
|
||||
nbr.setSize(nNbr);
|
||||
forAll(nbr, i)
|
||||
{
|
||||
nbr[i] = upper[cellToFaces[offsets[celli]+i]];
|
||||
@ -216,7 +345,6 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
|
||||
comm_(comm)
|
||||
{}
|
||||
|
||||
|
||||
void Foam::lduPrimitiveMesh::addInterfaces
|
||||
(
|
||||
lduInterfacePtrsList& interfaces,
|
||||
@ -238,6 +366,16 @@ void Foam::lduPrimitiveMesh::addInterfaces
|
||||
}
|
||||
|
||||
|
||||
Foam::lduPrimitiveMesh::lduPrimitiveMesh
|
||||
(
|
||||
const label nCells
|
||||
)
|
||||
:
|
||||
lduAddressing(nCells),
|
||||
comm_(0)
|
||||
{}
|
||||
|
||||
|
||||
Foam::lduPrimitiveMesh::lduPrimitiveMesh
|
||||
(
|
||||
const label nCells,
|
||||
@ -251,7 +389,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
|
||||
lduAddressing(nCells),
|
||||
lowerAddr_(l, true),
|
||||
upperAddr_(u, true),
|
||||
primitiveInterfaces_(0),
|
||||
primitiveInterfaces_(),
|
||||
patchSchedule_(ps),
|
||||
comm_(comm)
|
||||
{
|
||||
@ -286,10 +424,6 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
|
||||
)
|
||||
:
|
||||
lduAddressing(myMesh.lduAddr().size() + totalSize(otherMeshes)),
|
||||
lowerAddr_(0),
|
||||
upperAddr_(0),
|
||||
interfaces_(0),
|
||||
patchSchedule_(0),
|
||||
comm_(comm)
|
||||
{
|
||||
const label currentComm = myMesh.comm();
|
||||
@ -338,7 +472,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
|
||||
// Cells get added in order.
|
||||
cellOffsets.setSize(nMeshes+1);
|
||||
cellOffsets[0] = 0;
|
||||
for (label procMeshI = 0; procMeshI < nMeshes; procMeshI++)
|
||||
for (label procMeshI = 0; procMeshI < nMeshes; ++procMeshI)
|
||||
{
|
||||
const lduMesh& procMesh = mesh(myMesh, otherMeshes, procMeshI);
|
||||
|
||||
@ -351,7 +485,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
|
||||
// Faces initially get added in order, sorted later
|
||||
labelList internalFaceOffsets(nMeshes+1);
|
||||
internalFaceOffsets[0] = 0;
|
||||
for (label procMeshI = 0; procMeshI < nMeshes; procMeshI++)
|
||||
for (label procMeshI = 0; procMeshI < nMeshes; ++procMeshI)
|
||||
{
|
||||
const lduMesh& procMesh = mesh(myMesh, otherMeshes, procMeshI);
|
||||
|
||||
@ -380,7 +514,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
|
||||
label nOtherInterfaces = 0;
|
||||
labelList nCoupledFaces(nMeshes, Zero);
|
||||
|
||||
for (label procMeshI = 0; procMeshI < nMeshes; procMeshI++)
|
||||
for (label procMeshI = 0; procMeshI < nMeshes; ++procMeshI)
|
||||
{
|
||||
const lduInterfacePtrsList interfaces =
|
||||
mesh(myMesh, otherMeshes, procMeshI).interfaces();
|
||||
@ -539,7 +673,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
|
||||
faceOffsets.setSize(nMeshes+1);
|
||||
faceOffsets[0] = 0;
|
||||
faceMap.setSize(nMeshes);
|
||||
for (label procMeshI = 0; procMeshI < nMeshes; procMeshI++)
|
||||
for (label procMeshI = 0; procMeshI < nMeshes; ++procMeshI)
|
||||
{
|
||||
const lduMesh& procMesh = mesh(myMesh, otherMeshes, procMeshI);
|
||||
label nInternal = procMesh.lduAddr().lowerAddr().size();
|
||||
@ -566,7 +700,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
|
||||
// Old internal faces and resolved coupled interfaces
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
for (label procMeshI = 0; procMeshI < nMeshes; procMeshI++)
|
||||
for (label procMeshI = 0; procMeshI < nMeshes; ++procMeshI)
|
||||
{
|
||||
const lduMesh& procMesh = mesh(myMesh, otherMeshes, procMeshI);
|
||||
|
||||
@ -961,7 +1095,7 @@ void Foam::lduPrimitiveMesh::gather
|
||||
otherMeshes.setSize(procIDs.size()-1);
|
||||
|
||||
// Slave meshes
|
||||
for (label i = 1; i < procIDs.size(); i++)
|
||||
for (label i = 1; i < procIDs.size(); ++i)
|
||||
{
|
||||
//Pout<< "on master :"
|
||||
// << " receiving from slave " << procIDs[i] << endl;
|
||||
|
||||
@ -28,7 +28,7 @@ Class
|
||||
Foam::lduPrimitiveMesh
|
||||
|
||||
Description
|
||||
Simplest contrete lduMesh which stores the addressing needed by lduMatrix.
|
||||
Simplest concrete lduMesh that stores the addressing needed by lduMatrix.
|
||||
|
||||
SourceFiles
|
||||
lduPrimitiveMesh.C
|
||||
@ -99,6 +99,9 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from number of cells
|
||||
explicit lduPrimitiveMesh(const label nCells);
|
||||
|
||||
//- Construct from components but without interfaces. Add interfaces
|
||||
// separately using addInterfaces
|
||||
lduPrimitiveMesh
|
||||
@ -110,6 +113,7 @@ public:
|
||||
bool reuse
|
||||
);
|
||||
|
||||
|
||||
//- Add interfaces to a mesh constructed without
|
||||
void addInterfaces
|
||||
(
|
||||
@ -186,13 +190,32 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
//- Return non-const ldu addressing
|
||||
virtual lduAddressing& lduAddr()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
//- Return a list of pointers for each patch
|
||||
// with only those pointing to interfaces being set
|
||||
//- with only those pointing to interfaces being set
|
||||
virtual lduInterfacePtrsList interfaces() const
|
||||
{
|
||||
return interfaces_;
|
||||
}
|
||||
|
||||
//- Return a non-const list of pointers for each patch
|
||||
//- with only those pointing to interfaces being set
|
||||
virtual lduInterfacePtrsList& interfaces()
|
||||
{
|
||||
return interfaces_;
|
||||
}
|
||||
|
||||
//- Return a non-const list of primitive interfaces
|
||||
PtrList<const lduInterface>& primitiveInterfaces()
|
||||
{
|
||||
return primitiveInterfaces_;
|
||||
}
|
||||
|
||||
//- Return a list of pointers for each patch
|
||||
// with only those pointing to interfaces being set
|
||||
// (reference to cached interfaces)
|
||||
@ -219,6 +242,18 @@ public:
|
||||
return upperAddr_;
|
||||
}
|
||||
|
||||
//- Return non-const Lower addressing
|
||||
virtual labelList& lowerAddr()
|
||||
{
|
||||
return lowerAddr_;
|
||||
}
|
||||
|
||||
//- Return non-const Upper addressing
|
||||
virtual labelList& upperAddr()
|
||||
{
|
||||
return upperAddr_;
|
||||
}
|
||||
|
||||
//- Return patch addressing
|
||||
virtual const labelUList& patchAddr(const label i) const
|
||||
{
|
||||
@ -271,6 +306,13 @@ public:
|
||||
const labelUList& l,
|
||||
const labelUList& u
|
||||
);
|
||||
|
||||
//- Calculate global cell-cells
|
||||
static labelListList globalCellCells
|
||||
(
|
||||
const lduMesh& mesh,
|
||||
const globalIndex& globalNumbering
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -70,9 +70,9 @@ void Foam::coupledPolyPatch::writeOBJ
|
||||
const labelList& pointLabels
|
||||
)
|
||||
{
|
||||
forAll(pointLabels, i)
|
||||
for (const label pointi : pointLabels)
|
||||
{
|
||||
writeOBJ(os, points[pointLabels[i]]);
|
||||
writeOBJ(os, points[pointi]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,10 +108,8 @@ void Foam::coupledPolyPatch::writeOBJ
|
||||
|
||||
label vertI = 0;
|
||||
|
||||
forAll(faces, i)
|
||||
for (const face& f : faces)
|
||||
{
|
||||
const face& f = faces[i];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
if (foamToObj.insert(f[fp], vertI))
|
||||
@ -526,6 +524,18 @@ Foam::coupledPolyPatch::coupledPolyPatch
|
||||
{}
|
||||
|
||||
|
||||
Foam::coupledPolyPatch::coupledPolyPatch
|
||||
(
|
||||
const coupledPolyPatch& pp,
|
||||
const labelList& faceCells
|
||||
)
|
||||
:
|
||||
polyPatch(pp, faceCells),
|
||||
matchTolerance_(pp.matchTolerance_),
|
||||
transform_(pp.transform_)
|
||||
{}
|
||||
|
||||
|
||||
Foam::coupledPolyPatch::coupledPolyPatch
|
||||
(
|
||||
const coupledPolyPatch& pp,
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -207,11 +208,14 @@ public:
|
||||
const word& patchType
|
||||
);
|
||||
|
||||
//- Construct as copy, resetting the boundary mesh
|
||||
coupledPolyPatch(const coupledPolyPatch&, const polyBoundaryMesh&);
|
||||
//- Copy construct, resetting the boundary mesh
|
||||
coupledPolyPatch(const coupledPolyPatch&, const polyBoundaryMesh& bm);
|
||||
|
||||
//- Copy construct, resetting the faceCells
|
||||
coupledPolyPatch(const coupledPolyPatch&, const labelList& faceCells);
|
||||
|
||||
//- Construct given the original patch and resetting the
|
||||
// face list and boundary mesh information
|
||||
//- face list and boundary mesh information
|
||||
coupledPolyPatch
|
||||
(
|
||||
const coupledPolyPatch& pp,
|
||||
@ -238,6 +242,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
//- Return true because this patch is coupled
|
||||
@ -360,7 +365,7 @@ public:
|
||||
);
|
||||
|
||||
//- Write the polyPatch data as a dictionary
|
||||
virtual void write(Ostream&) const;
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -734,6 +734,28 @@ Foam::cyclicPolyPatch::cyclicPolyPatch
|
||||
}
|
||||
|
||||
|
||||
Foam::cyclicPolyPatch::cyclicPolyPatch
|
||||
(
|
||||
const cyclicPolyPatch& pp,
|
||||
const label nrbPatchID,
|
||||
const labelList& faceCells
|
||||
)
|
||||
:
|
||||
coupledPolyPatch(pp, faceCells),
|
||||
neighbPatchName_(pp.neighbPatchName_),
|
||||
coupleGroup_(pp.coupleGroup_),
|
||||
neighbPatchID_(nrbPatchID),
|
||||
rotationAxis_(pp.rotationAxis_),
|
||||
rotationCentre_(pp.rotationCentre_),
|
||||
separationVector_(pp.separationVector_),
|
||||
coupledPointsPtr_(nullptr),
|
||||
coupledEdgesPtr_(nullptr)
|
||||
{
|
||||
// Neighbour patch might not be valid yet so no transformation
|
||||
// calculation possible.
|
||||
}
|
||||
|
||||
|
||||
Foam::cyclicPolyPatch::cyclicPolyPatch
|
||||
(
|
||||
const cyclicPolyPatch& pp,
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -234,11 +235,19 @@ public:
|
||||
const word& patchType
|
||||
);
|
||||
|
||||
//- Construct as copy, resetting the boundary mesh
|
||||
//- Copy construct, resetting the boundary mesh
|
||||
cyclicPolyPatch(const cyclicPolyPatch&, const polyBoundaryMesh&);
|
||||
|
||||
//- Copy construct, resetting nbrPatchID and faceCells
|
||||
cyclicPolyPatch
|
||||
(
|
||||
const cyclicPolyPatch&,
|
||||
label nbrPatchID,
|
||||
const labelList& faceCells
|
||||
);
|
||||
|
||||
//- Construct given the original patch and resetting the
|
||||
// face list and boundary mesh information
|
||||
//- face list and boundary mesh information
|
||||
cyclicPolyPatch
|
||||
(
|
||||
const cyclicPolyPatch& pp,
|
||||
@ -312,6 +321,49 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Implicit Functions
|
||||
|
||||
//- Return number of new internal of this polyPatch faces
|
||||
virtual void newInternalProcFaces
|
||||
(
|
||||
label& newFaces,
|
||||
label& newProcFaces
|
||||
) const
|
||||
{
|
||||
newFaces = this->size();
|
||||
newProcFaces = neighbPatch().size() - this->size();
|
||||
}
|
||||
|
||||
//- Return nbrCells
|
||||
virtual const labelUList& nbrCells() const
|
||||
{
|
||||
return neighbPatch().faceCells();
|
||||
}
|
||||
|
||||
virtual label neighbPolyPatchID() const
|
||||
{
|
||||
return this->neighbPatchID();
|
||||
}
|
||||
|
||||
virtual refPtr<labelListList> mapCollocatedFaces() const
|
||||
{
|
||||
refPtr<labelListList> tMap(new labelListList(this->size()));
|
||||
labelListList& map = tMap.ref();
|
||||
forAll (map, i)
|
||||
{
|
||||
labelList& subMap = map[i];
|
||||
subMap.setSize(1);
|
||||
subMap[0] = i;
|
||||
}
|
||||
return tMap;
|
||||
}
|
||||
|
||||
//- Return implicit master
|
||||
virtual bool masterImplicit() const
|
||||
{
|
||||
return owner();
|
||||
}
|
||||
|
||||
//- Neighbour patch name
|
||||
const word& neighbPatchName() const;
|
||||
|
||||
|
||||
@ -252,6 +252,18 @@ Foam::polyPatch::polyPatch(const polyPatch& p)
|
||||
{}
|
||||
|
||||
|
||||
Foam::polyPatch::polyPatch
|
||||
(
|
||||
const polyPatch& p,
|
||||
const labelList& faceCells
|
||||
)
|
||||
:
|
||||
polyPatch(p)
|
||||
{
|
||||
faceCellsPtr_ = new labelList::subList(faceCells, faceCells.size());
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::polyPatch::~polyPatch()
|
||||
|
||||
@ -203,11 +203,11 @@ public:
|
||||
const word& patchType
|
||||
);
|
||||
|
||||
//- Construct as copy, resetting the boundary mesh
|
||||
//- Copy construct, resetting the boundary mesh
|
||||
polyPatch(const polyPatch&, const polyBoundaryMesh&);
|
||||
|
||||
//- Construct given the original patch and resetting the
|
||||
// face list and boundary mesh information
|
||||
//- face list and boundary mesh information
|
||||
polyPatch
|
||||
(
|
||||
const polyPatch& pp,
|
||||
@ -227,8 +227,19 @@ public:
|
||||
const label newStart
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
polyPatch(const polyPatch&);
|
||||
//- Copy construct
|
||||
polyPatch(const polyPatch& p);
|
||||
|
||||
//- Copy construct, setting faceCells
|
||||
// \note The faceCells are held by the caller
|
||||
polyPatch(const polyPatch& p, const labelList& faceCells);
|
||||
|
||||
//- Construct and return a clone, setting faceCells
|
||||
// \note The faceCells are held by the caller
|
||||
virtual autoPtr<polyPatch> clone(const labelList& faceCells) const
|
||||
{
|
||||
return autoPtr<polyPatch>::New(*this, faceCells);
|
||||
}
|
||||
|
||||
//- Construct and return a clone, resetting the boundary mesh
|
||||
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
|
||||
@ -266,8 +277,7 @@ public:
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a pointer to a new patch created on freestore from
|
||||
// components
|
||||
//- Return pointer to a new patch created on freestore from components
|
||||
static autoPtr<polyPatch> New
|
||||
(
|
||||
const word& patchType,
|
||||
@ -278,8 +288,7 @@ public:
|
||||
const polyBoundaryMesh& bm
|
||||
);
|
||||
|
||||
//- Return a pointer to a new patch created on freestore from
|
||||
// dictionary
|
||||
//- Return pointer to a new patch created on freestore from dictionary
|
||||
static autoPtr<polyPatch> New
|
||||
(
|
||||
const word& name,
|
||||
@ -288,8 +297,7 @@ public:
|
||||
const polyBoundaryMesh& bm
|
||||
);
|
||||
|
||||
//- Return a pointer to a new patch created on freestore from
|
||||
// dictionary
|
||||
//- Return pointer to a new patch created on freestore from dictionary
|
||||
static autoPtr<polyPatch> New
|
||||
(
|
||||
const word& patchType,
|
||||
@ -306,6 +314,51 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
|
||||
// Implicit treatment functions
|
||||
|
||||
//- Return number of new internal of this polyPatch faces
|
||||
virtual void newInternalProcFaces(label&, label&) const
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
//- Return nbrCells
|
||||
virtual const labelUList& nbrCells() const
|
||||
{
|
||||
NotImplemented
|
||||
return faceCells();
|
||||
}
|
||||
|
||||
//- Return nbr patchID
|
||||
virtual label neighbPolyPatchID() const
|
||||
{
|
||||
NotImplemented;
|
||||
return -1;
|
||||
}
|
||||
|
||||
//- Return mapped collocated faces
|
||||
virtual refPtr<labelListList> mapCollocatedFaces() const
|
||||
{
|
||||
NotImplemented;
|
||||
refPtr<labelListList> tMap(new labelListList(size()));
|
||||
return tMap;
|
||||
}
|
||||
|
||||
//- Return implicit master
|
||||
virtual bool masterImplicit() const
|
||||
{
|
||||
NotImplemented;
|
||||
return false;
|
||||
}
|
||||
|
||||
//- Return neighbour region name
|
||||
virtual word neighbRegionID() const
|
||||
{
|
||||
return word("none");
|
||||
}
|
||||
|
||||
|
||||
//- The offset where this patch starts in the boundary face list
|
||||
// The value is the same as patch.start() - mesh.nInternalFaces()
|
||||
label offset() const;
|
||||
@ -364,7 +417,7 @@ public:
|
||||
|
||||
|
||||
//- Write the polyPatch data as a dictionary
|
||||
virtual void write(Ostream&) const;
|
||||
virtual void write(Ostream& os) const;
|
||||
|
||||
|
||||
// Geometric data; point list required
|
||||
|
||||
@ -2,6 +2,7 @@ EXE_INC = \
|
||||
-I../turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/regionCoupled/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
|
||||
@ -118,6 +118,23 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
|
||||
kappaLayers_(0),
|
||||
contactRes_(0.0)
|
||||
{
|
||||
if (!isA<mappedPatchBase>(this->patch().patch()))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "' not type '" << mappedPatchBase::typeName << "'"
|
||||
<< "\n for patch " << p.name()
|
||||
<< " of field " << internalField().name()
|
||||
<< " in file " << internalField().objectPath()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
WarningInFunction
|
||||
<< "This BC has been superseded by "
|
||||
<< "compressible::turbulentTemperatureRadCoupledMixed "
|
||||
<< "which has more functionalities and it can handle "
|
||||
<< "the assemble coupled option for energy. "
|
||||
<< endl;
|
||||
|
||||
if (dict.readIfPresent("thicknessLayers", thicknessLayers_))
|
||||
{
|
||||
dict.readEntry("kappaLayers", kappaLayers_);
|
||||
@ -349,6 +366,53 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs()
|
||||
}
|
||||
|
||||
|
||||
void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::manipulateMatrix
|
||||
(
|
||||
fvMatrix<scalar>& m,
|
||||
const label iMatrix,
|
||||
const direction cmpt
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "This BC does not support energy coupling "
|
||||
<< "Use compressible::turbulentTemperatureRadCoupledMixed "
|
||||
<< "which has more functionalities and it can handle "
|
||||
<< "the assemble coupled option for energy. "
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
|
||||
tmp<Field<scalar>>
|
||||
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::coeffs
|
||||
(
|
||||
fvMatrix<scalar>& matrix,
|
||||
const Field<scalar>& coeffs,
|
||||
const label mat
|
||||
) const
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "This BC does not support energy coupling "
|
||||
<< "Use compressible::turbulentTemperatureRadCoupledMixed "
|
||||
<< "which has more functionalities and it can handle "
|
||||
<< "the assemble coupled option for energy. "
|
||||
<< abort(FatalError);
|
||||
/*
|
||||
const label index(this->patch().index());
|
||||
|
||||
const label nSubFaces(matrix.lduMesh().cellBoundMap()[mat][index].size());
|
||||
|
||||
Field<scalar> mapCoeffs(nSubFaces, Zero);
|
||||
|
||||
label subFaceI = 0;
|
||||
forAll(*this, faceI)
|
||||
{
|
||||
|
||||
}
|
||||
*/
|
||||
return tmp<Field<scalar>>(new Field<scalar>());
|
||||
}
|
||||
|
||||
|
||||
void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write
|
||||
(
|
||||
Ostream& os
|
||||
|
||||
@ -117,6 +117,17 @@ class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
|
||||
scalar contactRes_;
|
||||
|
||||
|
||||
// Private member functions
|
||||
|
||||
//- Calculate coefficients for assembly matrix
|
||||
tmp<Field<scalar>> coeffs
|
||||
(
|
||||
fvMatrix<scalar>& matrix,
|
||||
const Field<scalar>&,
|
||||
const label
|
||||
) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -193,13 +204,22 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// Member functions
|
||||
// Member Functions
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
//- Manipulate matrix
|
||||
virtual void manipulateMatrix
|
||||
(
|
||||
fvMatrix<scalar>& m,
|
||||
const label iMatrix,
|
||||
const direction cmpt
|
||||
);
|
||||
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -69,6 +69,7 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
|
||||
this->refValue() = 0.0;
|
||||
this->refGrad() = 0.0;
|
||||
this->valueFraction() = 1.0;
|
||||
this->source() = 0.0;
|
||||
}
|
||||
|
||||
|
||||
@ -152,6 +153,19 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField
|
||||
refGrad() = 0.0;
|
||||
valueFraction() = 1.0;
|
||||
}
|
||||
|
||||
if (dict.found("useImplicit"))
|
||||
{
|
||||
useImplicit() = dict.get<Switch>("useImplicit");
|
||||
}
|
||||
if (dict.found("source"))
|
||||
{
|
||||
source() = scalarField("source", dict, p.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
source() = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -320,6 +334,19 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
refGrad() = (qr + qrNbr)/kappa(Tp);
|
||||
}
|
||||
|
||||
source() = Zero;
|
||||
|
||||
// If useImplicit is true we need the source term associated with this BC
|
||||
if (this->useImplicit())
|
||||
{
|
||||
source() =
|
||||
alphaSfDelta()*
|
||||
(
|
||||
valueFraction()*deltaH()
|
||||
+ (qr + qrNbr)/beta()
|
||||
);
|
||||
}
|
||||
|
||||
mixedFvPatchScalarField::updateCoeffs();
|
||||
|
||||
if (debug)
|
||||
@ -345,6 +372,138 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
|
||||
}
|
||||
|
||||
|
||||
void turbulentTemperatureRadCoupledMixedFvPatchScalarField::manipulateMatrix
|
||||
(
|
||||
fvMatrix<scalar>& m,
|
||||
const label iMatrix,
|
||||
const direction cmpt
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "This T BC does not support energy coupling "
|
||||
<< "It is implemented on he field "
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
|
||||
tmp<Field<scalar>> turbulentTemperatureRadCoupledMixedFvPatchScalarField::coeffs
|
||||
(
|
||||
fvMatrix<scalar>& matrix,
|
||||
const Field<scalar>& coeffs,
|
||||
const label mat
|
||||
) const
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "This BC does not support energy coupling "
|
||||
<< "Use compressible::turbulentTemperatureRadCoupledMixed "
|
||||
<< "which has more functionalities and it can handle "
|
||||
<< "the assemble coupled option for energy. "
|
||||
<< abort(FatalError);
|
||||
|
||||
return tmp<Field<scalar>>(new Field<scalar>());
|
||||
}
|
||||
|
||||
|
||||
tmp<scalarField>
|
||||
turbulentTemperatureRadCoupledMixedFvPatchScalarField::alphaSfDelta() const
|
||||
{
|
||||
return (alpha(*this)*patch().deltaCoeffs()*patch().magSf());
|
||||
}
|
||||
|
||||
|
||||
tmp<scalarField> turbulentTemperatureRadCoupledMixedFvPatchScalarField::
|
||||
beta() const
|
||||
{
|
||||
const mappedPatchBase& mpp =
|
||||
refCast<const mappedPatchBase>(patch().patch());
|
||||
|
||||
const label samplePatchi = mpp.samplePolyPatch().index();
|
||||
const polyMesh& nbrMesh = mpp.sampleMesh();
|
||||
|
||||
const fvPatch& nbrPatch =
|
||||
refCast<const fvMesh>(nbrMesh).boundary()[samplePatchi];
|
||||
|
||||
const turbulentTemperatureRadCoupledMixedFvPatchScalarField&
|
||||
nbrField = refCast
|
||||
<const turbulentTemperatureRadCoupledMixedFvPatchScalarField>
|
||||
(
|
||||
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
|
||||
);
|
||||
|
||||
// Swap to obtain full local values of neighbour internal field
|
||||
scalarField TcNbr(nbrField.patchInternalField());
|
||||
mpp.distribute(TcNbr);
|
||||
|
||||
scalarField alphaDeltaNbr
|
||||
(
|
||||
nbrField.alpha(TcNbr)*nbrPatch.deltaCoeffs()
|
||||
);
|
||||
mpp.distribute(alphaDeltaNbr);
|
||||
|
||||
scalarField alphaDelta
|
||||
(
|
||||
alpha(*this)*patch().deltaCoeffs()
|
||||
);
|
||||
|
||||
return (alphaDeltaNbr + alphaDelta);
|
||||
}
|
||||
|
||||
|
||||
tmp<scalarField> turbulentTemperatureRadCoupledMixedFvPatchScalarField::
|
||||
deltaH() const
|
||||
{
|
||||
|
||||
const mappedPatchBase& mpp =
|
||||
refCast<const mappedPatchBase>(patch().patch());
|
||||
|
||||
const polyMesh& nbrMesh = mpp.sampleMesh();
|
||||
|
||||
const basicThermo* nbrThermo =
|
||||
nbrMesh.cfindObject<basicThermo>(basicThermo::dictName);
|
||||
|
||||
const polyMesh& mesh = patch().boundaryMesh().mesh();
|
||||
|
||||
const basicThermo* localThermo =
|
||||
mesh.cfindObject<basicThermo>(basicThermo::dictName);
|
||||
|
||||
|
||||
if (nbrThermo && localThermo)
|
||||
{
|
||||
const label patchi = patch().index();
|
||||
const scalarField& pp = localThermo->p().boundaryField()[patchi];
|
||||
const scalarField& Tp = *this;
|
||||
|
||||
const mappedPatchBase& mpp =
|
||||
refCast<const mappedPatchBase>(patch().patch());
|
||||
|
||||
const label patchiNrb = mpp.samplePolyPatch().index();
|
||||
|
||||
const scalarField& ppNbr = nbrThermo->p().boundaryField()[patchiNrb];
|
||||
//const scalarField& TpNbr = nbrThermo->T().boundaryField()[patchiNrb];
|
||||
|
||||
// Use this Tp to evaluate he jump as this is updated while doing
|
||||
// updateCoeffs on boundary fields which set T values on patches
|
||||
// then non consistent Tp and Tpnbr could be used from different
|
||||
// updated values (specially when T changes drastically between time
|
||||
// steps/
|
||||
return
|
||||
(
|
||||
- localThermo->he(pp, Tp, patchi)
|
||||
+ nbrThermo->he(ppNbr, Tp, patchiNrb)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Can't find thermos on mapped patch "
|
||||
<< " method, but thermo package not available"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return tmp<scalarField>::New(patch().size(), Zero);
|
||||
}
|
||||
|
||||
|
||||
void turbulentTemperatureRadCoupledMixedFvPatchScalarField::write
|
||||
(
|
||||
Ostream& os
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2017 OpenCFD Ltd
|
||||
Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -100,12 +100,13 @@ class turbulentTemperatureRadCoupledMixedFvPatchScalarField
|
||||
public mixedFvPatchScalarField,
|
||||
public temperatureCoupledBase
|
||||
{
|
||||
// Private data
|
||||
|
||||
// Private Data
|
||||
|
||||
//- Name of field on the neighbour region
|
||||
const word TnbrName_;
|
||||
|
||||
//- Name of the radiative heat flux in the neighbour region
|
||||
//- Name of the radiative heat flux in the neighbour region
|
||||
const word qrNbrName_;
|
||||
|
||||
//- Name of the radiative heat flux in local region
|
||||
@ -124,6 +125,27 @@ class turbulentTemperatureRadCoupledMixedFvPatchScalarField
|
||||
Switch thermalInertia_;
|
||||
|
||||
|
||||
// Private Functions
|
||||
|
||||
//- Return local alphaSfDelta
|
||||
tmp<scalarField> alphaSfDelta() const;
|
||||
|
||||
//- Return delta enthalpy between regions
|
||||
tmp<scalarField> deltaH() const;
|
||||
|
||||
//- Return the sum of deltaCoeff*alpha from nbr and local
|
||||
tmp<scalarField> beta() const;
|
||||
|
||||
|
||||
//- Calculate coefficients for assembly matrix
|
||||
tmp<Field<scalar>> coeffs
|
||||
(
|
||||
fvMatrix<scalar>& matrix,
|
||||
const Field<scalar>&,
|
||||
const label
|
||||
) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -195,13 +217,22 @@ public:
|
||||
}
|
||||
|
||||
|
||||
// Member functions
|
||||
// Member Functions
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
//- Manipulate matrix
|
||||
virtual void manipulateMatrix
|
||||
(
|
||||
fvMatrix<scalar>& m,
|
||||
const label iMatrix,
|
||||
const direction cmpt
|
||||
);
|
||||
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -130,8 +130,7 @@ void Foam::porousBafflePressureFvPatchField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const surfaceScalarField& phi =
|
||||
db().lookupObject<surfaceScalarField>(phiName_);
|
||||
const auto& phi = db().lookupObject<surfaceScalarField>(phiName_);
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -48,6 +49,7 @@ void Foam::cyclicFaPatch::calcTransforms()
|
||||
{
|
||||
if (size() > 0)
|
||||
{
|
||||
// const label sizeby2 = this->size()/2;
|
||||
pointField half0Ctrs(size()/2);
|
||||
pointField half1Ctrs(size()/2);
|
||||
for (label i=0; i<size()/2; ++i)
|
||||
@ -153,7 +155,7 @@ void Foam::cyclicFaPatch::makeWeights(scalarField& w) const
|
||||
const scalarField& magL = magEdgeLengths();
|
||||
|
||||
const scalarField deltas(edgeNormals() & faPatch::delta());
|
||||
label sizeby2 = deltas.size()/2;
|
||||
const label sizeby2 = deltas.size()/2;
|
||||
|
||||
scalar maxMatchError = 0;
|
||||
label errorEdge = -1;
|
||||
@ -206,7 +208,7 @@ void Foam::cyclicFaPatch::makeWeights(scalarField& w) const
|
||||
void Foam::cyclicFaPatch::makeDeltaCoeffs(scalarField& dc) const
|
||||
{
|
||||
const scalarField deltas(edgeNormals() & faPatch::delta());
|
||||
label sizeby2 = deltas.size()/2;
|
||||
const label sizeby2 = deltas.size()/2;
|
||||
|
||||
for (label edgei = 0; edgei < sizeby2; ++edgei)
|
||||
{
|
||||
@ -248,10 +250,10 @@ void Foam::cyclicFaPatch::movePoints(const pointField& p)
|
||||
Foam::tmp<Foam::vectorField> Foam::cyclicFaPatch::delta() const
|
||||
{
|
||||
const vectorField patchD(faPatch::delta());
|
||||
label sizeby2 = patchD.size()/2;
|
||||
const label sizeby2 = patchD.size()/2;
|
||||
|
||||
tmp<vectorField> tpdv(new vectorField(patchD.size()));
|
||||
vectorField& pdv = tpdv.ref();
|
||||
auto tpdv = tmp<vectorField>::New(patchD.size());
|
||||
auto& pdv = tpdv.ref();
|
||||
|
||||
// Do the transformation if necessary
|
||||
if (parallel())
|
||||
@ -290,16 +292,26 @@ Foam::tmp<Foam::labelField> Foam::cyclicFaPatch::interfaceInternalField
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::labelField> Foam::cyclicFaPatch::interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData,
|
||||
const labelUList& edgeFaces
|
||||
) const
|
||||
{
|
||||
return patchInternalField(internalData, edgeFaces);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::labelField> Foam::cyclicFaPatch::transfer
|
||||
(
|
||||
const Pstream::commsTypes,
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& interfaceData
|
||||
) const
|
||||
{
|
||||
tmp<labelField> tpnf(new labelField(this->size()));
|
||||
labelField& pnf = tpnf.ref();
|
||||
auto tpnf = tmp<labelField>::New(this->size());
|
||||
auto& pnf = tpnf.ref();
|
||||
|
||||
label sizeby2 = this->size()/2;
|
||||
const label sizeby2 = this->size()/2;
|
||||
|
||||
for (label edgei=0; edgei<sizeby2; ++edgei)
|
||||
{
|
||||
@ -317,12 +329,21 @@ Foam::tmp<Foam::labelField> Foam::cyclicFaPatch::internalFieldTransfer
|
||||
const labelUList& iF
|
||||
) const
|
||||
{
|
||||
const labelUList& edgeCells = this->faceCells();
|
||||
return internalFieldTransfer(commsType, iF, this->faceCells());
|
||||
}
|
||||
|
||||
tmp<labelField> tpnf(new labelField(this->size()));
|
||||
labelField& pnf = tpnf.ref();
|
||||
|
||||
label sizeby2 = this->size()/2;
|
||||
Foam::tmp<Foam::labelField> Foam::cyclicFaPatch::internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& iF,
|
||||
const labelUList& edgeCells
|
||||
) const
|
||||
{
|
||||
auto tpnf = tmp<labelField>::New(this->size());
|
||||
auto& pnf = tpnf.ref();
|
||||
|
||||
const label sizeby2 = this->size()/2;
|
||||
|
||||
for (label edgei=0; edgei<sizeby2; ++edgei)
|
||||
{
|
||||
|
||||
@ -167,12 +167,22 @@ public:
|
||||
// Interface transfer functions
|
||||
|
||||
//- Return the values of the given internal data adjacent to
|
||||
// the interface as a field
|
||||
//- the interface as a field
|
||||
virtual tmp<labelField> interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData
|
||||
) const;
|
||||
|
||||
|
||||
//- Return the values of the given internal data adjacent to
|
||||
//- the interface as a field using edgeFace mapping
|
||||
virtual tmp<labelField> interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData,
|
||||
const labelUList& edgeFaces
|
||||
) const;
|
||||
|
||||
|
||||
//- Transfer and return neighbour field
|
||||
virtual tmp<labelField> transfer
|
||||
(
|
||||
@ -186,6 +196,15 @@ public:
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& internalData
|
||||
) const;
|
||||
|
||||
|
||||
//- Return neighbour field using edgeCells mapping
|
||||
virtual tmp<labelField> internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& internalData,
|
||||
const labelUList& edgeCells
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -77,7 +78,6 @@ void Foam::processorFaPatch::makeNonGlobalPatchPoints() const
|
||||
(
|
||||
!Pstream::parRun()
|
||||
|| !boundaryMesh().mesh()().globalData().nGlobalPoints()
|
||||
// || !boundaryMesh().mesh().globalData().nGlobalPoints()
|
||||
)
|
||||
{
|
||||
nonGlobalPatchPointsPtr_ = new labelList(nPoints());
|
||||
@ -464,6 +464,16 @@ Foam::tmp<Foam::labelField> Foam::processorFaPatch::interfaceInternalField
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::labelField> Foam::processorFaPatch::interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData,
|
||||
const labelUList& edgeFaces
|
||||
) const
|
||||
{
|
||||
return patchInternalField(internalData, edgeFaces);
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorFaPatch::initTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
@ -504,6 +514,17 @@ Foam::tmp<Foam::labelField> Foam::processorFaPatch::internalFieldTransfer
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::labelField> Foam::processorFaPatch::internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList&,
|
||||
const labelUList&
|
||||
) const
|
||||
{
|
||||
return receive<label>(commsType, this->size());
|
||||
}
|
||||
|
||||
|
||||
void Foam::processorFaPatch::write(Ostream& os) const
|
||||
{
|
||||
faPatch::write(os);
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -264,12 +265,20 @@ public:
|
||||
// Interface transfer functions
|
||||
|
||||
//- Return the values of the given internal data adjacent to
|
||||
// the interface as a field
|
||||
//- the interface as a field
|
||||
virtual tmp<labelField> interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData
|
||||
) const;
|
||||
|
||||
//- Return the values of the given internal data adjacent to
|
||||
//- the interface as a field using edgeFaces
|
||||
virtual tmp<labelField> interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData,
|
||||
const labelUList& edgeFaces
|
||||
) const;
|
||||
|
||||
//- Initialise interface data transfer
|
||||
virtual void initTransfer
|
||||
(
|
||||
@ -298,8 +307,16 @@ public:
|
||||
const labelUList& internalData
|
||||
) const;
|
||||
|
||||
//- Return neighbour field using mapping
|
||||
virtual tmp<labelField> internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& internalData,
|
||||
const labelUList& edgeCells
|
||||
) const;
|
||||
|
||||
//- Write the patch data as a dictionary
|
||||
virtual void write(Ostream&) const;
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -357,6 +357,15 @@ public:
|
||||
template<class Type>
|
||||
tmp<Field<Type>> patchInternalField(const UList<Type>&) const;
|
||||
|
||||
//- Return given internal field next to patch as patch field
|
||||
// providing addressing
|
||||
template<class Type>
|
||||
tmp<Foam::Field<Type>> patchInternalField
|
||||
(
|
||||
const UList<Type>& f,
|
||||
const labelUList& edgeFaces
|
||||
) const;
|
||||
|
||||
//- Return the corresponding patchField of the named field
|
||||
template<class GeometricField, class Type>
|
||||
const typename GeometricField::Patch& patchField
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -35,10 +36,19 @@ Foam::tmp<Foam::Field<Type>> Foam::faPatch::patchInternalField
|
||||
const UList<Type>& f
|
||||
) const
|
||||
{
|
||||
tmp<Field<Type>> tpif (new Field<Type>(size()));
|
||||
Field<Type>& pif = tpif.ref();
|
||||
return patchInternalField(f, this->edgeFaces());
|
||||
}
|
||||
|
||||
const labelUList& edgeFaces = this->edgeFaces();
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>> Foam::faPatch::patchInternalField
|
||||
(
|
||||
const UList<Type>& f,
|
||||
const labelUList& edgeFaces
|
||||
) const
|
||||
{
|
||||
auto tpif = tmp<Field<Type>>::New(size());
|
||||
auto& pif = tpif.ref();
|
||||
|
||||
forAll(pif, facei)
|
||||
{
|
||||
|
||||
@ -193,6 +193,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
@ -204,6 +206,8 @@ public:
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>&,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes commsType
|
||||
|
||||
@ -129,7 +129,7 @@ Foam::cyclicFaPatchField<Type>::patchNeighbourField() const
|
||||
tmp<Field<Type>> tpnf(new Field<Type>(this->size()));
|
||||
Field<Type>& pnf = tpnf.ref();
|
||||
|
||||
label sizeby2 = this->size()/2;
|
||||
const label sizeby2 = this->size()/2;
|
||||
|
||||
if (doTransform())
|
||||
{
|
||||
@ -164,6 +164,8 @@ void Foam::cyclicFaPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -172,7 +174,7 @@ void Foam::cyclicFaPatchField<Type>::updateInterfaceMatrix
|
||||
{
|
||||
solveScalarField pnf(this->size());
|
||||
|
||||
label sizeby2 = this->size()/2;
|
||||
const label sizeby2 = this->size()/2;
|
||||
const labelUList& faceCells = cyclicPatch_.faceCells();
|
||||
|
||||
for (label facei = 0; facei < sizeby2; ++facei)
|
||||
@ -207,6 +209,8 @@ void Foam::cyclicFaPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes commsType
|
||||
@ -214,7 +218,7 @@ void Foam::cyclicFaPatchField<Type>::updateInterfaceMatrix
|
||||
{
|
||||
Field<Type> pnf(this->size());
|
||||
|
||||
label sizeby2 = this->size()/2;
|
||||
const label sizeby2 = this->size()/2;
|
||||
const labelUList& faceCells = cyclicPatch_.faceCells();
|
||||
|
||||
for (label facei = 0; facei < sizeby2; ++facei)
|
||||
|
||||
@ -179,6 +179,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -190,6 +192,8 @@ public:
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>&,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes commsType
|
||||
|
||||
@ -192,6 +192,8 @@ void Foam::processorFaPatchField<Type>::initInterfaceMatrixUpdate
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
@ -211,6 +213,8 @@ void Foam::processorFaPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField&,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -251,6 +255,8 @@ void Foam::processorFaPatchField<Type>::initInterfaceMatrixUpdate
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes commsType
|
||||
@ -269,6 +275,8 @@ void Foam::processorFaPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>&,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes commsType
|
||||
|
||||
@ -193,6 +193,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -204,6 +206,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -215,6 +219,8 @@ public:
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>&,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes commsType
|
||||
@ -225,6 +231,8 @@ public:
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>&,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes commsType
|
||||
|
||||
@ -44,6 +44,8 @@ void Foam::processorFaPatchField<Foam::scalar>::initInterfaceMatrixUpdate
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
@ -63,6 +65,8 @@ void Foam::processorFaPatchField<Foam::scalar>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField&,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
|
||||
@ -51,6 +51,8 @@ void processorFaPatchField<scalar>::initInterfaceMatrixUpdate
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField&,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
@ -63,6 +65,8 @@ void processorFaPatchField<scalar>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField&,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
|
||||
@ -142,6 +142,7 @@ $(constraintFvPatchFields)/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.C
|
||||
$(constraintFvPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFields.C
|
||||
$(constraintFvPatchFields)/processor/processorFvPatchFields.C
|
||||
$(constraintFvPatchFields)/processorCyclic/processorCyclicFvPatchFields.C
|
||||
$(constraintFvPatchFields)/calculatedProcessor/calculatedProcessorFvPatchFields.C
|
||||
$(constraintFvPatchFields)/symmetryPlane/symmetryPlaneFvPatchFields.C
|
||||
$(constraintFvPatchFields)/symmetryPlane/symmetryPlaneFvPatchScalarField.C
|
||||
$(constraintFvPatchFields)/symmetry/symmetryFvPatchFields.C
|
||||
@ -516,4 +517,9 @@ $(fvOptions)/fvOptionIO.C
|
||||
$(fvOptions)/fvOptionList.C
|
||||
$(fvOptions)/fvOptions.C
|
||||
|
||||
lduPrimitiveMeshAssembly/AssemblyFvPatches.C
|
||||
lduPrimitiveMeshAssembly/lduPrimitiveMeshAssembly.C
|
||||
lduPrimitiveMeshAssembly/assemblyFaceAreaPairGAMGAgglomeration/assemblyFaceAreaPairGAMGAgglomeration.C
|
||||
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libfiniteVolume
|
||||
|
||||
@ -9,3 +9,4 @@ LIB_LIBS = \
|
||||
-lfileFormats \
|
||||
-lsurfMesh \
|
||||
-lmeshTools
|
||||
|
||||
|
||||
@ -211,6 +211,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction,
|
||||
@ -222,6 +224,8 @@ public:
|
||||
(
|
||||
Field<Type>&,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>&,
|
||||
const scalarField&,
|
||||
const Pstream::commsTypes commsType
|
||||
|
||||
@ -39,7 +39,8 @@ Foam::mixedFvPatchField<Type>::mixedFvPatchField
|
||||
fvPatchField<Type>(p, iF),
|
||||
refValue_(p.size()),
|
||||
refGrad_(p.size()),
|
||||
valueFraction_(p.size())
|
||||
valueFraction_(p.size()),
|
||||
source_(p.size(), Zero)
|
||||
{}
|
||||
|
||||
|
||||
@ -54,7 +55,8 @@ Foam::mixedFvPatchField<Type>::mixedFvPatchField
|
||||
fvPatchField<Type>(p, iF, dict, false),
|
||||
refValue_("refValue", dict, p.size()),
|
||||
refGrad_("refGradient", dict, p.size()),
|
||||
valueFraction_("valueFraction", dict, p.size())
|
||||
valueFraction_("valueFraction", dict, p.size()),
|
||||
source_(p.size(), Zero)
|
||||
{
|
||||
// Could also check/clip fraction to 0-1 range
|
||||
evaluate();
|
||||
@ -73,7 +75,8 @@ Foam::mixedFvPatchField<Type>::mixedFvPatchField
|
||||
fvPatchField<Type>(ptf, p, iF, mapper),
|
||||
refValue_(ptf.refValue_, mapper),
|
||||
refGrad_(ptf.refGrad_, mapper),
|
||||
valueFraction_(ptf.valueFraction_, mapper)
|
||||
valueFraction_(ptf.valueFraction_, mapper),
|
||||
source_(ptf.source_, mapper)
|
||||
{
|
||||
if (notNull(iF) && mapper.hasUnmapped())
|
||||
{
|
||||
@ -96,7 +99,8 @@ Foam::mixedFvPatchField<Type>::mixedFvPatchField
|
||||
fvPatchField<Type>(ptf),
|
||||
refValue_(ptf.refValue_),
|
||||
refGrad_(ptf.refGrad_),
|
||||
valueFraction_(ptf.valueFraction_)
|
||||
valueFraction_(ptf.valueFraction_),
|
||||
source_(ptf.source_)
|
||||
{}
|
||||
|
||||
|
||||
@ -110,7 +114,8 @@ Foam::mixedFvPatchField<Type>::mixedFvPatchField
|
||||
fvPatchField<Type>(ptf, iF),
|
||||
refValue_(ptf.refValue_),
|
||||
refGrad_(ptf.refGrad_),
|
||||
valueFraction_(ptf.valueFraction_)
|
||||
valueFraction_(ptf.valueFraction_),
|
||||
source_(ptf.source_)
|
||||
{}
|
||||
|
||||
|
||||
@ -126,6 +131,7 @@ void Foam::mixedFvPatchField<Type>::autoMap
|
||||
refValue_.autoMap(m);
|
||||
refGrad_.autoMap(m);
|
||||
valueFraction_.autoMap(m);
|
||||
source_.autoMap(m);
|
||||
}
|
||||
|
||||
|
||||
@ -144,12 +150,14 @@ void Foam::mixedFvPatchField<Type>::rmap
|
||||
refValue_.rmap(mptf.refValue_, addr);
|
||||
refGrad_.rmap(mptf.refGrad_, addr);
|
||||
valueFraction_.rmap(mptf.valueFraction_, addr);
|
||||
source_.rmap(mptf.source_, addr);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::mixedFvPatchField<Type>::evaluate(const Pstream::commsTypes)
|
||||
{
|
||||
|
||||
if (!this->updated())
|
||||
{
|
||||
this->updateCoeffs();
|
||||
@ -158,9 +166,8 @@ void Foam::mixedFvPatchField<Type>::evaluate(const Pstream::commsTypes)
|
||||
Field<Type>::operator=
|
||||
(
|
||||
valueFraction_*refValue_
|
||||
+
|
||||
(1.0 - valueFraction_)*
|
||||
(
|
||||
+ (1.0 - valueFraction_)
|
||||
*(
|
||||
this->patchInternalField()
|
||||
+ refGrad_/this->patch().deltaCoeffs()
|
||||
)
|
||||
@ -190,7 +197,6 @@ Foam::mixedFvPatchField<Type>::valueInternalCoeffs
|
||||
) const
|
||||
{
|
||||
return Type(pTraits<Type>::one)*(1.0 - valueFraction_);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -202,8 +208,8 @@ Foam::mixedFvPatchField<Type>::valueBoundaryCoeffs
|
||||
) const
|
||||
{
|
||||
return
|
||||
valueFraction_*refValue_
|
||||
+ (1.0 - valueFraction_)*refGrad_/this->patch().deltaCoeffs();
|
||||
valueFraction_*refValue_
|
||||
+ (1.0 - valueFraction_)*refGrad_/this->patch().deltaCoeffs();
|
||||
}
|
||||
|
||||
|
||||
@ -232,6 +238,7 @@ void Foam::mixedFvPatchField<Type>::write(Ostream& os) const
|
||||
refValue_.writeEntry("refValue", os);
|
||||
refGrad_.writeEntry("refGradient", os);
|
||||
valueFraction_.writeEntry("valueFraction", os);
|
||||
source_.writeEntry("source", os);
|
||||
this->writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
@ -100,6 +100,9 @@ class mixedFvPatchField
|
||||
//- Fraction (0-1) of value used for boundary condition
|
||||
scalarField valueFraction_;
|
||||
|
||||
//- Source field
|
||||
Field<Type> source_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -219,6 +222,16 @@ public:
|
||||
return valueFraction_;
|
||||
}
|
||||
|
||||
virtual Field<Type>& source()
|
||||
{
|
||||
return source_;
|
||||
}
|
||||
|
||||
virtual const Field<Type>& source() const
|
||||
{
|
||||
return source_;
|
||||
}
|
||||
|
||||
|
||||
// Mapping functions
|
||||
|
||||
|
||||
@ -37,7 +37,6 @@ Foam::calculatedProcessorFvPatchField<Type>::calculatedProcessorFvPatchField
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
)
|
||||
:
|
||||
//lduInterfaceField(interface),
|
||||
coupledFvPatchField<Type>(p, iF),
|
||||
procInterface_(refCast<const lduPrimitiveProcessorInterface>(interface)),
|
||||
sendBuf_(interface.faceCells().size()),
|
||||
@ -55,7 +54,6 @@ Foam::calculatedProcessorFvPatchField<Type>::calculatedProcessorFvPatchField
|
||||
const calculatedProcessorFvPatchField<Type>& ptf
|
||||
)
|
||||
:
|
||||
//lduInterfaceField(ptf.procInterface_),
|
||||
coupledFvPatchField<Type>(ptf),
|
||||
procInterface_(ptf.procInterface_),
|
||||
sendBuf_(procInterface_.faceCells().size()),
|
||||
@ -75,7 +73,6 @@ Foam::calculatedProcessorFvPatchField<Type>::calculatedProcessorFvPatchField
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
)
|
||||
:
|
||||
//lduInterfaceField(ptf.procInterface_),
|
||||
coupledFvPatchField<Type>(ptf, iF),
|
||||
procInterface_(ptf.procInterface_),
|
||||
sendBuf_(procInterface_.faceCells().size()),
|
||||
@ -98,9 +95,7 @@ bool Foam::calculatedProcessorFvPatchField<Type>::ready() const
|
||||
&& this->outstandingSendRequest_ < Pstream::nRequests()
|
||||
)
|
||||
{
|
||||
bool finished =
|
||||
UPstream::finishedRequest(this->outstandingSendRequest_);
|
||||
if (!finished)
|
||||
if (!UPstream::finishedRequest(this->outstandingSendRequest_))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -113,9 +108,7 @@ bool Foam::calculatedProcessorFvPatchField<Type>::ready() const
|
||||
&& this->outstandingRecvRequest_ < Pstream::nRequests()
|
||||
)
|
||||
{
|
||||
bool finished =
|
||||
UPstream::finishedRequest(this->outstandingRecvRequest_);
|
||||
if (!finished)
|
||||
if (!UPstream::finishedRequest(this->outstandingRecvRequest_))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -130,7 +123,7 @@ template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::calculatedProcessorFvPatchField<Type>::patchNeighbourField() const
|
||||
{
|
||||
if (debug && !this->ready())
|
||||
if (!this->ready())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "On patch of size " << procInterface_.faceCells().size()
|
||||
@ -217,6 +210,8 @@ void Foam::calculatedProcessorFvPatchField<Type>::initInterfaceMatrixUpdate
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -224,14 +219,16 @@ void Foam::calculatedProcessorFvPatchField<Type>::initInterfaceMatrixUpdate
|
||||
) const
|
||||
{
|
||||
// Bypass patchInternalField since uses fvPatch addressing
|
||||
const labelList& fc = procInterface_.faceCells();
|
||||
|
||||
const labelList& fc = lduAddr.patchAddr(patchId);
|
||||
|
||||
scalarSendBuf_.setSize(fc.size());
|
||||
forAll(fc, i)
|
||||
{
|
||||
scalarSendBuf_[i] = psiInternal[fc[i]];
|
||||
}
|
||||
|
||||
if (debug && !this->ready())
|
||||
if (!this->ready())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "On patch " //<< interface_.name()
|
||||
@ -240,8 +237,10 @@ void Foam::calculatedProcessorFvPatchField<Type>::initInterfaceMatrixUpdate
|
||||
}
|
||||
|
||||
|
||||
|
||||
scalarReceiveBuf_.setSize(scalarSendBuf_.size());
|
||||
outstandingRecvRequest_ = UPstream::nRequests();
|
||||
|
||||
UIPstream::read
|
||||
(
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
@ -253,6 +252,7 @@ void Foam::calculatedProcessorFvPatchField<Type>::initInterfaceMatrixUpdate
|
||||
);
|
||||
|
||||
outstandingSendRequest_ = UPstream::nRequests();
|
||||
|
||||
UOPstream::write
|
||||
(
|
||||
Pstream::commsTypes::nonBlocking,
|
||||
@ -303,6 +303,8 @@ void Foam::calculatedProcessorFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -314,6 +316,7 @@ void Foam::calculatedProcessorFvPatchField<Type>::updateInterfaceMatrix
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if
|
||||
(
|
||||
outstandingRecvRequest_ >= 0
|
||||
@ -337,13 +340,4 @@ void Foam::calculatedProcessorFvPatchField<Type>::updateInterfaceMatrix
|
||||
}
|
||||
|
||||
|
||||
//template<class Type>
|
||||
//void Foam::calculatedProcessorFvPatchField<Type>::write(Ostream& os) const
|
||||
//{
|
||||
// //zeroGradientFvPatchField<Type>::write(os);
|
||||
// fvPatchField<Type>::write(os);
|
||||
// this->writeEntry("value", os);
|
||||
//}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -30,7 +30,7 @@ Group
|
||||
grpGenericBoundaryConditions
|
||||
|
||||
Description
|
||||
processorFvPatchField type bypassing fvPatch
|
||||
A processorFvPatchField type bypassing fvPatch
|
||||
|
||||
Used to temporarily add updateInterfaceMatrix capabilities to a matrix
|
||||
during overset solving. Supplies:
|
||||
@ -68,7 +68,7 @@ class calculatedProcessorFvPatchField
|
||||
{
|
||||
protected:
|
||||
|
||||
// Private data
|
||||
// Protected data
|
||||
|
||||
//- Local reference cast into the interface
|
||||
const lduPrimitiveProcessorInterface& procInterface_;
|
||||
@ -94,8 +94,7 @@ protected:
|
||||
mutable label outstandingRecvRequest_;
|
||||
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
// Protected Member Functions
|
||||
|
||||
void addToInternalField
|
||||
(
|
||||
@ -234,6 +233,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -245,6 +246,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -256,6 +259,8 @@ public:
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes commsType
|
||||
@ -269,6 +274,8 @@ public:
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes commsType
|
||||
@ -278,7 +285,7 @@ public:
|
||||
}
|
||||
|
||||
//- Write
|
||||
//virtual void write(Ostream&) const;
|
||||
// virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
@ -37,15 +37,31 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineNamedTemplateTypeNameAndDebug(calculatedProcessorFvPatchScalarField, 0);
|
||||
defineNamedTemplateTypeNameAndDebug(calculatedProcessorFvPatchVectorField, 0);
|
||||
defineNamedTemplateTypeNameAndDebug
|
||||
(
|
||||
calculatedProcessorFvPatchScalarField,
|
||||
0
|
||||
);
|
||||
defineNamedTemplateTypeNameAndDebug
|
||||
(
|
||||
calculatedProcessorFvPatchVectorField,
|
||||
0
|
||||
);
|
||||
defineNamedTemplateTypeNameAndDebug
|
||||
(
|
||||
calculatedProcessorFvPatchSphericalTensorField,
|
||||
0
|
||||
);
|
||||
defineNamedTemplateTypeNameAndDebug(calculatedProcessorFvPatchSymmTensorField, 0);
|
||||
defineNamedTemplateTypeNameAndDebug(calculatedProcessorFvPatchTensorField, 0);
|
||||
defineNamedTemplateTypeNameAndDebug
|
||||
(
|
||||
calculatedProcessorFvPatchSymmTensorField,
|
||||
0
|
||||
);
|
||||
defineNamedTemplateTypeNameAndDebug
|
||||
(
|
||||
calculatedProcessorFvPatchTensorField,
|
||||
0
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -26,8 +26,10 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvMatrix.H"
|
||||
#include "cyclicFvPatchField.H"
|
||||
#include "transformField.H"
|
||||
#include "volFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -174,27 +176,36 @@ Foam::cyclicFvPatchField<Type>::neighbourPatchField() const
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::cyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const Pstream::commsTypes
|
||||
const Pstream::commsTypes commsType
|
||||
) const
|
||||
{
|
||||
const labelUList& nbrFaceCells =
|
||||
cyclicPatch().cyclicPatch().neighbPatch().faceCells();
|
||||
lduAddr.patchAddr
|
||||
(
|
||||
this->cyclicPatch().neighbPatchID()
|
||||
);
|
||||
|
||||
solveScalarField pnf(psiInternal, nbrFaceCells);
|
||||
|
||||
// Transform according to the transformation tensors
|
||||
transformCoupleField(pnf, cmpt);
|
||||
|
||||
|
||||
const labelUList& faceCells = lduAddr.patchAddr(patchId);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
this->addToInternalField(result, !add, coeffs, pnf);
|
||||
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
|
||||
}
|
||||
|
||||
|
||||
@ -203,21 +214,28 @@ void Foam::cyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes
|
||||
) const
|
||||
{
|
||||
const labelUList& nbrFaceCells =
|
||||
cyclicPatch().cyclicPatch().neighbPatch().faceCells();
|
||||
const labelList& nbrFaceCells =
|
||||
lduAddr.patchAddr
|
||||
(
|
||||
this->cyclicPatch().neighbPatchID()
|
||||
);
|
||||
|
||||
Field<Type> pnf(psiInternal, nbrFaceCells);
|
||||
|
||||
// Transform according to the transformation tensors
|
||||
transformCoupleField(pnf);
|
||||
|
||||
const labelUList& faceCells = lduAddr.patchAddr(patchId);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
this->addToInternalField(result, !add, coeffs, pnf);
|
||||
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
|
||||
}
|
||||
|
||||
|
||||
@ -228,4 +246,81 @@ void Foam::cyclicFvPatchField<Type>::write(Ostream& os) const
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::cyclicFvPatchField<Type>::manipulateMatrix
|
||||
(
|
||||
fvMatrix<Type>& matrix,
|
||||
const label mat,
|
||||
const direction cmpt
|
||||
)
|
||||
{
|
||||
if (this->cyclicPatch().owner())
|
||||
{
|
||||
label index = this->patch().index();
|
||||
|
||||
const label globalPatchID =
|
||||
matrix.lduMeshAssembly().patchLocalToGlobalMap()[mat][index];
|
||||
|
||||
const Field<scalar> intCoeffsCmpt
|
||||
(
|
||||
matrix.internalCoeffs()[globalPatchID].component(cmpt)
|
||||
);
|
||||
|
||||
const Field<scalar> boundCoeffsCmpt
|
||||
(
|
||||
matrix.boundaryCoeffs()[globalPatchID].component(cmpt)
|
||||
);
|
||||
|
||||
const labelUList& u = matrix.lduAddr().upperAddr();
|
||||
const labelUList& l = matrix.lduAddr().lowerAddr();
|
||||
|
||||
const labelList& faceMap =
|
||||
matrix.lduMeshAssembly().faceBoundMap()[mat][index];
|
||||
|
||||
forAll (faceMap, faceI)
|
||||
{
|
||||
label globalFaceI = faceMap[faceI];
|
||||
|
||||
const scalar boundCorr = -boundCoeffsCmpt[faceI];
|
||||
const scalar intCorr = -intCoeffsCmpt[faceI];
|
||||
|
||||
matrix.upper()[globalFaceI] += boundCorr;
|
||||
matrix.diag()[u[globalFaceI]] -= boundCorr;
|
||||
matrix.diag()[l[globalFaceI]] -= intCorr;
|
||||
|
||||
if (matrix.asymmetric())
|
||||
{
|
||||
matrix.lower()[globalFaceI] += intCorr;
|
||||
}
|
||||
}
|
||||
|
||||
if (matrix.psi(mat).mesh().fluxRequired(this->internalField().name()))
|
||||
{
|
||||
matrix.internalCoeffs().set
|
||||
(
|
||||
globalPatchID, intCoeffsCmpt*pTraits<Type>::one
|
||||
);
|
||||
matrix.boundaryCoeffs().set
|
||||
(
|
||||
globalPatchID, boundCoeffsCmpt*pTraits<Type>::one
|
||||
);
|
||||
|
||||
const label nbrPathID = this->cyclicPatch().neighbPatchID();
|
||||
|
||||
const label nbrGlobalPatchID =
|
||||
matrix.lduMeshAssembly().patchLocalToGlobalMap()[mat][nbrPathID];
|
||||
|
||||
matrix.internalCoeffs().set
|
||||
(
|
||||
nbrGlobalPatchID, intCoeffsCmpt*pTraits<Type>::one
|
||||
|
||||
);
|
||||
matrix.boundaryCoeffs().set
|
||||
(
|
||||
nbrGlobalPatchID, boundCoeffsCmpt*pTraits<Type>::one
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -93,6 +93,7 @@ class cyclicFvPatchField
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//- Runtime type information
|
||||
TypeName(cyclicFvPatch::typeName_());
|
||||
|
||||
@ -183,6 +184,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -194,12 +197,24 @@ public:
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes commsType
|
||||
) const;
|
||||
|
||||
|
||||
//- Manipulate matrix
|
||||
virtual void manipulateMatrix
|
||||
(
|
||||
fvMatrix<Type>& m,
|
||||
const label iMatrix,
|
||||
const direction cmp
|
||||
);
|
||||
|
||||
|
||||
|
||||
// Cyclic coupled interface functions
|
||||
|
||||
//- Does the patch field perform the transformation
|
||||
|
||||
@ -26,6 +26,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvMatrix.H"
|
||||
#include "cyclicACMIFvPatchField.H"
|
||||
#include "transformField.H"
|
||||
|
||||
@ -160,7 +161,13 @@ Foam::tmp<Foam::Field<Type>>
|
||||
Foam::cyclicACMIFvPatchField<Type>::patchNeighbourField() const
|
||||
{
|
||||
const Field<Type>& iField = this->primitiveField();
|
||||
const cyclicACMIPolyPatch& cpp = cyclicACMIPatch_.cyclicACMIPatch();
|
||||
//const cyclicACMIPolyPatch& cpp = cyclicACMIPatch_.cyclicACMIPatch();
|
||||
|
||||
// By pass polyPatch to get nbrId. Instead use cyclicAMIFvPatch virtual
|
||||
// neighbPatch()
|
||||
const cyclicACMIFvPatch& neighbPatch = cyclicACMIPatch_.neighbPatch();
|
||||
const labelUList& nbrFaceCells = neighbPatch.faceCells();
|
||||
|
||||
tmp<Field<Type>> tpnf
|
||||
(
|
||||
cyclicACMIPatch_.interpolate
|
||||
@ -168,7 +175,8 @@ Foam::cyclicACMIFvPatchField<Type>::patchNeighbourField() const
|
||||
Field<Type>
|
||||
(
|
||||
iField,
|
||||
cpp.neighbPatch().faceCells()
|
||||
nbrFaceCells
|
||||
//cpp.neighbPatch().faceCells()
|
||||
)
|
||||
)
|
||||
);
|
||||
@ -209,6 +217,7 @@ Foam::cyclicACMIFvPatchField<Type>::nonOverlapPatchField() const
|
||||
this->primitiveField()
|
||||
);
|
||||
|
||||
// WIP: Needs to re-direct nonOverlapPatchID to new patchId for assembly?
|
||||
return fld.boundaryField()[cyclicACMIPatch_.nonOverlapPatchID()];
|
||||
}
|
||||
|
||||
@ -218,17 +227,24 @@ void Foam::cyclicACMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const Pstream::commsTypes
|
||||
) const
|
||||
{
|
||||
const cyclicACMIPolyPatch& cpp = cyclicACMIPatch_.cyclicACMIPatch();
|
||||
// note: only applying coupled contribution
|
||||
|
||||
// Note: only applying coupled contribution
|
||||
// const labelUList& nbrFaceCellsCoupled =
|
||||
// lduAddr.patchAddr
|
||||
// (
|
||||
// cyclicACMIPatch_.cyclicACMIPatch().neighbPatchID()
|
||||
// );
|
||||
|
||||
const labelUList& nbrFaceCellsCoupled = cpp.neighbPatch().faceCells();
|
||||
const labelUList& nbrFaceCellsCoupled =
|
||||
lduAddr.patchAddr(cyclicACMIPatch_.neighbPatchID());
|
||||
|
||||
solveScalarField pnf(psiInternal, nbrFaceCellsCoupled);
|
||||
|
||||
@ -237,7 +253,9 @@ void Foam::cyclicACMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
|
||||
pnf = cyclicACMIPatch_.interpolate(pnf);
|
||||
|
||||
this->addToInternalField(result, !add, coeffs, pnf);
|
||||
const labelUList& faceCells = lduAddr.patchAddr(patchId);
|
||||
|
||||
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
|
||||
}
|
||||
|
||||
|
||||
@ -246,16 +264,17 @@ void Foam::cyclicACMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes
|
||||
) const
|
||||
{
|
||||
const cyclicACMIPolyPatch& cpp = cyclicACMIPatch_.cyclicACMIPatch();
|
||||
// note: only applying coupled contribution
|
||||
|
||||
// Note: only applying coupled contribution
|
||||
|
||||
const labelUList& nbrFaceCellsCoupled = cpp.neighbPatch().faceCells();
|
||||
const labelUList& nbrFaceCellsCoupled =
|
||||
lduAddr.patchAddr(cyclicACMIPatch_.neighbPatchID());
|
||||
|
||||
Field<Type> pnf(psiInternal, nbrFaceCellsCoupled);
|
||||
|
||||
@ -264,7 +283,9 @@ void Foam::cyclicACMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
|
||||
pnf = cyclicACMIPatch_.interpolate(pnf);
|
||||
|
||||
this->addToInternalField(result, !add, coeffs, pnf);
|
||||
const labelUList& faceCells = lduAddr.patchAddr(patchId);
|
||||
|
||||
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
|
||||
}
|
||||
|
||||
|
||||
@ -284,6 +305,141 @@ void Foam::cyclicACMIFvPatchField<Type>::manipulateMatrix
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::cyclicACMIFvPatchField<Type>::manipulateMatrix
|
||||
(
|
||||
fvMatrix<Type>& matrix,
|
||||
const label mat,
|
||||
const direction cmpt
|
||||
)
|
||||
{
|
||||
if (this->cyclicACMIPatch().owner())
|
||||
{
|
||||
label index = this->patch().index();
|
||||
|
||||
const label globalPatchID =
|
||||
matrix.lduMeshAssembly().patchLocalToGlobalMap()[mat][index];
|
||||
|
||||
const Field<scalar> intCoeffsCmpt
|
||||
(
|
||||
matrix.internalCoeffs()[globalPatchID].component(cmpt)
|
||||
);
|
||||
|
||||
const Field<scalar> boundCoeffsCmpt
|
||||
(
|
||||
matrix.boundaryCoeffs()[globalPatchID].component(cmpt)
|
||||
);
|
||||
|
||||
tmp<Field<scalar>> tintCoeffs(coeffs(matrix, intCoeffsCmpt, mat));
|
||||
tmp<Field<scalar>> tbndCoeffs(coeffs(matrix, boundCoeffsCmpt, mat));
|
||||
const Field<scalar>& intCoeffs = tintCoeffs.ref();
|
||||
const Field<scalar>& bndCoeffs = tbndCoeffs.ref();
|
||||
|
||||
const labelUList& u = matrix.lduAddr().upperAddr();
|
||||
const labelUList& l = matrix.lduAddr().lowerAddr();
|
||||
|
||||
label subFaceI = 0;
|
||||
|
||||
const labelList& faceMap =
|
||||
matrix.lduMeshAssembly().faceBoundMap()[mat][index];
|
||||
|
||||
forAll (faceMap, j)
|
||||
{
|
||||
label globalFaceI = faceMap[j];
|
||||
|
||||
const scalar boundCorr = -bndCoeffs[subFaceI];
|
||||
const scalar intCorr = -intCoeffs[subFaceI];
|
||||
|
||||
matrix.upper()[globalFaceI] += boundCorr;
|
||||
matrix.diag()[u[globalFaceI]] -= intCorr;
|
||||
matrix.diag()[l[globalFaceI]] -= boundCorr;
|
||||
|
||||
if (matrix.asymmetric())
|
||||
{
|
||||
matrix.lower()[globalFaceI] += intCorr;
|
||||
}
|
||||
subFaceI++;
|
||||
}
|
||||
|
||||
// Set internalCoeffs and boundaryCoeffs in the assembly matrix
|
||||
// on clyclicAMI patches to be used in the individual matrix by
|
||||
// matrix.flux()
|
||||
if (matrix.psi(mat).mesh().fluxRequired(this->internalField().name()))
|
||||
{
|
||||
matrix.internalCoeffs().set
|
||||
(
|
||||
globalPatchID, intCoeffs*pTraits<Type>::one
|
||||
);
|
||||
matrix.boundaryCoeffs().set
|
||||
(
|
||||
globalPatchID, bndCoeffs*pTraits<Type>::one
|
||||
);
|
||||
|
||||
const label nbrPathID =
|
||||
cyclicACMIPatch_.cyclicACMIPatch().neighbPatchID();
|
||||
|
||||
const label nbrGlobalPatchID =
|
||||
matrix.lduMeshAssembly().patchLocalToGlobalMap()
|
||||
[mat][nbrPathID];
|
||||
|
||||
matrix.internalCoeffs().set
|
||||
(
|
||||
nbrGlobalPatchID, intCoeffs*pTraits<Type>::one
|
||||
);
|
||||
matrix.boundaryCoeffs().set
|
||||
(
|
||||
nbrGlobalPatchID, bndCoeffs*pTraits<Type>::one
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Foam::scalar>>
|
||||
Foam::cyclicACMIFvPatchField<Type>::coeffs
|
||||
(
|
||||
fvMatrix<Type>& matrix,
|
||||
const Field<scalar>& coeffs,
|
||||
const label mat
|
||||
) const
|
||||
{
|
||||
const label index(this->patch().index());
|
||||
|
||||
const label nSubFaces
|
||||
(
|
||||
matrix.lduMeshAssembly().cellBoundMap()[mat][index].size()
|
||||
);
|
||||
|
||||
Field<scalar> mapCoeffs(nSubFaces, Zero);
|
||||
|
||||
const scalarListList& srcWeight =
|
||||
cyclicACMIPatch_.cyclicACMIPatch().AMI().srcWeights();
|
||||
|
||||
const scalarField& mask = cyclicACMIPatch_.cyclicACMIPatch().mask();
|
||||
|
||||
const scalar tol = cyclicACMIPolyPatch::tolerance();
|
||||
label subFaceI = 0;
|
||||
forAll(mask, faceI)
|
||||
{
|
||||
const scalarList& w = srcWeight[faceI];
|
||||
for(label i=0; i<w.size(); i++)
|
||||
{
|
||||
if (mask[faceI] > tol)
|
||||
{
|
||||
const label localFaceId =
|
||||
matrix.lduMeshAssembly().facePatchFaceMap()
|
||||
[mat][index][subFaceI];
|
||||
mapCoeffs[subFaceI] = w[i]*coeffs[localFaceId];
|
||||
}
|
||||
subFaceI++;
|
||||
}
|
||||
}
|
||||
|
||||
return tmp<Field<scalar>>(new Field<scalar>(mapCoeffs));
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::cyclicACMIFvPatchField<Type>::updateCoeffs()
|
||||
{
|
||||
|
||||
@ -89,6 +89,15 @@ class cyclicACMIFvPatchField
|
||||
const Field<Type2>&
|
||||
) const;
|
||||
|
||||
//- Return new matrix coeffs
|
||||
tmp<Field<scalar>> coeffs
|
||||
(
|
||||
fvMatrix<Type>& matrix,
|
||||
const Field<scalar>&,
|
||||
const label
|
||||
) const;
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -206,6 +215,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -217,6 +228,8 @@ public:
|
||||
(
|
||||
Field<Type>&,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>&,
|
||||
const scalarField&,
|
||||
const Pstream::commsTypes commsType
|
||||
@ -225,6 +238,14 @@ public:
|
||||
//- Manipulate matrix
|
||||
virtual void manipulateMatrix(fvMatrix<Type>& matrix);
|
||||
|
||||
//- Manipulate matrix
|
||||
virtual void manipulateMatrix
|
||||
(
|
||||
fvMatrix<Type>& m,
|
||||
const label iMatrix,
|
||||
const direction cmpt
|
||||
);
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
|
||||
|
||||
@ -26,6 +26,10 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvMatrix.H"
|
||||
#include "volFields.H"
|
||||
//#include "cylicFvPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
@ -142,15 +146,20 @@ Foam::tmp<Foam::Field<Type>>
|
||||
Foam::cyclicAMIFvPatchField<Type>::patchNeighbourField() const
|
||||
{
|
||||
const Field<Type>& iField = this->primitiveField();
|
||||
const labelUList& nbrFaceCells =
|
||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().faceCells();
|
||||
|
||||
// By pass polyPatch to get nbrId. Instead use cyclicAMIFvPatch virtual
|
||||
// neighbPatch()
|
||||
const cyclicAMIFvPatch& neighbPatch = cyclicAMIPatch_.neighbPatch();
|
||||
const labelUList& nbrFaceCells = neighbPatch.faceCells();
|
||||
|
||||
Field<Type> pnf(iField, nbrFaceCells);
|
||||
|
||||
tmp<Field<Type>> tpnf;
|
||||
if (cyclicAMIPatch_.applyLowWeightCorrection())
|
||||
{
|
||||
tpnf = cyclicAMIPatch_.interpolate(pnf, this->patchInternalField()());
|
||||
Field<Type> pnfInternal(iField, cyclicAMIPatch_.faceCells());
|
||||
|
||||
tpnf = cyclicAMIPatch_.interpolate(pnf, pnfInternal);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -188,6 +197,8 @@ void Foam::cyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -195,7 +206,7 @@ void Foam::cyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
) const
|
||||
{
|
||||
const labelUList& nbrFaceCells =
|
||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().faceCells();
|
||||
lduAddr.patchAddr(cyclicAMIPatch_.neighbPatchID());
|
||||
|
||||
solveScalarField pnf(psiInternal, nbrFaceCells);
|
||||
|
||||
@ -212,8 +223,10 @@ void Foam::cyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
pnf = cyclicAMIPatch_.interpolate(pnf);
|
||||
}
|
||||
|
||||
const labelUList& faceCells = lduAddr.patchAddr(patchId);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
this->addToInternalField(result, !add, coeffs, pnf);
|
||||
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
|
||||
}
|
||||
|
||||
|
||||
@ -222,13 +235,15 @@ void Foam::cyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes
|
||||
) const
|
||||
{
|
||||
const labelUList& nbrFaceCells =
|
||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatch().faceCells();
|
||||
lduAddr.patchAddr(cyclicAMIPatch_.neighbPatchID());
|
||||
|
||||
Field<Type> pnf(psiInternal, nbrFaceCells);
|
||||
|
||||
@ -245,8 +260,178 @@ void Foam::cyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
pnf = cyclicAMIPatch_.interpolate(pnf);
|
||||
}
|
||||
|
||||
const labelUList& faceCells = lduAddr.patchAddr(patchId);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
this->addToInternalField(result, !add, coeffs, pnf);
|
||||
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::cyclicAMIFvPatchField<Type>::manipulateMatrix
|
||||
(
|
||||
fvMatrix<Type>& matrix,
|
||||
const label mat,
|
||||
const direction cmpt
|
||||
)
|
||||
{
|
||||
|
||||
if (this->cyclicAMIPatch().owner())
|
||||
{
|
||||
label index = this->patch().index();
|
||||
|
||||
const label globalPatchID =
|
||||
matrix.lduMeshAssembly().patchLocalToGlobalMap()[mat][index];
|
||||
|
||||
const Field<scalar> intCoeffsCmpt
|
||||
(
|
||||
matrix.internalCoeffs()[globalPatchID].component(cmpt)
|
||||
);
|
||||
|
||||
const Field<scalar> boundCoeffsCmpt
|
||||
(
|
||||
matrix.boundaryCoeffs()[globalPatchID].component(cmpt)
|
||||
);
|
||||
|
||||
tmp<Field<scalar>> tintCoeffs(coeffs(matrix, intCoeffsCmpt, mat));
|
||||
tmp<Field<scalar>> tbndCoeffs(coeffs(matrix, boundCoeffsCmpt, mat));
|
||||
const Field<scalar>& intCoeffs = tintCoeffs.ref();
|
||||
const Field<scalar>& bndCoeffs = tbndCoeffs.ref();
|
||||
|
||||
const labelUList& u = matrix.lduAddr().upperAddr();
|
||||
const labelUList& l = matrix.lduAddr().lowerAddr();
|
||||
|
||||
label subFaceI = 0;
|
||||
|
||||
const labelList& faceMap =
|
||||
matrix.lduMeshAssembly().faceBoundMap()[mat][index];
|
||||
|
||||
forAll (faceMap, j)
|
||||
{
|
||||
label globalFaceI = faceMap[j];
|
||||
|
||||
const scalar boundCorr = -bndCoeffs[subFaceI];
|
||||
const scalar intCorr = -intCoeffs[subFaceI];
|
||||
|
||||
matrix.upper()[globalFaceI] += boundCorr;
|
||||
matrix.diag()[u[globalFaceI]] -= intCorr;
|
||||
matrix.diag()[l[globalFaceI]] -= boundCorr;
|
||||
|
||||
if (matrix.asymmetric())
|
||||
{
|
||||
matrix.lower()[globalFaceI] += intCorr;
|
||||
}
|
||||
subFaceI++;
|
||||
}
|
||||
|
||||
// Set internalCoeffs and boundaryCoeffs in the assembly matrix
|
||||
// on clyclicAMI patches to be used in the individual matrix by
|
||||
// matrix.flux()
|
||||
if (matrix.psi(mat).mesh().fluxRequired(this->internalField().name()))
|
||||
{
|
||||
matrix.internalCoeffs().set
|
||||
(
|
||||
globalPatchID, intCoeffs*pTraits<Type>::one
|
||||
);
|
||||
matrix.boundaryCoeffs().set
|
||||
(
|
||||
globalPatchID, bndCoeffs*pTraits<Type>::one
|
||||
);
|
||||
|
||||
const label nbrPathID =
|
||||
cyclicAMIPatch_.cyclicAMIPatch().neighbPatchID();
|
||||
|
||||
const label nbrGlobalPatchID =
|
||||
matrix.lduMeshAssembly().patchLocalToGlobalMap()
|
||||
[mat][nbrPathID];
|
||||
|
||||
matrix.internalCoeffs().set
|
||||
(
|
||||
nbrGlobalPatchID, intCoeffs*pTraits<Type>::one
|
||||
);
|
||||
matrix.boundaryCoeffs().set
|
||||
(
|
||||
nbrGlobalPatchID, bndCoeffs*pTraits<Type>::one
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Foam::scalar>>
|
||||
Foam::cyclicAMIFvPatchField<Type>::coeffs
|
||||
(
|
||||
fvMatrix<Type>& matrix,
|
||||
const Field<scalar>& coeffs,
|
||||
const label mat
|
||||
) const
|
||||
{
|
||||
const label index(this->patch().index());
|
||||
|
||||
const label nSubFaces
|
||||
(
|
||||
matrix.lduMeshAssembly().cellBoundMap()[mat][index].size()
|
||||
);
|
||||
|
||||
Field<scalar> mapCoeffs(nSubFaces, Zero);
|
||||
|
||||
const scalarListList& srcWeight =
|
||||
cyclicAMIPatch_.cyclicAMIPatch().AMI().srcWeights();
|
||||
|
||||
label subFaceI = 0;
|
||||
forAll(*this, faceI)
|
||||
{
|
||||
const scalarList& w = srcWeight[faceI];
|
||||
for(label i=0; i<w.size(); i++)
|
||||
{
|
||||
const label localFaceId =
|
||||
matrix.lduMeshAssembly().facePatchFaceMap()[mat][index][subFaceI];
|
||||
mapCoeffs[subFaceI] = w[i]*coeffs[localFaceId];
|
||||
subFaceI++;
|
||||
}
|
||||
}
|
||||
|
||||
return tmp<Field<scalar>>(new Field<scalar>(mapCoeffs));
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
template<class Type2>
|
||||
void Foam::cyclicAMIFvPatchField<Type>::collectStencilData
|
||||
(
|
||||
const refPtr<mapDistribute>& mapPtr,
|
||||
const labelListList& stencil,
|
||||
const Type2& data,
|
||||
List<Type2>& expandedData
|
||||
)
|
||||
{
|
||||
expandedData.setSize(stencil.size());
|
||||
if (mapPtr.valid())
|
||||
{
|
||||
Type2 work(data);
|
||||
mapPtr().distribute(work);
|
||||
|
||||
forAll(stencil, facei)
|
||||
{
|
||||
const labelList& slots = stencil[facei];
|
||||
expandedData[facei].append
|
||||
(
|
||||
UIndirectList<typename Type2::value_type>(work, slots)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(stencil, facei)
|
||||
{
|
||||
const labelList& slots = stencil[facei];
|
||||
expandedData[facei].append
|
||||
(
|
||||
UIndirectList<typename Type2::value_type>(data, slots)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -259,3 +444,4 @@ void Foam::cyclicAMIFvPatchField<Type>::write(Ostream& os) const
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
|
||||
@ -60,6 +60,7 @@ SourceFiles
|
||||
#ifndef cyclicAMIFvPatchField_H
|
||||
#define cyclicAMIFvPatchField_H
|
||||
|
||||
|
||||
#include "coupledFvPatchField.H"
|
||||
#include "cyclicAMILduInterfaceField.H"
|
||||
#include "cyclicAMIFvPatch.H"
|
||||
@ -95,6 +96,25 @@ class cyclicAMIFvPatchField
|
||||
) const;
|
||||
|
||||
|
||||
//- Return new matrix coeffs
|
||||
tmp<Field<scalar>> coeffs
|
||||
(
|
||||
fvMatrix<Type>& matrix,
|
||||
const Field<scalar>&,
|
||||
const label
|
||||
) const;
|
||||
|
||||
|
||||
template<class Type2>
|
||||
void collectStencilData
|
||||
(
|
||||
const refPtr<mapDistribute>& mapPtr,
|
||||
const labelListList& stencil,
|
||||
const Type2& data,
|
||||
List<Type2>& expandedData
|
||||
);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -187,6 +207,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -198,12 +220,23 @@ public:
|
||||
(
|
||||
Field<Type>&,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>&,
|
||||
const scalarField&,
|
||||
const Pstream::commsTypes commsType
|
||||
) const;
|
||||
|
||||
|
||||
//- Manipulate matrix
|
||||
virtual void manipulateMatrix
|
||||
(
|
||||
fvMatrix<Type>& m,
|
||||
const label iMatrix,
|
||||
const direction cmpt
|
||||
);
|
||||
|
||||
|
||||
// Cyclic AMI coupled interface functions
|
||||
|
||||
//- Does the patch field perform the transformation
|
||||
|
||||
@ -101,8 +101,8 @@ Foam::jumpCyclicFvPatchField<Type>::patchNeighbourField() const
|
||||
const labelUList& nbrFaceCells =
|
||||
this->cyclicPatch().neighbFvPatch().faceCells();
|
||||
|
||||
tmp<Field<Type>> tpnf(new Field<Type>(this->size()));
|
||||
Field<Type>& pnf = tpnf.ref();
|
||||
auto tpnf = tmp<Field<Type>>::New(this->size());
|
||||
auto& pnf = tpnf.ref();
|
||||
|
||||
Field<Type> jf(this->jump());
|
||||
if (!this->cyclicPatch().owner())
|
||||
@ -137,6 +137,8 @@ void Foam::jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -152,6 +154,8 @@ void Foam::jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes
|
||||
@ -160,7 +164,10 @@ void Foam::jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
Field<Type> pnf(this->size());
|
||||
|
||||
const labelUList& nbrFaceCells =
|
||||
this->cyclicPatch().neighbFvPatch().faceCells();
|
||||
lduAddr.patchAddr
|
||||
(
|
||||
this->cyclicPatch().neighbPatchID()
|
||||
);
|
||||
|
||||
// only apply jump to original field
|
||||
if (&psiInternal == &this->primitiveField())
|
||||
@ -188,8 +195,10 @@ void Foam::jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
// Transform according to the transformation tensors
|
||||
this->transformCoupleField(pnf);
|
||||
|
||||
const labelUList& faceCells = lduAddr.patchAddr(patchId);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
this->addToInternalField(result, !add, coeffs, pnf);
|
||||
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -133,6 +133,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -144,6 +146,8 @@ public:
|
||||
(
|
||||
Field<Type>&,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>&,
|
||||
const scalarField&,
|
||||
const Pstream::commsTypes commsType
|
||||
@ -156,6 +160,8 @@ void jumpCyclicFvPatchField<scalar>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -168,6 +174,8 @@ void jumpCyclicFvPatchField<vector>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
|
||||
@ -44,6 +44,8 @@ void Foam::jumpCyclicFvPatchField<Foam::scalar>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -53,7 +55,10 @@ void Foam::jumpCyclicFvPatchField<Foam::scalar>::updateInterfaceMatrix
|
||||
solveScalarField pnf(this->size());
|
||||
|
||||
const labelUList& nbrFaceCells =
|
||||
this->cyclicPatch().neighbFvPatch().faceCells();
|
||||
lduAddr.patchAddr
|
||||
(
|
||||
this->cyclicPatch().neighbPatchID()
|
||||
);
|
||||
|
||||
// only apply jump to original field
|
||||
if
|
||||
@ -85,8 +90,10 @@ void Foam::jumpCyclicFvPatchField<Foam::scalar>::updateInterfaceMatrix
|
||||
// Transform according to the transformation tensors
|
||||
this->transformCoupleField(pnf, cmpt);
|
||||
|
||||
const labelUList& faceCells = lduAddr.patchAddr(patchId);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
this->addToInternalField(result, !add, coeffs, pnf);
|
||||
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
|
||||
}
|
||||
|
||||
|
||||
@ -95,6 +102,8 @@ void Foam::jumpCyclicFvPatchField<Foam::vector>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -104,7 +113,10 @@ void Foam::jumpCyclicFvPatchField<Foam::vector>::updateInterfaceMatrix
|
||||
solveScalarField pnf(this->size());
|
||||
|
||||
const labelUList& nbrFaceCells =
|
||||
this->cyclicPatch().neighbFvPatch().faceCells();
|
||||
lduAddr.patchAddr
|
||||
(
|
||||
this->cyclicPatch().neighbPatchID()
|
||||
);
|
||||
|
||||
const Field<vector>& iField = this->primitiveField();
|
||||
|
||||
@ -140,8 +152,10 @@ void Foam::jumpCyclicFvPatchField<Foam::vector>::updateInterfaceMatrix
|
||||
// Transform according to the transformation tensors
|
||||
this->transformCoupleField(pnf, cmpt);
|
||||
|
||||
const labelUList& faceCells = lduAddr.patchAddr(patchId);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
this->addToInternalField(result, !add, coeffs, pnf);
|
||||
this->addToInternalField(result, !add, faceCells, coeffs, pnf);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -138,6 +138,8 @@ void Foam::jumpCyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -153,13 +155,18 @@ void Foam::jumpCyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
Field<Type>& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes
|
||||
) const
|
||||
{
|
||||
const labelUList& nbrFaceCells =
|
||||
this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells();
|
||||
lduAddr.patchAddr
|
||||
(
|
||||
this->cyclicAMIPatch().neighbPatchID()
|
||||
);
|
||||
|
||||
Field<Type> pnf(psiInternal, nbrFaceCells);
|
||||
|
||||
@ -193,8 +200,10 @@ void Foam::jumpCyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
// Transform according to the transformation tensors
|
||||
this->transformCoupleField(pnf);
|
||||
|
||||
const labelUList& faceCells = lduAddr.patchAddr(patchId);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
this->addToInternalField(result, !add, coeffs, pnf);
|
||||
this->addToInternalField(result, !add,faceCells, coeffs, pnf);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -135,6 +135,8 @@ public:
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
@ -146,6 +148,8 @@ public:
|
||||
(
|
||||
Field<Type>&,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const Field<Type>&,
|
||||
const scalarField&,
|
||||
const Pstream::commsTypes commsType
|
||||
@ -159,6 +163,8 @@ void jumpCyclicAMIFvPatchField<scalar>::updateInterfaceMatrix
|
||||
(
|
||||
solveScalarField& result,
|
||||
const bool add,
|
||||
const lduAddressing& lduAddr,
|
||||
const label patchId,
|
||||
const solveScalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user