mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -39,15 +39,8 @@
|
|||||||
|
|
||||||
#include "compressibleCreatePhi.H"
|
#include "compressibleCreatePhi.H"
|
||||||
|
|
||||||
dimensionedScalar rhoMax
|
dimensionedScalar rhoMax(pimple.dict().lookup("rhoMax"));
|
||||||
(
|
dimensionedScalar rhoMin(pimple.dict().lookup("rhoMin"));
|
||||||
mesh.solutionDict().subDict("PIMPLE").lookup("rhoMax")
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar rhoMin
|
|
||||||
(
|
|
||||||
mesh.solutionDict().subDict("PIMPLE").lookup("rhoMin")
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
autoPtr<compressible::turbulenceModel> turbulence
|
autoPtr<compressible::turbulenceModel> turbulence
|
||||||
|
|||||||
@ -46,10 +46,13 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
|
|
||||||
|
pimpleControl pimple(mesh);
|
||||||
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
pimpleControl pimple(mesh);
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
|||||||
@ -48,12 +48,13 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
|
|
||||||
|
pimpleControl pimple(mesh);
|
||||||
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createZones.H"
|
#include "createZones.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
pimpleControl pimple(mesh);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|||||||
@ -42,17 +42,10 @@
|
|||||||
|
|
||||||
label pRefCell = 0;
|
label pRefCell = 0;
|
||||||
scalar pRefValue = 0.0;
|
scalar pRefValue = 0.0;
|
||||||
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
|
setRefCell(p, simple.dict(), pRefCell, pRefValue);
|
||||||
|
|
||||||
dimensionedScalar rhoMax
|
dimensionedScalar rhoMax(simple.dict().lookup("rhoMax"));
|
||||||
(
|
dimensionedScalar rhoMin(simple.dict().lookup("rhoMin"));
|
||||||
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMax")
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar rhoMin
|
|
||||||
(
|
|
||||||
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMin")
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
autoPtr<compressible::RASModel> turbulence
|
autoPtr<compressible::RASModel> turbulence
|
||||||
|
|||||||
@ -9,13 +9,7 @@
|
|||||||
if (pZones.size())
|
if (pZones.size())
|
||||||
{
|
{
|
||||||
// nUCorrectors for pressureImplicitPorosity
|
// nUCorrectors for pressureImplicitPorosity
|
||||||
if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors"))
|
simple.dict().readIfPresent("nUCorrectors", nUCorr);
|
||||||
{
|
|
||||||
nUCorr = readInt
|
|
||||||
(
|
|
||||||
mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nUCorr > 0)
|
if (nUCorr > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -45,12 +45,13 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
|
|
||||||
|
simpleControl simple(mesh);
|
||||||
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createZones.H"
|
#include "createZones.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
simpleControl simple(mesh);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|||||||
@ -42,11 +42,12 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "createFields.H"
|
|
||||||
#include "initContinuityErrs.H"
|
|
||||||
|
|
||||||
simpleControl simple(mesh);
|
simpleControl simple(mesh);
|
||||||
|
|
||||||
|
#include "createFields.H"
|
||||||
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|||||||
@ -41,17 +41,10 @@
|
|||||||
|
|
||||||
label pRefCell = 0;
|
label pRefCell = 0;
|
||||||
scalar pRefValue = 0.0;
|
scalar pRefValue = 0.0;
|
||||||
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
|
setRefCell(p, simple.dict(), pRefCell, pRefValue);
|
||||||
|
|
||||||
dimensionedScalar rhoMax
|
dimensionedScalar rhoMax(simple.dict().lookup("rhoMax"));
|
||||||
(
|
dimensionedScalar rhoMin(simple.dict().lookup("rhoMin"));
|
||||||
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMax")
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar rhoMin
|
|
||||||
(
|
|
||||||
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMin")
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
autoPtr<compressible::RASModel> turbulence
|
autoPtr<compressible::RASModel> turbulence
|
||||||
|
|||||||
@ -44,11 +44,12 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "createFields.H"
|
|
||||||
#include "initContinuityErrs.H"
|
|
||||||
|
|
||||||
simpleControl simple(mesh);
|
simpleControl simple(mesh);
|
||||||
|
|
||||||
|
#include "createFields.H"
|
||||||
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|||||||
@ -8,7 +8,9 @@ EXE_INC = \
|
|||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude
|
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
||||||
|
-I$(LIB_SRC)/parallel/decompose/decompose/lnInclude \
|
||||||
|
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
@ -19,4 +21,6 @@ EXE_LIBS = \
|
|||||||
-lcompressibleLESModels \
|
-lcompressibleLESModels \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lradiationModels
|
-lradiationModels \
|
||||||
|
-ldecompose \
|
||||||
|
-lreconstruct
|
||||||
|
|||||||
@ -0,0 +1,84 @@
|
|||||||
|
|
||||||
|
// Get mapped alpha (surfaceScalarField)
|
||||||
|
tmp<surfaceScalarField> tallAlpha = procToAllMapper().reconstructFvSurfaceField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"alpha",
|
||||||
|
allMesh().time().timeName(),
|
||||||
|
allMesh(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
procAlpha
|
||||||
|
);
|
||||||
|
|
||||||
|
// Get alpha from harmonic interpolation of vol quantities
|
||||||
|
// (Note: really only needed at internal faces originating patches
|
||||||
|
// inbetween regions)
|
||||||
|
tmp<surfaceScalarField> allHarmonicAlpha
|
||||||
|
(
|
||||||
|
harmonic(allMesh()).interpolate(allVolAlpha())
|
||||||
|
);
|
||||||
|
|
||||||
|
// Loop over all fluid and solid regions to transfer
|
||||||
|
// allHarmonicAlpha to allAlpha
|
||||||
|
surfaceScalarField& allAlpha = tallAlpha();
|
||||||
|
forAll(boundaryProcAddressing, procI)
|
||||||
|
{
|
||||||
|
forAll(boundaryProcAddressing[procI], patchI)
|
||||||
|
{
|
||||||
|
if (boundaryProcAddressing[procI][patchI] == -1)
|
||||||
|
{
|
||||||
|
// Interface patch
|
||||||
|
const labelList::subList cp =
|
||||||
|
procMeshes[procI].boundary()[patchI].patchSlice
|
||||||
|
(
|
||||||
|
faceProcAddressing[procI]
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(cp, faceI)
|
||||||
|
{
|
||||||
|
label curF = mag(cp[faceI])-1;
|
||||||
|
if (curF < allMesh().nInternalFaces())
|
||||||
|
{
|
||||||
|
allAlpha[curF] = allHarmonicAlpha()[curF];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tmp<surfaceScalarField> allPhi
|
||||||
|
(
|
||||||
|
procToAllMapper().reconstructFvSurfaceField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"phi",
|
||||||
|
allMesh().time().timeName(),
|
||||||
|
allMesh(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
procPhi
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// So we have nNonOrthCorr
|
||||||
|
//#include "readSolidMultiRegionPIMPLEControls.H"
|
||||||
|
//for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
|
{
|
||||||
|
fvScalarMatrix hEqn
|
||||||
|
(
|
||||||
|
fvm::ddt(allRho(), allh())
|
||||||
|
+ fvm::div(allPhi(), allh())
|
||||||
|
- fvm::laplacian(allAlpha, allh())
|
||||||
|
==
|
||||||
|
allSource()
|
||||||
|
);
|
||||||
|
|
||||||
|
hEqn.relax();
|
||||||
|
hEqn.solve(allMesh().solver(allh().select(finalIter)));
|
||||||
|
}
|
||||||
@ -39,6 +39,11 @@ Description
|
|||||||
#include "solidRegionDiffNo.H"
|
#include "solidRegionDiffNo.H"
|
||||||
#include "basicSolidThermo.H"
|
#include "basicSolidThermo.H"
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
|
#include "fvFieldReconstructor.H"
|
||||||
|
#include "mixedFvPatchFields.H"
|
||||||
|
#include "fvFieldDecomposer.H"
|
||||||
|
#include "harmonic.H"
|
||||||
|
#include "rmap.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -49,12 +54,40 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
regionProperties rp(runTime);
|
regionProperties rp(runTime);
|
||||||
|
|
||||||
|
const label nAllRegions =
|
||||||
|
rp.fluidRegionNames().size()
|
||||||
|
+ rp.solidRegionNames().size();
|
||||||
|
PtrList<labelIOList> cellProcAddressing(nAllRegions);
|
||||||
|
PtrList<labelIOList> faceProcAddressing(nAllRegions);
|
||||||
|
PtrList<labelIOList> boundaryProcAddressing(nAllRegions);
|
||||||
|
PtrList<fvMesh> procMeshes(nAllRegions);
|
||||||
|
|
||||||
|
// Load meshes, fluid first
|
||||||
|
labelList fluidToProc(identity(rp.fluidRegionNames().size()));
|
||||||
|
labelList solidToProc(rp.solidRegionNames().size());
|
||||||
|
forAll(solidToProc, i)
|
||||||
|
{
|
||||||
|
solidToProc[i] = fluidToProc.size()+i;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the coupled solution flag
|
||||||
|
#include "readPIMPLEControls.H"
|
||||||
|
|
||||||
|
if (temperatureCoupled)
|
||||||
|
{
|
||||||
|
Info<< "Solving single enthalpy for all equations" << nl << endl;
|
||||||
|
}
|
||||||
|
|
||||||
#include "createFluidMeshes.H"
|
#include "createFluidMeshes.H"
|
||||||
#include "createSolidMeshes.H"
|
#include "createSolidMeshes.H"
|
||||||
|
|
||||||
#include "createFluidFields.H"
|
#include "createFluidFields.H"
|
||||||
#include "createSolidFields.H"
|
#include "createSolidFields.H"
|
||||||
|
|
||||||
|
// Temperature solved on single mesh
|
||||||
|
#include "createAllMesh.H"
|
||||||
|
#include "createAllFields.H"
|
||||||
|
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
#include "readTimeControls.H"
|
#include "readTimeControls.H"
|
||||||
@ -81,9 +114,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
|
||||||
if (nOuterCorr != 1)
|
if (nOuterCorr != 1)
|
||||||
{
|
{
|
||||||
forAll(fluidRegions, i)
|
forAll(fluidToProc, i)
|
||||||
{
|
{
|
||||||
#include "setRegionFluidFields.H"
|
#include "setRegionFluidFields.H"
|
||||||
#include "storeOldFluidFields.H"
|
#include "storeOldFluidFields.H"
|
||||||
@ -96,22 +130,133 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
bool finalIter = oCorr == nOuterCorr-1;
|
bool finalIter = oCorr == nOuterCorr-1;
|
||||||
|
|
||||||
forAll(fluidRegions, i)
|
if (finalIter)
|
||||||
{
|
{
|
||||||
Info<< "\nSolving for fluid region "
|
forAll(procMeshes, procI)
|
||||||
<< fluidRegions[i].name() << endl;
|
{
|
||||||
#include "setRegionFluidFields.H"
|
procMeshes[procI].data::add("finalIteration", true);
|
||||||
#include "readFluidMultiRegionPIMPLEControls.H"
|
}
|
||||||
#include "solveFluid.H"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(solidRegions, i)
|
|
||||||
|
PtrList<surfaceScalarField> procPhi(nAllRegions);
|
||||||
|
PtrList<surfaceScalarField> procAlpha(nAllRegions);
|
||||||
|
|
||||||
|
|
||||||
|
// Solve (uncoupled) or set up (coupled) the temperature equation
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
forAll(solidToProc, i)
|
||||||
{
|
{
|
||||||
Info<< "\nSolving for solid region "
|
label procI = solidToProc[i];
|
||||||
<< solidRegions[i].name() << endl;
|
|
||||||
|
Info<< "\nSolving temperature for solid region "
|
||||||
|
<< procMeshes[procI].name() << endl;
|
||||||
#include "setRegionSolidFields.H"
|
#include "setRegionSolidFields.H"
|
||||||
#include "readSolidMultiRegionPIMPLEControls.H"
|
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||||
#include "solveSolid.H"
|
|
||||||
|
if (temperatureCoupled)
|
||||||
|
{
|
||||||
|
// Map my properties to overall h equation
|
||||||
|
#include "rmapSolid.H"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#include "solveSolid.H"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
forAll(fluidToProc, i)
|
||||||
|
{
|
||||||
|
label procI = fluidToProc[i];
|
||||||
|
|
||||||
|
Info<< "\nSolving temperature for fluid region "
|
||||||
|
<< procMeshes[procI].name() << endl;
|
||||||
|
#include "setRegionFluidFields.H"
|
||||||
|
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||||
|
|
||||||
|
if (oCorr == 0)
|
||||||
|
{
|
||||||
|
#include "rhoEqn.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (temperatureCoupled)
|
||||||
|
{
|
||||||
|
// Map my properties to overall h equation
|
||||||
|
#include "rmapFluid.H"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#include "hEqn.H"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Solve combined h equation
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
if (temperatureCoupled)
|
||||||
|
{
|
||||||
|
Info<< "\nSolving single enthalpy for all regions"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
// Solve combined h
|
||||||
|
#include "allhEqn.H"
|
||||||
|
|
||||||
|
forAll(solidToProc, i)
|
||||||
|
{
|
||||||
|
label procI = solidToProc[i];
|
||||||
|
#include "setRegionSolidFields.H"
|
||||||
|
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||||
|
|
||||||
|
#include "mapSolid.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(fluidToProc, i)
|
||||||
|
{
|
||||||
|
label procI = fluidToProc[i];
|
||||||
|
#include "setRegionFluidFields.H"
|
||||||
|
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||||
|
|
||||||
|
#include "mapFluid.H"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Update thermos
|
||||||
|
// ~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
forAll(fluidToProc, i)
|
||||||
|
{
|
||||||
|
Info<< "\nUpdating thermo for fluid region "
|
||||||
|
<< procMeshes[fluidToProc[i]].name() << endl;
|
||||||
|
|
||||||
|
#include "setRegionFluidFields.H"
|
||||||
|
#include "readFluidMultiRegionPIMPLEControls.H"
|
||||||
|
|
||||||
|
thermo.correct();
|
||||||
|
rad.correct();
|
||||||
|
#include "solvePressureVelocityFluid.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(solidToProc, i)
|
||||||
|
{
|
||||||
|
Info<< "\nUpdating thermo for solid region "
|
||||||
|
<< procMeshes[solidToProc[i]].name() << endl;
|
||||||
|
#include "setRegionSolidFields.H"
|
||||||
|
#include "readSolidMultiRegionPIMPLEControls.H"
|
||||||
|
|
||||||
|
thermo.correct();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (finalIter)
|
||||||
|
{
|
||||||
|
forAll(procMeshes, procI)
|
||||||
|
{
|
||||||
|
procMeshes[procI].data::remove("finalIteration");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,64 @@
|
|||||||
|
autoPtr<volScalarField> allRho;
|
||||||
|
autoPtr<volScalarField> allh;
|
||||||
|
autoPtr<volScalarField> allVolAlpha;
|
||||||
|
autoPtr<fvScalarMatrix> allSource;
|
||||||
|
|
||||||
|
if (temperatureCoupled)
|
||||||
|
{
|
||||||
|
allRho.reset
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rho",
|
||||||
|
runTime.timeName(),
|
||||||
|
allMesh(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
allMesh(),
|
||||||
|
dimensionedScalar("rho", dimDensity, 0.0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
allh.reset
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"h",
|
||||||
|
runTime.timeName(),
|
||||||
|
allMesh(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
allMesh(),
|
||||||
|
dimensionedScalar("h", dimEnergy/dimMass, 0.0),
|
||||||
|
mixedFvPatchScalarField::typeName
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
allVolAlpha.reset
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"volAlpha",
|
||||||
|
runTime.timeName(),
|
||||||
|
allMesh(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
allMesh(),
|
||||||
|
dimensionedScalar("volAlpha", dimMass/dimLength/dimTime, 0.0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
allSource.reset
|
||||||
|
(
|
||||||
|
new fvMatrix<scalar>(allh(), allh().dimensions()*dimMass/dimTime)
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
//
|
||||||
|
// createAllMesh.H
|
||||||
|
// ~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
autoPtr<fvMesh> allMesh;
|
||||||
|
autoPtr<fvFieldReconstructor> procToAllMapper;
|
||||||
|
PtrList<fvFieldDecomposer> allToProcMappers;
|
||||||
|
|
||||||
|
if (temperatureCoupled)
|
||||||
|
{
|
||||||
|
Foam::Info
|
||||||
|
<< "Create mesh for time = "
|
||||||
|
<< runTime.timeName() << Foam::nl << Foam::endl;
|
||||||
|
|
||||||
|
allMesh.reset
|
||||||
|
(
|
||||||
|
new Foam::fvMesh
|
||||||
|
(
|
||||||
|
Foam::IOobject
|
||||||
|
(
|
||||||
|
Foam::fvMesh::defaultRegion,
|
||||||
|
runTime.timeName(),
|
||||||
|
runTime,
|
||||||
|
Foam::IOobject::MUST_READ
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
procToAllMapper.reset
|
||||||
|
(
|
||||||
|
new fvFieldReconstructor
|
||||||
|
(
|
||||||
|
allMesh(),
|
||||||
|
procMeshes,
|
||||||
|
faceProcAddressing,
|
||||||
|
cellProcAddressing,
|
||||||
|
boundaryProcAddressing
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
allToProcMappers.setSize
|
||||||
|
(
|
||||||
|
rp.fluidRegionNames().size()
|
||||||
|
+ rp.solidRegionNames().size()
|
||||||
|
);
|
||||||
|
|
||||||
|
forAll(allToProcMappers, i)
|
||||||
|
{
|
||||||
|
allToProcMappers.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new fvFieldDecomposer
|
||||||
|
(
|
||||||
|
allMesh(),
|
||||||
|
procMeshes[i],
|
||||||
|
faceProcAddressing[i],
|
||||||
|
cellProcAddressing[i],
|
||||||
|
boundaryProcAddressing[i]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,12 +1,12 @@
|
|||||||
scalar CoNum = -GREAT;
|
scalar CoNum = -GREAT;
|
||||||
|
|
||||||
forAll(fluidRegions, regionI)
|
forAll(fluidToProc, regionI)
|
||||||
{
|
{
|
||||||
CoNum = max
|
CoNum = max
|
||||||
(
|
(
|
||||||
compressibleCourantNo
|
compressibleCourantNo
|
||||||
(
|
(
|
||||||
fluidRegions[regionI],
|
procMeshes[fluidToProc[regionI]],
|
||||||
runTime,
|
runTime,
|
||||||
rhoFluid[regionI],
|
rhoFluid[regionI],
|
||||||
phiFluid[regionI]
|
phiFluid[regionI]
|
||||||
|
|||||||
@ -1,30 +1,36 @@
|
|||||||
// Initialise fluid field pointer lists
|
// Initialise fluid field pointer lists
|
||||||
PtrList<basicRhoThermo> thermoFluid(fluidRegions.size());
|
PtrList<basicRhoThermo> thermoFluid(rp.fluidRegionNames().size());
|
||||||
PtrList<volScalarField> rhoFluid(fluidRegions.size());
|
PtrList<volScalarField> rhoFluid(rp.fluidRegionNames().size());
|
||||||
PtrList<volScalarField> KFluid(fluidRegions.size());
|
PtrList<volScalarField> KFluid(rp.fluidRegionNames().size());
|
||||||
PtrList<volVectorField> UFluid(fluidRegions.size());
|
PtrList<volVectorField> UFluid(rp.fluidRegionNames().size());
|
||||||
PtrList<surfaceScalarField> phiFluid(fluidRegions.size());
|
PtrList<surfaceScalarField> phiFluid(rp.fluidRegionNames().size());
|
||||||
PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size());
|
PtrList<uniformDimensionedVectorField> gFluid(rp.fluidRegionNames().size());
|
||||||
PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size());
|
PtrList<compressible::turbulenceModel> turbulence
|
||||||
PtrList<volScalarField> p_rghFluid(fluidRegions.size());
|
(
|
||||||
PtrList<volScalarField> ghFluid(fluidRegions.size());
|
rp.fluidRegionNames().size()
|
||||||
PtrList<surfaceScalarField> ghfFluid(fluidRegions.size());
|
);
|
||||||
PtrList<radiation::radiationModel> radiation(fluidRegions.size());
|
PtrList<volScalarField> p_rghFluid(rp.fluidRegionNames().size());
|
||||||
PtrList<volScalarField> DpDtFluid(fluidRegions.size());
|
PtrList<volScalarField> ghFluid(rp.fluidRegionNames().size());
|
||||||
|
PtrList<surfaceScalarField> ghfFluid(rp.fluidRegionNames().size());
|
||||||
|
PtrList<radiation::radiationModel> radiation(rp.fluidRegionNames().size());
|
||||||
|
PtrList<volScalarField> DpDtFluid(rp.fluidRegionNames().size());
|
||||||
|
|
||||||
List<scalar> initialMassFluid(fluidRegions.size());
|
List<scalar> initialMassFluid(rp.fluidRegionNames().size());
|
||||||
|
|
||||||
// Populate fluid field pointer lists
|
// Populate fluid field pointer lists
|
||||||
forAll(fluidRegions, i)
|
forAll(rp.fluidRegionNames(), i)
|
||||||
{
|
{
|
||||||
Info<< "*** Reading fluid mesh thermophysical properties for region "
|
Info<< "*** Reading fluid mesh thermophysical properties for region "
|
||||||
<< fluidRegions[i].name() << nl << endl;
|
<< rp.fluidRegionNames()[i] << nl << endl;
|
||||||
|
|
||||||
|
label procI = fluidToProc[i];
|
||||||
|
|
||||||
|
|
||||||
Info<< " Adding to thermoFluid\n" << endl;
|
Info<< " Adding to thermoFluid\n" << endl;
|
||||||
thermoFluid.set
|
thermoFluid.set
|
||||||
(
|
(
|
||||||
i,
|
i,
|
||||||
basicRhoThermo::New(fluidRegions[i]).ptr()
|
basicRhoThermo::New(procMeshes[procI]).ptr()
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< " Adding to rhoFluid\n" << endl;
|
Info<< " Adding to rhoFluid\n" << endl;
|
||||||
@ -37,7 +43,7 @@
|
|||||||
(
|
(
|
||||||
"rho",
|
"rho",
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
fluidRegions[i],
|
procMeshes[procI],
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
@ -55,7 +61,7 @@
|
|||||||
(
|
(
|
||||||
"K",
|
"K",
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
fluidRegions[i],
|
procMeshes[procI],
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
@ -73,11 +79,11 @@
|
|||||||
(
|
(
|
||||||
"U",
|
"U",
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
fluidRegions[i],
|
procMeshes[procI],
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
fluidRegions[i]
|
procMeshes[procI]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -91,12 +97,12 @@
|
|||||||
(
|
(
|
||||||
"phi",
|
"phi",
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
fluidRegions[i],
|
procMeshes[procI],
|
||||||
IOobject::READ_IF_PRESENT,
|
IOobject::READ_IF_PRESENT,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
linearInterpolate(rhoFluid[i]*UFluid[i])
|
linearInterpolate(rhoFluid[i]*UFluid[i])
|
||||||
& fluidRegions[i].Sf()
|
& procMeshes[procI].Sf()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -110,7 +116,7 @@
|
|||||||
(
|
(
|
||||||
"g",
|
"g",
|
||||||
runTime.constant(),
|
runTime.constant(),
|
||||||
fluidRegions[i],
|
procMeshes[procI],
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
)
|
)
|
||||||
@ -137,14 +143,14 @@
|
|||||||
ghFluid.set
|
ghFluid.set
|
||||||
(
|
(
|
||||||
i,
|
i,
|
||||||
new volScalarField("gh", gFluid[i] & fluidRegions[i].C())
|
new volScalarField("gh", gFluid[i] & procMeshes[procI].C())
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< " Adding to ghfFluid\n" << endl;
|
Info<< " Adding to ghfFluid\n" << endl;
|
||||||
ghfFluid.set
|
ghfFluid.set
|
||||||
(
|
(
|
||||||
i,
|
i,
|
||||||
new surfaceScalarField("ghf", gFluid[i] & fluidRegions[i].Cf())
|
new surfaceScalarField("ghf", gFluid[i] & procMeshes[procI].Cf())
|
||||||
);
|
);
|
||||||
|
|
||||||
p_rghFluid.set
|
p_rghFluid.set
|
||||||
@ -156,11 +162,11 @@
|
|||||||
(
|
(
|
||||||
"p_rgh",
|
"p_rgh",
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
fluidRegions[i],
|
procMeshes[procI],
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
fluidRegions[i]
|
procMeshes[procI]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
PtrList<fvMesh> fluidRegions(rp.fluidRegionNames().size());
|
|
||||||
|
|
||||||
forAll(rp.fluidRegionNames(), i)
|
forAll(rp.fluidRegionNames(), i)
|
||||||
{
|
{
|
||||||
Info<< "Create fluid mesh for region " << rp.fluidRegionNames()[i]
|
Info<< "Create fluid mesh for region " << rp.fluidRegionNames()[i]
|
||||||
<< " for time = " << runTime.timeName() << nl << endl;
|
<< " for time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
fluidRegions.set
|
label procI = fluidToProc[i];
|
||||||
|
|
||||||
|
procMeshes.set
|
||||||
(
|
(
|
||||||
i,
|
procI,
|
||||||
new fvMesh
|
new fvMesh
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -19,4 +19,58 @@
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (temperatureCoupled)
|
||||||
|
{
|
||||||
|
cellProcAddressing.set
|
||||||
|
(
|
||||||
|
procI,
|
||||||
|
new labelIOList
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"cellRegionAddressing",
|
||||||
|
procMeshes[procI].facesInstance(),
|
||||||
|
procMeshes[procI].meshSubDir,
|
||||||
|
procMeshes[procI],
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
faceProcAddressing.set
|
||||||
|
(
|
||||||
|
procI,
|
||||||
|
new labelIOList
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"faceRegionAddressing",
|
||||||
|
procMeshes[procI].facesInstance(),
|
||||||
|
procMeshes[procI].meshSubDir,
|
||||||
|
procMeshes[procI],
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
boundaryProcAddressing.set
|
||||||
|
(
|
||||||
|
procI,
|
||||||
|
new labelIOList
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"boundaryRegionAddressing",
|
||||||
|
procMeshes[procI].facesInstance(),
|
||||||
|
procMeshes[procI].meshSubDir,
|
||||||
|
procMeshes[procI],
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
List<scalar> cumulativeContErr(fluidRegions.size(), 0.0);
|
List<scalar> cumulativeContErr(fluidToProc.size(), 0.0);
|
||||||
|
|||||||
@ -0,0 +1,3 @@
|
|||||||
|
h = allToProcMappers[procI].decomposeField(allh(), true);
|
||||||
|
h.oldTime().timeIndex() = allh().oldTime().timeIndex();
|
||||||
|
h.correctBoundaryConditions();
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
// Note:Map rho and rho.oldTime() since fluid rho assigned to at
|
||||||
|
// end of iteration.
|
||||||
|
rmap
|
||||||
|
(
|
||||||
|
allRho(),
|
||||||
|
rho,
|
||||||
|
faceProcAddressing[procI],
|
||||||
|
cellProcAddressing[procI],
|
||||||
|
boundaryProcAddressing[procI]
|
||||||
|
);
|
||||||
|
rmap
|
||||||
|
(
|
||||||
|
allRho().oldTime(),
|
||||||
|
rho.oldTime(),
|
||||||
|
faceProcAddressing[procI],
|
||||||
|
cellProcAddressing[procI],
|
||||||
|
boundaryProcAddressing[procI]
|
||||||
|
);
|
||||||
|
|
||||||
|
// Necessary? Probably only for boundary values since bcs on
|
||||||
|
// h are not the same as those on allh
|
||||||
|
|
||||||
|
rmap
|
||||||
|
(
|
||||||
|
allh(),
|
||||||
|
h,
|
||||||
|
faceProcAddressing[procI],
|
||||||
|
cellProcAddressing[procI],
|
||||||
|
boundaryProcAddressing[procI]
|
||||||
|
);
|
||||||
|
|
||||||
|
procAlpha.set(procI, fvc::interpolate(turb.alphaEff()));
|
||||||
|
|
||||||
|
rmap
|
||||||
|
(
|
||||||
|
allVolAlpha(),
|
||||||
|
turb.alphaEff()(),
|
||||||
|
faceProcAddressing[procI],
|
||||||
|
cellProcAddressing[procI],
|
||||||
|
boundaryProcAddressing[procI]
|
||||||
|
);
|
||||||
|
|
||||||
|
rmap
|
||||||
|
(
|
||||||
|
allSource(),
|
||||||
|
(DpDt + rad.Sh(thermo))(),
|
||||||
|
faceProcAddressing[procI],
|
||||||
|
cellProcAddressing[procI],
|
||||||
|
boundaryProcAddressing[procI]
|
||||||
|
);
|
||||||
|
|
||||||
|
procPhi.set
|
||||||
|
(
|
||||||
|
procI,
|
||||||
|
new surfaceScalarField(phi)
|
||||||
|
);
|
||||||
@ -1,4 +1,4 @@
|
|||||||
fvMesh& mesh = fluidRegions[i];
|
fvMesh& mesh = procMeshes[fluidToProc[i]];
|
||||||
|
|
||||||
basicRhoThermo& thermo = thermoFluid[i];
|
basicRhoThermo& thermo = thermoFluid[i];
|
||||||
volScalarField& rho = rhoFluid[i];
|
volScalarField& rho = rhoFluid[i];
|
||||||
|
|||||||
@ -0,0 +1,11 @@
|
|||||||
|
#include "UEqn.H"
|
||||||
|
|
||||||
|
// --- PISO loop
|
||||||
|
for (int corr=0; corr<nCorr; corr++)
|
||||||
|
{
|
||||||
|
#include "pEqn.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
turb.correct();
|
||||||
|
|
||||||
|
rho = thermo.rho();
|
||||||
@ -6,3 +6,6 @@
|
|||||||
|
|
||||||
const int nOuterCorr =
|
const int nOuterCorr =
|
||||||
pimple.lookupOrDefault<int>("nOuterCorrectors", 1);
|
pimple.lookupOrDefault<int>("nOuterCorrectors", 1);
|
||||||
|
|
||||||
|
const Switch temperatureCoupled =
|
||||||
|
pimple.lookupOrDefault<Switch>("temperatureCoupled", false);
|
||||||
|
|||||||
96
applications/solvers/heatTransfer/chtMultiRegionFoam/rmap.H
Normal file
96
applications/solvers/heatTransfer/chtMultiRegionFoam/rmap.H
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Global
|
||||||
|
rmap
|
||||||
|
|
||||||
|
Description
|
||||||
|
map field on subset of mesh onto overall field. Rewrites boundary
|
||||||
|
conditions to be mixed.
|
||||||
|
|
||||||
|
The source fields can have different patch types for the same destination
|
||||||
|
patch. To work around this it attempts to convert all patch fields into
|
||||||
|
mixed type since this can accomodate anything from fixedValue to
|
||||||
|
fixedGradient.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
rmap.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef rmap_H
|
||||||
|
#define rmap_H
|
||||||
|
|
||||||
|
#include "volFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
//- Map patchField
|
||||||
|
template<class Type>
|
||||||
|
static void rmap
|
||||||
|
(
|
||||||
|
fvPatchField<Type>& destBC,
|
||||||
|
const labelList& reverseAddressing,
|
||||||
|
const fvPatchField<Type>& sourceBC
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Map volField
|
||||||
|
template<class Type>
|
||||||
|
static void rmap
|
||||||
|
(
|
||||||
|
GeometricField<Type, fvPatchField, volMesh>& dest,
|
||||||
|
const GeometricField<Type, fvPatchField, volMesh>& source,
|
||||||
|
const labelList& faceProcAddressing,
|
||||||
|
const labelList& cellProcAddressing,
|
||||||
|
const labelList& boundaryProcAddressing
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Map fvMatrix
|
||||||
|
template<class Type>
|
||||||
|
static void rmap
|
||||||
|
(
|
||||||
|
fvMatrix<Type>& dest,
|
||||||
|
const fvMatrix<Type>& source,
|
||||||
|
const labelList& faceProcAddressing,
|
||||||
|
const labelList& cellProcAddressing,
|
||||||
|
const labelList& boundaryProcAddressing
|
||||||
|
);
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "rmapTemplates.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,309 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "rmap.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::rmap
|
||||||
|
(
|
||||||
|
fvPatchField<Type>& destBC,
|
||||||
|
const labelList& reverseAddressing,
|
||||||
|
const fvPatchField<Type>& sourceBC
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// Assign value
|
||||||
|
destBC.Field<Type>::rmap(sourceBC, reverseAddressing);
|
||||||
|
|
||||||
|
// Assign other properties
|
||||||
|
if (isA<mixedFvPatchField<Type> >(destBC))
|
||||||
|
{
|
||||||
|
mixedFvPatchField<Type>& mp =
|
||||||
|
refCast<mixedFvPatchField<Type> >(destBC);
|
||||||
|
|
||||||
|
if (isA<mixedFvPatchField<Type> >(sourceBC))
|
||||||
|
{
|
||||||
|
const mixedFvPatchField<Type>& Tp =
|
||||||
|
refCast<const mixedFvPatchField<Type> >(sourceBC);
|
||||||
|
|
||||||
|
mp.refValue().rmap(Tp.refValue(), reverseAddressing);
|
||||||
|
mp.refGrad().rmap(Tp.refGrad(), reverseAddressing);
|
||||||
|
mp.valueFraction().rmap(Tp.valueFraction(), reverseAddressing);
|
||||||
|
}
|
||||||
|
else if (isA<fixedGradientFvPatchField<Type> >(sourceBC))
|
||||||
|
{
|
||||||
|
const fixedGradientFvPatchField<Type>& Tp =
|
||||||
|
refCast<const fixedGradientFvPatchField<Type> >
|
||||||
|
(
|
||||||
|
sourceBC
|
||||||
|
);
|
||||||
|
// Make pure fixedGradient
|
||||||
|
mp.refValue().rmap(Tp, reverseAddressing); // unused
|
||||||
|
mp.refGrad().rmap(Tp.gradient(), reverseAddressing);
|
||||||
|
mp.valueFraction().rmap
|
||||||
|
(
|
||||||
|
Field<Type>(reverseAddressing.size(), 0.0),
|
||||||
|
reverseAddressing
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (isA<zeroGradientFvPatchField<Type> >(sourceBC))
|
||||||
|
{
|
||||||
|
// Make pure fixedGradient with gradient = 0
|
||||||
|
mp.refValue().rmap(sourceBC, reverseAddressing); // unused
|
||||||
|
mp.refGrad().rmap
|
||||||
|
(
|
||||||
|
Field<Type>(reverseAddressing.size(), 0.0),
|
||||||
|
reverseAddressing
|
||||||
|
);
|
||||||
|
mp.valueFraction().rmap
|
||||||
|
(
|
||||||
|
Field<Type>(reverseAddressing.size(), 0.0),
|
||||||
|
reverseAddressing
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (isA<fixedValueFvPatchField<Type> >(sourceBC))
|
||||||
|
{
|
||||||
|
// Make pure fixedValue
|
||||||
|
mp.refValue().rmap(sourceBC, reverseAddressing);
|
||||||
|
mp.refGrad().rmap
|
||||||
|
(
|
||||||
|
Field<Type>(reverseAddressing.size(), 0.0),
|
||||||
|
reverseAddressing
|
||||||
|
); // unused
|
||||||
|
mp.valueFraction().rmap
|
||||||
|
(
|
||||||
|
Field<Type>(reverseAddressing.size(), 1.0),
|
||||||
|
reverseAddressing
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if (isA<calculatedFvPatchField<Type> >(sourceBC))
|
||||||
|
{
|
||||||
|
// Make pure fixedValue
|
||||||
|
mp.refValue().rmap(sourceBC, reverseAddressing);
|
||||||
|
mp.refGrad().rmap
|
||||||
|
(
|
||||||
|
Field<Type>(reverseAddressing.size(), 0.0),
|
||||||
|
reverseAddressing
|
||||||
|
); // unused
|
||||||
|
mp.valueFraction().rmap
|
||||||
|
(
|
||||||
|
Field<Type>(reverseAddressing.size(), 1.0),
|
||||||
|
reverseAddressing
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn("rmap(..)")
|
||||||
|
<< "Don't know how to map source bc "
|
||||||
|
<< sourceBC.type()
|
||||||
|
<< " into a mixed boundary condition at "
|
||||||
|
<< destBC.patch().name()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (isA<fixedGradientFvPatchField<Type> >(destBC))
|
||||||
|
{
|
||||||
|
fixedGradientFvPatchField<Type>& mp =
|
||||||
|
refCast<fixedGradientFvPatchField<Type> >(destBC);
|
||||||
|
|
||||||
|
if (isA<fixedGradientFvPatchField<Type> >(sourceBC))
|
||||||
|
{
|
||||||
|
const fixedGradientFvPatchField<Type>& Tp =
|
||||||
|
refCast<const fixedGradientFvPatchField<Type> >
|
||||||
|
(
|
||||||
|
sourceBC
|
||||||
|
);
|
||||||
|
mp.gradient().rmap(Tp.gradient(), reverseAddressing);
|
||||||
|
}
|
||||||
|
else if (isA<mixedFvPatchField<Type> >(sourceBC))
|
||||||
|
{
|
||||||
|
const mixedFvPatchField<Type>& Tp =
|
||||||
|
refCast<const mixedFvPatchField<Type> >(sourceBC);
|
||||||
|
mp.gradient().rmap(Tp.snGrad(), reverseAddressing);
|
||||||
|
}
|
||||||
|
else if (isA<zeroGradientFvPatchField<Type> >(sourceBC))
|
||||||
|
{
|
||||||
|
mp.gradient().rmap
|
||||||
|
(
|
||||||
|
Field<Type>(reverseAddressing.size(), 0.0),
|
||||||
|
reverseAddressing
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn("rmap(..)")
|
||||||
|
<< "Don't know how to map source bc "
|
||||||
|
<< sourceBC.type()
|
||||||
|
<< " into a fixedGradient boundary condition at "
|
||||||
|
<< destBC.patch().name()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::rmap
|
||||||
|
(
|
||||||
|
GeometricField<Type, fvPatchField, volMesh>& dest,
|
||||||
|
const GeometricField<Type, fvPatchField, volMesh>& source,
|
||||||
|
const labelList& faceProcAddressing,
|
||||||
|
const labelList& cellProcAddressing,
|
||||||
|
const labelList& boundaryProcAddressing
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (dest.dimensions() != source.dimensions())
|
||||||
|
{
|
||||||
|
FatalErrorIn("rmap(..)")
|
||||||
|
<< "Different dimensions for = for fields " << dest.name()
|
||||||
|
<< " and " << source.name() << endl
|
||||||
|
<< " dimensions : " << dest.dimensions()
|
||||||
|
<< " = " << source.dimensions() << endl
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy internal field
|
||||||
|
dest.internalField().rmap(source.internalField(), cellProcAddressing);
|
||||||
|
|
||||||
|
// Copy boundary properties as mixed
|
||||||
|
forAll(source.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
label curBPatch = boundaryProcAddressing[patchI];
|
||||||
|
|
||||||
|
if (curBPatch == -1)
|
||||||
|
{
|
||||||
|
// Unknown patch. Do not change any values.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Get addressing slice for this patch
|
||||||
|
const labelList::subList cp =
|
||||||
|
source.mesh().boundary()[patchI].patchSlice
|
||||||
|
(
|
||||||
|
faceProcAddressing
|
||||||
|
);
|
||||||
|
|
||||||
|
const label curPatchStart =
|
||||||
|
dest.mesh().boundaryMesh()[curBPatch].start();
|
||||||
|
|
||||||
|
labelList reverseAddressing(cp.size());
|
||||||
|
|
||||||
|
forAll(cp, faceI)
|
||||||
|
{
|
||||||
|
// Subtract one to take into account offsets for
|
||||||
|
// face direction.
|
||||||
|
if (cp[faceI] <= 0)
|
||||||
|
{
|
||||||
|
FatalErrorIn("rmap(..)")
|
||||||
|
<< "Problem:"
|
||||||
|
<< " patch:" << source.mesh().boundary()[patchI].name()
|
||||||
|
<< " field:" << source.name()
|
||||||
|
<< " local face:" << faceI
|
||||||
|
<< " mapped to:" << cp[faceI] << exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
reverseAddressing[faceI] = cp[faceI] - 1 - curPatchStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Map curBPatch from source patch. Is like rmap but also
|
||||||
|
// copies non-value properties from alike patchFields.
|
||||||
|
rmap
|
||||||
|
(
|
||||||
|
dest.boundaryField()[curBPatch],
|
||||||
|
reverseAddressing,
|
||||||
|
source.boundaryField()[patchI]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy timeIndex
|
||||||
|
dest.timeIndex() = source.timeIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::rmap
|
||||||
|
(
|
||||||
|
fvMatrix<Type>& dest,
|
||||||
|
const fvMatrix<Type>& source,
|
||||||
|
const labelList& faceProcAddressing,
|
||||||
|
const labelList& cellProcAddressing,
|
||||||
|
const labelList& boundaryProcAddressing
|
||||||
|
)
|
||||||
|
{
|
||||||
|
dest.source().rmap(source.source(), cellProcAddressing);
|
||||||
|
|
||||||
|
FieldField<Field, Type>& sourceInternal =
|
||||||
|
const_cast<fvMatrix<Type>&>(source).internalCoeffs();
|
||||||
|
FieldField<Field, Type>& sourceBoundary =
|
||||||
|
const_cast<fvMatrix<Type>&>(source).boundaryCoeffs();
|
||||||
|
|
||||||
|
forAll(sourceInternal, patchI)
|
||||||
|
{
|
||||||
|
label curBPatch = boundaryProcAddressing[patchI];
|
||||||
|
|
||||||
|
if (curBPatch == -1)
|
||||||
|
{
|
||||||
|
// Unknown patch. Do not change any values.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Get addressing slice for this patch
|
||||||
|
const fvMesh& sourceMesh = source.psi().mesh();
|
||||||
|
|
||||||
|
const labelList::subList cp =
|
||||||
|
sourceMesh.boundary()[patchI].patchSlice
|
||||||
|
(
|
||||||
|
faceProcAddressing
|
||||||
|
);
|
||||||
|
|
||||||
|
const label curPatchStart =
|
||||||
|
dest.psi().mesh().boundaryMesh()[curBPatch].start();
|
||||||
|
|
||||||
|
labelList reverseAddressing(cp.size());
|
||||||
|
|
||||||
|
forAll(cp, faceI)
|
||||||
|
{
|
||||||
|
// Subtract one to take into account offsets for
|
||||||
|
// face direction.
|
||||||
|
reverseAddressing[faceI] = cp[faceI] - 1 - curPatchStart;
|
||||||
|
}
|
||||||
|
dest.internalCoeffs()[curBPatch].rmap
|
||||||
|
(
|
||||||
|
sourceInternal[patchI],
|
||||||
|
reverseAddressing
|
||||||
|
);
|
||||||
|
dest.boundaryCoeffs()[curBPatch].rmap
|
||||||
|
(
|
||||||
|
sourceBoundary[patchI],
|
||||||
|
reverseAddressing
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -1,12 +1,36 @@
|
|||||||
// Initialise solid field pointer lists
|
// Initialise solid field pointer lists
|
||||||
PtrList<basicSolidThermo> thermos(solidRegions.size());
|
PtrList<basicSolidThermo> thermoSolid(rp.solidRegionNames().size());
|
||||||
|
PtrList<volScalarField> hSolid(rp.solidRegionNames().size());
|
||||||
|
|
||||||
// Populate solid field pointer lists
|
// Populate solid field pointer lists
|
||||||
forAll(solidRegions, i)
|
forAll(rp.solidRegionNames(), i)
|
||||||
{
|
{
|
||||||
Info<< "*** Reading solid mesh thermophysical properties for region "
|
Info<< "*** Reading solid mesh thermophysical properties for region "
|
||||||
<< solidRegions[i].name() << nl << endl;
|
<< rp.solidRegionNames()[i] << nl << endl;
|
||||||
|
|
||||||
Info<< " Adding to thermos\n" << endl;
|
label procI = solidToProc[i];
|
||||||
thermos.set(i, basicSolidThermo::New(solidRegions[i]));
|
|
||||||
|
Info<< " Adding to thermoSolid\n" << endl;
|
||||||
|
thermoSolid.set(i, basicSolidThermo::New(procMeshes[procI]));
|
||||||
|
|
||||||
|
if (temperatureCoupled)
|
||||||
|
{
|
||||||
|
Info<< " Adding to hSolid\n" << endl;
|
||||||
|
hSolid.set
|
||||||
|
(
|
||||||
|
i,
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"h",
|
||||||
|
runTime.timeName(),
|
||||||
|
procMeshes[procI],
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
procMeshes[procI]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
PtrList<fvMesh> solidRegions(rp.solidRegionNames().size());
|
|
||||||
|
|
||||||
forAll(rp.solidRegionNames(), i)
|
forAll(rp.solidRegionNames(), i)
|
||||||
{
|
{
|
||||||
Info<< "Create solid mesh for region " << rp.solidRegionNames()[i]
|
Info<< "Create solid mesh for region " << rp.solidRegionNames()[i]
|
||||||
<< " for time = " << runTime.timeName() << nl << endl;
|
<< " for time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
solidRegions.set
|
label procI = solidToProc[i];
|
||||||
|
|
||||||
|
procMeshes.set
|
||||||
(
|
(
|
||||||
i,
|
procI,
|
||||||
new fvMesh
|
new fvMesh
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -20,8 +20,57 @@
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Force calculation of geometric properties to prevent it being done
|
if (temperatureCoupled)
|
||||||
// later in e.g. some boundary evaluation
|
{
|
||||||
//(void)solidRegions[i].weights();
|
cellProcAddressing.set
|
||||||
//(void)solidRegions[i].deltaCoeffs();
|
(
|
||||||
|
procI,
|
||||||
|
new labelIOList
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"cellRegionAddressing",
|
||||||
|
procMeshes[procI].facesInstance(),
|
||||||
|
procMeshes[procI].meshSubDir,
|
||||||
|
procMeshes[procI],
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
faceProcAddressing.set
|
||||||
|
(
|
||||||
|
procI,
|
||||||
|
new labelIOList
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"faceRegionAddressing",
|
||||||
|
procMeshes[procI].facesInstance(),
|
||||||
|
procMeshes[procI].meshSubDir,
|
||||||
|
procMeshes[procI],
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
boundaryProcAddressing.set
|
||||||
|
(
|
||||||
|
procI,
|
||||||
|
new labelIOList
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"boundaryRegionAddressing",
|
||||||
|
procMeshes[procI].facesInstance(),
|
||||||
|
procMeshes[procI].meshSubDir,
|
||||||
|
procMeshes[procI],
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
volScalarField& h = hSolid[i];
|
||||||
|
|
||||||
|
h = allToProcMappers[procI].decomposeField(allh(), true);
|
||||||
|
h.oldTime().timeIndex() = allh().oldTime().timeIndex();
|
||||||
|
|
||||||
|
T += (h-h.oldTime())/cp;
|
||||||
|
// Correct T boundary conditions and update h boundary
|
||||||
|
// conditions accordingly.
|
||||||
|
volScalarField::GeometricBoundaryField Told = T.boundaryField();
|
||||||
|
T.correctBoundaryConditions();
|
||||||
|
h.boundaryField() +=
|
||||||
|
cp.boundaryField()
|
||||||
|
* (T.boundaryField()-Told);
|
||||||
|
}
|
||||||
@ -0,0 +1,90 @@
|
|||||||
|
{
|
||||||
|
volScalarField& h = hSolid[i];
|
||||||
|
|
||||||
|
procPhi.setSize(nAllRegions);
|
||||||
|
procAlpha.setSize(nAllRegions);
|
||||||
|
|
||||||
|
rmap
|
||||||
|
(
|
||||||
|
allRho(),
|
||||||
|
rho,
|
||||||
|
faceProcAddressing[procI],
|
||||||
|
cellProcAddressing[procI],
|
||||||
|
boundaryProcAddressing[procI]
|
||||||
|
);
|
||||||
|
|
||||||
|
// Necessary? Probably only for boundary values since bcs on
|
||||||
|
// h are not the same as those on allh
|
||||||
|
rmap
|
||||||
|
(
|
||||||
|
allh(),
|
||||||
|
h,
|
||||||
|
faceProcAddressing[procI],
|
||||||
|
cellProcAddressing[procI],
|
||||||
|
boundaryProcAddressing[procI]
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
tmp<volScalarField> Kcp(K/cp);
|
||||||
|
|
||||||
|
rmap
|
||||||
|
(
|
||||||
|
allVolAlpha(),
|
||||||
|
Kcp(),
|
||||||
|
faceProcAddressing[procI],
|
||||||
|
cellProcAddressing[procI],
|
||||||
|
boundaryProcAddressing[procI]
|
||||||
|
);
|
||||||
|
|
||||||
|
procAlpha.set(procI, fvc::interpolate(Kcp));
|
||||||
|
|
||||||
|
// allSource is initialised to zero already
|
||||||
|
//rmap
|
||||||
|
//(
|
||||||
|
// allSource(),
|
||||||
|
// volScalarField
|
||||||
|
// (
|
||||||
|
// IOobject
|
||||||
|
// (
|
||||||
|
// "procSource",
|
||||||
|
// runTime.timeName(),
|
||||||
|
// mesh,
|
||||||
|
// IOobject::NO_READ,
|
||||||
|
// IOobject::AUTO_WRITE
|
||||||
|
// ),
|
||||||
|
// mesh,
|
||||||
|
// dimensionedScalar
|
||||||
|
// (
|
||||||
|
// "procSource",
|
||||||
|
// allh().dimensions()*dimDensity/dimTime,
|
||||||
|
// 0.0
|
||||||
|
// )
|
||||||
|
// ),
|
||||||
|
// faceProcAddressing[procI],
|
||||||
|
// cellProcAddressing[procI],
|
||||||
|
// boundaryProcAddressing[procI]
|
||||||
|
//);
|
||||||
|
|
||||||
|
procPhi.set
|
||||||
|
(
|
||||||
|
procI,
|
||||||
|
new surfaceScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"phi",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar
|
||||||
|
(
|
||||||
|
"phi",
|
||||||
|
dimDensity*dimVelocity*dimArea,
|
||||||
|
0.0
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
fvMesh& mesh = solidRegions[i];
|
fvMesh& mesh = procMeshes[solidToProc[i]];
|
||||||
basicSolidThermo& thermo = thermos[i];
|
basicSolidThermo& thermo = thermoSolid[i];
|
||||||
|
|
||||||
tmp<volScalarField> trho = thermo.rho();
|
tmp<volScalarField> trho = thermo.rho();
|
||||||
const volScalarField& rho = trho();
|
const volScalarField& rho = trho();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
scalar DiNum = -GREAT;
|
scalar DiNum = -GREAT;
|
||||||
|
|
||||||
forAll(solidRegions, i)
|
forAll(solidToProc, i)
|
||||||
{
|
{
|
||||||
# include "setRegionSolidFields.H"
|
# include "setRegionSolidFields.H"
|
||||||
|
|
||||||
@ -8,7 +8,7 @@
|
|||||||
(
|
(
|
||||||
solidRegionDiffNo
|
solidRegionDiffNo
|
||||||
(
|
(
|
||||||
solidRegions[i],
|
procMeshes[solidToProc[i]],
|
||||||
runTime,
|
runTime,
|
||||||
rho*cp,
|
rho*cp,
|
||||||
K
|
K
|
||||||
|
|||||||
@ -1,8 +1,3 @@
|
|||||||
if (finalIter)
|
|
||||||
{
|
|
||||||
mesh.data::add("finalIteration", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
{
|
{
|
||||||
@ -17,10 +12,3 @@ if (finalIter)
|
|||||||
|
|
||||||
Info<< "Min/max T:" << min(T) << ' ' << max(T) << endl;
|
Info<< "Min/max T:" << min(T) << ' ' << max(T) << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
thermo.correct();
|
|
||||||
|
|
||||||
if (finalIter)
|
|
||||||
{
|
|
||||||
mesh.data::remove("finalIteration");
|
|
||||||
}
|
|
||||||
|
|||||||
@ -7,6 +7,11 @@ if (pimple.nCorr() <= 1)
|
|||||||
|
|
||||||
phi = (fvc::interpolate(U) & mesh.Sf());
|
phi = (fvc::interpolate(U) & mesh.Sf());
|
||||||
|
|
||||||
|
if (ddtPhiCorr)
|
||||||
|
{
|
||||||
|
phi += fvc::ddtPhiCorr(rAU, U, phi);
|
||||||
|
}
|
||||||
|
|
||||||
if (p.needReference())
|
if (p.needReference())
|
||||||
{
|
{
|
||||||
fvc::makeRelative(phi, U);
|
fvc::makeRelative(phi, U);
|
||||||
|
|||||||
@ -8,3 +8,5 @@
|
|||||||
const bool checkMeshCourantNo =
|
const bool checkMeshCourantNo =
|
||||||
pimpleDict.lookupOrDefault("checkMeshCourantNo", false);
|
pimpleDict.lookupOrDefault("checkMeshCourantNo", false);
|
||||||
|
|
||||||
|
const bool ddtPhiCorr =
|
||||||
|
pimpleDict.lookupOrDefault("ddtPhiCorr", true);
|
||||||
|
|||||||
@ -58,6 +58,9 @@ int main(int argc, char *argv[])
|
|||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
#include "setInitialDeltaT.H"
|
#include "setInitialDeltaT.H"
|
||||||
|
|
||||||
|
surfaceScalarField phiAbs("phiAbs", phi);
|
||||||
|
fvc::makeAbsolute(phiAbs, U);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
@ -67,9 +70,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "alphaCourantNo.H"
|
#include "alphaCourantNo.H"
|
||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
|
|
||||||
// Make the fluxes absolute
|
|
||||||
fvc::makeAbsolute(phi, U);
|
|
||||||
|
|
||||||
#include "setDeltaT.H"
|
#include "setDeltaT.H"
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
@ -78,8 +78,18 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
||||||
|
|
||||||
// Do any mesh changes
|
{
|
||||||
mesh.update();
|
// Calculate the relative velocity used to map the relative flux phi
|
||||||
|
volVectorField Urel("Urel", U);
|
||||||
|
|
||||||
|
if (mesh.moving())
|
||||||
|
{
|
||||||
|
Urel -= fvc::reconstruct(fvc::meshPhi(U));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do any mesh changes
|
||||||
|
mesh.update();
|
||||||
|
}
|
||||||
|
|
||||||
if (mesh.changing())
|
if (mesh.changing())
|
||||||
{
|
{
|
||||||
@ -96,9 +106,6 @@ int main(int argc, char *argv[])
|
|||||||
#include "correctPhi.H"
|
#include "correctPhi.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the fluxes relative to the mesh motion
|
|
||||||
fvc::makeRelative(phi, U);
|
|
||||||
|
|
||||||
if (mesh.changing() && checkMeshCourantNo)
|
if (mesh.changing() && checkMeshCourantNo)
|
||||||
{
|
{
|
||||||
#include "meshCourantNo.H"
|
#include "meshCourantNo.H"
|
||||||
|
|||||||
@ -3,16 +3,19 @@
|
|||||||
surfaceScalarField rAUf(fvc::interpolate(rAU));
|
surfaceScalarField rAUf(fvc::interpolate(rAU));
|
||||||
|
|
||||||
U = rAU*UEqn.H();
|
U = rAU*UEqn.H();
|
||||||
surfaceScalarField phiU("phiU", (fvc::interpolate(U) & mesh.Sf()));
|
|
||||||
|
phiAbs =
|
||||||
|
(fvc::interpolate(U) & mesh.Sf())
|
||||||
|
+ fvc::ddtPhiCorr(rAU, rho, U, phiAbs);
|
||||||
|
|
||||||
if (p_rgh.needReference())
|
if (p_rgh.needReference())
|
||||||
{
|
{
|
||||||
fvc::makeRelative(phiU, U);
|
fvc::makeRelative(phiAbs, U);
|
||||||
adjustPhi(phiU, U, p_rgh);
|
adjustPhi(phiAbs, U, p_rgh);
|
||||||
fvc::makeAbsolute(phiU, U);
|
fvc::makeAbsolute(phiAbs, U);
|
||||||
}
|
}
|
||||||
|
|
||||||
phi = phiU +
|
phi = phiAbs +
|
||||||
(
|
(
|
||||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
|
||||||
- ghf*fvc::snGrad(rho)
|
- ghf*fvc::snGrad(rho)
|
||||||
@ -38,11 +41,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
|
U += rAU*fvc::reconstruct((phi - phiAbs)/rAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
|
||||||
#include "continuityErrs.H"
|
#include "continuityErrs.H"
|
||||||
|
|
||||||
|
phiAbs = phi;
|
||||||
|
|
||||||
// Make the fluxes relative to the mesh motion
|
// Make the fluxes relative to the mesh motion
|
||||||
fvc::makeRelative(phi, U);
|
fvc::makeRelative(phi, U);
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
multiphaseEulerFoam.C
|
multiphaseEulerFoam.C
|
||||||
|
multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/multiphaseEulerFoam
|
EXE = $(FOAM_APPBIN)/multiphaseEulerFoam
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-IphaseModel/lnInclude \
|
-IphaseModel/lnInclude \
|
||||||
-ImultiphaseSystem/lnInclude \
|
-ImultiphaseSystem/lnInclude \
|
||||||
|
-ImultiphaseFixedFluxPressure \
|
||||||
/*-IkineticTheoryModels/lnInclude*/ \
|
/*-IkineticTheoryModels/lnInclude*/ \
|
||||||
-IinterfacialModels/lnInclude \
|
-IinterfacialModels/lnInclude \
|
||||||
-I$(LIB_SRC)/transportModels \
|
-I$(LIB_SRC)/transportModels \
|
||||||
|
|||||||
@ -1,2 +1,8 @@
|
|||||||
MRFZones mrfZones(mesh);
|
MRFZones mrfZones(mesh);
|
||||||
|
|
||||||
|
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
|
||||||
|
{
|
||||||
|
mrfZones.correctBoundaryVelocity(iter().U());
|
||||||
|
}
|
||||||
|
|
||||||
mrfZones.correctBoundaryVelocity(U);
|
mrfZones.correctBoundaryVelocity(U);
|
||||||
|
|||||||
@ -53,12 +53,12 @@
|
|||||||
|
|
||||||
phase.U() = rAUs[phasei]*UEqns[phasei].H();
|
phase.U() = rAUs[phasei]*UEqns[phasei].H();
|
||||||
|
|
||||||
|
mrfZones.absoluteFlux(phase.phi());
|
||||||
phase.phi() =
|
phase.phi() =
|
||||||
(
|
(
|
||||||
(fvc::interpolate(phase.U()) & mesh.Sf())
|
(fvc::interpolate(phase.U()) & mesh.Sf())
|
||||||
+ fvc::ddtPhiCorr(rAUs[phasei], alpha, phase.U(), phase.phi())
|
+ fvc::ddtPhiCorr(rAUs[phasei], alpha, phase.U(), phase.phi())
|
||||||
);
|
);
|
||||||
|
|
||||||
mrfZones.relativeFlux(phase.phi());
|
mrfZones.relativeFlux(phase.phi());
|
||||||
phase.phi() += rAlphaAUfs[phasei]*(g & mesh.Sf());
|
phase.phi() += rAlphaAUfs[phasei]*(g & mesh.Sf());
|
||||||
|
|
||||||
@ -241,7 +241,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
phase.U() = fvc::reconstruct(phase.phi());
|
|
||||||
phase.U().correctBoundaryConditions();
|
phase.U().correctBoundaryConditions();
|
||||||
|
|
||||||
U += alpha*phase.U();
|
U += alpha*phase.U();
|
||||||
|
|||||||
@ -924,6 +924,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "addRegionOption.H"
|
#include "addRegionOption.H"
|
||||||
#include "addOverwriteOption.H"
|
#include "addOverwriteOption.H"
|
||||||
|
argList::addOption("dict", "name", "specify alternative dictionary");
|
||||||
argList::addBoolOption("AMI", "apply mapped AMI boundary type");
|
argList::addBoolOption("AMI", "apply mapped AMI boundary type");
|
||||||
|
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
@ -932,18 +933,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
const word oldInstance = mesh.pointsInstance();
|
const word oldInstance = mesh.pointsInstance();
|
||||||
bool overwrite = args.optionFound("overwrite");
|
bool overwrite = args.optionFound("overwrite");
|
||||||
|
const word dictName
|
||||||
mappedPatchBase::sampleMode sampleMode = mappedPatchBase::NEARESTPATCHFACE;
|
(args.optionLookupOrDefault<word>("dict", "extrudeToRegionMeshDict"));
|
||||||
if (args.optionFound("AMI"))
|
|
||||||
{
|
|
||||||
sampleMode = mappedPatchBase::NEARESTPATCHFACEAMI;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOdictionary dict
|
IOdictionary dict
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"extrudeToRegionMeshDict",
|
dictName,
|
||||||
runTime.system(),
|
runTime.system(),
|
||||||
runTime,
|
runTime,
|
||||||
IOobject::MUST_READ_IF_MODIFIED
|
IOobject::MUST_READ_IF_MODIFIED
|
||||||
@ -963,6 +960,9 @@ int main(int argc, char *argv[])
|
|||||||
dict.lookup("faceZonesShadow") >> zoneShadowNames;
|
dict.lookup("faceZonesShadow") >> zoneShadowNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mappedPatchBase::sampleMode sampleMode =
|
||||||
|
mappedPatchBase::sampleModeNames_[dict.lookup("sampleMode")];
|
||||||
|
|
||||||
const Switch oneD(dict.lookup("oneD"));
|
const Switch oneD(dict.lookup("oneD"));
|
||||||
const Switch adaptMesh(dict.lookup("adaptMesh"));
|
const Switch adaptMesh(dict.lookup("adaptMesh"));
|
||||||
|
|
||||||
|
|||||||
@ -15,10 +15,10 @@ FoamFile
|
|||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Name of region to create
|
// Name of region to create
|
||||||
region liquidFilm;
|
region liquidFilm;
|
||||||
|
|
||||||
// FaceZones to extrude
|
// FaceZones to extrude
|
||||||
faceZones (f0);
|
faceZones (f0);
|
||||||
|
|
||||||
// FaceZone shadow
|
// FaceZone shadow
|
||||||
//faceZonesShadow (fBaffleShadow);
|
//faceZonesShadow (fBaffleShadow);
|
||||||
@ -30,10 +30,13 @@ faceZones (f0);
|
|||||||
// - extruding boundary faces: repatched to be on mapped patches
|
// - extruding boundary faces: repatched to be on mapped patches
|
||||||
// If false: leave original mesh intact. Extruded mesh will still have
|
// If false: leave original mesh intact. Extruded mesh will still have
|
||||||
// mapped patch which might need to be adapted.
|
// mapped patch which might need to be adapted.
|
||||||
adaptMesh true;
|
adaptMesh true;
|
||||||
|
|
||||||
|
// Sample mode for inter-region communication
|
||||||
|
sampleMode nearestPatchFace;
|
||||||
|
|
||||||
// Extrude 1D-columns of cells?
|
// Extrude 1D-columns of cells?
|
||||||
oneD false;
|
oneD false;
|
||||||
|
|
||||||
// If oneD is true. Specify which boundary is wanted between the layers
|
// If oneD is true. Specify which boundary is wanted between the layers
|
||||||
//oneDPolyPatchType emptyPolyPatch; //wedgePolyPatch
|
//oneDPolyPatchType emptyPolyPatch; //wedgePolyPatch
|
||||||
@ -42,23 +45,23 @@ oneD false;
|
|||||||
//- Extrusion model to use. The only logical choice is linearNormal?
|
//- Extrusion model to use. The only logical choice is linearNormal?
|
||||||
|
|
||||||
//- Linear extrusion in normal direction
|
//- Linear extrusion in normal direction
|
||||||
extrudeModel linearNormal;
|
extrudeModel linearNormal;
|
||||||
|
|
||||||
//- Linear extrusion in specified direction
|
//- Linear extrusion in specified direction
|
||||||
//extrudeModel linearDirection;
|
// extrudeModel linearDirection;
|
||||||
|
|
||||||
//- Wedge extrusion. If nLayers is 1 assumes symmetry around plane.
|
//- Wedge extrusion. If nLayers is 1 assumes symmetry around plane.
|
||||||
// extrudeModel wedge;
|
// extrudeModel wedge;
|
||||||
|
|
||||||
//- Extrudes into sphere around (0 0 0)
|
//- Extrudes into sphere around (0 0 0)
|
||||||
//extrudeModel linearRadial;
|
// extrudeModel linearRadial;
|
||||||
|
|
||||||
//- Extrudes into sphere with grading according to pressure (atmospherics)
|
//- Extrudes into sphere with grading according to pressure (atmospherics)
|
||||||
//extrudeModel sigmaRadial;
|
// extrudeModel sigmaRadial;
|
||||||
|
|
||||||
nLayers 10;
|
nLayers 10;
|
||||||
|
|
||||||
expansionRatio 0.9;
|
expansionRatio 0.9;
|
||||||
|
|
||||||
linearNormalCoeffs
|
linearNormalCoeffs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -70,7 +70,7 @@ castellatedMeshControls
|
|||||||
// If local number of cells is >= maxLocalCells on any processor
|
// If local number of cells is >= maxLocalCells on any processor
|
||||||
// switches from from refinement followed by balancing
|
// switches from from refinement followed by balancing
|
||||||
// (current method) to (weighted) balancing before refinement.
|
// (current method) to (weighted) balancing before refinement.
|
||||||
maxLocalCells 1000000;
|
maxLocalCells 100000;
|
||||||
|
|
||||||
// Overall cell limit (approximately). Refinement will stop immediately
|
// Overall cell limit (approximately). Refinement will stop immediately
|
||||||
// upon reaching this number so a refinement level might not complete.
|
// upon reaching this number so a refinement level might not complete.
|
||||||
@ -311,6 +311,11 @@ addLayersControls
|
|||||||
// get used. Up to nRelaxIter it uses the settings in meshQualityControls,
|
// get used. Up to nRelaxIter it uses the settings in meshQualityControls,
|
||||||
// after nRelaxIter it uses the values in meshQualityControls::relaxed.
|
// after nRelaxIter it uses the values in meshQualityControls::relaxed.
|
||||||
nRelaxedIter 20;
|
nRelaxedIter 20;
|
||||||
|
|
||||||
|
// Additional reporting: if there are just a few faces where there
|
||||||
|
// are mesh errors (after adding the layers) print their face centres.
|
||||||
|
// This helps in tracking down problematic mesh areas.
|
||||||
|
//additionalReporting true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generic mesh quality settings. At any undoable phase these determine
|
// Generic mesh quality settings. At any undoable phase these determine
|
||||||
|
|||||||
@ -55,8 +55,10 @@ Description
|
|||||||
this if you don't mind having disconnected domains in a single region.
|
this if you don't mind having disconnected domains in a single region.
|
||||||
This option requires all cells to be in one (and one only) cellZone.
|
This option requires all cells to be in one (and one only) cellZone.
|
||||||
|
|
||||||
|
|
||||||
- Should work in parallel.
|
- Should work in parallel.
|
||||||
cellZones can differ on either side of processor boundaries in which case
|
cellZones can differ on either side of processor boundaries in which case
|
||||||
|
the faces get moved from processor patch to directMapped patch. Not
|
||||||
the faces get moved from processor patch to mapped patch. Not
|
the faces get moved from processor patch to mapped patch. Not
|
||||||
very well tested.
|
very well tested.
|
||||||
|
|
||||||
@ -79,6 +81,8 @@ Description
|
|||||||
- faceRegionAddressing : ,, face ,, face in
|
- faceRegionAddressing : ,, face ,, face in
|
||||||
the original mesh + 'turning index'. For a face in the same orientation
|
the original mesh + 'turning index'. For a face in the same orientation
|
||||||
this is the original facelabel+1, for a turned face this is -facelabel-1
|
this is the original facelabel+1, for a turned face this is -facelabel-1
|
||||||
|
- boundaryRegionAddressing : for every patch in this region the
|
||||||
|
patch in the original mesh (or -1 if added patch)
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "SortableList.H"
|
#include "SortableList.H"
|
||||||
@ -1231,6 +1235,36 @@ void createAndWriteRegion
|
|||||||
<< " from region" << regionI
|
<< " from region" << regionI
|
||||||
<< " cells back to base mesh." << endl;
|
<< " cells back to base mesh." << endl;
|
||||||
cellProcAddressing.write();
|
cellProcAddressing.write();
|
||||||
|
|
||||||
|
labelIOList boundaryProcAddressing
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"boundaryRegionAddressing",
|
||||||
|
newMesh().facesInstance(),
|
||||||
|
newMesh().meshSubDir,
|
||||||
|
newMesh(),
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
labelList(nNewPatches, -1)
|
||||||
|
);
|
||||||
|
forAll(oldToNew, i)
|
||||||
|
{
|
||||||
|
if (!addedPatches.found(i))
|
||||||
|
{
|
||||||
|
label newI = oldToNew[i];
|
||||||
|
if (newI >= 0 && newI < nNewPatches)
|
||||||
|
{
|
||||||
|
boundaryProcAddressing[oldToNew[i]] = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Info<< "Writing map " << boundaryProcAddressing.name()
|
||||||
|
<< " from region" << regionI
|
||||||
|
<< " boundary back to base mesh." << endl;
|
||||||
|
boundaryProcAddressing.write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -33,24 +33,28 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // Select by explicitly providing cell labels
|
// // Select by explicitly providing cell labels
|
||||||
// source labelToCell;
|
// source labelToCell;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// value (12 13 56); // labels of cells
|
// value (12 13 56); // labels of cells
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Copy elements from cellSet
|
// // Copy elements from cellSet
|
||||||
// source cellToCell;
|
// source cellToCell;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// set c1;
|
// set c1;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Cells in cell zone
|
// // Cells in cell zone
|
||||||
// source zoneToCell;
|
// source zoneToCell;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// name ".*Zone"; // Name of cellZone, regular expressions allowed
|
// name ".*Zone"; // Name of cellZone, regular expressions allowed
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Cells on master or slave side of faceZone
|
// // Cells on master or slave side of faceZone
|
||||||
// source faceZoneToCell;
|
// source faceZoneToCell;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// name ".*Zone"; // Name of faceZone, regular expressions allowed
|
// name ".*Zone"; // Name of faceZone, regular expressions allowed
|
||||||
// option master; // master/slave
|
// option master; // master/slave
|
||||||
@ -58,6 +62,7 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // Select based on faceSet
|
// // Select based on faceSet
|
||||||
// source faceToCell;
|
// source faceToCell;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// set f0; // Name of faceSet
|
// set f0; // Name of faceSet
|
||||||
//
|
//
|
||||||
@ -69,6 +74,7 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // Select based on pointSet
|
// // Select based on pointSet
|
||||||
// source pointToCell;
|
// source pointToCell;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// set p0;
|
// set p0;
|
||||||
// option any; // cell with any point in pointSet
|
// option any; // cell with any point in pointSet
|
||||||
@ -77,12 +83,14 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // Select based on cellShape
|
// // Select based on cellShape
|
||||||
// source shapeToCell;
|
// source shapeToCell;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// type hex; // hex/wedge/prism/pyr/tet/tetWedge/splitHex
|
// type hex; // hex/wedge/prism/pyr/tet/tetWedge/splitHex
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Cells with cell centre within box
|
// // Cells with cell centre within box
|
||||||
// source boxToCell;
|
// source boxToCell;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// box (0 0 0) (1 1 1);
|
// box (0 0 0) (1 1 1);
|
||||||
// }
|
// }
|
||||||
@ -90,6 +98,7 @@ FoamFile
|
|||||||
// // Cells with cell centre within box
|
// // Cells with cell centre within box
|
||||||
// // Is skewed, rotated box. Given as origin and three spanning vectors.
|
// // Is skewed, rotated box. Given as origin and three spanning vectors.
|
||||||
// source rotatedBoxToCell;
|
// source rotatedBoxToCell;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// origin (0.2 0.2 -10);
|
// origin (0.2 0.2 -10);
|
||||||
// i (0.2 0.2 0);
|
// i (0.2 0.2 0);
|
||||||
@ -99,6 +108,7 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // Cells with centre within cylinder
|
// // Cells with centre within cylinder
|
||||||
// source cylinderToCell;
|
// source cylinderToCell;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// p1 (0.2 0.2 -10); // start point on cylinder axis
|
// p1 (0.2 0.2 -10); // start point on cylinder axis
|
||||||
// p2 (0.2 0.2 0); // end point on cylinder axis
|
// p2 (0.2 0.2 0); // end point on cylinder axis
|
||||||
@ -107,6 +117,7 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // Cells with centre within sphere
|
// // Cells with centre within sphere
|
||||||
// source sphereToCell;
|
// source sphereToCell;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// centre (0.2 0.2 -10);
|
// centre (0.2 0.2 -10);
|
||||||
// radius 5.0;
|
// radius 5.0;
|
||||||
@ -114,12 +125,14 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // Cells with cellCentre nearest to coordinates
|
// // Cells with cellCentre nearest to coordinates
|
||||||
// source nearestToCell;
|
// source nearestToCell;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// points ((0 0 0) (1 1 1)(2 2 2));
|
// points ((0 0 0) (1 1 1)(2 2 2));
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Select based on surface
|
// // Select based on surface
|
||||||
// source surfaceToCell;
|
// source surfaceToCell;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// file "www.avl.com-geometry.stl";
|
// file "www.avl.com-geometry.stl";
|
||||||
// outsidePoints ((-99 -99 -59)); // definition of outside
|
// outsidePoints ((-99 -99 -59)); // definition of outside
|
||||||
@ -135,6 +148,7 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // values of field within certain range
|
// // values of field within certain range
|
||||||
// source fieldToCell;
|
// source fieldToCell;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// fieldName U; // Note: uses mag(U) since volVectorField
|
// fieldName U; // Note: uses mag(U) since volVectorField
|
||||||
// min 0.1;
|
// min 0.1;
|
||||||
@ -143,6 +157,7 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // Mesh region (non-face connected part of (subset of)mesh)
|
// // Mesh region (non-face connected part of (subset of)mesh)
|
||||||
// source regionToCell;
|
// source regionToCell;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// set c0; // name of cellSet giving mesh subset
|
// set c0; // name of cellSet giving mesh subset
|
||||||
// insidePoint (1 2 3); // point inside region to select
|
// insidePoint (1 2 3); // point inside region to select
|
||||||
@ -155,12 +170,14 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // Copy elements from faceSet
|
// // Copy elements from faceSet
|
||||||
// source faceToFace;
|
// source faceToFace;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// set f1;
|
// set f1;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Select based on cellSet
|
// // Select based on cellSet
|
||||||
// source cellToFace;
|
// source cellToFace;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// set c0;
|
// set c0;
|
||||||
// option all; // All faces of cells
|
// option all; // All faces of cells
|
||||||
@ -169,6 +186,7 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // Select based on pointSet
|
// // Select based on pointSet
|
||||||
// source pointToFace;
|
// source pointToFace;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// set p0;
|
// set p0;
|
||||||
// option any; // Faces using any point in pointSet
|
// option any; // Faces using any point in pointSet
|
||||||
@ -177,30 +195,35 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // Select by explicitly providing face labels
|
// // Select by explicitly providing face labels
|
||||||
// source labelToFace;
|
// source labelToFace;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// value (12 13 56); // labels of faces
|
// value (12 13 56); // labels of faces
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // All faces of patch
|
// // All faces of patch
|
||||||
// source patchToFace;
|
// source patchToFace;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// name ".*Wall"; // Name of patch, regular expressions allowed
|
// name ".*Wall"; // Name of patch, regular expressions allowed
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // All faces of faceZone
|
// // All faces of faceZone
|
||||||
// source zoneToFace;
|
// source zoneToFace;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// name ".*Zone1"; // Name of faceZone, regular expressions allowed
|
// name ".*Zone1"; // Name of faceZone, regular expressions allowed
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Faces with face centre within box
|
// // Faces with face centre within box
|
||||||
// source boxToFace;
|
// source boxToFace;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// box (0 0 0) (1 1 1);
|
// box (0 0 0) (1 1 1);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Faces with normal to within certain angle aligned with vector.
|
// // Faces with normal to within certain angle aligned with vector.
|
||||||
// source normalToFace;
|
// source normalToFace;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// normal (0 0 1); // Vector
|
// normal (0 0 1); // Vector
|
||||||
// cos 0.01; // Tolerance (max cos of angle)
|
// cos 0.01; // Tolerance (max cos of angle)
|
||||||
@ -213,12 +236,14 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // Copy elements from pointSet
|
// // Copy elements from pointSet
|
||||||
// source pointToPoint;
|
// source pointToPoint;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// set p1;
|
// set p1;
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Select based on cellSet
|
// // Select based on cellSet
|
||||||
// source cellToPoint;
|
// source cellToPoint;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// set c0;
|
// set c0;
|
||||||
// option all; // all points of cell
|
// option all; // all points of cell
|
||||||
@ -226,6 +251,7 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // Select based on faceSet
|
// // Select based on faceSet
|
||||||
// source faceToPoint;
|
// source faceToPoint;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// set f0; // name of faceSet
|
// set f0; // name of faceSet
|
||||||
// option all; // all points of face
|
// option all; // all points of face
|
||||||
@ -233,30 +259,35 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // Select by explicitly providing point labels
|
// // Select by explicitly providing point labels
|
||||||
// source labelToPoint;
|
// source labelToPoint;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// value (12 13 56); // labels of points
|
// value (12 13 56); // labels of points
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // All points in pointzone
|
// // All points in pointzone
|
||||||
// source zoneToPoint;
|
// source zoneToPoint;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// name ".*Zone"; // name of pointZone, regular expressions allowed
|
// name ".*Zone"; // name of pointZone, regular expressions allowed
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Points nearest to coordinates
|
// // Points nearest to coordinates
|
||||||
// source nearestToPoint;
|
// source nearestToPoint;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// points ((0 0 0) (1 1 1));
|
// points ((0 0 0) (1 1 1));
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Points with coordinate within box
|
// // Points with coordinate within box
|
||||||
// source boxToPoint;
|
// source boxToPoint;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// box (0 0 0) (1 1 1);
|
// box (0 0 0) (1 1 1);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Select based on surface
|
// // Select based on surface
|
||||||
// source surfaceToPoint;
|
// source surfaceToPoint;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// file "www.avl.com-geometry.stl";
|
// file "www.avl.com-geometry.stl";
|
||||||
// nearDistance 0.1; // points near to surface
|
// nearDistance 0.1; // points near to surface
|
||||||
@ -275,6 +306,7 @@ FoamFile
|
|||||||
//
|
//
|
||||||
// // Select based on cellSet
|
// // Select based on cellSet
|
||||||
// source setToCellZone;
|
// source setToCellZone;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// set c0; // name of cellSet
|
// set c0; // name of cellSet
|
||||||
// }
|
// }
|
||||||
@ -285,12 +317,14 @@ FoamFile
|
|||||||
// ~~~~~~~~~~~
|
// ~~~~~~~~~~~
|
||||||
// // Select based on faceSet without orientation
|
// // Select based on faceSet without orientation
|
||||||
// source setToFaceZone;
|
// source setToFaceZone;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// set f0; // name of faceSet
|
// set f0; // name of faceSet
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Select based on faceSet, using cellSet to determine orientation
|
// // Select based on faceSet, using cellSet to determine orientation
|
||||||
// source setsToFaceZone;
|
// source setsToFaceZone;
|
||||||
|
// sourceInfo
|
||||||
// {
|
// {
|
||||||
// faceSet f0; // name of faceSet
|
// faceSet f0; // name of faceSet
|
||||||
// cellSet c0; // name of cellSet of slave side
|
// cellSet c0; // name of cellSet of slave side
|
||||||
|
|||||||
@ -3,7 +3,6 @@ domainDecomposition.C
|
|||||||
domainDecompositionMesh.C
|
domainDecompositionMesh.C
|
||||||
domainDecompositionDistribute.C
|
domainDecompositionDistribute.C
|
||||||
dimFieldDecomposer.C
|
dimFieldDecomposer.C
|
||||||
fvFieldDecomposer.C
|
|
||||||
pointFieldDecomposer.C
|
pointFieldDecomposer.C
|
||||||
lagrangianFieldDecomposer.C
|
lagrangianFieldDecomposer.C
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/parallel/decompose/decompose/lnInclude \
|
||||||
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
|
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
@ -6,6 +7,7 @@ EXE_INC = \
|
|||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
-ldecompose \
|
||||||
-lgenericPatchFields \
|
-lgenericPatchFields \
|
||||||
-ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp \
|
-ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp \
|
||||||
-llagrangian \
|
-llagrangian \
|
||||||
|
|||||||
@ -43,6 +43,7 @@ Description
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Foam::timeSelector::addOptions();
|
Foam::timeSelector::addOptions();
|
||||||
|
# include "addRegionOption.H"
|
||||||
Foam::argList::addBoolOption
|
Foam::argList::addBoolOption
|
||||||
(
|
(
|
||||||
"noWrite",
|
"noWrite",
|
||||||
@ -74,7 +75,7 @@ int main(int argc, char *argv[])
|
|||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args);
|
Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args);
|
||||||
# include "createMesh.H"
|
# include "createNamedMesh.H"
|
||||||
|
|
||||||
utility().tryPreCalc(args, runTime, mesh);
|
utility().tryPreCalc(args, runTime, mesh);
|
||||||
|
|
||||||
|
|||||||
@ -37,6 +37,11 @@ Description
|
|||||||
|
|
||||||
#include "calc.H"
|
#include "calc.H"
|
||||||
|
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "surfaceFields.H"
|
||||||
|
#include "pointFields.H"
|
||||||
|
#include "ReadFields.H"
|
||||||
|
|
||||||
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
|
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
|
||||||
|
|
||||||
#include "incompressible/RAS/RASModel/RASModel.H"
|
#include "incompressible/RAS/RASModel/RASModel.H"
|
||||||
@ -84,203 +89,268 @@ namespace Foam
|
|||||||
|
|
||||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||||
{
|
{
|
||||||
Info<< " Reading phi" << endl;
|
if (args.optionFound("noFlow"))
|
||||||
surfaceScalarField phi
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"phi",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< " Reading U" << endl;
|
|
||||||
volVectorField U
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"U",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< " Reading p" << endl;
|
|
||||||
volScalarField p
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"p",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ
|
|
||||||
),
|
|
||||||
mesh
|
|
||||||
);
|
|
||||||
|
|
||||||
if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
|
|
||||||
{
|
{
|
||||||
IOobject RASPropertiesHeader
|
Info<< " Operating in no-flow mode; no models will be loaded."
|
||||||
(
|
<< " All vol, surface and point fields will be loaded." << endl;
|
||||||
"RASProperties",
|
|
||||||
runTime.constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
IOobject LESPropertiesHeader
|
// Read objects in time directory
|
||||||
(
|
IOobjectList objects(mesh, runTime.timeName());
|
||||||
"LESProperties",
|
|
||||||
runTime.constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
if (RASPropertiesHeader.headerOk())
|
// Read vol fields.
|
||||||
{
|
|
||||||
IOdictionary RASProperties(RASPropertiesHeader);
|
|
||||||
|
|
||||||
singlePhaseTransportModel laminarTransport(U, phi);
|
PtrList<volScalarField> vsFlds;
|
||||||
|
ReadFields(mesh, objects, vsFlds);
|
||||||
|
|
||||||
autoPtr<incompressible::RASModel> RASModel
|
PtrList<volVectorField> vvFlds;
|
||||||
(
|
ReadFields(mesh, objects, vvFlds);
|
||||||
incompressible::RASModel::New
|
|
||||||
(
|
|
||||||
U,
|
|
||||||
phi,
|
|
||||||
laminarTransport
|
|
||||||
)
|
|
||||||
);
|
|
||||||
execFlowFunctionObjects(args, runTime);
|
|
||||||
}
|
|
||||||
else if (LESPropertiesHeader.headerOk())
|
|
||||||
{
|
|
||||||
IOdictionary LESProperties(LESPropertiesHeader);
|
|
||||||
|
|
||||||
singlePhaseTransportModel laminarTransport(U, phi);
|
PtrList<volSphericalTensorField> vstFlds;
|
||||||
|
ReadFields(mesh, objects, vstFlds);
|
||||||
|
|
||||||
autoPtr<incompressible::LESModel> sgsModel
|
PtrList<volSymmTensorField> vsymtFlds;
|
||||||
(
|
ReadFields(mesh, objects, vsymtFlds);
|
||||||
incompressible::LESModel::New(U, phi, laminarTransport)
|
|
||||||
);
|
|
||||||
|
|
||||||
execFlowFunctionObjects(args, runTime);
|
PtrList<volTensorField> vtFlds;
|
||||||
}
|
ReadFields(mesh, objects, vtFlds);
|
||||||
else
|
|
||||||
{
|
|
||||||
IOdictionary transportProperties
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"transportProperties",
|
|
||||||
runTime.constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar nu(transportProperties.lookup("nu"));
|
// Read surface fields.
|
||||||
|
|
||||||
execFlowFunctionObjects(args, runTime);
|
PtrList<surfaceScalarField> ssFlds;
|
||||||
}
|
ReadFields(mesh, objects, ssFlds);
|
||||||
}
|
|
||||||
else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
|
|
||||||
{
|
|
||||||
autoPtr<basicPsiThermo> thermo(basicPsiThermo::New(mesh));
|
|
||||||
|
|
||||||
volScalarField rho
|
PtrList<surfaceVectorField> svFlds;
|
||||||
(
|
ReadFields(mesh, objects, svFlds);
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"rho",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh
|
|
||||||
),
|
|
||||||
thermo->rho()
|
|
||||||
);
|
|
||||||
|
|
||||||
IOobject RASPropertiesHeader
|
PtrList<surfaceSphericalTensorField> sstFlds;
|
||||||
(
|
ReadFields(mesh, objects, sstFlds);
|
||||||
"RASProperties",
|
|
||||||
runTime.constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
IOobject LESPropertiesHeader
|
PtrList<surfaceSymmTensorField> ssymtFlds;
|
||||||
(
|
ReadFields(mesh, objects, ssymtFlds);
|
||||||
"LESProperties",
|
|
||||||
runTime.constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
if (RASPropertiesHeader.headerOk())
|
PtrList<surfaceTensorField> stFlds;
|
||||||
{
|
ReadFields(mesh, objects, stFlds);
|
||||||
IOdictionary RASProperties(RASPropertiesHeader);
|
|
||||||
|
|
||||||
autoPtr<compressible::RASModel> RASModel
|
// Read point fields.
|
||||||
(
|
const pointMesh& pMesh = pointMesh::New(mesh);
|
||||||
compressible::RASModel::New
|
|
||||||
(
|
|
||||||
rho,
|
|
||||||
U,
|
|
||||||
phi,
|
|
||||||
thermo()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
execFlowFunctionObjects(args, runTime);
|
PtrList<pointScalarField> psFlds;
|
||||||
}
|
ReadFields(pMesh, objects, psFlds);
|
||||||
else if (LESPropertiesHeader.headerOk())
|
|
||||||
{
|
|
||||||
IOdictionary LESProperties(LESPropertiesHeader);
|
|
||||||
|
|
||||||
autoPtr<compressible::LESModel> sgsModel
|
PtrList<pointVectorField> pvFlds;
|
||||||
(
|
ReadFields(pMesh, objects, pvFlds);
|
||||||
compressible::LESModel::New(rho, U, phi, thermo())
|
|
||||||
);
|
|
||||||
|
|
||||||
execFlowFunctionObjects(args, runTime);
|
PtrList<pointSphericalTensorField> pstFlds;
|
||||||
}
|
ReadFields(pMesh, objects, pstFlds);
|
||||||
else
|
|
||||||
{
|
|
||||||
IOdictionary transportProperties
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"transportProperties",
|
|
||||||
runTime.constant(),
|
|
||||||
mesh,
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar mu(transportProperties.lookup("mu"));
|
PtrList<pointSymmTensorField> psymtFlds;
|
||||||
|
ReadFields(pMesh, objects, psymtFlds);
|
||||||
|
|
||||||
execFlowFunctionObjects(args, runTime);
|
PtrList<pointTensorField> ptFlds;
|
||||||
}
|
ReadFields(pMesh, objects, ptFlds);
|
||||||
|
|
||||||
|
execFlowFunctionObjects(args, runTime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
Info<< " Reading phi" << endl;
|
||||||
<< "Incorrect dimensions of phi: " << phi.dimensions()
|
surfaceScalarField phi
|
||||||
<< nl << exit(FatalError);
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"phi",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< " Reading U" << endl;
|
||||||
|
volVectorField U
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"U",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< " Reading p" << endl;
|
||||||
|
volScalarField p
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"p",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
|
||||||
|
{
|
||||||
|
IOobject RASPropertiesHeader
|
||||||
|
(
|
||||||
|
"RASProperties",
|
||||||
|
runTime.constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
IOobject LESPropertiesHeader
|
||||||
|
(
|
||||||
|
"LESProperties",
|
||||||
|
runTime.constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
if (RASPropertiesHeader.headerOk())
|
||||||
|
{
|
||||||
|
IOdictionary RASProperties(RASPropertiesHeader);
|
||||||
|
|
||||||
|
singlePhaseTransportModel laminarTransport(U, phi);
|
||||||
|
|
||||||
|
autoPtr<incompressible::RASModel> RASModel
|
||||||
|
(
|
||||||
|
incompressible::RASModel::New
|
||||||
|
(
|
||||||
|
U,
|
||||||
|
phi,
|
||||||
|
laminarTransport
|
||||||
|
)
|
||||||
|
);
|
||||||
|
execFlowFunctionObjects(args, runTime);
|
||||||
|
}
|
||||||
|
else if (LESPropertiesHeader.headerOk())
|
||||||
|
{
|
||||||
|
IOdictionary LESProperties(LESPropertiesHeader);
|
||||||
|
|
||||||
|
singlePhaseTransportModel laminarTransport(U, phi);
|
||||||
|
|
||||||
|
autoPtr<incompressible::LESModel> sgsModel
|
||||||
|
(
|
||||||
|
incompressible::LESModel::New(U, phi, laminarTransport)
|
||||||
|
);
|
||||||
|
|
||||||
|
execFlowFunctionObjects(args, runTime);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IOdictionary transportProperties
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"transportProperties",
|
||||||
|
runTime.constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
dimensionedScalar nu(transportProperties.lookup("nu"));
|
||||||
|
|
||||||
|
execFlowFunctionObjects(args, runTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
|
||||||
|
{
|
||||||
|
autoPtr<basicPsiThermo> thermo(basicPsiThermo::New(mesh));
|
||||||
|
|
||||||
|
volScalarField rho
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rho",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh
|
||||||
|
),
|
||||||
|
thermo->rho()
|
||||||
|
);
|
||||||
|
|
||||||
|
IOobject RASPropertiesHeader
|
||||||
|
(
|
||||||
|
"RASProperties",
|
||||||
|
runTime.constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
IOobject LESPropertiesHeader
|
||||||
|
(
|
||||||
|
"LESProperties",
|
||||||
|
runTime.constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
if (RASPropertiesHeader.headerOk())
|
||||||
|
{
|
||||||
|
IOdictionary RASProperties(RASPropertiesHeader);
|
||||||
|
|
||||||
|
autoPtr<compressible::RASModel> RASModel
|
||||||
|
(
|
||||||
|
compressible::RASModel::New
|
||||||
|
(
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
phi,
|
||||||
|
thermo()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
execFlowFunctionObjects(args, runTime);
|
||||||
|
}
|
||||||
|
else if (LESPropertiesHeader.headerOk())
|
||||||
|
{
|
||||||
|
IOdictionary LESProperties(LESPropertiesHeader);
|
||||||
|
|
||||||
|
autoPtr<compressible::LESModel> sgsModel
|
||||||
|
(
|
||||||
|
compressible::LESModel::New(rho, U, phi, thermo())
|
||||||
|
);
|
||||||
|
|
||||||
|
execFlowFunctionObjects(args, runTime);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IOdictionary transportProperties
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"transportProperties",
|
||||||
|
runTime.constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
dimensionedScalar mu(transportProperties.lookup("mu"));
|
||||||
|
|
||||||
|
execFlowFunctionObjects(args, runTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn(args.executable())
|
||||||
|
<< "Incorrect dimensions of phi: " << phi.dimensions()
|
||||||
|
<< nl << exit(FatalError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -188,8 +188,25 @@ surfaces
|
|||||||
// cell, can be arbitrarily far away.
|
// cell, can be arbitrarily far away.
|
||||||
type patchInternalField;
|
type patchInternalField;
|
||||||
patches ( ".*Wall.*" );
|
patches ( ".*Wall.*" );
|
||||||
distance 0.0001;
|
|
||||||
interpolate true;
|
interpolate true;
|
||||||
|
|
||||||
|
|
||||||
|
// Optional: specify how to obtain sampling points from the patch
|
||||||
|
// face centres (default is 'normal')
|
||||||
|
//
|
||||||
|
// //- Specify distance to offset in normal direction
|
||||||
|
offsetMode normal;
|
||||||
|
distance 0.1;
|
||||||
|
//
|
||||||
|
// //- Specify single uniform offset
|
||||||
|
// offsetMode uniform;
|
||||||
|
// offset (0 0 0.0001);
|
||||||
|
//
|
||||||
|
// //- Specify offset per patch face
|
||||||
|
// offsetMode nonuniform;
|
||||||
|
// offsets ((0 0 0.0001) (0 0 0.0002));
|
||||||
|
|
||||||
|
|
||||||
// Optional: whether to leave as faces (=default) or triangulate
|
// Optional: whether to leave as faces (=default) or triangulate
|
||||||
// triangulate false;
|
// triangulate false;
|
||||||
}
|
}
|
||||||
@ -255,6 +272,7 @@ surfaces
|
|||||||
distance 0.0;
|
distance 0.0;
|
||||||
|
|
||||||
interpolate false;
|
interpolate false;
|
||||||
|
regularise false; // Optional: do not simplify
|
||||||
// mergeTol 1e-10; // Optional: fraction of mesh bounding box
|
// mergeTol 1e-10; // Optional: fraction of mesh bounding box
|
||||||
// to merge points (default=1e-6)
|
// to merge points (default=1e-6)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,13 +42,14 @@ Description
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
timeSelector::addOptions();
|
timeSelector::addOptions();
|
||||||
|
# include "addRegionOption.H"
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
|
|
||||||
# include "createMeshNoClear.H"
|
# include "createNamedMesh.H"
|
||||||
|
|
||||||
pointMesh pMesh(mesh);
|
pointMesh pMesh(mesh);
|
||||||
|
|
||||||
|
|||||||
@ -486,6 +486,14 @@ case QSMPI:
|
|||||||
_foamAddLib $MPI_ARCH_PATH/lib
|
_foamAddLib $MPI_ARCH_PATH/lib
|
||||||
breaksw
|
breaksw
|
||||||
|
|
||||||
|
case SGIMPI:
|
||||||
|
setenv FOAM_MPI ${MPI_ROOT##*/}
|
||||||
|
setenv MPI_ARCH_PATH $MPI_ROOT
|
||||||
|
|
||||||
|
_foamAddPath $MPI_ARCH_PATH/bin
|
||||||
|
_foamAddLib $MPI_ARCH_PATH/lib
|
||||||
|
breaksw
|
||||||
|
|
||||||
default:
|
default:
|
||||||
setenv FOAM_MPI dummy
|
setenv FOAM_MPI dummy
|
||||||
breaksw
|
breaksw
|
||||||
|
|||||||
@ -510,6 +510,14 @@ QSMPI)
|
|||||||
_foamAddLib $MPI_ARCH_PATH/lib
|
_foamAddLib $MPI_ARCH_PATH/lib
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
SGIMPI)
|
||||||
|
export FOAM_MPI=${MPI_ROOT##*/}
|
||||||
|
export MPI_ARCH_PATH=$MPI_ROOT
|
||||||
|
|
||||||
|
_foamAddPath $MPI_ARCH_PATH/bin
|
||||||
|
_foamAddLib $MPI_ARCH_PATH/lib
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
export FOAM_MPI=dummy
|
export FOAM_MPI=dummy
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -37,6 +37,18 @@ void Foam::OutputFilterFunctionObject<OutputFilter>::readDict()
|
|||||||
dict_.readIfPresent("dictionary", dictName_);
|
dict_.readIfPresent("dictionary", dictName_);
|
||||||
dict_.readIfPresent("enabled", enabled_);
|
dict_.readIfPresent("enabled", enabled_);
|
||||||
dict_.readIfPresent("storeFilter", storeFilter_);
|
dict_.readIfPresent("storeFilter", storeFilter_);
|
||||||
|
dict_.readIfPresent("timeStart", timeStart_);
|
||||||
|
dict_.readIfPresent("timeEnd", timeEnd_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class OutputFilter>
|
||||||
|
bool Foam::OutputFilterFunctionObject<OutputFilter>::active() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
enabled_
|
||||||
|
&& time_.value() >= timeStart_
|
||||||
|
&& time_.value() <= timeEnd_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -94,6 +106,8 @@ Foam::OutputFilterFunctionObject<OutputFilter>::OutputFilterFunctionObject
|
|||||||
dictName_(),
|
dictName_(),
|
||||||
enabled_(true),
|
enabled_(true),
|
||||||
storeFilter_(true),
|
storeFilter_(true),
|
||||||
|
timeStart_(-VGREAT),
|
||||||
|
timeEnd_(VGREAT),
|
||||||
outputControl_(t, dict)
|
outputControl_(t, dict)
|
||||||
{
|
{
|
||||||
readDict();
|
readDict();
|
||||||
@ -121,7 +135,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::start()
|
|||||||
{
|
{
|
||||||
readDict();
|
readDict();
|
||||||
|
|
||||||
if (enabled_&&storeFilter_)
|
if (enabled_ && storeFilter_)
|
||||||
{
|
{
|
||||||
allocateFilter();
|
allocateFilter();
|
||||||
}
|
}
|
||||||
@ -136,7 +150,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::execute
|
|||||||
const bool forceWrite
|
const bool forceWrite
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (enabled_)
|
if (active())
|
||||||
{
|
{
|
||||||
if (!storeFilter_)
|
if (!storeFilter_)
|
||||||
{
|
{
|
||||||
@ -163,7 +177,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::execute
|
|||||||
template<class OutputFilter>
|
template<class OutputFilter>
|
||||||
bool Foam::OutputFilterFunctionObject<OutputFilter>::end()
|
bool Foam::OutputFilterFunctionObject<OutputFilter>::end()
|
||||||
{
|
{
|
||||||
if (enabled_)
|
if (active())
|
||||||
{
|
{
|
||||||
if (!storeFilter_)
|
if (!storeFilter_)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -68,18 +68,28 @@ class OutputFilterFunctionObject
|
|||||||
//- Input dictionary
|
//- Input dictionary
|
||||||
dictionary dict_;
|
dictionary dict_;
|
||||||
|
|
||||||
//- Name of region
|
|
||||||
word regionName_;
|
|
||||||
|
|
||||||
//- Optional dictionary name to supply required inputs
|
// Optional user inputs
|
||||||
word dictName_;
|
|
||||||
|
|
||||||
//- Switch for the execution of the functionObject
|
//- Name of region - defaults to name of polyMesh::defaultRegion
|
||||||
bool enabled_;
|
word regionName_;
|
||||||
|
|
||||||
|
//- Dictionary name to supply required inputs
|
||||||
|
word dictName_;
|
||||||
|
|
||||||
|
//- Switch for the execution - defaults to 'yes/on'
|
||||||
|
bool enabled_;
|
||||||
|
|
||||||
|
//- Switch to store filter in between writes or use on-the-fly
|
||||||
|
// construction - defaults to true
|
||||||
|
bool storeFilter_;
|
||||||
|
|
||||||
|
//- Activation time - defaults to -VGREAT
|
||||||
|
scalar timeStart_;
|
||||||
|
|
||||||
|
//- De-activation time - defaults to VGREAT
|
||||||
|
scalar timeEnd_;
|
||||||
|
|
||||||
//- Switch to store filter in between writes or use on-the-fly
|
|
||||||
// construction
|
|
||||||
bool storeFilter_;
|
|
||||||
|
|
||||||
//- Output controls
|
//- Output controls
|
||||||
outputFilterOutputControl outputControl_;
|
outputFilterOutputControl outputControl_;
|
||||||
@ -99,6 +109,9 @@ class OutputFilterFunctionObject
|
|||||||
//- Destroys most of the data associated with this object.
|
//- Destroys most of the data associated with this object.
|
||||||
void destroyFilter();
|
void destroyFilter();
|
||||||
|
|
||||||
|
//- Returns true if active (enabled and within time bounds)
|
||||||
|
bool active() const;
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
OutputFilterFunctionObject(const OutputFilterFunctionObject&);
|
OutputFilterFunctionObject(const OutputFilterFunctionObject&);
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@ Foam::Field<Type> Foam::interpolateSplineXY
|
|||||||
|
|
||||||
forAll(xNew, i)
|
forAll(xNew, i)
|
||||||
{
|
{
|
||||||
yNew[i] = interpolateSmoothXY(xNew[i], xOld, yOld);
|
yNew[i] = interpolateSplineXY(xNew[i], xOld, yOld);
|
||||||
}
|
}
|
||||||
|
|
||||||
return yNew;
|
return yNew;
|
||||||
|
|||||||
@ -514,7 +514,8 @@ Foam::label Foam::polyBoundaryMesh::whichPatch(const label faceIndex) const
|
|||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
"polyBoundaryMesh::whichPatch(const label faceIndex) const"
|
"polyBoundaryMesh::whichPatch(const label faceIndex) const"
|
||||||
) << "given label greater than the number of geometric faces"
|
) << "given label " << faceIndex
|
||||||
|
<< " greater than the number of geometric faces " << mesh().nFaces()
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "STARCDMeshReader.H"
|
#include "STARCDMeshReader.H"
|
||||||
#include "cyclicPolyPatch.H"
|
#include "oldCyclicPolyPatch.H"
|
||||||
#include "emptyPolyPatch.H"
|
#include "emptyPolyPatch.H"
|
||||||
#include "wallPolyPatch.H"
|
#include "wallPolyPatch.H"
|
||||||
#include "symmetryPolyPatch.H"
|
#include "symmetryPolyPatch.H"
|
||||||
@ -950,7 +950,7 @@ void Foam::meshReaders::STARCD::readBoundary(const fileName& inputName)
|
|||||||
{
|
{
|
||||||
// incorrect. should be cyclicPatch but this
|
// incorrect. should be cyclicPatch but this
|
||||||
// requires info on connected faces.
|
// requires info on connected faces.
|
||||||
patchTypes_[patchI] = cyclicPolyPatch::typeName;
|
patchTypes_[patchI] = oldCyclicPolyPatch::typeName;
|
||||||
patchPhysicalTypes_[patchI] = patchTypes_[patchI];
|
patchPhysicalTypes_[patchI] = patchTypes_[patchI];
|
||||||
}
|
}
|
||||||
else if (origType == "baffle")
|
else if (origType == "baffle")
|
||||||
|
|||||||
@ -186,7 +186,16 @@ void Foam::dynamicRefineFvMesh::readDict()
|
|||||||
).subDict(typeName + "Coeffs")
|
).subDict(typeName + "Coeffs")
|
||||||
);
|
);
|
||||||
|
|
||||||
correctFluxes_ = List<Pair<word> >(refineDict.lookup("correctFluxes"));
|
List<Pair<word> > fluxVelocities = List<Pair<word> >
|
||||||
|
(
|
||||||
|
refineDict.lookup("correctFluxes")
|
||||||
|
);
|
||||||
|
// Rework into hashtable.
|
||||||
|
correctFluxes_.resize(fluxVelocities.size());
|
||||||
|
forAll(fluxVelocities, i)
|
||||||
|
{
|
||||||
|
correctFluxes_.insert(fluxVelocities[i][0], fluxVelocities[i][1]);
|
||||||
|
}
|
||||||
|
|
||||||
dumpLevel_ = Switch(refineDict.lookup("dumpLevel"));
|
dumpLevel_ = Switch(refineDict.lookup("dumpLevel"));
|
||||||
}
|
}
|
||||||
@ -289,23 +298,46 @@ Foam::dynamicRefineFvMesh::refine
|
|||||||
<< " split faces " << endl;
|
<< " split faces " << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(correctFluxes_, i)
|
HashTable<const surfaceScalarField*> fluxes
|
||||||
|
(
|
||||||
|
lookupClass<surfaceScalarField>()
|
||||||
|
);
|
||||||
|
forAllConstIter(HashTable<const surfaceScalarField*>, fluxes, iter)
|
||||||
{
|
{
|
||||||
|
if (!correctFluxes_.found(iter.key()))
|
||||||
|
{
|
||||||
|
WarningIn("dynamicRefineFvMesh::refine(const labelList&)")
|
||||||
|
<< "Cannot find surfaceScalarField " << iter.key()
|
||||||
|
<< " in user-provided flux mapping table "
|
||||||
|
<< correctFluxes_ << endl
|
||||||
|
<< " The flux mapping table is used to recreate the"
|
||||||
|
<< " flux on newly created faces." << endl
|
||||||
|
<< " Either add the entry if it is a flux or use ("
|
||||||
|
<< iter.key() << " none) to suppress this warning."
|
||||||
|
<< endl;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const word& UName = correctFluxes_[iter.key()];
|
||||||
|
|
||||||
|
if (UName == "none")
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Mapping flux " << correctFluxes_[i][0]
|
Info<< "Mapping flux " << iter.key()
|
||||||
<< " using interpolated flux " << correctFluxes_[i][1]
|
<< " using interpolated flux " << UName
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
surfaceScalarField& phi = const_cast<surfaceScalarField&>
|
|
||||||
(
|
surfaceScalarField& phi = const_cast<surfaceScalarField&>(*iter());
|
||||||
lookupObject<surfaceScalarField>(correctFluxes_[i][0])
|
|
||||||
);
|
|
||||||
const surfaceScalarField phiU
|
const surfaceScalarField phiU
|
||||||
(
|
(
|
||||||
fvc::interpolate
|
fvc::interpolate
|
||||||
(
|
(
|
||||||
lookupObject<volVectorField>(correctFluxes_[i][1])
|
lookupObject<volVectorField>(UName)
|
||||||
)
|
)
|
||||||
& Sf()
|
& Sf()
|
||||||
);
|
);
|
||||||
@ -482,27 +514,51 @@ Foam::dynamicRefineFvMesh::unrefine
|
|||||||
const labelList& reversePointMap = map().reversePointMap();
|
const labelList& reversePointMap = map().reversePointMap();
|
||||||
const labelList& reverseFaceMap = map().reverseFaceMap();
|
const labelList& reverseFaceMap = map().reverseFaceMap();
|
||||||
|
|
||||||
forAll(correctFluxes_, i)
|
HashTable<const surfaceScalarField*> fluxes
|
||||||
|
(
|
||||||
|
lookupClass<surfaceScalarField>()
|
||||||
|
);
|
||||||
|
forAllConstIter(HashTable<const surfaceScalarField*>, fluxes, iter)
|
||||||
{
|
{
|
||||||
|
if (!correctFluxes_.found(iter.key()))
|
||||||
|
{
|
||||||
|
WarningIn("dynamicRefineFvMesh::refine(const labelList&)")
|
||||||
|
<< "Cannot find surfaceScalarField " << iter.key()
|
||||||
|
<< " in user-provided flux mapping table "
|
||||||
|
<< correctFluxes_ << endl
|
||||||
|
<< " The flux mapping table is used to recreate the"
|
||||||
|
<< " flux on newly created faces." << endl
|
||||||
|
<< " Either add the entry if it is a flux or use ("
|
||||||
|
<< iter.key() << " none) to suppress this warning."
|
||||||
|
<< endl;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const word& UName = correctFluxes_[iter.key()];
|
||||||
|
|
||||||
|
if (UName == "none")
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Mapping flux " << correctFluxes_[i][0]
|
Info<< "Mapping flux " << iter.key()
|
||||||
<< " using interpolated flux " << correctFluxes_[i][1]
|
<< " using interpolated flux " << UName
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
surfaceScalarField& phi = const_cast<surfaceScalarField&>
|
|
||||||
(
|
surfaceScalarField& phi = const_cast<surfaceScalarField&>(*iter());
|
||||||
lookupObject<surfaceScalarField>(correctFluxes_[i][0])
|
const surfaceScalarField phiU
|
||||||
);
|
|
||||||
surfaceScalarField phiU
|
|
||||||
(
|
(
|
||||||
fvc::interpolate
|
fvc::interpolate
|
||||||
(
|
(
|
||||||
lookupObject<volVectorField>(correctFluxes_[i][1])
|
lookupObject<volVectorField>(UName)
|
||||||
)
|
)
|
||||||
& Sf()
|
& Sf()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
forAllConstIter(Map<label>, faceToSplitPoint, iter)
|
forAllConstIter(Map<label>, faceToSplitPoint, iter)
|
||||||
{
|
{
|
||||||
label oldFaceI = iter.key();
|
label oldFaceI = iter.key();
|
||||||
|
|||||||
@ -64,7 +64,7 @@ protected:
|
|||||||
Switch dumpLevel_;
|
Switch dumpLevel_;
|
||||||
|
|
||||||
//- Fluxes to map
|
//- Fluxes to map
|
||||||
List<Pair<word> > correctFluxes_;
|
HashTable<word> correctFluxes_;
|
||||||
|
|
||||||
//- Number of refinement/unrefinement steps done so far.
|
//- Number of refinement/unrefinement steps done so far.
|
||||||
label nRefinementIterations_;
|
label nRefinementIterations_;
|
||||||
|
|||||||
@ -127,7 +127,6 @@ $(derivedFvPatchFields)/fan/fanFvPatchFields.C
|
|||||||
$(derivedFvPatchFields)/fanPressure/fanPressureFvPatchScalarField.C
|
$(derivedFvPatchFields)/fanPressure/fanPressureFvPatchScalarField.C
|
||||||
$(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C
|
$(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C
|
||||||
$(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C
|
$(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C
|
||||||
$(derivedFvPatchFields)/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C
|
|
||||||
$(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C
|
$(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C
|
$(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C
|
$(derivedFvPatchFields)/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C
|
||||||
|
|||||||
@ -107,7 +107,7 @@ bool Foam::adjustPhi
|
|||||||
{
|
{
|
||||||
massCorr = (massIn - fixedMassOut)/adjustableMassOut;
|
massCorr = (massIn - fixedMassOut)/adjustableMassOut;
|
||||||
}
|
}
|
||||||
else if (mag(fixedMassOut - massIn)/totalFlux > 1e-10)
|
else if (mag(fixedMassOut - massIn)/totalFlux > 1e-8)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
|
|||||||
@ -59,7 +59,7 @@ addRadialActuationDiskAxialInertialResistance
|
|||||||
const Field<scalar> zoneCellVolumes(mesh().cellVolumes(), cells);
|
const Field<scalar> zoneCellVolumes(mesh().cellVolumes(), cells);
|
||||||
|
|
||||||
const vector avgCentre = gSum(zoneCellVolumes*zoneCellCentres)/V();
|
const vector avgCentre = gSum(zoneCellVolumes*zoneCellCentres)/V();
|
||||||
const scalar maxR = mag(max(zoneCellCentres - avgCentre));
|
const scalar maxR = gMax(mag(zoneCellCentres - avgCentre));
|
||||||
|
|
||||||
scalar intCoeffs =
|
scalar intCoeffs =
|
||||||
coeffs_[0]
|
coeffs_[0]
|
||||||
|
|||||||
@ -59,36 +59,37 @@ bool Foam::pimpleControl::criteriaSatisfied()
|
|||||||
bool firstIter = corr_ == 1;
|
bool firstIter = corr_ == 1;
|
||||||
|
|
||||||
bool achieved = true;
|
bool achieved = true;
|
||||||
const dictionary& solverDict = mesh_.solverPerformanceDict();
|
bool checked = false; // safety that some checks were indeed performed
|
||||||
|
|
||||||
|
const dictionary& solverDict = mesh_.solverPerformanceDict();
|
||||||
forAllConstIter(dictionary, solverDict, iter)
|
forAllConstIter(dictionary, solverDict, iter)
|
||||||
{
|
{
|
||||||
const word& variableName = iter().keyword();
|
const word& variableName = iter().keyword();
|
||||||
label fieldI = applyToField(variableName);
|
const label fieldI = applyToField(variableName);
|
||||||
if (fieldI != -1)
|
if (fieldI != -1)
|
||||||
{
|
{
|
||||||
const List<lduMatrix::solverPerformance> sp(iter().stream());
|
const List<lduMatrix::solverPerformance> sp(iter().stream());
|
||||||
const scalar residual = sp.last().initialResidual();
|
const scalar residual = sp.last().initialResidual();
|
||||||
|
|
||||||
|
checked = true;
|
||||||
|
|
||||||
if (firstIter)
|
if (firstIter)
|
||||||
{
|
{
|
||||||
residualControl_[fieldI].initialResidual =
|
residualControl_[fieldI].initialResidual =
|
||||||
sp.first().initialResidual();
|
sp.first().initialResidual();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool absCheck = residual < residualControl_[fieldI].absTol;
|
const bool absCheck = residual < residualControl_[fieldI].absTol;
|
||||||
|
|
||||||
bool relCheck = false;
|
bool relCheck = false;
|
||||||
|
|
||||||
scalar relative = 0.0;
|
scalar relative = 0.0;
|
||||||
if (!firstIter)
|
if (!firstIter)
|
||||||
{
|
{
|
||||||
scalar iniRes =
|
const scalar iniRes =
|
||||||
residualControl_[fieldI].initialResidual
|
residualControl_[fieldI].initialResidual
|
||||||
+ ROOTVSMALL;
|
+ ROOTVSMALL;
|
||||||
|
|
||||||
relative = residual/iniRes;
|
relative = residual/iniRes;
|
||||||
|
|
||||||
relCheck = relative < residualControl_[fieldI].relTol;
|
relCheck = relative < residualControl_[fieldI].relTol;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,7 +111,7 @@ bool Foam::pimpleControl::criteriaSatisfied()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return achieved;
|
return checked && achieved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -129,7 +130,13 @@ Foam::pimpleControl::pimpleControl(fvMesh& mesh)
|
|||||||
if (nOuterCorr_ > 1)
|
if (nOuterCorr_ > 1)
|
||||||
{
|
{
|
||||||
Info<< nl;
|
Info<< nl;
|
||||||
if (!residualControl_.empty())
|
if (residualControl_.empty())
|
||||||
|
{
|
||||||
|
Info<< algorithmName_ << ": no residual control data found. "
|
||||||
|
<< "Calculations will employ " << nOuterCorr_
|
||||||
|
<< " corrector loops" << nl << endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Info<< algorithmName_ << ": max iterations = " << nOuterCorr_
|
Info<< algorithmName_ << ": max iterations = " << nOuterCorr_
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -142,12 +149,6 @@ Foam::pimpleControl::pimpleControl(fvMesh& mesh)
|
|||||||
}
|
}
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< algorithmName_ << ": no residual control data found. " << nl
|
|
||||||
<< "Calculations will employ " << nOuterCorr_
|
|
||||||
<< " corrector loops" << nl << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -69,10 +69,10 @@ protected:
|
|||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Read constrols from fvSolution dictionary
|
//- Read controls from fvSolution dictionary
|
||||||
virtual void read();
|
virtual void read();
|
||||||
|
|
||||||
//- Return true if all convergence checks are satified
|
//- Return true if all convergence checks are satisfied
|
||||||
virtual bool criteriaSatisfied();
|
virtual bool criteriaSatisfied();
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
|
|||||||
@ -50,17 +50,20 @@ bool Foam::simpleControl::criteriaSatisfied()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool achieved = true;
|
bool achieved = true;
|
||||||
const dictionary& solverDict = mesh_.solverPerformanceDict();
|
bool checked = false; // safety that some checks were indeed performed
|
||||||
|
|
||||||
|
const dictionary& solverDict = mesh_.solverPerformanceDict();
|
||||||
forAllConstIter(dictionary, solverDict, iter)
|
forAllConstIter(dictionary, solverDict, iter)
|
||||||
{
|
{
|
||||||
const word& variableName = iter().keyword();
|
const word& variableName = iter().keyword();
|
||||||
label fieldI = applyToField(variableName);
|
const label fieldI = applyToField(variableName);
|
||||||
if (fieldI != -1)
|
if (fieldI != -1)
|
||||||
{
|
{
|
||||||
const List<lduMatrix::solverPerformance> sp(iter().stream());
|
const List<lduMatrix::solverPerformance> sp(iter().stream());
|
||||||
const scalar residual = sp.first().initialResidual();
|
const scalar residual = sp.first().initialResidual();
|
||||||
|
|
||||||
|
checked = true;
|
||||||
|
|
||||||
bool absCheck = residual < residualControl_[fieldI].absTol;
|
bool absCheck = residual < residualControl_[fieldI].absTol;
|
||||||
achieved = achieved && absCheck;
|
achieved = achieved && absCheck;
|
||||||
|
|
||||||
@ -75,7 +78,7 @@ bool Foam::simpleControl::criteriaSatisfied()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return achieved;
|
return checked && achieved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -90,7 +93,13 @@ Foam::simpleControl::simpleControl(fvMesh& mesh)
|
|||||||
|
|
||||||
Info<< nl;
|
Info<< nl;
|
||||||
|
|
||||||
if (residualControl_.size() > 0)
|
if (residualControl_.empty())
|
||||||
|
{
|
||||||
|
Info<< algorithmName_ << ": no convergence criteria found. "
|
||||||
|
<< "Calculations will run for " << mesh_.time().endTime().value()
|
||||||
|
<< " steps." << nl << endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Info<< algorithmName_ << ": convergence criteria" << nl;
|
Info<< algorithmName_ << ": convergence criteria" << nl;
|
||||||
forAll(residualControl_, i)
|
forAll(residualControl_, i)
|
||||||
@ -101,12 +110,6 @@ Foam::simpleControl::simpleControl(fvMesh& mesh)
|
|||||||
}
|
}
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Info<< algorithmName_ << ": no convergence criteria found. "
|
|
||||||
<< "Calculations will run for " << mesh_.time().endTime().value()
|
|
||||||
<< " steps." << nl << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -59,10 +59,10 @@ protected:
|
|||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Read constrols from fvSolution dictionary
|
//- Read controls from fvSolution dictionary
|
||||||
void read();
|
void read();
|
||||||
|
|
||||||
//- Return true if all convergence checks are satified
|
//- Return true if all convergence checks are satisfied
|
||||||
bool criteriaSatisfied();
|
bool criteriaSatisfied();
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
|
|||||||
@ -76,7 +76,8 @@ void Foam::solutionControl::read(const bool absTolOnly)
|
|||||||
{
|
{
|
||||||
FatalErrorIn("bool Foam::solutionControl::read()")
|
FatalErrorIn("bool Foam::solutionControl::read()")
|
||||||
<< "Residual data for " << iter().keyword()
|
<< "Residual data for " << iter().keyword()
|
||||||
<< " must be specified as a dictionary";
|
<< " must be specified as a dictionary"
|
||||||
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class solutionControl Declaration
|
Class solutionControl Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class solutionControl
|
class solutionControl
|
||||||
@ -78,19 +78,19 @@ protected:
|
|||||||
//- Flag to indicate to solve for momentum
|
//- Flag to indicate to solve for momentum
|
||||||
bool momentumPredictor_;
|
bool momentumPredictor_;
|
||||||
|
|
||||||
//- Flag to indictae to solve using transonic algorithm
|
//- Flag to indicate to solve using transonic algorithm
|
||||||
bool transonic_;
|
bool transonic_;
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Read constrols from fvSolution dictionary
|
//- Read controls from fvSolution dictionary
|
||||||
virtual void read(const bool absTolOnly);
|
virtual void read(const bool absTolOnly);
|
||||||
|
|
||||||
//- Return index of field in residualControl_ if present
|
//- Return index of field in residualControl_ if present
|
||||||
virtual label applyToField(const word& fieldName) const;
|
virtual label applyToField(const word& fieldName) const;
|
||||||
|
|
||||||
//- Return true if all convergence checks are satified
|
//- Return true if all convergence checks are satisfied
|
||||||
virtual bool criteriaSatisfied() = 0;
|
virtual bool criteriaSatisfied() = 0;
|
||||||
|
|
||||||
//- Store previous iteration fields
|
//- Store previous iteration fields
|
||||||
@ -142,7 +142,7 @@ public:
|
|||||||
//- Flag to indicate to solve for momentum
|
//- Flag to indicate to solve for momentum
|
||||||
inline bool momentumPredictor() const;
|
inline bool momentumPredictor() const;
|
||||||
|
|
||||||
//- Flag to indictae to solve using transonic algorithm
|
//- Flag to indicate to solve using transonic algorithm
|
||||||
inline bool transonic() const;
|
inline bool transonic() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -204,14 +204,13 @@ void mappedFieldFvPatchField<Type>::updateCoeffs()
|
|||||||
{
|
{
|
||||||
case NEARESTCELL:
|
case NEARESTCELL:
|
||||||
{
|
{
|
||||||
const mapDistribute& distMap = mappedPatchBase::map();
|
|
||||||
newValues = sampleField();
|
newValues = sampleField();
|
||||||
|
|
||||||
distMap.distribute(newValues);
|
this->distribute(newValues);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NEARESTPATCHFACE:
|
case NEARESTPATCHFACE: case NEARESTPATCHFACEAMI:
|
||||||
{
|
{
|
||||||
const label nbrPatchID =
|
const label nbrPatchID =
|
||||||
nbrMesh.boundaryMesh().findPatchID(samplePatch());
|
nbrMesh.boundaryMesh().findPatchID(samplePatch());
|
||||||
@ -228,36 +227,8 @@ void mappedFieldFvPatchField<Type>::updateCoeffs()
|
|||||||
|
|
||||||
const fieldType& nbrField = sampleField();
|
const fieldType& nbrField = sampleField();
|
||||||
|
|
||||||
const mapDistribute& distMap = mappedPatchBase::map();
|
|
||||||
newValues = nbrField.boundaryField()[nbrPatchID];
|
newValues = nbrField.boundaryField()[nbrPatchID];
|
||||||
distMap.distribute(newValues);
|
this->distribute(newValues);
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case mappedPatchBase::NEARESTPATCHFACEAMI:
|
|
||||||
{
|
|
||||||
const label nbrPatchID =
|
|
||||||
nbrMesh.boundaryMesh().findPatchID(samplePatch());
|
|
||||||
|
|
||||||
if (nbrPatchID < 0)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"void mappedFixedValueFvPatchField<Type>::updateCoeffs()"
|
|
||||||
)<< "Unable to find sample patch " << samplePatch()
|
|
||||||
<< " in region " << sampleRegion()
|
|
||||||
<< " for patch " << this->patch().name() << nl
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
// const fieldType& nbrField = sampleField();
|
|
||||||
// newValues = mpp.AMI().interpolateToSource(nbrField);
|
|
||||||
|
|
||||||
notImplemented
|
|
||||||
(
|
|
||||||
"void mappedFieldFvPatchField<Type>::updateCoeffs() "
|
|
||||||
"with mappedPatchBase::NEARESTPATCHFACEAMI"
|
|
||||||
);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -279,9 +250,7 @@ void mappedFieldFvPatchField<Type>::updateCoeffs()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapDistribute& distMap = mappedPatchBase::map();
|
this->distribute(allValues);
|
||||||
distMap.distribute(allValues);
|
|
||||||
|
|
||||||
newValues.transfer(allValues);
|
newValues.transfer(allValues);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -114,42 +114,65 @@ void Foam::mappedFixedInternalValueFvPatchField<Type>::updateCoeffs()
|
|||||||
const mappedPatchBase& mpp =
|
const mappedPatchBase& mpp =
|
||||||
refCast<const mappedPatchBase>(this->patch().patch());
|
refCast<const mappedPatchBase>(this->patch().patch());
|
||||||
const fvMesh& nbrMesh = refCast<const fvMesh>(mpp.sampleMesh());
|
const fvMesh& nbrMesh = refCast<const fvMesh>(mpp.sampleMesh());
|
||||||
const label samplePatchI = mpp.samplePolyPatch().index();
|
|
||||||
const fvPatch& nbrPatch = nbrMesh.boundary()[samplePatchI];
|
|
||||||
|
|
||||||
|
Field<Type> nbrIntFld;
|
||||||
// Retrieve the neighbour field
|
|
||||||
const fvPatchField<Type>& nbrField =
|
|
||||||
nbrPatch.template lookupPatchField<FieldType, Type>
|
|
||||||
(
|
|
||||||
this->dimensionedInternalField().name()
|
|
||||||
);
|
|
||||||
|
|
||||||
// Retrieve the neighbour patch internal field
|
|
||||||
Field<Type> nbrIntFld(nbrField.patchInternalField());
|
|
||||||
|
|
||||||
switch (mpp.mode())
|
switch (mpp.mode())
|
||||||
{
|
{
|
||||||
case (mappedPatchBase::NEARESTPATCHFACEAMI):
|
case mappedPatchBase::NEARESTCELL:
|
||||||
{
|
{
|
||||||
// Retrieve the neighbour patch internal field
|
FatalErrorIn
|
||||||
nbrIntFld = mpp.AMI().interpolateToSource(nbrIntFld);
|
(
|
||||||
|
"void mappedFixedValueFvPatchField<Type>::updateCoeffs()"
|
||||||
|
) << "Cannot apply "
|
||||||
|
<< mappedPatchBase::sampleModeNames_
|
||||||
|
[
|
||||||
|
mappedPatchBase::NEARESTCELL
|
||||||
|
]
|
||||||
|
<< " mapping mode for patch " << this->patch().name()
|
||||||
|
<< exit(FatalError);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case mappedPatchBase::NEARESTPATCHFACE:
|
||||||
|
{
|
||||||
|
const label samplePatchI = mpp.samplePolyPatch().index();
|
||||||
|
const fvPatchField<Type>& nbrPatchField =
|
||||||
|
this->sampleField().boundaryField()[samplePatchI];
|
||||||
|
nbrIntFld = nbrPatchField.patchInternalField();
|
||||||
|
mpp.distribute(nbrIntFld);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case mappedPatchBase::NEARESTFACE:
|
||||||
|
{
|
||||||
|
Field<Type> allValues(nbrMesh.nFaces(), pTraits<Type>::zero);
|
||||||
|
|
||||||
|
const FieldType& nbrField = this->sampleField();
|
||||||
|
|
||||||
|
forAll(nbrField.boundaryField(), patchI)
|
||||||
|
{
|
||||||
|
const fvPatchField<Type>& pf = nbrField.boundaryField()[patchI];
|
||||||
|
const Field<Type> pif(pf.patchInternalField());
|
||||||
|
|
||||||
|
label faceStart = pf.patch().start();
|
||||||
|
|
||||||
|
forAll(pf, faceI)
|
||||||
|
{
|
||||||
|
allValues[faceStart++] = pif[faceI];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mpp.distribute(allValues);
|
||||||
|
nbrIntFld.transfer(allValues);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
const mapDistribute& distMap = mpp.map();
|
FatalErrorIn("mappedFixedValueFvPatchField<Type>::updateCoeffs()")
|
||||||
|
<< "Unknown sampling mode: " << mpp.mode()
|
||||||
mapDistribute::distribute
|
<< abort(FatalError);
|
||||||
(
|
|
||||||
Pstream::defaultCommsType,
|
|
||||||
distMap.schedule(),
|
|
||||||
distMap.constructSize(),
|
|
||||||
distMap.subMap(), // what to send
|
|
||||||
distMap.constructMap(), // what to receive
|
|
||||||
nbrIntFld
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -283,30 +283,6 @@ void mappedFixedValueFvPatchField<Type>::updateCoeffs()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case mappedPatchBase::NEARESTPATCHFACE:
|
case mappedPatchBase::NEARESTPATCHFACE:
|
||||||
{
|
|
||||||
const mapDistribute& distMap = mpp.map();
|
|
||||||
|
|
||||||
const label nbrPatchID =
|
|
||||||
nbrMesh.boundaryMesh().findPatchID(mpp.samplePatch());
|
|
||||||
|
|
||||||
if (nbrPatchID < 0)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"void mappedFixedValueFvPatchField<Type>::updateCoeffs()"
|
|
||||||
)<< "Unable to find sample patch " << mpp.samplePatch()
|
|
||||||
<< " in region " << mpp.sampleRegion()
|
|
||||||
<< " for patch " << this->patch().name() << nl
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
const fieldType& nbrField = sampleField();
|
|
||||||
|
|
||||||
newValues = nbrField.boundaryField()[nbrPatchID];
|
|
||||||
distMap.distribute(newValues);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case mappedPatchBase::NEARESTPATCHFACEAMI:
|
case mappedPatchBase::NEARESTPATCHFACEAMI:
|
||||||
{
|
{
|
||||||
const label nbrPatchID =
|
const label nbrPatchID =
|
||||||
@ -324,9 +300,9 @@ void mappedFixedValueFvPatchField<Type>::updateCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fieldType& nbrField = sampleField();
|
const fieldType& nbrField = sampleField();
|
||||||
newValues = nbrField.boundaryField()[nbrPatchID];
|
|
||||||
|
|
||||||
newValues = mpp.AMI().interpolateToSource(newValues);
|
newValues = nbrField.boundaryField()[nbrPatchID];
|
||||||
|
mpp.distribute(newValues);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,7 +71,10 @@ class mappedFixedValueFvPatchField
|
|||||||
:
|
:
|
||||||
public fixedValueFvPatchField<Type>
|
public fixedValueFvPatchField<Type>
|
||||||
{
|
{
|
||||||
// Private data
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
//- Name of field to sample - defaults to field associated with this
|
//- Name of field to sample - defaults to field associated with this
|
||||||
// patchField if not specified
|
// patchField if not specified
|
||||||
@ -90,7 +93,7 @@ class mappedFixedValueFvPatchField
|
|||||||
mutable autoPtr<interpolation<Type> > interpolator_;
|
mutable autoPtr<interpolation<Type> > interpolator_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Field to sample. Either on my or nbr mesh
|
//- Field to sample. Either on my or nbr mesh
|
||||||
const GeometricField<Type, fvPatchField, volMesh>& sampleField() const;
|
const GeometricField<Type, fvPatchField, volMesh>& sampleField() const;
|
||||||
|
|||||||
@ -28,7 +28,6 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "fvPatchFieldMapper.H"
|
#include "fvPatchFieldMapper.H"
|
||||||
#include "mappedPatchBase.H"
|
#include "mappedPatchBase.H"
|
||||||
#include "mapDistribute.H"
|
|
||||||
#include "surfaceFields.H"
|
#include "surfaceFields.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
@ -128,7 +127,7 @@ void Foam::mappedFlowRateFvPatchVectorField::updateCoeffs()
|
|||||||
scalarList phi =
|
scalarList phi =
|
||||||
nbrPatch.lookupPatchField<surfaceScalarField, scalar>(nbrPhiName_);
|
nbrPatch.lookupPatchField<surfaceScalarField, scalar>(nbrPhiName_);
|
||||||
|
|
||||||
mpp.map().distribute(phi);
|
mpp.distribute(phi);
|
||||||
|
|
||||||
|
|
||||||
const surfaceScalarField& phiName =
|
const surfaceScalarField& phiName =
|
||||||
|
|||||||
@ -176,13 +176,10 @@ void Foam::mappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
|
|||||||
(
|
(
|
||||||
mappedVelocityFluxFixedValueFvPatchField::patch().patch()
|
mappedVelocityFluxFixedValueFvPatchField::patch().patch()
|
||||||
);
|
);
|
||||||
const mapDistribute& distMap = mpp.map();
|
|
||||||
const fvMesh& nbrMesh = refCast<const fvMesh>(mpp.sampleMesh());
|
const fvMesh& nbrMesh = refCast<const fvMesh>(mpp.sampleMesh());
|
||||||
const word& fieldName = dimensionedInternalField().name();
|
const word& fieldName = dimensionedInternalField().name();
|
||||||
const volVectorField& UField = nbrMesh.lookupObject<volVectorField>
|
const volVectorField& UField =
|
||||||
(
|
nbrMesh.lookupObject<volVectorField>(fieldName);
|
||||||
fieldName
|
|
||||||
);
|
|
||||||
|
|
||||||
surfaceScalarField& phiField = const_cast<surfaceScalarField&>
|
surfaceScalarField& phiField = const_cast<surfaceScalarField&>
|
||||||
(
|
(
|
||||||
@ -213,26 +210,25 @@ void Foam::mappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
distMap.distribute(allUValues);
|
mpp.distribute(allUValues);
|
||||||
newUValues.transfer(allUValues);
|
newUValues.transfer(allUValues);
|
||||||
|
|
||||||
distMap.distribute(allPhiValues);
|
mpp.distribute(allPhiValues);
|
||||||
newPhiValues.transfer(allPhiValues);
|
newPhiValues.transfer(allPhiValues);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case mappedPolyPatch::NEARESTPATCHFACE:
|
case mappedPolyPatch::NEARESTPATCHFACE:
|
||||||
|
case mappedPolyPatch::NEARESTPATCHFACEAMI:
|
||||||
{
|
{
|
||||||
const label nbrPatchID = nbrMesh.boundaryMesh().findPatchID
|
const label nbrPatchID =
|
||||||
(
|
nbrMesh.boundaryMesh().findPatchID(mpp.samplePatch());
|
||||||
mpp.samplePatch()
|
|
||||||
);
|
|
||||||
|
|
||||||
newUValues = UField.boundaryField()[nbrPatchID];
|
newUValues = UField.boundaryField()[nbrPatchID];
|
||||||
distMap.distribute(newUValues);
|
mpp.distribute(newUValues);
|
||||||
|
|
||||||
newPhiValues = phiField.boundaryField()[nbrPatchID];
|
newPhiValues = phiField.boundaryField()[nbrPatchID];
|
||||||
distMap.distribute(newPhiValues);
|
mpp.distribute(newPhiValues);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -242,8 +238,9 @@ void Foam::mappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
|
|||||||
(
|
(
|
||||||
"mappedVelocityFluxFixedValueFvPatchField::"
|
"mappedVelocityFluxFixedValueFvPatchField::"
|
||||||
"updateCoeffs()"
|
"updateCoeffs()"
|
||||||
) << "patch can only be used in NEARESTPATCHFACE or NEARESTFACE "
|
) << "patch can only be used in NEARESTPATCHFACE, "
|
||||||
<< "mode" << nl << abort(FatalError);
|
<< "NEARESTPATCHFACEAMI or NEARESTFACE mode" << nl
|
||||||
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,177 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "multiphaseFixedFluxPressureFvPatchScalarField.H"
|
|
||||||
#include "fvPatchFieldMapper.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
#include "surfaceFields.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedGradientFvPatchScalarField(p, iF),
|
|
||||||
UName_("U"),
|
|
||||||
phiName_("phi"),
|
|
||||||
rhoName_("rho")
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const multiphaseFixedFluxPressureFvPatchScalarField& ptf,
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const fvPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
|
|
||||||
UName_(ptf.UName_),
|
|
||||||
phiName_(ptf.phiName_),
|
|
||||||
rhoName_(ptf.rhoName_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedGradientFvPatchScalarField(p, iF),
|
|
||||||
UName_(dict.lookupOrDefault<word>("U", "U")),
|
|
||||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
|
||||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
|
|
||||||
{
|
|
||||||
if (dict.found("gradient"))
|
|
||||||
{
|
|
||||||
gradient() = scalarField("gradient", dict, p.size());
|
|
||||||
fixedGradientFvPatchScalarField::updateCoeffs();
|
|
||||||
fixedGradientFvPatchScalarField::evaluate();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fvPatchField<scalar>::operator=(patchInternalField());
|
|
||||||
gradient() = 0.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const multiphaseFixedFluxPressureFvPatchScalarField& wbppsf
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedGradientFvPatchScalarField(wbppsf),
|
|
||||||
UName_(wbppsf.UName_),
|
|
||||||
phiName_(wbppsf.phiName_),
|
|
||||||
rhoName_(wbppsf.rhoName_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const multiphaseFixedFluxPressureFvPatchScalarField& wbppsf,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedGradientFvPatchScalarField(wbppsf, iF),
|
|
||||||
UName_(wbppsf.UName_),
|
|
||||||
phiName_(wbppsf.phiName_),
|
|
||||||
rhoName_(wbppsf.rhoName_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void Foam::multiphaseFixedFluxPressureFvPatchScalarField::updateCoeffs()
|
|
||||||
{
|
|
||||||
if (updated())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const fvPatchField<vector>& Up =
|
|
||||||
patch().lookupPatchField<volVectorField, vector>(UName_);
|
|
||||||
|
|
||||||
const surfaceScalarField& phi =
|
|
||||||
db().lookupObject<surfaceScalarField>(phiName_);
|
|
||||||
|
|
||||||
fvsPatchField<scalar> phip =
|
|
||||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
|
||||||
|
|
||||||
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
|
||||||
{
|
|
||||||
const fvPatchField<scalar>& rhop =
|
|
||||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
|
||||||
|
|
||||||
phip /= rhop;
|
|
||||||
}
|
|
||||||
|
|
||||||
const fvsPatchField<scalar>& Dpp =
|
|
||||||
patch().lookupPatchField<surfaceScalarField, scalar>("Dp");
|
|
||||||
|
|
||||||
gradient() = (phip - (patch().Sf() & Up))/patch().magSf()/Dpp;
|
|
||||||
|
|
||||||
fixedGradientFvPatchScalarField::updateCoeffs();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Foam::multiphaseFixedFluxPressureFvPatchScalarField::write
|
|
||||||
(
|
|
||||||
Ostream& os
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
fvPatchScalarField::write(os);
|
|
||||||
writeEntryIfDifferent<word>(os, "U", "U", UName_);
|
|
||||||
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
|
||||||
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
|
||||||
gradient().writeEntry("gradient", os);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
makePatchTypeField
|
|
||||||
(
|
|
||||||
fvPatchScalarField,
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,154 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
|
|
||||||
Description
|
|
||||||
Foam::multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef multiphaseFixedFluxPressureFvPatchScalarFields_H
|
|
||||||
#define multiphaseFixedFluxPressureFvPatchScalarFields_H
|
|
||||||
|
|
||||||
#include "fvPatchFields.H"
|
|
||||||
#include "fixedGradientFvPatchFields.H"
|
|
||||||
#include "Switch.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class multiphaseFixedFluxPressureFvPatch Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
:
|
|
||||||
public fixedGradientFvPatchScalarField
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Name of the velocity field
|
|
||||||
word UName_;
|
|
||||||
|
|
||||||
//- Name of the flux transporting the field
|
|
||||||
word phiName_;
|
|
||||||
|
|
||||||
//- Name of the density field used to normalise the mass flux
|
|
||||||
// if neccessary
|
|
||||||
word rhoName_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("multiphaseFixedFluxPressure");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct by mapping given
|
|
||||||
// multiphaseFixedFluxPressureFvPatchScalarField onto a new patch
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const multiphaseFixedFluxPressureFvPatchScalarField&,
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const fvPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const multiphaseFixedFluxPressureFvPatchScalarField&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone
|
|
||||||
virtual tmp<fvPatchScalarField> clone() const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new multiphaseFixedFluxPressureFvPatchScalarField(*this)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Construct as copy setting internal field reference
|
|
||||||
multiphaseFixedFluxPressureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const multiphaseFixedFluxPressureFvPatchScalarField&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual tmp<fvPatchScalarField> clone
|
|
||||||
(
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new multiphaseFixedFluxPressureFvPatchScalarField(*this, iF)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
|
||||||
virtual void updateCoeffs();
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
virtual void write(Ostream&) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -229,7 +229,6 @@ void selfContainedMappedFixedValueFvPatchField<Type>::updateCoeffs()
|
|||||||
|
|
||||||
const fvMesh& thisMesh = this->patch().boundaryMesh().mesh();
|
const fvMesh& thisMesh = this->patch().boundaryMesh().mesh();
|
||||||
const fvMesh& nbrMesh = refCast<const fvMesh>(sampleMesh());
|
const fvMesh& nbrMesh = refCast<const fvMesh>(sampleMesh());
|
||||||
const mapDistribute& distMap = mappedPatchBase::map();
|
|
||||||
|
|
||||||
// Result of obtaining remote values
|
// Result of obtaining remote values
|
||||||
Field<Type> newValues;
|
Field<Type> newValues;
|
||||||
@ -238,6 +237,8 @@ void selfContainedMappedFixedValueFvPatchField<Type>::updateCoeffs()
|
|||||||
{
|
{
|
||||||
case NEARESTCELL:
|
case NEARESTCELL:
|
||||||
{
|
{
|
||||||
|
const mapDistribute& distMap = mappedPatchBase::map();
|
||||||
|
|
||||||
if (interpolationScheme_ != interpolationCell<Type>::typeName)
|
if (interpolationScheme_ != interpolationCell<Type>::typeName)
|
||||||
{
|
{
|
||||||
// Need to do interpolation so need cells to sample.
|
// Need to do interpolation so need cells to sample.
|
||||||
@ -275,12 +276,10 @@ void selfContainedMappedFixedValueFvPatchField<Type>::updateCoeffs()
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case NEARESTPATCHFACE:
|
case NEARESTPATCHFACE: case NEARESTPATCHFACEAMI:
|
||||||
{
|
{
|
||||||
const label nbrPatchID = nbrMesh.boundaryMesh().findPatchID
|
const label nbrPatchID =
|
||||||
(
|
nbrMesh.boundaryMesh().findPatchID(samplePatch());
|
||||||
samplePatch()
|
|
||||||
);
|
|
||||||
if (nbrPatchID < 0)
|
if (nbrPatchID < 0)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
@ -297,7 +296,7 @@ void selfContainedMappedFixedValueFvPatchField<Type>::updateCoeffs()
|
|||||||
const fieldType& nbrField = sampleField();
|
const fieldType& nbrField = sampleField();
|
||||||
|
|
||||||
newValues = nbrField.boundaryField()[nbrPatchID];
|
newValues = nbrField.boundaryField()[nbrPatchID];
|
||||||
distMap.distribute(newValues);
|
this->distribute(newValues);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -319,7 +318,7 @@ void selfContainedMappedFixedValueFvPatchField<Type>::updateCoeffs()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
distMap.distribute(allValues);
|
this->distribute(allValues);
|
||||||
|
|
||||||
newValues.transfer(allValues);
|
newValues.transfer(allValues);
|
||||||
|
|
||||||
|
|||||||
@ -324,6 +324,8 @@ bool Foam::KinematicParcel<ParcelType>::move
|
|||||||
}
|
}
|
||||||
|
|
||||||
p.age() += dt;
|
p.age() += dt;
|
||||||
|
|
||||||
|
td.cloud().functions().postMove(p, cellI, dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
return td.keepParticle;
|
return td.keepParticle;
|
||||||
|
|||||||
@ -31,6 +31,7 @@ License
|
|||||||
#include "FacePostProcessing.H"
|
#include "FacePostProcessing.H"
|
||||||
#include "ParticleTracks.H"
|
#include "ParticleTracks.H"
|
||||||
#include "PatchPostProcessing.H"
|
#include "PatchPostProcessing.H"
|
||||||
|
#include "VoidFraction.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -40,7 +41,8 @@ License
|
|||||||
\
|
\
|
||||||
makeCloudFunctionObjectType(FacePostProcessing, CloudType); \
|
makeCloudFunctionObjectType(FacePostProcessing, CloudType); \
|
||||||
makeCloudFunctionObjectType(ParticleTracks, CloudType); \
|
makeCloudFunctionObjectType(ParticleTracks, CloudType); \
|
||||||
makeCloudFunctionObjectType(PatchPostProcessing, CloudType);
|
makeCloudFunctionObjectType(PatchPostProcessing, CloudType); \
|
||||||
|
makeCloudFunctionObjectType(VoidFraction, CloudType);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -91,6 +91,18 @@ void Foam::CloudFunctionObject<CloudType>::postEvolve()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
void Foam::CloudFunctionObject<CloudType>::postMove
|
||||||
|
(
|
||||||
|
const typename CloudType::parcelType&,
|
||||||
|
const label,
|
||||||
|
const scalar
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
void Foam::CloudFunctionObject<CloudType>::postPatch
|
void Foam::CloudFunctionObject<CloudType>::postPatch
|
||||||
(
|
(
|
||||||
@ -98,14 +110,7 @@ void Foam::CloudFunctionObject<CloudType>::postPatch
|
|||||||
const label
|
const label
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
notImplemented
|
// do nothing
|
||||||
(
|
|
||||||
"void Foam::CloudFunctionObject<CloudType>::postPatch"
|
|
||||||
"("
|
|
||||||
"const typename CloudType::parcelType&,"
|
|
||||||
"const label"
|
|
||||||
")"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -115,13 +120,7 @@ void Foam::CloudFunctionObject<CloudType>::postFace
|
|||||||
const typename CloudType::parcelType&
|
const typename CloudType::parcelType&
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
notImplemented
|
// do nothing
|
||||||
(
|
|
||||||
"void Foam::CloudFunctionObject<CloudType>::postFace"
|
|
||||||
"("
|
|
||||||
"const typename CloudType::parcelType&"
|
|
||||||
")"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -129,6 +129,14 @@ public:
|
|||||||
//- Post-evolve hook
|
//- Post-evolve hook
|
||||||
virtual void postEvolve();
|
virtual void postEvolve();
|
||||||
|
|
||||||
|
//- Post-move hook
|
||||||
|
virtual void postMove
|
||||||
|
(
|
||||||
|
const typename CloudType::parcelType& p,
|
||||||
|
const label cellI,
|
||||||
|
const scalar dt
|
||||||
|
);
|
||||||
|
|
||||||
//- Post-patch hook
|
//- Post-patch hook
|
||||||
virtual void postPatch
|
virtual void postPatch
|
||||||
(
|
(
|
||||||
|
|||||||
@ -127,6 +127,21 @@ void Foam::CloudFunctionObjectList<CloudType>::postEvolve()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
void Foam::CloudFunctionObjectList<CloudType>::postMove
|
||||||
|
(
|
||||||
|
const typename CloudType::parcelType& p,
|
||||||
|
const label cellI,
|
||||||
|
const scalar dt
|
||||||
|
)
|
||||||
|
{
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
this->operator[](i).postMove(p, cellI, dt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
void Foam::CloudFunctionObjectList<CloudType>::postPatch
|
void Foam::CloudFunctionObjectList<CloudType>::postPatch
|
||||||
(
|
(
|
||||||
|
|||||||
@ -109,6 +109,14 @@ public:
|
|||||||
//- Post-evolve hook
|
//- Post-evolve hook
|
||||||
virtual void postEvolve();
|
virtual void postEvolve();
|
||||||
|
|
||||||
|
//- Post-move hook
|
||||||
|
virtual void postMove
|
||||||
|
(
|
||||||
|
const typename CloudType::parcelType& p,
|
||||||
|
const label cellI,
|
||||||
|
const scalar dt
|
||||||
|
);
|
||||||
|
|
||||||
//- Post-patch hook
|
//- Post-patch hook
|
||||||
virtual void postPatch
|
virtual void postPatch
|
||||||
(
|
(
|
||||||
|
|||||||
@ -0,0 +1,137 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "VoidFraction.H"
|
||||||
|
#
|
||||||
|
// * * * * * * * * * * * * * Protectd Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
void Foam::VoidFraction<CloudType>::write()
|
||||||
|
{
|
||||||
|
if (thetaPtr_.valid())
|
||||||
|
{
|
||||||
|
thetaPtr_->write();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn("void Foam::VoidFraction<CloudType>::write()")
|
||||||
|
<< "thetaPtr not valid" << abort(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
Foam::VoidFraction<CloudType>::VoidFraction
|
||||||
|
(
|
||||||
|
const dictionary& dict,
|
||||||
|
CloudType& owner
|
||||||
|
)
|
||||||
|
:
|
||||||
|
CloudFunctionObject<CloudType>(owner),
|
||||||
|
thetaPtr_(NULL)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
Foam::VoidFraction<CloudType>::VoidFraction
|
||||||
|
(
|
||||||
|
const VoidFraction<CloudType>& vf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
CloudFunctionObject<CloudType>(vf),
|
||||||
|
thetaPtr_(NULL)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
Foam::VoidFraction<CloudType>::~VoidFraction()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
void Foam::VoidFraction<CloudType>::preEvolve()
|
||||||
|
{
|
||||||
|
if (thetaPtr_.valid())
|
||||||
|
{
|
||||||
|
thetaPtr_->internalField() = 0.0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const fvMesh& mesh = this->owner().mesh();
|
||||||
|
|
||||||
|
thetaPtr_.reset
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
this->owner().name() + "Theta",
|
||||||
|
mesh.time().timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar("zero", dimless, 0.0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
void Foam::VoidFraction<CloudType>::postEvolve()
|
||||||
|
{
|
||||||
|
volScalarField& theta = thetaPtr_();
|
||||||
|
|
||||||
|
const fvMesh& mesh = this->owner().mesh();
|
||||||
|
|
||||||
|
theta.internalField() /= mesh.time().deltaTValue()*mesh.V();
|
||||||
|
|
||||||
|
CloudFunctionObject<CloudType>::postEvolve();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
void Foam::VoidFraction<CloudType>::postMove
|
||||||
|
(
|
||||||
|
const parcelType& p,
|
||||||
|
const label cellI,
|
||||||
|
const scalar dt
|
||||||
|
)
|
||||||
|
{
|
||||||
|
volScalarField& theta = thetaPtr_();
|
||||||
|
|
||||||
|
theta[cellI] += dt*p.nParticle()*p.volume();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,137 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::VoidFraction
|
||||||
|
|
||||||
|
Description
|
||||||
|
Creates particle void fraction field on carrier phase
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
VoidFraction.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef VoidFraction_H
|
||||||
|
#define VoidFraction_H
|
||||||
|
|
||||||
|
#include "CloudFunctionObject.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class VoidFraction Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
class VoidFraction
|
||||||
|
:
|
||||||
|
public CloudFunctionObject<CloudType>
|
||||||
|
{
|
||||||
|
// Private Data
|
||||||
|
|
||||||
|
// Typedefs
|
||||||
|
|
||||||
|
//- Convenience typedef for parcel type
|
||||||
|
typedef typename CloudType::parcelType parcelType;
|
||||||
|
|
||||||
|
|
||||||
|
//- Void fraction field
|
||||||
|
autoPtr<volScalarField> thetaPtr_;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected Member Functions
|
||||||
|
|
||||||
|
//- Write post-processing info
|
||||||
|
virtual void write();
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("voidFraction");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from dictionary
|
||||||
|
VoidFraction(const dictionary& dict, CloudType& owner);
|
||||||
|
|
||||||
|
//- Construct copy
|
||||||
|
VoidFraction(const VoidFraction<CloudType>& vf);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual autoPtr<CloudFunctionObject<CloudType> > clone() const
|
||||||
|
{
|
||||||
|
return autoPtr<CloudFunctionObject<CloudType> >
|
||||||
|
(
|
||||||
|
new VoidFraction<CloudType>(*this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~VoidFraction();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// Evaluation
|
||||||
|
|
||||||
|
//- Pre-evolve hook
|
||||||
|
virtual void preEvolve();
|
||||||
|
|
||||||
|
//- Post-evolve hook
|
||||||
|
virtual void postEvolve();
|
||||||
|
|
||||||
|
//- Post-move hook
|
||||||
|
virtual void postMove
|
||||||
|
(
|
||||||
|
const parcelType& p,
|
||||||
|
const label cellI,
|
||||||
|
const scalar dt
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#ifdef NoRepository
|
||||||
|
# include "VoidFraction.C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -220,11 +220,14 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
|
|||||||
:
|
:
|
||||||
InjectionModel<CloudType>(im),
|
InjectionModel<CloudType>(im),
|
||||||
injectionMethod_(im.injectionMethod_),
|
injectionMethod_(im.injectionMethod_),
|
||||||
|
flowType_(im.flowType_),
|
||||||
outerDiameter_(im.outerDiameter_),
|
outerDiameter_(im.outerDiameter_),
|
||||||
innerDiameter_(im.innerDiameter_),
|
innerDiameter_(im.innerDiameter_),
|
||||||
duration_(im.duration_),
|
duration_(im.duration_),
|
||||||
position_(im.position_),
|
position_(im.position_),
|
||||||
injectorCell_(im.injectorCell_),
|
injectorCell_(im.injectorCell_),
|
||||||
|
tetFaceI_(im.tetFaceI_),
|
||||||
|
tetPtI_(im.tetPtI_),
|
||||||
direction_(im.direction_),
|
direction_(im.direction_),
|
||||||
parcelsPerSecond_(im.parcelsPerSecond_),
|
parcelsPerSecond_(im.parcelsPerSecond_),
|
||||||
flowRateProfile_(im.flowRateProfile_().clone().ptr()),
|
flowRateProfile_(im.flowRateProfile_().clone().ptr()),
|
||||||
@ -235,9 +238,18 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
|
|||||||
tanVec2_(im.tanVec1_),
|
tanVec2_(im.tanVec1_),
|
||||||
normal_(im.normal_),
|
normal_(im.normal_),
|
||||||
UMag_(im.UMag_),
|
UMag_(im.UMag_),
|
||||||
Cd_(im.Cd_().clone().ptr()),
|
Cd_(NULL),
|
||||||
Pinj_(im.Pinj_().clone().ptr())
|
Pinj_(NULL)
|
||||||
{}
|
{
|
||||||
|
if (im.Cd_.valid())
|
||||||
|
{
|
||||||
|
Cd_.reset(im.Cd_().clone().ptr());
|
||||||
|
}
|
||||||
|
if (im.Pinj_.valid())
|
||||||
|
{
|
||||||
|
Pinj_.reset(im.Pinj_().clone().ptr());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -114,8 +114,8 @@ bool Foam::SurfaceFilmModel<CloudType>::transferParcel
|
|||||||
"bool Foam::SurfaceFilmModel<CloudType>::transferParcel"
|
"bool Foam::SurfaceFilmModel<CloudType>::transferParcel"
|
||||||
"("
|
"("
|
||||||
"parcelType&, "
|
"parcelType&, "
|
||||||
"const label, "
|
"const polyPatch&, "
|
||||||
"const bool&"
|
"bool&"
|
||||||
")"
|
")"
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -156,11 +156,9 @@ void Foam::SurfaceFilmModel<CloudType>::inject(TrackData& td)
|
|||||||
const label filmPatchI = filmPatches[i];
|
const label filmPatchI = filmPatches[i];
|
||||||
const label primaryPatchI = primaryPatches[i];
|
const label primaryPatchI = primaryPatches[i];
|
||||||
|
|
||||||
const mappedPatchBase& mapPatch = filmModel.mappedPatches()[filmPatchI];
|
|
||||||
|
|
||||||
const labelList& injectorCellsPatch = pbm[primaryPatchI].faceCells();
|
const labelList& injectorCellsPatch = pbm[primaryPatchI].faceCells();
|
||||||
|
|
||||||
cacheFilmFields(filmPatchI, primaryPatchI, mapPatch, filmModel);
|
cacheFilmFields(filmPatchI, primaryPatchI, filmModel);
|
||||||
|
|
||||||
const vectorField& Cf = mesh.C().boundaryField()[primaryPatchI];
|
const vectorField& Cf = mesh.C().boundaryField()[primaryPatchI];
|
||||||
const vectorField& Sf = mesh.Sf().boundaryField()[primaryPatchI];
|
const vectorField& Sf = mesh.Sf().boundaryField()[primaryPatchI];
|
||||||
@ -172,13 +170,11 @@ void Foam::SurfaceFilmModel<CloudType>::inject(TrackData& td)
|
|||||||
{
|
{
|
||||||
const label cellI = injectorCellsPatch[j];
|
const label cellI = injectorCellsPatch[j];
|
||||||
|
|
||||||
// The position is at the cell centre, which could be
|
// The position could bein any tet of the decomposed cell,
|
||||||
// in any tet of the decomposed cell, so arbitrarily
|
// so arbitrarily choose the first face of the cell as the
|
||||||
// choose the first face of the cell as the tetFace
|
// tetFace and the first point on the face after the base
|
||||||
// and the first point on the face after the base
|
// point as the tetPt. The tracking will pick the cell
|
||||||
// point as the tetPt. The tracking will
|
// consistent with the motion in the first tracking step.
|
||||||
// pick the cell consistent with the motion in the
|
|
||||||
// first tracking step.
|
|
||||||
const label tetFaceI = this->owner().mesh().cells()[cellI][0];
|
const label tetFaceI = this->owner().mesh().cells()[cellI][0];
|
||||||
const label tetPtI = 1;
|
const label tetPtI = 1;
|
||||||
|
|
||||||
@ -208,14 +204,22 @@ void Foam::SurfaceFilmModel<CloudType>::inject(TrackData& td)
|
|||||||
|
|
||||||
setParcelProperties(*pPtr, j);
|
setParcelProperties(*pPtr, j);
|
||||||
|
|
||||||
// Check new parcel properties
|
if (pPtr->nParticle() > 0.001)
|
||||||
// td.cloud().checkParcelProperties(*pPtr, 0.0, true);
|
{
|
||||||
td.cloud().checkParcelProperties(*pPtr, 0.0, false);
|
// Check new parcel properties
|
||||||
|
// td.cloud().checkParcelProperties(*pPtr, 0.0, true);
|
||||||
|
td.cloud().checkParcelProperties(*pPtr, 0.0, false);
|
||||||
|
|
||||||
// Add the new parcel to the cloud
|
// Add the new parcel to the cloud
|
||||||
td.cloud().addParticle(pPtr);
|
td.cloud().addParticle(pPtr);
|
||||||
|
|
||||||
nParcelsInjected_++;
|
nParcelsInjected_++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO: cache mass and re-distribute?
|
||||||
|
delete pPtr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -227,26 +231,25 @@ void Foam::SurfaceFilmModel<CloudType>::cacheFilmFields
|
|||||||
(
|
(
|
||||||
const label filmPatchI,
|
const label filmPatchI,
|
||||||
const label primaryPatchI,
|
const label primaryPatchI,
|
||||||
const mappedPatchBase& mapPatch,
|
|
||||||
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel
|
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
massParcelPatch_ = filmModel.cloudMassTrans().boundaryField()[filmPatchI];
|
massParcelPatch_ = filmModel.cloudMassTrans().boundaryField()[filmPatchI];
|
||||||
mapPatch.distribute(massParcelPatch_);
|
filmModel.toPrimary(filmPatchI, massParcelPatch_);
|
||||||
|
|
||||||
diameterParcelPatch_ =
|
diameterParcelPatch_ =
|
||||||
filmModel.cloudDiameterTrans().boundaryField()[filmPatchI];
|
filmModel.cloudDiameterTrans().boundaryField()[filmPatchI];
|
||||||
mapPatch.distribute(diameterParcelPatch_);
|
filmModel.toPrimary(filmPatchI, diameterParcelPatch_);
|
||||||
|
|
||||||
UFilmPatch_ = filmModel.Us().boundaryField()[filmPatchI];
|
UFilmPatch_ = filmModel.Us().boundaryField()[filmPatchI];
|
||||||
mapPatch.distribute(UFilmPatch_);
|
filmModel.toPrimary(filmPatchI, UFilmPatch_);
|
||||||
|
|
||||||
rhoFilmPatch_ = filmModel.rho().boundaryField()[filmPatchI];
|
rhoFilmPatch_ = filmModel.rho().boundaryField()[filmPatchI];
|
||||||
mapPatch.distribute(rhoFilmPatch_);
|
filmModel.toPrimary(filmPatchI, rhoFilmPatch_);
|
||||||
|
|
||||||
deltaFilmPatch_[primaryPatchI] =
|
deltaFilmPatch_[primaryPatchI] =
|
||||||
filmModel.delta().boundaryField()[filmPatchI];
|
filmModel.delta().boundaryField()[filmPatchI];
|
||||||
mapPatch.distribute(deltaFilmPatch_[primaryPatchI]);
|
filmModel.toPrimary(filmPatchI, deltaFilmPatch_[primaryPatchI]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -116,7 +116,6 @@ protected:
|
|||||||
(
|
(
|
||||||
const label filmPatchI,
|
const label filmPatchI,
|
||||||
const label primaryPatchI,
|
const label primaryPatchI,
|
||||||
const mappedPatchBase& mapPatch,
|
|
||||||
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel
|
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -643,7 +643,6 @@ void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields
|
|||||||
(
|
(
|
||||||
const label filmPatchI,
|
const label filmPatchI,
|
||||||
const label primaryPatchI,
|
const label primaryPatchI,
|
||||||
const mappedPatchBase& mapPatch,
|
|
||||||
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel
|
const regionModels::surfaceFilmModels::surfaceFilmModel& filmModel
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -651,15 +650,14 @@ void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields
|
|||||||
(
|
(
|
||||||
filmPatchI,
|
filmPatchI,
|
||||||
primaryPatchI,
|
primaryPatchI,
|
||||||
mapPatch,
|
|
||||||
filmModel
|
filmModel
|
||||||
);
|
);
|
||||||
|
|
||||||
TFilmPatch_ = filmModel.Ts().boundaryField()[filmPatchI];
|
TFilmPatch_ = filmModel.Ts().boundaryField()[filmPatchI];
|
||||||
mapPatch.distribute(TFilmPatch_);
|
filmModel.toPrimary(filmPatchI, TFilmPatch_);
|
||||||
|
|
||||||
CpFilmPatch_ = filmModel.Cp().boundaryField()[filmPatchI];
|
CpFilmPatch_ = filmModel.Cp().boundaryField()[filmPatchI];
|
||||||
mapPatch.distribute(CpFilmPatch_);
|
filmModel.toPrimary(filmPatchI, CpFilmPatch_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -227,7 +227,6 @@ protected:
|
|||||||
(
|
(
|
||||||
const label filmPatchI,
|
const label filmPatchI,
|
||||||
const label primaryPatchI,
|
const label primaryPatchI,
|
||||||
const mappedPatchBase& distMap,
|
|
||||||
const regionModels::surfaceFilmModels::surfaceFilmModel&
|
const regionModels::surfaceFilmModels::surfaceFilmModel&
|
||||||
filmModel
|
filmModel
|
||||||
);
|
);
|
||||||
|
|||||||
@ -110,6 +110,11 @@ Foam::SprayCloud<CloudType>::SprayCloud
|
|||||||
|
|
||||||
Info << "Average parcel mass: " << averageParcelMass_ << endl;
|
Info << "Average parcel mass: " << averageParcelMass_ << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this->solution().resetSourcesOnStartup())
|
||||||
|
{
|
||||||
|
CloudType::resetSourceTerms();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,7 @@ Description
|
|||||||
#include "combineFaces.H"
|
#include "combineFaces.H"
|
||||||
#include "IOmanip.H"
|
#include "IOmanip.H"
|
||||||
#include "globalIndex.H"
|
#include "globalIndex.H"
|
||||||
|
#include "DynamicField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -1990,6 +1991,7 @@ Foam::label Foam::autoLayerDriver::checkAndUnmark
|
|||||||
(
|
(
|
||||||
const addPatchCellLayer& addLayer,
|
const addPatchCellLayer& addLayer,
|
||||||
const dictionary& meshQualityDict,
|
const dictionary& meshQualityDict,
|
||||||
|
const bool additionalReporting,
|
||||||
const List<labelPair>& baffles,
|
const List<labelPair>& baffles,
|
||||||
const indirectPrimitivePatch& pp,
|
const indirectPrimitivePatch& pp,
|
||||||
const fvMesh& newMesh,
|
const fvMesh& newMesh,
|
||||||
@ -2032,6 +2034,12 @@ Foam::label Foam::autoLayerDriver::checkAndUnmark
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Check if any of the faces in error uses any face of an added cell
|
// Check if any of the faces in error uses any face of an added cell
|
||||||
|
// - if additionalReporting print the few remaining areas for ease of
|
||||||
|
// finding out where the problems are.
|
||||||
|
|
||||||
|
const label nReportMax = 10;
|
||||||
|
DynamicField<point> disabledFaceCentres(nReportMax);
|
||||||
|
|
||||||
forAll(addedCells, oldPatchFaceI)
|
forAll(addedCells, oldPatchFaceI)
|
||||||
{
|
{
|
||||||
// Get the cells (in newMesh labels) per old patch face (in mesh
|
// Get the cells (in newMesh labels) per old patch face (in mesh
|
||||||
@ -2052,12 +2060,58 @@ Foam::label Foam::autoLayerDriver::checkAndUnmark
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if (additionalReporting && (nChanged < nReportMax))
|
||||||
|
{
|
||||||
|
disabledFaceCentres.append
|
||||||
|
(
|
||||||
|
pp.faceCentres()[oldPatchFaceI]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
nChanged++;
|
nChanged++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnReduce(nChanged, sumOp<label>());
|
|
||||||
|
label nChangedTotal = returnReduce(nChanged, sumOp<label>());
|
||||||
|
|
||||||
|
if (additionalReporting)
|
||||||
|
{
|
||||||
|
// Limit the number of points to be printed so that
|
||||||
|
// not too many points are reported when running in parallel
|
||||||
|
// Not accurate, i.e. not always nReportMax points are written,
|
||||||
|
// but this estimation avoid some communication here.
|
||||||
|
// The important thing, however, is that when only a few faces
|
||||||
|
// are disabled, their coordinates are printed, and this should be
|
||||||
|
// the case
|
||||||
|
label nReportLocal =
|
||||||
|
min
|
||||||
|
(
|
||||||
|
max(nChangedTotal / Pstream::nProcs(), 1),
|
||||||
|
min
|
||||||
|
(
|
||||||
|
nChanged,
|
||||||
|
max(nReportMax / Pstream::nProcs(), 1)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
Pout<< "Checked mesh with layers. Disabled extrusion at " << endl;
|
||||||
|
for (label i=0; i < nReportLocal; i++)
|
||||||
|
{
|
||||||
|
Pout<< " " << disabledFaceCentres[i] << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
label nReportTotal = returnReduce(nReportLocal, sumOp<label>());
|
||||||
|
|
||||||
|
if (nReportTotal < nChangedTotal)
|
||||||
|
{
|
||||||
|
Info<< "Suppressed disabled extrusion message for other "
|
||||||
|
<< nChangedTotal - nReportTotal << " faces." << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nChangedTotal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2858,6 +2912,7 @@ void Foam::autoLayerDriver::addLayers
|
|||||||
(
|
(
|
||||||
addLayer,
|
addLayer,
|
||||||
meshQualityDict,
|
meshQualityDict,
|
||||||
|
layerParams.additionalReporting(),
|
||||||
newMeshBaffles,
|
newMeshBaffles,
|
||||||
pp(),
|
pp(),
|
||||||
newMesh,
|
newMesh,
|
||||||
|
|||||||
@ -331,6 +331,7 @@ class autoLayerDriver
|
|||||||
(
|
(
|
||||||
const addPatchCellLayer& addLayer,
|
const addPatchCellLayer& addLayer,
|
||||||
const dictionary& motionDict,
|
const dictionary& motionDict,
|
||||||
|
const bool additionalReporting,
|
||||||
const List<labelPair>& baffles,
|
const List<labelPair>& baffles,
|
||||||
const indirectPrimitivePatch& pp,
|
const indirectPrimitivePatch& pp,
|
||||||
const fvMesh&,
|
const fvMesh&,
|
||||||
|
|||||||
@ -137,98 +137,98 @@ Foam::labelList Foam::layerParameters::readNumLayers
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from dictionary
|
//// Construct from dictionary
|
||||||
Foam::layerParameters::layerParameters
|
//Foam::layerParameters::layerParameters
|
||||||
(
|
//(
|
||||||
const PtrList<dictionary>& surfaceDicts,
|
// const PtrList<dictionary>& surfaceDicts,
|
||||||
const refinementSurfaces& refineSurfaces,
|
// const refinementSurfaces& refineSurfaces,
|
||||||
const labelList& globalToPatch,
|
// const labelList& globalToPatch,
|
||||||
const dictionary& dict,
|
// const dictionary& dict,
|
||||||
const polyBoundaryMesh& boundaryMesh
|
// const polyBoundaryMesh& boundaryMesh
|
||||||
)
|
//)
|
||||||
:
|
//:
|
||||||
numLayers_
|
// numLayers_
|
||||||
(
|
// (
|
||||||
readNumLayers
|
// readNumLayers
|
||||||
(
|
// (
|
||||||
surfaceDicts,
|
// surfaceDicts,
|
||||||
refineSurfaces,
|
// refineSurfaces,
|
||||||
globalToPatch,
|
// globalToPatch,
|
||||||
boundaryMesh
|
// boundaryMesh
|
||||||
)
|
// )
|
||||||
),
|
// ),
|
||||||
expansionRatio_
|
// expansionRatio_
|
||||||
(
|
// (
|
||||||
numLayers_.size(),
|
// numLayers_.size(),
|
||||||
readScalar(dict.lookup("expansionRatio"))
|
// readScalar(dict.lookup("expansionRatio"))
|
||||||
),
|
// ),
|
||||||
relativeSizes_(false),
|
// relativeSizes_(false),
|
||||||
finalLayerThickness_
|
// finalLayerThickness_
|
||||||
(
|
// (
|
||||||
numLayers_.size(),
|
// numLayers_.size(),
|
||||||
readScalar(dict.lookup("finalLayerRatio"))
|
// readScalar(dict.lookup("finalLayerRatio"))
|
||||||
),
|
// ),
|
||||||
minThickness_
|
// minThickness_
|
||||||
(
|
// (
|
||||||
numLayers_.size(),
|
// numLayers_.size(),
|
||||||
readScalar(dict.lookup("minThickness"))
|
// readScalar(dict.lookup("minThickness"))
|
||||||
),
|
// ),
|
||||||
featureAngle_(readScalar(dict.lookup("featureAngle"))),
|
// featureAngle_(readScalar(dict.lookup("featureAngle"))),
|
||||||
concaveAngle_
|
// concaveAngle_
|
||||||
(
|
// (
|
||||||
dict.lookupOrDefault("concaveAngle", defaultConcaveAngle)
|
// dict.lookupOrDefault("concaveAngle", defaultConcaveAngle)
|
||||||
),
|
// ),
|
||||||
nGrow_(readLabel(dict.lookup("nGrow"))),
|
// nGrow_(readLabel(dict.lookup("nGrow"))),
|
||||||
nSmoothSurfaceNormals_
|
// nSmoothSurfaceNormals_
|
||||||
(
|
// (
|
||||||
readLabel(dict.lookup("nSmoothSurfaceNormals"))
|
// readLabel(dict.lookup("nSmoothSurfaceNormals"))
|
||||||
),
|
// ),
|
||||||
nSmoothNormals_(readLabel(dict.lookup("nSmoothNormals"))),
|
// nSmoothNormals_(readLabel(dict.lookup("nSmoothNormals"))),
|
||||||
nSmoothThickness_(readLabel(dict.lookup("nSmoothThickness"))),
|
// nSmoothThickness_(readLabel(dict.lookup("nSmoothThickness"))),
|
||||||
maxFaceThicknessRatio_
|
// maxFaceThicknessRatio_
|
||||||
(
|
// (
|
||||||
readScalar(dict.lookup("maxFaceThicknessRatio"))
|
// readScalar(dict.lookup("maxFaceThicknessRatio"))
|
||||||
),
|
// ),
|
||||||
layerTerminationCos_
|
// layerTerminationCos_
|
||||||
(
|
// (
|
||||||
Foam::cos(degToRad(0.5*featureAngle_))
|
// Foam::cos(degToRad(0.5*featureAngle_))
|
||||||
),
|
// ),
|
||||||
maxThicknessToMedialRatio_
|
// maxThicknessToMedialRatio_
|
||||||
(
|
// (
|
||||||
readScalar(dict.lookup("maxThicknessToMedialRatio"))
|
// readScalar(dict.lookup("maxThicknessToMedialRatio"))
|
||||||
),
|
// ),
|
||||||
minMedianAxisAngleCos_
|
// minMedianAxisAngleCos_
|
||||||
(
|
// (
|
||||||
Foam::cos(degToRad(readScalar(dict.lookup("minMedianAxisAngle"))))
|
// Foam::cos(degToRad(readScalar(dict.lookup("minMedianAxisAngle"))))
|
||||||
),
|
// ),
|
||||||
nBufferCellsNoExtrude_
|
// nBufferCellsNoExtrude_
|
||||||
(
|
// (
|
||||||
readLabel(dict.lookup("nBufferCellsNoExtrude"))
|
// readLabel(dict.lookup("nBufferCellsNoExtrude"))
|
||||||
),
|
// ),
|
||||||
nSnap_(readLabel(dict.lookup("nSnap"))),
|
// nSnap_(readLabel(dict.lookup("nSnap"))),
|
||||||
nLayerIter_(readLabel(dict.lookup("nLayerIter"))),
|
// nLayerIter_(readLabel(dict.lookup("nLayerIter"))),
|
||||||
nRelaxedIter_(labelMax)
|
// nRelaxedIter_(labelMax)
|
||||||
{
|
//{
|
||||||
if (nGrow_ > 0)
|
// if (nGrow_ > 0)
|
||||||
{
|
// {
|
||||||
WarningIn("layerParameters::layerParameters(..)")
|
// WarningIn("layerParameters::layerParameters(..)")
|
||||||
<< "The nGrow parameter effect has changed with respect to 1.6.x."
|
// << "The nGrow parameter effect has changed with respect to 1.6.x."
|
||||||
<< endl
|
// << endl
|
||||||
<< "Please set nGrow=0 for 1.6.x behaviour."
|
// << "Please set nGrow=0 for 1.6.x behaviour."
|
||||||
<< endl;
|
// << endl;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
dict.readIfPresent("nRelaxedIter", nRelaxedIter_);
|
// dict.readIfPresent("nRelaxedIter", nRelaxedIter_);
|
||||||
|
//
|
||||||
if (nLayerIter_ < 0 || nRelaxedIter_ < 0)
|
// if (nLayerIter_ < 0 || nRelaxedIter_ < 0)
|
||||||
{
|
// {
|
||||||
FatalErrorIn("layerParameters::layerParameters(..)")
|
// FatalErrorIn("layerParameters::layerParameters(..)")
|
||||||
<< "Layer iterations should be >= 0." << endl
|
// << "Layer iterations should be >= 0." << endl
|
||||||
<< "nLayerIter:" << nLayerIter_
|
// << "nLayerIter:" << nLayerIter_
|
||||||
<< " nRelaxedIter:" << nRelaxedIter_
|
// << " nRelaxedIter:" << nRelaxedIter_
|
||||||
<< exit(FatalError);
|
// << exit(FatalError);
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
// Construct from dictionary
|
// Construct from dictionary
|
||||||
@ -289,7 +289,8 @@ Foam::layerParameters::layerParameters
|
|||||||
),
|
),
|
||||||
nSnap_(readLabel(dict.lookup("nRelaxIter"))),
|
nSnap_(readLabel(dict.lookup("nRelaxIter"))),
|
||||||
nLayerIter_(readLabel(dict.lookup("nLayerIter"))),
|
nLayerIter_(readLabel(dict.lookup("nLayerIter"))),
|
||||||
nRelaxedIter_(labelMax)
|
nRelaxedIter_(labelMax),
|
||||||
|
additionalReporting_(dict.lookupOrDefault("additionalReporting", false))
|
||||||
{
|
{
|
||||||
if (nGrow_ > 0)
|
if (nGrow_ > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -105,6 +105,7 @@ class layerParameters
|
|||||||
|
|
||||||
label nRelaxedIter_;
|
label nRelaxedIter_;
|
||||||
|
|
||||||
|
Switch additionalReporting_;
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
@ -128,15 +129,15 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary - old syntax
|
////- Construct from dictionary - old syntax
|
||||||
layerParameters
|
//layerParameters
|
||||||
(
|
//(
|
||||||
const PtrList<dictionary>& surfaceDicts,
|
// const PtrList<dictionary>& surfaceDicts,
|
||||||
const refinementSurfaces& refineSurfaces,
|
// const refinementSurfaces& refineSurfaces,
|
||||||
const labelList& globalToPatch,
|
// const labelList& globalToPatch,
|
||||||
const dictionary& dict,
|
// const dictionary& dict,
|
||||||
const polyBoundaryMesh& boundaryMesh
|
// const polyBoundaryMesh& boundaryMesh
|
||||||
);
|
//);
|
||||||
|
|
||||||
//- Construct from dictionary - new syntax
|
//- Construct from dictionary - new syntax
|
||||||
layerParameters(const dictionary& dict, const polyBoundaryMesh&);
|
layerParameters(const dictionary& dict, const polyBoundaryMesh&);
|
||||||
@ -259,6 +260,12 @@ public:
|
|||||||
return nSnap_;
|
return nSnap_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Switch& additionalReporting() const
|
||||||
|
{
|
||||||
|
return additionalReporting_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Overall
|
// Overall
|
||||||
|
|
||||||
//- Number of overall layer addition iterations
|
//- Number of overall layer addition iterations
|
||||||
|
|||||||
@ -97,9 +97,10 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::checkPatches
|
|||||||
boundBox bbSrc(srcPatch.points(), srcPatch.meshPoints());
|
boundBox bbSrc(srcPatch.points(), srcPatch.meshPoints());
|
||||||
boundBox bbTgt(tgtPatch.points(), tgtPatch.meshPoints());
|
boundBox bbTgt(tgtPatch.points(), tgtPatch.meshPoints());
|
||||||
|
|
||||||
bbTgt.inflate(maxBoundsError);
|
boundBox bbTgtInf(bbTgt);
|
||||||
|
bbTgtInf.inflate(maxBoundsError);
|
||||||
|
|
||||||
if (!bbTgt.contains(bbSrc))
|
if (!bbTgtInf.contains(bbSrc))
|
||||||
{
|
{
|
||||||
WarningIn
|
WarningIn
|
||||||
(
|
(
|
||||||
@ -109,14 +110,46 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::checkPatches
|
|||||||
"const primitivePatch&"
|
"const primitivePatch&"
|
||||||
")"
|
")"
|
||||||
) << "Source and target patch bounding boxes are not similar" << nl
|
) << "Source and target patch bounding boxes are not similar" << nl
|
||||||
<< " src span : " << bbSrc.span() << nl
|
<< " source box span : " << bbSrc.span() << nl
|
||||||
<< " tgt span : " << bbTgt.span() << nl
|
<< " target box span : " << bbTgt.span() << nl
|
||||||
<< " source: " << bbSrc << nl
|
<< " source box : " << bbSrc << nl
|
||||||
<< " target: " << bbTgt << endl;
|
<< " target box : " << bbTgt << nl
|
||||||
|
<< " inflated target box : " << bbTgtInf << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class SourcePatch, class TargetPatch>
|
||||||
|
bool Foam::AMIInterpolation<SourcePatch, TargetPatch>::distributed
|
||||||
|
(
|
||||||
|
const primitivePatch& srcPatch,
|
||||||
|
const primitivePatch& tgtPatch
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (Pstream::parRun())
|
||||||
|
{
|
||||||
|
List<label> facesPresentOnProc(Pstream::nProcs(), 0);
|
||||||
|
if ((srcPatch.size() > 0) || (tgtPatch.size() > 0))
|
||||||
|
{
|
||||||
|
facesPresentOnProc[Pstream::myProcNo()] = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
facesPresentOnProc[Pstream::myProcNo()] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Pstream::gatherList(facesPresentOnProc);
|
||||||
|
Pstream::scatterList(facesPresentOnProc);
|
||||||
|
if (sum(facesPresentOnProc) > 1)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class SourcePatch, class TargetPatch>
|
template<class SourcePatch, class TargetPatch>
|
||||||
Foam::label
|
Foam::label
|
||||||
Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcOverlappingProcs
|
Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcOverlappingProcs
|
||||||
@ -1158,7 +1191,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
|
|||||||
{
|
{
|
||||||
static label patchI = 0;
|
static label patchI = 0;
|
||||||
|
|
||||||
if (Pstream::parRun())
|
if (Pstream::parRun() && distributed(srcPatch, tgtPatch))
|
||||||
{
|
{
|
||||||
// convert local addressing to global addressing
|
// convert local addressing to global addressing
|
||||||
globalIndex globalSrcFaces(srcPatch.size());
|
globalIndex globalSrcFaces(srcPatch.size());
|
||||||
|
|||||||
@ -167,6 +167,13 @@ class AMIInterpolation
|
|||||||
|
|
||||||
// Parallel functionality
|
// Parallel functionality
|
||||||
|
|
||||||
|
//- Return true if faces are spread over multiple domains
|
||||||
|
bool distributed
|
||||||
|
(
|
||||||
|
const primitivePatch& srcPatch,
|
||||||
|
const primitivePatch& tgtPatch
|
||||||
|
);
|
||||||
|
|
||||||
label calcOverlappingProcs
|
label calcOverlappingProcs
|
||||||
(
|
(
|
||||||
const List<treeBoundBoxList>& procBb,
|
const List<treeBoundBoxList>& procBb,
|
||||||
|
|||||||
@ -112,6 +112,10 @@ public:
|
|||||||
NORMAL // use face normal + distance
|
NORMAL // use face normal + distance
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const NamedEnum<sampleMode, 4> sampleModeNames_;
|
||||||
|
|
||||||
|
static const NamedEnum<offsetMode, 3> offsetModeNames_;
|
||||||
|
|
||||||
|
|
||||||
//- Helper class for finding nearest
|
//- Helper class for finding nearest
|
||||||
// Nearest:
|
// Nearest:
|
||||||
@ -142,13 +146,9 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
|
|
||||||
// Private data
|
// Protected data
|
||||||
|
|
||||||
static const NamedEnum<sampleMode, 4> sampleModeNames_;
|
|
||||||
|
|
||||||
static const NamedEnum<offsetMode, 3> offsetModeNames_;
|
|
||||||
|
|
||||||
//- Patch to sample
|
//- Patch to sample
|
||||||
const polyPatch& patch_;
|
const polyPatch& patch_;
|
||||||
@ -199,7 +199,7 @@ private:
|
|||||||
dictionary surfDict_;
|
dictionary surfDict_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Collect single list of samples and originating processor+face.
|
//- Collect single list of samples and originating processor+face.
|
||||||
void collectSamples
|
void collectSamples
|
||||||
@ -339,6 +339,26 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Wrapper around map/interpolate data distribution
|
||||||
|
template<class Type>
|
||||||
|
void reverseDistribute(List<Type>& lst) const
|
||||||
|
{
|
||||||
|
switch (mode_)
|
||||||
|
{
|
||||||
|
case NEARESTPATCHFACEAMI:
|
||||||
|
{
|
||||||
|
lst = AMI().interpolateToTarget(Field<Type>(lst.xfer()));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
label cSize = patch_.size();
|
||||||
|
map().reverseDistribute(cSize, lst);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Return reference to the parallel distribution map
|
//- Return reference to the parallel distribution map
|
||||||
const mapDistribute& map() const
|
const mapDistribute& map() const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -53,4 +53,6 @@ fi
|
|||||||
|
|
||||||
wmake $makeType decompositionMethods
|
wmake $makeType decompositionMethods
|
||||||
|
|
||||||
|
wmake $makeType decompose
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
# ----------------------------------------------------------------- end-of-file
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user