Merge branch 'parallelTopo'
Conflicts: applications/utilities/mesh/manipulation/moveDyMEngineMesh/Make/options applications/utilities/mesh/manipulation/moveDyMEngineMesh/moveDyMEngineMesh.C applications/utilities/mesh/manipulation/setsToZones/setsToZones.C applications/utilities/parallelProcessing/decomposePar/decomposePar.C src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C src/decompositionMethods/decompositionMethods/patchConstrainedDecomp/patchConstrainedDecomp.C src/decompositionMethods/metisDecomp/metisDecomp.C src/dynamicMesh/topoChangerFvMesh/Make/files src/dynamicMesh/topoChangerFvMesh/mixerFvMesh/mixerFvMesh.C src/finiteArea/faMesh/faMesh.C src/finiteVolume/cfdTools/general/include/checkVolContinuity.H src/tetDecompositionFiniteElement/tetPolyMeshCellDecomp/tetPolyPatches/constraint/processor/calcProcessorTetPolyPatchCellDecompPointAddr.C src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C tutorials/incompressible/icoDyMFoam/movingConeTopo/system/decomposeParDict
This commit is contained in:
commit
b2cd738861
30 changed files with 391 additions and 168 deletions
|
@ -36,7 +36,6 @@ Description
|
|||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
# include "setRootCase.H"
|
||||
|
||||
# include "createTime.H"
|
||||
|
|
|
@ -69,6 +69,7 @@ int main(int argc, char *argv[])
|
|||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
bool meshChanged = mesh.update();
|
||||
reduce(meshChanged, orOp<bool>());
|
||||
|
||||
if (meshChanged)
|
||||
{
|
||||
|
|
|
@ -4,10 +4,12 @@ EXE_INC = \
|
|||
-I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||
-I$(LIB_SRC)/engine/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lengine \
|
||||
-lfiniteVolume \
|
||||
-ldynamicFvMesh \
|
||||
-ldynamicMesh \
|
||||
-ltopoChangerFvMesh \
|
||||
|
@ -17,6 +19,5 @@ EXE_LIBS = \
|
|||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lmeshTools \
|
||||
-lfiniteVolume \
|
||||
$(WM_DECOMP_LIBS) \
|
||||
-llduSolvers
|
||||
|
|
|
@ -6,6 +6,13 @@
|
|||
+ turbulence->divDevRhoReff(U)
|
||||
);
|
||||
|
||||
UEqn.relax();
|
||||
if (oCorr == nOuterCorr - 1)
|
||||
{
|
||||
UEqn.relax(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
UEqn.relax();
|
||||
}
|
||||
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
);
|
||||
basicPsiThermo& thermo = pThermo();
|
||||
|
||||
// Make density field with zero gradient boundary conditions to handle
|
||||
// attach-detach cases. HJ, 20/Mar/2011
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
|
@ -18,7 +20,8 @@
|
|||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
thermo.rho()
|
||||
thermo.rho(),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
rho.oldTime();
|
||||
|
||||
|
@ -73,6 +76,7 @@
|
|||
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
|
||||
);
|
||||
|
||||
volScalarField dpdt = fvc::ddt(p);
|
||||
|
||||
volScalarField rUA
|
||||
(
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
Pav << runTime.theta() << " " << p.weightedAverage(mesh.V()).value() << endl;
|
||||
Tav << runTime.theta() << " " << T.weightedAverage(mesh.V()).value() << endl;
|
||||
|
||||
Info << "Max T = " << max(T) << " K" << endl;
|
||||
Info << "Min T = " << min(T) << " K" << endl;
|
||||
Info << "Max p = " << max(p)/1.0e5 << " bar" << endl;
|
||||
Info << "Max T = " << max(T).value() << " K" << endl;
|
||||
Info << "Min T = " << min(T).value() << " K" << endl;
|
||||
Info << "Max p = " << max(p).value()/1.0e5 << " bar" << endl;
|
||||
|
||||
massBal << runTime.theta() << " "
|
||||
<< fvc::domainIntegrate(rho).value() << endl;
|
||||
volume << runTime.theta() << " " << sum(mesh.V()) << endl;
|
||||
|
||||
debugT << nl << "Crank angle: " << runTime.theta() << endl;
|
||||
debugT << "Max T = " << max(T) << " K" << endl;
|
||||
debugT << "Min T = " << min(T) << " K" << endl;
|
||||
debugT << "Max T = " << max(T).value() << " K" << endl;
|
||||
debugT << "Min T = " << min(T).value() << " K" << endl;
|
||||
|
||||
kav << runTime.theta() << " "
|
||||
<< (turbulence->k())().weightedAverage(mesh.V()).value() << endl;
|
||||
|
|
|
@ -2,45 +2,71 @@
|
|||
rho = thermo.rho();
|
||||
|
||||
rUA = 1.0/UEqn.A();
|
||||
H = UEqn.H();
|
||||
U = rUA*UEqn.H();
|
||||
|
||||
phi = fvc::interpolate(rho)
|
||||
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
|
||||
|
||||
// Store pressure for under-relaxation
|
||||
p.storePrevIter();
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
if (nOuterCorr != 1)
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi, p)
|
||||
+ fvc::div(phi)
|
||||
- fvm::laplacian(rho*rUA, p)
|
||||
);
|
||||
p.storePrevIter();
|
||||
}
|
||||
|
||||
pEqn.solve();
|
||||
if (transonic)
|
||||
{
|
||||
surfaceScalarField phid =
|
||||
fvc::interpolate(thermo.psi())*
|
||||
((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
phi += pEqn.flux();
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi, p)
|
||||
+ fvm::div(phid, p, "div(phid,p)")
|
||||
- fvm::laplacian(rho*rUA, p)
|
||||
);
|
||||
|
||||
pEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi == pEqn.flux();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
phi = fvc::interpolate(rho)*
|
||||
((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi, p)
|
||||
+ fvc::div(phi)
|
||||
- fvm::laplacian(rho*rUA, p)
|
||||
);
|
||||
|
||||
pEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi += pEqn.flux();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Explicitly relax pressure except for last corrector
|
||||
if (oCorr != nOuterCorr - 1)
|
||||
{
|
||||
p.relax();
|
||||
}
|
||||
|
||||
# include "rhoEqn.H"
|
||||
# include "compressibleContinuityErrs.H"
|
||||
|
||||
// Warning:
|
||||
// rho does not carry working boundary conditions and needs to be updated
|
||||
// strictly according to the thermodynamics package
|
||||
// HJ, 22/Aug/2007
|
||||
thermo.correct();
|
||||
rho = thermo.rho();
|
||||
|
||||
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
||||
|
||||
U -= rUA*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
|
||||
dpdt = fvc::ddt(p);
|
||||
}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
# include "readTimeControls.H"
|
||||
# include "readPISOControls.H"
|
||||
|
||||
bool correctPhi = false;
|
||||
if (piso.found("correctPhi"))
|
||||
{
|
||||
correctPhi = Switch(piso.lookup("correctPhi"));
|
||||
}
|
||||
|
||||
bool checkMeshCourantNo = false;
|
||||
if (piso.found("checkMeshCourantNo"))
|
||||
{
|
||||
checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
|
||||
}
|
|
@ -49,8 +49,8 @@ int main(int argc, char *argv[])
|
|||
# include "setRootCase.H"
|
||||
|
||||
# include "createEngineTime.H"
|
||||
# include "createDynamicFvMesh.H"
|
||||
# include "readPISOControls.H"
|
||||
# include "createEngineDynamicMesh.H"
|
||||
# include "readPIMPLEControls.H"
|
||||
# include "createFields.H"
|
||||
# include "initContinuityErrs.H"
|
||||
# include "readEngineTimeControls.H"
|
||||
|
@ -67,7 +67,9 @@ int main(int argc, char *argv[])
|
|||
|
||||
while (runTime.run())
|
||||
{
|
||||
# include "readControls.H"
|
||||
# include "readPIMPLEControls.H"
|
||||
# include "checkTotalVolume.H"
|
||||
# include "readEngineTimeControls.H"
|
||||
# include "compressibleCourantNo.H"
|
||||
# include "setDeltaT.H"
|
||||
|
||||
|
@ -75,38 +77,48 @@ int main(int argc, char *argv[])
|
|||
|
||||
Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;
|
||||
|
||||
// make phi relative
|
||||
|
||||
// Make flux absolute
|
||||
phi += meshFlux;
|
||||
|
||||
bool meshChanged = mesh.update();
|
||||
|
||||
if(meshChanged)
|
||||
# include "volContinuity.H"
|
||||
|
||||
mesh.setBoundaryVelocity(U);
|
||||
|
||||
if (meshChanged)
|
||||
{
|
||||
thermo.correct();
|
||||
|
||||
# include "checkTotalVolume.H"
|
||||
# include "compressibleCorrectPhi.H"
|
||||
# include "CourantNo.H"
|
||||
rho = thermo.rho();
|
||||
rho.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
meshFlux = fvc::interpolate(rho)*fvc::meshPhi(rho, U);
|
||||
|
||||
// Make phi absolute
|
||||
phi = fvc::interpolate(rho)
|
||||
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
|
||||
|
||||
phi -= meshFlux;
|
||||
DpDt = dpdt + fvc::div(phi/fvc::interpolate(rho), p)
|
||||
- fvc::div(phi/fvc::interpolate(rho) + fvc::meshPhi(U))*p;
|
||||
|
||||
# include "rhoEqn.H"
|
||||
|
||||
// --- SIMPLE loop
|
||||
for (int corr=1; corr<=nCorr; corr++)
|
||||
{
|
||||
# include "compressibleCourantNo.H"
|
||||
}
|
||||
|
||||
// Pressure-velocity corrector
|
||||
int oCorr = 0;
|
||||
do
|
||||
{
|
||||
# include "rhoEqn.H"
|
||||
# include "UEqn.H"
|
||||
|
||||
# include "hEqn.H"
|
||||
|
||||
# include "pEqn.H"
|
||||
}
|
||||
// --- PISO loop
|
||||
for (int corr = 1; corr <= nCorr; corr++)
|
||||
{
|
||||
# include "pEqn.H"
|
||||
# include "hEqn.H"
|
||||
}
|
||||
} while (++oCorr < nOuterCorr);
|
||||
|
||||
turbulence->correct();
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ int main(int argc, char *argv[])
|
|||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
bool meshChanged = mesh.update();
|
||||
reduce(meshChanged, orOp<bool>());
|
||||
|
||||
if (meshChanged)
|
||||
{
|
||||
|
|
|
@ -68,6 +68,7 @@ int main(int argc, char *argv[])
|
|||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
bool meshChanged = mesh.update();
|
||||
reduce(meshChanged, orOp<bool>());
|
||||
|
||||
# include "volContinuity.H"
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ int main(int argc, char *argv[])
|
|||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
bool meshChanged = mesh.update();
|
||||
reduce(meshChanged, orOp<bool>());
|
||||
|
||||
# include "volContinuity.H"
|
||||
|
||||
|
|
|
@ -70,8 +70,9 @@ int main(int argc, char *argv[])
|
|||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
bool meshChanged = mesh.update();
|
||||
reduce(meshChanged, orOp<bool>());
|
||||
|
||||
if (correctPhi && (mesh.moving() || meshChanged))
|
||||
if (correctPhi && meshChanged)
|
||||
{
|
||||
# include "correctPhi.H"
|
||||
}
|
||||
|
@ -79,7 +80,7 @@ int main(int argc, char *argv[])
|
|||
// Make the fluxes relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
if (mesh.moving() && checkMeshCourantNo)
|
||||
if (checkMeshCourantNo)
|
||||
{
|
||||
# include "meshCourantNo.H"
|
||||
}
|
||||
|
|
|
@ -82,28 +82,23 @@ int main(int argc, char *argv[])
|
|||
|
||||
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
||||
|
||||
// Do any mesh changes
|
||||
mesh.update();
|
||||
bool meshChanged = mesh.update();
|
||||
reduce(meshChanged, orOp<bool>());
|
||||
|
||||
if (mesh.changing())
|
||||
{
|
||||
Info<< "Execution time for mesh.update() = "
|
||||
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
|
||||
<< " s" << endl;
|
||||
}
|
||||
# include "volContinuity.H"
|
||||
|
||||
if (mesh.changing() && correctPhi)
|
||||
if (correctPhi && meshChanged)
|
||||
{
|
||||
#include "correctPhi.H"
|
||||
# include "correctPhi.H"
|
||||
}
|
||||
}
|
||||
|
||||
// Make the fluxes relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
if (mesh.changing() && checkMeshCourantNo)
|
||||
if (checkMeshCourantNo)
|
||||
{
|
||||
#include "meshCourantNo.H"
|
||||
# include "meshCourantNo.H"
|
||||
}
|
||||
|
||||
turbulence->correct();
|
||||
|
|
|
@ -75,22 +75,15 @@ int main(int argc, char *argv[])
|
|||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
|
||||
bool meshChanged = mesh.update();
|
||||
reduce(meshChanged, orOp<bool>());
|
||||
|
||||
// Do any mesh changes
|
||||
mesh.update();
|
||||
|
||||
if (mesh.changing())
|
||||
{
|
||||
Info<< "Execution time for mesh.update() = "
|
||||
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
|
||||
<< " s" << endl;
|
||||
}
|
||||
# include "volContinuity.H"
|
||||
|
||||
volScalarField gh("gh", g & mesh.C());
|
||||
surfaceScalarField ghf("ghf", g & mesh.Cf());
|
||||
|
||||
if (mesh.changing() && correctPhi)
|
||||
if (correctPhi && meshChanged)
|
||||
{
|
||||
# include "correctPhi.H"
|
||||
}
|
||||
|
@ -98,7 +91,7 @@ int main(int argc, char *argv[])
|
|||
// Make the fluxes relative to the mesh motion
|
||||
fvc::makeRelative(phi, U);
|
||||
|
||||
if (mesh.changing() && checkMeshCourantNo)
|
||||
if (checkMeshCourantNo)
|
||||
{
|
||||
# include "meshCourantNo.H"
|
||||
}
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/engine/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
$(WM_DECOMP_INC)
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-ldynamicMesh \
|
||||
-ldynamicFvMesh \
|
||||
-lmeshTools \
|
||||
-ldynamicMesh \
|
||||
-lengine \
|
||||
-lmeshTools \
|
||||
$(WM_DECOMP_LIBS) \
|
||||
-llduSolvers
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
{
|
||||
// Volume and motion flux check
|
||||
|
||||
scalar newTotalVolume = sum(mesh.V()).value();
|
||||
|
||||
motionContErr =
|
||||
fvc::ddt(dimensionedScalar("1", dimless, 1.0), mesh)
|
||||
- fvc::div(fvc::meshPhi(U));
|
||||
|
||||
scalar sumLocalContErr = runTime.deltaT().value()*
|
||||
mag(motionContErr)().weightedAverage(mesh.V()).value();
|
||||
|
||||
scalar maxContErr =
|
||||
runTime.deltaT().value()*max(motionContErr.internalField());
|
||||
|
||||
Info<< "Volume: new = " << newTotalVolume << " old = " << totalVolume
|
||||
<< " change = " << Foam::mag(newTotalVolume - totalVolume) << nl
|
||||
<< "Motion continuity errors : sum local = " << sumLocalContErr
|
||||
<< ", maximum = " << maxContErr
|
||||
<< endl;
|
||||
|
||||
totalVolume = newTotalVolume;
|
||||
}
|
|
@ -26,7 +26,7 @@ Application
|
|||
moveDynamicMesh
|
||||
|
||||
Description
|
||||
Mesh motion and topological mesh changes run for an engine geometry
|
||||
Mesh motion and topological mesh changes utility for an engine geometry
|
||||
|
||||
Author
|
||||
Hrvoje Jasak, Wikki Ltd. All rights reserved
|
||||
|
@ -36,56 +36,48 @@ Author
|
|||
#include "fvCFD.H"
|
||||
#include "engineTime.H"
|
||||
#include "engineTopoChangerMesh.H"
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
#include "OFstream.H"
|
||||
|
||||
using namespace Foam;
|
||||
>>>>>>> parallelTopo
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createEngineTime.H"
|
||||
# include "createEngineDynamicMesh.H"
|
||||
|
||||
scalar totalVolume = sum(mesh.V()).value();
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector("zero", dimVelocity, vector::zero)
|
||||
);
|
||||
|
||||
volScalarField motionContErr
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"motionContErr",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
fvc::ddt(dimensionedScalar("1", dimless, 1.0), mesh),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
fileName path = runTime.caseName();
|
||||
OFstream volFile(path+"/totVol.Cyl");
|
||||
|
||||
while (runTime.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
mesh.update();
|
||||
// mesh.checkMesh(true);
|
||||
volFile << runTime.timeName() << "\t" << sum(mesh.V()).value() << endl;
|
||||
|
||||
# include "checkTotalVolume.H"
|
||||
if (isDir(runTime.path()/"VTK"))
|
||||
{
|
||||
Info << "Clear VTK directory" << endl;
|
||||
rmDir(runTime.path()/"VTK");
|
||||
}
|
||||
|
||||
mesh.update();
|
||||
|
||||
# include "checkVolContinuity.H"
|
||||
|
||||
if(checkEngineMesh)
|
||||
{
|
||||
mesh.checkMesh(true);
|
||||
}
|
||||
|
||||
volFile << runTime.timeName() << tab << sum(mesh.V()).value() << endl;
|
||||
|
||||
runTime.write();
|
||||
|
||||
|
|
|
@ -30,7 +30,11 @@ Description
|
|||
condition which denotes the side of the face. This application
|
||||
reads a cellSet (xxxMasterCells if 'xxx' is the name of the faceSet) which
|
||||
is the masterCells of the zone. Master cell is the one IN FRONT of the
|
||||
<<<<<<< HEAD
|
||||
face, ie. the one INTO which the face normal points. If master cells are
|
||||
=======
|
||||
face, ie. the one into which the face normal points. If master cells are
|
||||
>>>>>>> parallelTopo
|
||||
not found, take faces without a flip
|
||||
|
||||
If one is not interested in sidedness specify the -noFlipMap
|
||||
|
|
|
@ -144,9 +144,51 @@ int main(int argc, char *argv[])
|
|||
|
||||
// Mesh write will be controlled by hand
|
||||
meshPtr->write();
|
||||
procMeshes.writeAddressing();
|
||||
meshPtr->setMotionWriteOpt(IOobject::NO_WRITE);
|
||||
meshPtr->setTopoWriteOpt(IOobject::NO_WRITE);
|
||||
|
||||
// Write cell decomposition
|
||||
if (writeCellDist)
|
||||
{
|
||||
// Write as volScalarField for post-processing
|
||||
Info<< "Writing cellDist to time " << runTime.timeName()
|
||||
<< endl;
|
||||
volScalarField cellDist
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"cellDist",
|
||||
runTime.timeName(),
|
||||
meshPtr(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
meshPtr(),
|
||||
dimensionedScalar("cellDist", dimless, 0),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
scalarField& cellDistIn = cellDist.internalField();
|
||||
|
||||
label cellI = 0;
|
||||
|
||||
forAll (procMeshes.meshes(), procI)
|
||||
{
|
||||
for
|
||||
(
|
||||
label i = 0;
|
||||
i < procMeshes.meshes()[procI].nCells();
|
||||
i++
|
||||
)
|
||||
{
|
||||
cellDistIn[cellI] = procI;
|
||||
cellI++;
|
||||
}
|
||||
}
|
||||
|
||||
cellDist.write();
|
||||
}
|
||||
|
||||
// Get region prefix for lagrangian
|
||||
fileName regionPrefix = "";
|
||||
if (regionName != fvMesh::defaultRegion)
|
||||
|
@ -221,7 +263,9 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (writeCellDist)
|
||||
{
|
||||
// Write as volScalarField for postprocessing.
|
||||
// Write as volScalarField for post-processing
|
||||
Info<< "Writing cellDist to time " << runTime.timeName()
|
||||
<< endl;
|
||||
volScalarField cellDist
|
||||
(
|
||||
IOobject
|
||||
|
|
|
@ -293,7 +293,7 @@ void printMeshData(Ostream& os, const polyMesh& mesh)
|
|||
}
|
||||
|
||||
|
||||
// Debugging: write volScalarField with decomposition for post processing.
|
||||
// Debugging: write volScalarField with decomposition for post-processing.
|
||||
void writeDecomposition
|
||||
(
|
||||
const word& name,
|
||||
|
@ -302,7 +302,7 @@ void writeDecomposition
|
|||
)
|
||||
{
|
||||
Info<< "Writing wanted cell distribution to volScalarField " << name
|
||||
<< " for postprocessing purposes." << nl << endl;
|
||||
<< " for post-processing purposes." << nl << endl;
|
||||
|
||||
volScalarField procCells
|
||||
(
|
||||
|
|
|
@ -178,13 +178,10 @@ public:
|
|||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
timeSelector::addOptions();
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
|
|
|
@ -40,6 +40,8 @@ DebugSwitches
|
|||
mixingPlane 0;
|
||||
MixingPlaneInterpolation 0;
|
||||
|
||||
tetFemVectorMatrix 0;
|
||||
|
||||
overlapGgi 0;
|
||||
cyclicGgi 0;
|
||||
coupledLduMatrix 1;
|
||||
|
|
|
@ -1014,8 +1014,10 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChanger::changeMesh
|
|||
) << "Face " << faceI << " in the new mesh is not "
|
||||
<< "mapped correctly." << nl
|
||||
<< "It uses a removed or a non-existing vertex or "
|
||||
<< "has been skipped ." << nl
|
||||
<< "Face before mapping: " << oldFace << nl
|
||||
<< "has been skipped." << nl
|
||||
<< "Face before mapping: " << oldFace << " with points "
|
||||
<< oldFace.points(newPointsZeroVol) << nl
|
||||
<< mesh.allPoints().size() << nl
|
||||
<< "Face after mapping: " << renumberedFace << nl
|
||||
<< "Max new vertex index: "
|
||||
<< newPointsZeroVol.size() - 1 << "." << nl
|
||||
|
@ -1098,6 +1100,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChanger::changeMesh
|
|||
|
||||
if (rotate != 0)
|
||||
{
|
||||
Info<< "Rotating face" << endl;
|
||||
newFaces[faceI] = rotateFace(newFaces[faceI], rotate);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ cd ${0%/*} || exit 1 # run from this directory
|
|||
set -x
|
||||
|
||||
# Make meshMotion solvers
|
||||
wmake libso solidBodyMotion
|
||||
wmake libso fvMotionSolver
|
||||
wmake libso RBFMotionSolver
|
||||
wmake libso mesquiteMotionSolver
|
||||
|
|
|
@ -310,10 +310,17 @@ void Foam::mixerFvMesh::calcMovingMask() const
|
|||
(
|
||||
word(dict_.subDict("slider").lookup("moving")) + "Zone"
|
||||
);
|
||||
<<<<<<< HEAD
|
||||
|
||||
const labelList& movingSliderAddr =
|
||||
faceZones()[faceZones().findZoneID(movingSliderZoneName)];
|
||||
|
||||
=======
|
||||
|
||||
const labelList& movingSliderAddr =
|
||||
faceZones()[faceZones().findZoneID(movingSliderZoneName)];
|
||||
|
||||
>>>>>>> parallelTopo
|
||||
forAll (movingSliderAddr, faceI)
|
||||
{
|
||||
const face& curFace = f[movingSliderAddr[faceI]];
|
||||
|
@ -479,6 +486,7 @@ bool Foam::mixerFvMesh::update()
|
|||
mappedOldPointsNew.map(oldPointsNew, topoChangeMap->pointMap());
|
||||
|
||||
movePoints(mappedOldPointsNew);
|
||||
<<<<<<< HEAD
|
||||
|
||||
resetMotion();
|
||||
setV0();
|
||||
|
@ -497,6 +505,27 @@ bool Foam::mixerFvMesh::update()
|
|||
// Move the sliding interface points to correct position
|
||||
movePoints(newPoints);
|
||||
}
|
||||
=======
|
||||
|
||||
resetMotion();
|
||||
setV0();
|
||||
|
||||
// Move the sliding interface points to correct position
|
||||
movePoints(topoChangeMap->preMotionPoints());
|
||||
}
|
||||
else
|
||||
{
|
||||
pointField newPoints = allPoints();
|
||||
movePoints(oldPointsNew);
|
||||
|
||||
resetMotion();
|
||||
setV0();
|
||||
|
||||
// Move the sliding interface points to correct position
|
||||
movePoints(newPoints);
|
||||
}
|
||||
|
||||
>>>>>>> parallelTopo
|
||||
}
|
||||
|
||||
return topoChangeMap->morphing();
|
||||
|
|
|
@ -582,12 +582,17 @@ Foam::faMesh::faMesh
|
|||
// Check for processor edges
|
||||
labelList allUndefEdges = tmpList;
|
||||
labelList ngbPolyPatch(allUndefEdges.size(), -1);
|
||||
<<<<<<< HEAD
|
||||
forAll (ngbPolyPatch, edgeI)
|
||||
=======
|
||||
forAll(ngbPolyPatch, edgeI)
|
||||
>>>>>>> parallelTopo
|
||||
{
|
||||
label curEdge = allUndefEdges[edgeI];
|
||||
|
||||
label curPMeshEdge = meshEdges[curEdge];
|
||||
|
||||
<<<<<<< HEAD
|
||||
forAll (edgeFaces[curPMeshEdge], faceI)
|
||||
{
|
||||
label curFace = edgeFaces[curPMeshEdge][faceI];
|
||||
|
@ -597,10 +602,22 @@ Foam::faMesh::faMesh
|
|||
label polyPatchID =
|
||||
pMesh.boundaryMesh().whichPatch(curFace);
|
||||
|
||||
=======
|
||||
forAll(edgeFaces[curPMeshEdge], faceI)
|
||||
{
|
||||
label curFace = edgeFaces[curPMeshEdge][faceI];
|
||||
|
||||
if (findIndex(faceLabels_, curFace) == -1)
|
||||
{
|
||||
label polyPatchID =
|
||||
m.boundaryMesh().whichPatch(curFace);
|
||||
|
||||
>>>>>>> parallelTopo
|
||||
if (polyPatchID != -1)
|
||||
{
|
||||
ngbPolyPatch[edgeI] = polyPatchID;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -620,6 +637,25 @@ Foam::faMesh::faMesh
|
|||
)
|
||||
{
|
||||
if (!processorPatchSet.found(ngbPolyPatch[edgeI]))
|
||||
=======
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Count ngb processorPolyPatch-es
|
||||
labelHashSet processorPatchSet;
|
||||
forAll(ngbPolyPatch, edgeI)
|
||||
{
|
||||
if (ngbPolyPatch[edgeI] != -1)
|
||||
{
|
||||
if
|
||||
(
|
||||
m.boundaryMesh()[ngbPolyPatch[edgeI]].type()
|
||||
== processorPolyPatch::typeName
|
||||
)
|
||||
{
|
||||
if(!processorPatchSet.found(ngbPolyPatch[edgeI]))
|
||||
>>>>>>> parallelTopo
|
||||
{
|
||||
processorPatchSet.insert(ngbPolyPatch[edgeI]);
|
||||
}
|
||||
|
@ -629,7 +665,11 @@ Foam::faMesh::faMesh
|
|||
labelList processorPatches(processorPatchSet.toc());
|
||||
faPatches.setSize(faPatches.size() + processorPatches.size());
|
||||
|
||||
<<<<<<< HEAD
|
||||
for (label i=0; i<processorPatches.size(); i++)
|
||||
=======
|
||||
for(label i=0; i<processorPatches.size(); i++)
|
||||
>>>>>>> parallelTopo
|
||||
{
|
||||
SLList<label> tmpLst;
|
||||
|
||||
|
@ -640,6 +680,7 @@ Foam::faMesh::faMesh
|
|||
tmpLst.append(allUndefEdges[eI]);
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
faPatches[faPatchNames.size() + i].edgeLabels_ = tmpLst;
|
||||
|
||||
|
@ -649,18 +690,31 @@ Foam::faMesh::faMesh
|
|||
faPatches[faPatchNames.size() + i].type_ =
|
||||
processorFaPatch::typeName;
|
||||
|
||||
=======
|
||||
|
||||
faPatches[faPatchNames.size() + i].edgeLabels_ = tmpLst;
|
||||
faPatches[faPatchNames.size() + i].name_ =
|
||||
m.boundaryMesh()[processorPatches[i]].name();
|
||||
faPatches[faPatchNames.size() + i].type_ =
|
||||
processorFaPatch::typeName;
|
||||
>>>>>>> parallelTopo
|
||||
faPatches[faPatchNames.size() + i].ngbPolyPatchID_ =
|
||||
processorPatches[i];
|
||||
}
|
||||
|
||||
// Remaining undefined edges
|
||||
SLList<label> undefEdges;
|
||||
<<<<<<< HEAD
|
||||
forAll (ngbPolyPatch, eI)
|
||||
=======
|
||||
forAll(ngbPolyPatch, eI)
|
||||
>>>>>>> parallelTopo
|
||||
{
|
||||
if (ngbPolyPatch[eI] == -1)
|
||||
{
|
||||
undefEdges.append(allUndefEdges[eI]);
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
else if
|
||||
(
|
||||
!isA<processorPolyPatch>
|
||||
|
@ -670,6 +724,15 @@ Foam::faMesh::faMesh
|
|||
)
|
||||
{
|
||||
undefEdges.append(allUndefEdges[eI]);
|
||||
=======
|
||||
else if
|
||||
(
|
||||
m.boundaryMesh()[ngbPolyPatch[eI]].type()
|
||||
!= processorPolyPatch::typeName
|
||||
)
|
||||
{
|
||||
undefEdges.append(allUndefEdges[eI]);
|
||||
>>>>>>> parallelTopo
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -683,6 +746,7 @@ Foam::faMesh::faMesh
|
|||
}
|
||||
else
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
faPatches.setSize(faPatches.size() - 1);
|
||||
}
|
||||
}
|
||||
|
@ -732,8 +796,60 @@ Foam::faMesh::faMesh
|
|||
}
|
||||
|
||||
faPatches[patchI].edgeLabels_ = reorderedEdgeLabels;
|
||||
=======
|
||||
faPatches.setSize(faPatches.size()-1);
|
||||
>>>>>>> parallelTopo
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
faPatches.setSize(faPatches.size()-1);
|
||||
}
|
||||
|
||||
|
||||
// Reorder processorFaPatch using
|
||||
// ordering of ngb processorPolyPatch
|
||||
forAll(faPatches, patchI)
|
||||
{
|
||||
if (faPatches[patchI].type_ == processorFaPatch::typeName)
|
||||
{
|
||||
labelList ngbFaces(faPatches[patchI].edgeLabels_.size(), -1);
|
||||
|
||||
forAll(ngbFaces, edgeI)
|
||||
{
|
||||
label curEdge = faPatches[patchI].edgeLabels_[edgeI];
|
||||
|
||||
label curPMeshEdge = meshEdges[curEdge];
|
||||
|
||||
forAll(edgeFaces[curPMeshEdge], faceI)
|
||||
{
|
||||
label curFace = edgeFaces[curPMeshEdge][faceI];
|
||||
|
||||
label curPatchID =
|
||||
m.boundaryMesh().whichPatch(curFace);
|
||||
|
||||
if (curPatchID == faPatches[patchI].ngbPolyPatchID_)
|
||||
{
|
||||
ngbFaces[edgeI] = curFace;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SortableList<label> sortedNgbFaces(ngbFaces);
|
||||
labelList reorderedEdgeLabels(ngbFaces.size(), -1);
|
||||
for (label i=0; i<reorderedEdgeLabels.size(); i++)
|
||||
{
|
||||
reorderedEdgeLabels[i] =
|
||||
faPatches[patchI].edgeLabels_
|
||||
[
|
||||
sortedNgbFaces.indices()[i]
|
||||
];
|
||||
}
|
||||
|
||||
faPatches[patchI].edgeLabels_ = reorderedEdgeLabels;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Add good patches to faMesh
|
||||
|
@ -754,6 +870,7 @@ Foam::faMesh::faMesh
|
|||
if (faPatches[pI].ngbPolyPatchID_ == -1)
|
||||
{
|
||||
FatalErrorIn
|
||||
<<<<<<< HEAD
|
||||
(
|
||||
"void faMesh::faMesh(const polyMesh&, const fileName&)"
|
||||
)
|
||||
|
@ -766,12 +883,30 @@ Foam::faMesh::faMesh
|
|||
refCast<const processorPolyPatch>
|
||||
(
|
||||
pMesh.boundaryMesh()[faPatches[pI].ngbPolyPatchID_]
|
||||
=======
|
||||
(
|
||||
"void faMesh::faMesh(const polyMesh&, const fileName&)"
|
||||
)
|
||||
<< "ngbPolyPatch is not defined for processorFaPatch: "
|
||||
<< faPatches[pI].name_
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
const processorPolyPatch& procPolyPatch =
|
||||
refCast<const processorPolyPatch>
|
||||
(
|
||||
m.boundaryMesh()[faPatches[pI].ngbPolyPatchID_]
|
||||
>>>>>>> parallelTopo
|
||||
);
|
||||
|
||||
faPatches[pI].dict_.add("myProcNo", procPolyPatch.myProcNo());
|
||||
faPatches[pI].dict_.add
|
||||
(
|
||||
<<<<<<< HEAD
|
||||
"neighbProcNo",
|
||||
=======
|
||||
"neighbProcNo",
|
||||
>>>>>>> parallelTopo
|
||||
procPolyPatch.neighbProcNo()
|
||||
);
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ public:
|
|||
public:
|
||||
|
||||
// Constructors
|
||||
|
||||
|
||||
fieldScheme
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field,
|
||||
|
|
|
@ -63,6 +63,8 @@ solvers
|
|||
SIMPLE
|
||||
{
|
||||
nNonOrthogonalCorrectors 0;
|
||||
|
||||
convergence 1e-4;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
|
|
|
@ -16,7 +16,14 @@ FoamFile
|
|||
|
||||
solvers
|
||||
{
|
||||
motionU ICCG 1e-9 0.001;
|
||||
motionU
|
||||
{
|
||||
solver CG;
|
||||
preconditioner Cholesky;
|
||||
|
||||
tolerance 1e-09;
|
||||
relTol 0.001;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
Reference in a new issue