Fixing snappyHexMesh tut conflict

This commit is contained in:
graham
2009-07-06 14:40:38 +01:00
220 changed files with 57034 additions and 96655 deletions

View File

@ -41,17 +41,16 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
# include "setRootCase.H"
#include "createTime.H"
#include "createMeshNoClear.H"
#include "readTransportProperties.H"
#include "createFields.H"
#include "readTurbulenceProperties.H"
#include "initContinuityErrs.H"
# include "createTime.H"
# include "createMeshNoClear.H"
# include "readTransportProperties.H"
# include "createFields.H"
# include "readTurbulenceProperties.H"
# include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< nl << "Starting time loop" << endl;
@ -59,7 +58,7 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readPISOControls.H"
#include "readPISOControls.H"
force.internalField() = ReImSum
(
@ -69,12 +68,12 @@ int main(int argc, char *argv[])
)
);
# include "globalProperties.H"
#include "globalProperties.H"
fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
fvm::ddt(U)
+ fvm::div(phi, U)
- fvm::laplacian(nu, U)
==
force
@ -90,7 +89,7 @@ int main(int argc, char *argv[])
volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);
fvScalarMatrix pEqn
@ -102,7 +101,7 @@ int main(int argc, char *argv[])
phi -= pEqn.flux();
# include "continuityErrs.H"
#include "continuityErrs.H"
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();

View File

@ -77,7 +77,6 @@ int main(int argc, char *argv[])
#include "readCombustionProperties.H"
#include "readEnvironmentalProperties.H"
#include "createFields.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "CourantNo.H"

View File

@ -61,50 +61,49 @@ Description
int main(int argc, char *argv[])
{
# include "setRootCase.H"
#include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "readCombustionProperties.H"
# include "readEnvironmentalProperties.H"
# include "createFields.H"
# include "readPISOControls.H"
# include "initContinuityErrs.H"
# include "readTimeControls.H"
# include "compressibleCourantNo.H"
# include "setInitialDeltaT.H"
#include "createTime.H"
#include "createMesh.H"
#include "readCombustionProperties.H"
#include "readEnvironmentalProperties.H"
#include "createFields.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
# include "readTimeControls.H"
# include "readPISOControls.H"
# include "compressibleCourantNo.H"
# include "setDeltaT.H"
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "rhoEqn.H"
# include "UEqn.H"
#include "rhoEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
# include "ftEqn.H"
# include "bEqn.H"
# include "huEqn.H"
# include "hEqn.H"
#include "ftEqn.H"
#include "bEqn.H"
#include "huEqn.H"
#include "hEqn.H"
if (!ign.ignited())
{
hu == h;
}
# include "pEqn.H"
#include "pEqn.H"
}
turbulence->correct();

View File

@ -67,7 +67,6 @@ int main(int argc, char *argv[])
#include "createEngineTime.H"
#include "createEngineMesh.H"
#include "readPISOControls.H"
#include "readCombustionProperties.H"
#include "createFields.H"
#include "initContinuityErrs.H"

View File

@ -43,14 +43,13 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;

View File

@ -40,14 +40,13 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "initContinuityErrs.H"
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
# include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -55,17 +54,17 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readSIMPLEControls.H"
# include "initConvergenceCheck.H"
#include "readSIMPLEControls.H"
#include "initConvergenceCheck.H"
p.storePrevIter();
rho.storePrevIter();
// Pressure-velocity SIMPLE corrector
{
# include "UEqn.H"
# include "hEqn.H"
# include "pEqn.H"
#include "UEqn.H"
#include "hEqn.H"
#include "pEqn.H"
}
turbulence->correct();
@ -75,7 +74,7 @@ int main(int argc, char *argv[])
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
# include "convergenceCheck.H"
#include "convergenceCheck.H"
}
Info<< "End\n" << endl;

View File

@ -42,14 +42,13 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readThermodynamicProperties.H"
#include "createFields.H"
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "readThermodynamicProperties.H"
# include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -57,10 +56,10 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.value() << nl << endl;
# include "readPISOControls.H"
#include "readPISOControls.H"
scalar HbyAblend = readScalar(piso.lookup("HbyAblend"));
# include "readTimeControls.H"
#include "readTimeControls.H"
scalar CoNum = max
(
@ -70,7 +69,7 @@ int main(int argc, char *argv[])
Info<< "Max Courant Number = " << CoNum << endl;
# include "setDeltaT.H"
#include "setDeltaT.H"
for (int outerCorr=0; outerCorr<nOuterCorr; outerCorr++)
{
@ -145,9 +144,9 @@ int main(int argc, char *argv[])
phi -= phiGradp;
# include "resetPhiPatches.H"
#include "resetPhiPatches.H"
surfaceScalarField rhof =
surfaceScalarField rhof =
mvConvection.interpolationScheme()()(rho)()
.interpolate(rho);
@ -165,7 +164,7 @@ int main(int argc, char *argv[])
phi += phiGradp + pEqn.flux();
rho = psi*p;
rhof =
rhof =
mvConvection.interpolationScheme()()(rho)()
.interpolate(rho);
phiv = phi/rhof;

View File

@ -7,7 +7,7 @@
basicPsiThermo& thermo = pThermo();
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
volScalarField& e = thermo.e();
const volScalarField& psi = thermo.psi();
volScalarField rho

View File

@ -72,7 +72,7 @@ int main(int argc, char *argv[])
solve(UEqn == -fvc::grad(p));
#include "hEqn.H"
#include "eEqn.H"
// --- PISO loop

View File

@ -36,14 +36,13 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
# include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting iteration loop\n" << endl;

View File

@ -26,7 +26,7 @@ Application
mhdFoam
Description
Solver for magnetohydrodynamics (MHD): incompressible, laminar flow of a
Solver for magnetohydrodynamics (MHD): incompressible, laminar flow of a
conducting fluid under the influence of a magnetic field.
An applied magnetic field H acts as a driving force,
@ -58,27 +58,25 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
# include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "initContinuityErrs.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
# include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< nl << "Starting time loop" << endl;
while (runTime.loop())
{
# include "readPISOControls.H"
# include "readBPISOControls.H"
#include "readPISOControls.H"
#include "readBPISOControls.H"
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "CourantNo.H"
#include "CourantNo.H"
{
fvVectorMatrix UEqn
@ -101,7 +99,7 @@ int main(int argc, char *argv[])
U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
@ -120,7 +118,7 @@ int main(int argc, char *argv[])
}
}
# include "continuityErrs.H"
#include "continuityErrs.H"
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
@ -154,7 +152,7 @@ int main(int argc, char *argv[])
phiB -= pBEqn.flux();
# include "magneticFieldErr.H"
#include "magneticFieldErr.H"
}
runTime.write();

View File

@ -38,14 +38,13 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< nl << "Calculating value(price of comodities)" << endl;

View File

@ -30,18 +30,18 @@ Description
Uses the Boussinesq approximation:
\f[
rho_{eff} = 1 - beta(T - T_{ref})
rho_{k} = 1 - beta(T - T_{ref})
\f]
where:
\f$ rho_{eff} \f$ = the effective (driving) density
\f$ rho_{k} \f$ = the effective (driving) kinematic density
beta = thermal expansion coefficient [1/K]
T = temperature [K]
\f$ T_{ref} \f$ = reference temperature [K]
Valid when:
\f[
rho_{eff} << 1
rho_{k} << 1
\f]
\*---------------------------------------------------------------------------*/

View File

@ -47,14 +47,13 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
# include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;

View File

@ -36,15 +36,14 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
# include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "initContinuityErrs.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
# include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -52,8 +51,8 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readPISOControls.H"
# include "CourantNo.H"
#include "readPISOControls.H"
#include "CourantNo.H"
fvVectorMatrix UEqn
(
@ -92,7 +91,7 @@ int main(int argc, char *argv[])
}
}
# include "continuityErrs.H"
#include "continuityErrs.H"
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();

View File

@ -37,15 +37,14 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
# include "setRootCase.H"
#include "createTime.H"
#include "createMeshNoClear.H"
#include "createFields.H"
#include "initContinuityErrs.H"
# include "createTime.H"
# include "createMeshNoClear.H"
# include "createFields.H"
# include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -53,8 +52,8 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readPISOControls.H"
# include "CourantNo.H"
#include "readPISOControls.H"
#include "CourantNo.H"
fluid.correct();
@ -95,7 +94,7 @@ int main(int argc, char *argv[])
}
}
# include "continuityErrs.H"
#include "continuityErrs.H"
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();

View File

@ -42,29 +42,28 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
# include "setRootCase.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "readPIMPLEControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "readTimeControls.H"
# include "createTime.H"
# include "createDynamicFvMesh.H"
# include "readPIMPLEControls.H"
# include "initContinuityErrs.H"
# include "createFields.H"
# include "readTimeControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
# include "readControls.H"
# include "CourantNo.H"
#include "readControls.H"
#include "CourantNo.H"
// Make the fluxes absolute
fvc::makeAbsolute(phi, U);
# include "setDeltaT.H"
#include "setDeltaT.H"
runTime++;
@ -74,7 +73,7 @@ int main(int argc, char *argv[])
if (mesh.changing() && correctPhi)
{
# include "correctPhi.H"
#include "correctPhi.H"
}
// Make the fluxes relative to the mesh motion
@ -82,7 +81,7 @@ int main(int argc, char *argv[])
if (mesh.changing() && checkMeshCourantNo)
{
# include "meshCourantNo.H"
#include "meshCourantNo.H"
}
// --- PIMPLE loop
@ -93,7 +92,7 @@ int main(int argc, char *argv[])
p.storePrevIter();
}
# include "UEqn.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
@ -138,7 +137,7 @@ int main(int argc, char *argv[])
}
}
# include "continuityErrs.H"
#include "continuityErrs.H"
// Explicitly relax pressure for momentum corrector
if (ocorr != nOuterCorr-1)

View File

@ -38,14 +38,13 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "initContinuityErrs.H"
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"
# include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -53,15 +52,15 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readSIMPLEControls.H"
# include "initConvergenceCheck.H"
#include "readSIMPLEControls.H"
#include "initConvergenceCheck.H"
p.storePrevIter();
// Pressure-velocity SIMPLE corrector
{
# include "UEqn.H"
# include "pEqn.H"
#include "UEqn.H"
#include "pEqn.H"
}
turbulence->correct();
@ -72,7 +71,7 @@ int main(int argc, char *argv[])
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
# include "convergenceCheck.H"
#include "convergenceCheck.H"
}
Info<< "End\n" << endl;

View File

@ -55,7 +55,6 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "createClouds.H"
#include "createRadiationModel.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"

View File

@ -61,7 +61,6 @@ int main(int argc, char *argv[])
#include "createClouds.H"
#include "createMulticomponentPointSources.H"
#include "createPorousZones.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"

View File

@ -53,7 +53,6 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "createClouds.H"
#include "createRadiationModel.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "compressibleCourantNo.H"

View File

@ -43,17 +43,16 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
# include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readMechanicalProperties.H"
#include "readThermalProperties.H"
#include "readSolidDisplacementFoamControls.H"
#include "createFields.H"
# include "createTime.H"
# include "createMesh.H"
# include "readMechanicalProperties.H"
# include "readThermalProperties.H"
# include "readSolidDisplacementFoamControls.H"
# include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nCalculating displacement field\n" << endl;
@ -61,7 +60,7 @@ int main(int argc, char *argv[])
{
Info<< "Iteration: " << runTime.value() << nl << endl;
# include "readSolidDisplacementFoamControls.H"
#include "readSolidDisplacementFoamControls.H"
int iCorr = 0;
scalar initialResidual = 0;
@ -91,7 +90,7 @@ int main(int argc, char *argv[])
const volScalarField& T = Tptr();
DEqn += fvc::grad(threeKalpha*T);
}
//DEqn.setComponentReference(1, 0, vector::X, 0);
//DEqn.setComponentReference(1, 0, vector::Z, 0);
@ -123,7 +122,7 @@ int main(int argc, char *argv[])
} while (initialResidual > convergenceTolerance && ++iCorr < nCorr);
# include "calculateStress.H"
#include "calculateStress.H"
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"

View File

@ -209,6 +209,8 @@ snapControls
// Settings for the layer addition.
addLayersControls
{
relativeSizes true;
// Per final patch (so not geometry!) the layer information
layers
{
@ -226,11 +228,12 @@ addLayersControls
// Expansion factor for layer mesh
expansionRatio 1.0;
//- Wanted thickness of final added cell layer. If multiple layers
// is the
// thickness of the layer furthest away from the wall.
// Relative to undistorted size of cell outside layer.
finalLayerRatio 0.3;
finalLayerThickness 0.3;
//- Minimum thickness of cell layer. If for any reason layer
// cannot be above minThickness do not add layer.

View File

@ -7,6 +7,31 @@
#include "pointSet.H"
#include "IOmanip.H"
bool Foam::checkSync(const wordList& names)
{
List<wordList> allNames(Pstream::nProcs());
allNames[Pstream::myProcNo()] = names;
Pstream::gatherList(allNames);
bool hasError = false;
for (label procI = 1; procI < allNames.size(); procI++)
{
if (allNames[procI] != allNames[0])
{
hasError = true;
Info<< " ***Inconsistent zones across processors, "
"processor 0 has zones:" << allNames[0]
<< ", processor " << procI << " has zones:"
<< allNames[procI]
<< endl;
}
}
return hasError;
}
Foam::label Foam::checkTopology
(
const polyMesh& mesh,
@ -24,6 +49,31 @@ Foam::label Foam::checkTopology
// Check if the boundary processor patches are correct
mesh.boundaryMesh().checkParallelSync(true);
// Check names of zones are equal
if (checkSync(mesh.cellZones().names()))
{
noFailedChecks++;
}
if (checkSync(mesh.faceZones().names()))
{
noFailedChecks++;
}
if (checkSync(mesh.pointZones().names()))
{
noFailedChecks++;
}
// Check contents of faceZones consistent
{
forAll(mesh.faceZones(), zoneI)
{
if (mesh.faceZones()[zoneI].checkParallelSync(true))
{
noFailedChecks++;
}
}
}
{
pointSet points(mesh, "unusedPoints", mesh.nPoints()/100);
if (mesh.checkPoints(true, &points))

View File

@ -1,8 +1,11 @@
#include "label.H"
#include "wordList.H"
namespace Foam
{
class polyMesh;
bool checkSync(const wordList& names);
label checkTopology(const polyMesh&, const bool, const bool);
}

View File

@ -69,13 +69,13 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
<< " cells: "
<< returnReduce(mesh.cells().size(), sumOp<label>()) << nl
<< " boundary patches: "
<< returnReduce(mesh.boundaryMesh().size(), sumOp<label>()) << nl
<< mesh.boundaryMesh().size() << nl
<< " point zones: "
<< returnReduce(mesh.pointZones().size(), sumOp<label>()) << nl
<< mesh.pointZones().size() << nl
<< " face zones: "
<< returnReduce(mesh.faceZones().size(), sumOp<label>()) << nl
<< mesh.faceZones().size() << nl
<< " cell zones: "
<< returnReduce(mesh.cellZones().size(), sumOp<label>()) << nl
<< mesh.cellZones().size() << nl
<< endl;

View File

@ -43,16 +43,89 @@ Description
#include "ReadFields.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "ZoneIDs.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void modifyOrAddFace
(
polyTopoChange& meshMod,
const face& f,
const label faceI,
const label own,
const bool flipFaceFlux,
const label newPatchI,
const label zoneID,
const bool zoneFlip,
PackedBoolList& modifiedFace
)
{
if (!modifiedFace[faceI])
{
// First usage of face. Modify.
meshMod.setAction
(
polyModifyFace
(
f, // modified face
faceI, // label of face
own, // owner
-1, // neighbour
flipFaceFlux, // face flip
newPatchI, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
modifiedFace[faceI] = 1;
}
else
{
// Second or more usage of face. Add.
meshMod.setAction
(
polyAddFace
(
f, // modified face
own, // owner
-1, // neighbour
-1, // master point
-1, // master edge
faceI, // master face
flipFaceFlux, // face flip
newPatchI, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
}
label findPatchID(const polyMesh& mesh, const word& name)
{
label patchI = mesh.boundaryMesh().findPatchID(name);
if (patchI == -1)
{
FatalErrorIn("findPatchID(const polyMesh&, const word&)")
<< "Cannot find patch " << name << endl
<< "Valid patches are " << mesh.boundaryMesh().names()
<< exit(FatalError);
}
return patchI;
}
// Main program:
int main(int argc, char *argv[])
{
argList::validArgs.append("set");
argList::validArgs.append("faceZone");
argList::validArgs.append("patch");
argList::validOptions.insert("additionalPatches", "(patch2 .. patchN)");
argList::validOptions.insert("overwrite", "");
@ -67,30 +140,28 @@ int main(int argc, char *argv[])
const faceZoneMesh& faceZones = mesh.faceZones();
// Faces to baffle
word setName(args.additionalArgs()[0]);
Info<< "Reading faceSet from " << setName << nl << endl;
faceSet facesToSplit(mesh, setName);
// Make sure set is synchronised across couples
facesToSplit.sync(mesh);
Info<< "Read " << returnReduce(facesToSplit.size(), sumOp<label>())
<< " faces from " << setName << nl << endl;
faceZoneID zoneID(args.additionalArgs()[0], faceZones);
Info<< "Converting faces on zone " << zoneID.name()
<< " into baffles." << nl << endl;
const faceZone& fZone = faceZones[zoneID.index()];
Info<< "Found " << returnReduce(fZone.size(), sumOp<label>())
<< " faces on zone " << zoneID.name() << nl << endl;
// Make sure patches and zoneFaces are synchronised across couples
patches.checkParallelSync(true);
fZone.checkParallelSync(true);
// Patches to put baffles into
DynamicList<label> newPatches(1);
word patchName(args.additionalArgs()[1]);
newPatches.append(patches.findPatchID(patchName));
Pout<< "Using patch " << patchName
newPatches.append(findPatchID(mesh, patchName));
Info<< "Using patch " << patchName
<< " at index " << newPatches[0] << endl;
if (newPatches[0] == -1)
{
FatalErrorIn(args.executable())
<< "Cannot find patch " << patchName << endl
<< "Valid patches are " << patches.names() << exit(FatalError);
}
// Additional patches
if (args.optionFound("additionalPatches"))
@ -103,19 +174,9 @@ int main(int argc, char *argv[])
newPatches.reserve(patchNames.size() + 1);
forAll(patchNames, i)
{
label patchI = patches.findPatchID(patchNames[i]);
newPatches.append(findPatchID(mesh, patchNames[i]));
Info<< "Using additional patch " << patchNames[i]
<< " at index " << patchI << endl;
if (patchI == -1)
{
FatalErrorIn(args.executable())
<< "Cannot find patch " << patchNames[i] << endl
<< "Valid patches are " << patches.names()
<< exit(FatalError);
}
newPatches.append(patchI);
<< " at index " << newPatches[newPatches.size()-1] << endl;
}
}
@ -166,111 +227,112 @@ int main(int argc, char *argv[])
polyTopoChange meshMod(mesh);
// Do the actual changes
// Note order in which faces are modified/added is so they end up correctly
// for cyclic patches (original faces first and then reversed faces)
// since otherwise it will have trouble matching baffles.
// Do the actual changes. Note:
// - loop in incrementing face order (not necessary if faceZone ordered).
// Preserves any existing ordering on patch faces.
// - two passes, do non-flip faces first and flip faces second. This
// guarantees that when e.g. creating a cyclic all faces from one
// side come first and faces from the other side next.
label nBaffled = 0;
PackedBoolList modifiedFace(mesh.nFaces());
forAll(newPatches, i)
{
label newPatchI = newPatches[i];
// Pass 1. Do selected side of zone
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
{
if (facesToSplit.found(faceI))
{
const face& f = mesh.faces()[faceI];
label zoneID = faceZones.whichZone(faceI);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
}
label zoneFaceI = fZone.whichFace(faceI);
if (i == 0)
if (zoneFaceI != -1)
{
if (!fZone.flipMap()[zoneFaceI])
{
// First usage of face. Modify.
meshMod.setAction
// Use owner side of face
modifyOrAddFace
(
polyModifyFace
(
f, // modified face
faceI, // label of face
mesh.faceOwner()[faceI], // owner
-1, // neighbour
false, // face flip
newPatchI, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
meshMod,
mesh.faces()[faceI], // modified face
faceI, // label of face
mesh.faceOwner()[faceI],// owner
false, // face flip
newPatchI, // patch for face
zoneID.index(), // zone for face
false, // face flip in zone
modifiedFace // modify or add status
);
}
else
{
// Second or more usage of face. Add.
meshMod.setAction
// Use neighbour side of face
modifyOrAddFace
(
polyAddFace
(
f, // modified face
mesh.faceOwner()[faceI], // owner
-1, // neighbour
-1, // master point
-1, // master edge
faceI, // master face
false, // face flip
newPatchI, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
nBaffled++;
}
}
// Add the reversed face.
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
{
if (facesToSplit.found(faceI))
{
const face& f = mesh.faces()[faceI];
label zoneID = faceZones.whichZone(faceI);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
}
label nei = mesh.faceNeighbour()[faceI];
meshMod.setAction
(
polyAddFace
(
f.reverseFace(), // modified face
nei, // owner
-1, // neighbour
-1, // masterPointID
-1, // masterEdgeID
faceI, // masterFaceID,
meshMod,
mesh.faces()[faceI].reverseFace(), // modified face
faceI, // label of face
mesh.faceNeighbour()[faceI],// owner
true, // face flip
newPatchI, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
nBaffled++;
zoneID.index(), // zone for face
true, // face flip in zone
modifiedFace // modify or add status
);
}
}
}
// Pass 2. Do other side of zone
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
{
label zoneFaceI = fZone.whichFace(faceI);
if (zoneFaceI != -1)
{
if (!fZone.flipMap()[zoneFaceI])
{
// Use neighbour side of face
modifyOrAddFace
(
meshMod,
mesh.faces()[faceI].reverseFace(), // modified face
faceI, // label of face
mesh.faceNeighbour()[faceI], // owner
true, // face flip
newPatchI, // patch for face
zoneID.index(), // zone for face
true, // face flip in zone
modifiedFace // modify or add
);
}
else
{
// Use owner side of face
modifyOrAddFace
(
meshMod,
mesh.faces()[faceI], // modified face
faceI, // label of face
mesh.faceOwner()[faceI],// owner
false, // face flip
newPatchI, // patch for face
zoneID.index(), // zone for face
false, // face flip in zone
modifiedFace // modify or add status
);
}
}
}
// Modify any boundary faces
// ~~~~~~~~~~~~~~~~~~~~~~~~~
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
@ -286,58 +348,22 @@ int main(int argc, char *argv[])
{
label faceI = pp.start()+i;
if (facesToSplit.found(faceI))
label zoneFaceI = fZone.whichFace(faceI);
if (zoneFaceI != -1)
{
const face& f = mesh.faces()[faceI];
label zoneID = faceZones.whichZone(faceI);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
}
if (i == 0)
{
// First usage of face. Modify.
meshMod.setAction
(
polyModifyFace
(
f, // modified face
faceI, // label of face
mesh.faceOwner()[faceI],// owner
-1, // neighbour
false, // face flip
newPatchI, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
else
{
// Second or more usage of face. Add.
meshMod.setAction
(
polyAddFace
(
f, // modified face
mesh.faceOwner()[faceI],// owner
-1, // neighbour
-1, // master point
-1, // master edge
faceI, // master face
false, // face flip
newPatchI, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
nBaffled++;
modifyOrAddFace
(
meshMod,
mesh.faces()[faceI], // modified face
faceI, // label of face
mesh.faceOwner()[faceI], // owner
false, // face flip
newPatchI, // patch for face
zoneID.index(), // zone for face
fZone.flipMap()[zoneFaceI], // face flip in zone
modifiedFace // modify or add status
);
}
}
}
@ -345,7 +371,7 @@ int main(int argc, char *argv[])
}
Info<< "Converted " << returnReduce(nBaffled, sumOp<label>())
Info<< "Converted " << returnReduce(modifiedFace.count(), sumOp<label>())
<< " faces into boundary faces on patch " << patchName << nl << endl;
if (!overwrite)

View File

@ -73,23 +73,6 @@ public:
};
label getPatch(const polyBoundaryMesh& patches, const word& patchName)
{
label patchI = patches.findPatchID(patchName);
if (patchI == -1)
{
FatalErrorIn("createPatch(const polyBoundaryMesh&, const word&)")
<< "Cannot find source patch " << patchName
<< endl << "Valid patch names are " << patches.names()
<< exit(FatalError);
}
return patchI;
}
void changePatchID
(
const polyMesh& mesh,
@ -704,14 +687,12 @@ int main(int argc, char *argv[])
if (sourceType == "patches")
{
wordList patchSources(dict.lookup("patches"));
labelHashSet patchSources(patches.patchSet(dict.lookup("patches")));
// Repatch faces of the patches.
forAll(patchSources, sourceI)
forAllConstIter(labelHashSet, patchSources, iter)
{
label patchI = getPatch(patches, patchSources[sourceI]);
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[iter.key()];
Info<< "Moving faces from patch " << pp.name()
<< " to patch " << destPatchI << endl;

View File

@ -69,8 +69,8 @@ patches
// How to construct: either from 'patches' or 'set'
constructFrom patches;
// If constructFrom = patches : names of patches
patches (periodic-1 periodic-2);
// If constructFrom = patches : names of patches. Wildcards allowed.
patches ("periodic.*");
// If constructFrom = set : name of faceSet
set f0;

View File

@ -367,7 +367,7 @@ bool doCommand
{
r = IOobject::NO_READ;
backup(mesh, setName, setName + "_old");
//backup(mesh, setName, setName + "_old");
currentSetPtr = topoSet::New(setType, mesh, setName, typSize);
}
@ -399,11 +399,11 @@ bool doCommand
<< " Action:" << actionName
<< endl;
if ((r == IOobject::MUST_READ) && (action != topoSetSource::LIST))
{
// currentSet has been read so can make copy.
backup(mesh, setName, currentSet, setName + "_old");
}
//if ((r == IOobject::MUST_READ) && (action != topoSetSource::LIST))
//{
// // currentSet has been read so can make copy.
// backup(mesh, setName, currentSet, setName + "_old");
//}
switch (action)
{
@ -558,7 +558,8 @@ void printMesh(const Time& runTime, const polyMesh& mesh)
<< " cells:" << mesh.nCells()
<< " faces:" << mesh.nFaces()
<< " points:" << mesh.nPoints()
<< " patches:" << mesh.boundaryMesh().size() << nl;
<< " patches:" << mesh.boundaryMesh().size()
<< " bb:" << mesh.bounds() << nl;
}

View File

@ -87,7 +87,7 @@ int main(int argc, char *argv[])
polyMesh::meshSubDir/"sets"
);
Pout<< "Searched : " << mesh.pointsInstance()/polyMesh::meshSubDir/"sets"
Info<< "Searched : " << mesh.pointsInstance()/polyMesh::meshSubDir/"sets"
<< nl
<< "Found : " << objects.names() << nl
<< endl;
@ -95,7 +95,7 @@ int main(int argc, char *argv[])
IOobjectList pointObjects(objects.lookupClass(pointSet::typeName));
Pout<< "pointSets:" << pointObjects.names() << endl;
//Pout<< "pointSets:" << pointObjects.names() << endl;
for
(
@ -126,6 +126,7 @@ int main(int argc, char *argv[])
)
);
mesh.pointZones().writeOpt() = IOobject::AUTO_WRITE;
mesh.pointZones().instance() = mesh.facesInstance();
}
else
{
@ -133,57 +134,17 @@ int main(int argc, char *argv[])
<< " with that of set " << set.name() << "." << endl;
mesh.pointZones()[zoneID] = pointLabels;
mesh.pointZones().writeOpt() = IOobject::AUTO_WRITE;
mesh.pointZones().instance() = mesh.facesInstance();
}
}
IOobjectList cellObjects(objects.lookupClass(cellSet::typeName));
Pout<< "cellSets:" << cellObjects.names() << endl;
for
(
IOobjectList::const_iterator iter = cellObjects.begin();
iter != cellObjects.end();
++iter
)
{
// Not in memory. Load it.
cellSet set(*iter());
SortableList<label> cellLabels(set.toc());
label zoneID = mesh.cellZones().findZoneID(set.name());
if (zoneID == -1)
{
Info<< "Adding set " << set.name() << " as a cellZone." << endl;
label sz = mesh.cellZones().size();
mesh.cellZones().setSize(sz+1);
mesh.cellZones().set
(
sz,
new cellZone
(
set.name(), //name
cellLabels, //addressing
sz, //index
mesh.cellZones() //pointZoneMesh
)
);
mesh.cellZones().writeOpt() = IOobject::AUTO_WRITE;
}
else
{
Info<< "Overwriting contents of existing cellZone " << zoneID
<< " with that of set " << set.name() << "." << endl;
mesh.cellZones()[zoneID] = cellLabels;
mesh.cellZones().writeOpt() = IOobject::AUTO_WRITE;
}
}
IOobjectList faceObjects(objects.lookupClass(faceSet::typeName));
Pout<< "faceSets:" << faceObjects.names() << endl;
HashSet<word> slaveCellSets;
//Pout<< "faceSets:" << faceObjects.names() << endl;
for
(
@ -203,9 +164,9 @@ int main(int argc, char *argv[])
{
word setName(set.name() + "SlaveCells");
Pout<< "Trying to load cellSet " << setName
Info<< "Trying to load cellSet " << setName
<< " to find out the slave side of the zone." << nl
<< " If you do not care about the flipMap"
<< "If you do not care about the flipMap"
<< " (i.e. do not use the sideness)" << nl
<< "use the -noFlipMap command line option."
<< endl;
@ -213,6 +174,9 @@ int main(int argc, char *argv[])
// Load corresponding cells
cellSet cells(mesh, setName);
// Store setName to exclude from cellZones further on
slaveCellSets.insert(setName);
forAll(faceLabels, i)
{
label faceI = faceLabels[i];
@ -227,7 +191,7 @@ int main(int argc, char *argv[])
&& !cells.found(mesh.faceNeighbour()[faceI])
)
{
flip = true;
flip = false;
}
else if
(
@ -235,7 +199,7 @@ int main(int argc, char *argv[])
&& cells.found(mesh.faceNeighbour()[faceI])
)
{
flip = false;
flip = true;
}
else
{
@ -257,11 +221,11 @@ int main(int argc, char *argv[])
{
if (cells.found(mesh.faceOwner()[faceI]))
{
flip = true;
flip = false;
}
else
{
flip = false;
flip = true;
}
}
@ -299,6 +263,7 @@ int main(int argc, char *argv[])
)
);
mesh.faceZones().writeOpt() = IOobject::AUTO_WRITE;
mesh.faceZones().instance() = mesh.facesInstance();
}
else
{
@ -310,10 +275,63 @@ int main(int argc, char *argv[])
flipMap.shrink()
);
mesh.faceZones().writeOpt() = IOobject::AUTO_WRITE;
mesh.faceZones().instance() = mesh.facesInstance();
}
}
Pout<< "Writing mesh." << endl;
IOobjectList cellObjects(objects.lookupClass(cellSet::typeName));
//Pout<< "cellSets:" << cellObjects.names() << endl;
for
(
IOobjectList::const_iterator iter = cellObjects.begin();
iter != cellObjects.end();
++iter
)
{
if (!slaveCellSets.found(iter.key()))
{
// Not in memory. Load it.
cellSet set(*iter());
SortableList<label> cellLabels(set.toc());
label zoneID = mesh.cellZones().findZoneID(set.name());
if (zoneID == -1)
{
Info<< "Adding set " << set.name() << " as a cellZone." << endl;
label sz = mesh.cellZones().size();
mesh.cellZones().setSize(sz+1);
mesh.cellZones().set
(
sz,
new cellZone
(
set.name(), //name
cellLabels, //addressing
sz, //index
mesh.cellZones() //pointZoneMesh
)
);
mesh.cellZones().writeOpt() = IOobject::AUTO_WRITE;
mesh.cellZones().instance() = mesh.facesInstance();
}
else
{
Info<< "Overwriting contents of existing cellZone " << zoneID
<< " with that of set " << set.name() << "." << endl;
mesh.cellZones()[zoneID] = cellLabels;
mesh.cellZones().writeOpt() = IOobject::AUTO_WRITE;
mesh.cellZones().instance() = mesh.facesInstance();
}
}
}
Info<< "Writing mesh." << endl;
if (!mesh.write())
{
@ -322,7 +340,7 @@ int main(int argc, char *argv[])
<< exit(FatalError);
}
Pout << nl << "End" << endl;
Info<< nl << "End" << endl;
return 0;
}

View File

@ -23,7 +23,7 @@ INCLUDE_DIRECTORIES(
)
ADD_DEFINITIONS(
-D$ENV{WM_PRECISION_OPTION}
-DWM_$ENV{WM_PRECISION_OPTION}
)
# Set output library destination to plugin folder

View File

@ -22,7 +22,7 @@ INCLUDE_DIRECTORIES(
$ENV{ParaView_INST_DIR}/include
../vtkFoam/lnInclude
)
ADD_DEFINITIONS(-D$ENV{WM_PRECISION_OPTION})
ADD_DEFINITIONS(-DWM_$ENV{WM_PRECISION_OPTION})
#-----------------------------------------------------------------------------
# Most users should not need to change anything below this line.

View File

@ -50,9 +50,8 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::validArgs.append("output file");
# include "addRegionOption.H"
argList::validOptions.insert("excludeProcPatches", "");
argList::validOptions.insert("patches", "(patch0 .. patchN)");
# include "setRootCase.H"
@ -65,7 +64,7 @@ int main(int argc, char *argv[])
Pout<< "Reading mesh from time " << runTime.value() << endl;
# include "createPolyMesh.H"
# include "createNamedPolyMesh.H"
bool includeProcPatches =
!(

View File

@ -64,6 +64,9 @@ cleanCase ()
rm -rf constant/polyMesh/{allOwner*,cell*,face*,meshModifiers*} \
constant/polyMesh/{owner*,neighbour*,point*,edge*} \
constant/polyMesh/{cellLevel*,pointLevel*,refinementHistory*,surfaceIndex*} \
constant/{cellLevel*,pointLevel*} \
constant/polyMesh/sets/ \
> /dev/null 2>&1
for f in `find . -name "*Dict"`

View File

@ -68,7 +68,7 @@ void* Foam::sigFpe::my_malloc_hook(size_t size, const void *caller)
result = malloc (size);
// initialize to signalling nan
# ifdef SP
# ifdef WM_SP
const uint32_t sNAN = 0x7ff7fffflu;

View File

@ -34,6 +34,7 @@ Description
#include "primitiveMesh.H"
#include "demandDrivenData.H"
#include "mapPolyMesh.H"
#include "syncTools.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -530,6 +531,87 @@ bool Foam::faceZone::checkDefinition(const bool report) const
}
bool Foam::faceZone::checkParallelSync(const bool report) const
{
const polyMesh& mesh = zoneMesh().mesh();
const polyBoundaryMesh& bm = mesh.boundaryMesh();
bool boundaryError = false;
// Check that zone faces are synced
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{
boolList neiZoneFace(mesh.nFaces()-mesh.nInternalFaces(), false);
boolList neiZoneFlip(mesh.nFaces()-mesh.nInternalFaces(), false);
forAll(*this, i)
{
label faceI = operator[](i);
if (!mesh.isInternalFace(faceI))
{
neiZoneFace[faceI-mesh.nInternalFaces()] = true;
neiZoneFlip[faceI-mesh.nInternalFaces()] = flipMap()[i];
}
}
boolList myZoneFace(neiZoneFace);
syncTools::swapBoundaryFaceList(mesh, neiZoneFace, false);
boolList myZoneFlip(neiZoneFlip);
syncTools::swapBoundaryFaceList(mesh, neiZoneFlip, false);
forAll(*this, i)
{
label faceI = operator[](i);
label patchI = bm.whichPatch(faceI);
if (patchI != -1 && bm[patchI].coupled())
{
label bFaceI = faceI-mesh.nInternalFaces();
// Check face in zone on both sides
if (myZoneFace[bFaceI] != neiZoneFace[bFaceI])
{
boundaryError = true;
if (report)
{
Pout<< " ***Problem with faceZone " << index()
<< " named " << name()
<< ". Face " << faceI
<< " on coupled patch "
<< bm[patchI].name()
<< " is not consistent with its coupled neighbour."
<< endl;
}
}
// Flip state should be opposite.
if (myZoneFlip[bFaceI] == neiZoneFlip[bFaceI])
{
boundaryError = true;
if (report)
{
Pout<< " ***Problem with faceZone " << index()
<< " named " << name()
<< ". Face " << faceI
<< " on coupled patch "
<< bm[patchI].name()
<< " does not have consistent flipMap"
<< " across coupled faces."
<< endl;
}
}
}
}
}
return returnReduce(boundaryError, orOp<bool>());
}
void Foam::faceZone::movePoints(const pointField& p)
{
if (patchPtr_)

View File

@ -302,6 +302,10 @@ public:
//- Check zone definition. Return true if in error.
bool checkDefinition(const bool report = false) const;
//- Check whether all procs have faces synchronised. Return
// true if in error.
bool checkParallelSync(const bool report = false) const;
//- Correct patch after moving points
virtual void movePoints(const pointField&);

View File

@ -27,7 +27,7 @@ Typedef
Description
Single floating point number identical to float or double depending on
whether SP or DP is defined.
whether WM_SP or WM_DP is defined.
SourceFiles
scalar.C
@ -42,7 +42,7 @@ SourceFiles
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#if defined(SP)
#if defined(WM_SP)
// Define scalar as a float
@ -60,7 +60,7 @@ namespace Foam
scalar readScalar(Istream& is);
}
#elif defined(DP)
#elif defined(WM_DP)
// Define scalar as a double

View File

@ -34,9 +34,9 @@ License
#include <cstdlib>
#include <csignal>
#if defined(SP)
#if defined(WM_SP)
# define MPI_SCALAR MPI_FLOAT
#elif defined(DP)
#elif defined(WM_DP)
# define MPI_SCALAR MPI_DOUBLE
#endif

View File

@ -110,7 +110,7 @@ Foam::label Foam::meshRefinement::createBaffle
-1, // masterPointID
-1, // masterEdgeID
faceI, // masterFaceID,
false, // face flip
true, // face flip
neiPatch, // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
@ -1017,7 +1017,7 @@ void Foam::meshRefinement::findCellZoneGeometric
if (namedSurfaceIndex[faceI] == -1 && (ownZone != neiZone))
{
// Give face the zone of the owner
// Give face the zone of max cell zone
namedSurfaceIndex[faceI] = findIndex
(
surfaceToCellZone,
@ -1059,7 +1059,7 @@ void Foam::meshRefinement::findCellZoneGeometric
if (namedSurfaceIndex[faceI] == -1 && (ownZone != neiZone))
{
// Give face the zone of the owner
// Give face the max cell zone
namedSurfaceIndex[faceI] = findIndex
(
surfaceToCellZone,
@ -2211,16 +2211,14 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
{
label faceI = testFaces[i];
label own = mesh_.faceOwner()[faceI];
if (mesh_.isInternalFace(faceI))
{
start[i] = cellCentres[own];
end[i] = cellCentres[mesh_.faceNeighbour()[faceI]];
start[i] = cellCentres[faceOwner[faceI]];
end[i] = cellCentres[faceNeighbour[faceI]];
}
else
{
start[i] = cellCentres[own];
start[i] = cellCentres[faceOwner[faceI]];
end[i] = neiCc[faceI-mesh_.nInternalFaces()];
}
}
@ -2357,6 +2355,20 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
if (surfI != -1)
{
// Orient face zone to have slave cells in max cell zone.
label ownZone = cellToZone[faceOwner[faceI]];
label neiZone = cellToZone[faceNeighbour[faceI]];
bool flip;
if (ownZone == max(ownZone, neiZone))
{
flip = false;
}
else
{
flip = true;
}
meshMod.setAction
(
polyModifyFace
@ -2369,12 +2381,31 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
-1, // patch for face
false, // remove from zone
surfaceToFaceZone[surfI], // zone for face
false // face flip in zone
flip // face flip in zone
)
);
}
}
// Get coupled neighbour cellZone. Set to -1 on non-coupled patches.
labelList neiCellZone(mesh_.nFaces()-mesh_.nInternalFaces(), -1);
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (pp.coupled())
{
forAll(pp, i)
{
label faceI = pp.start()+i;
neiCellZone[faceI-mesh_.nInternalFaces()] =
cellToZone[mesh_.faceOwner()[faceI]];
}
}
}
syncTools::swapBoundaryFaceList(mesh_, neiCellZone, false);
// Set owner as no-flip
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
@ -2387,6 +2418,19 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
if (surfI != -1)
{
label ownZone = cellToZone[faceOwner[faceI]];
label neiZone = neiCellZone[faceI-mesh_.nInternalFaces()];
bool flip;
if (ownZone == max(ownZone, neiZone))
{
flip = false;
}
else
{
flip = true;
}
meshMod.setAction
(
polyModifyFace
@ -2399,7 +2443,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
patchI, // patch for face
false, // remove from zone
surfaceToFaceZone[surfI], // zone for face
false // face flip in zone
flip // face flip in zone
)
);
}

View File

@ -159,7 +159,7 @@ public:
// return nRegions_;
//}
//- Per point that is to duplicated to the local index
//- Per point that is to be duplicated the local index
const Map<label>& meshPointMap() const
{
return meshPointMap_;

View File

@ -58,23 +58,6 @@ const Foam::point Foam::polyTopoChange::greatPoint
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Renumber
void Foam::polyTopoChange::renumber
(
const labelList& map,
DynamicList<label>& elems
)
{
forAll(elems, elemI)
{
if (elems[elemI] >= 0)
{
elems[elemI] = map[elems[elemI]];
}
}
}
// Renumber with special handling for merged items (marked with <-1)
void Foam::polyTopoChange::renumberReverseMap
(
@ -208,6 +191,20 @@ void Foam::polyTopoChange::countMap
}
Foam::labelHashSet Foam::polyTopoChange::getSetIndices(const PackedBoolList& lst)
{
labelHashSet values(lst.count());
forAll(lst, i)
{
if (lst[i])
{
values.insert(i);
}
}
return values;
}
void Foam::polyTopoChange::writeMeshStats(const polyMesh& mesh, Ostream& os)
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
@ -782,9 +779,11 @@ void Foam::polyTopoChange::reorderCompactFaces
renumberKey(oldToNew, faceFromPoint_);
renumberKey(oldToNew, faceFromEdge_);
renumber(oldToNew, flipFaceFlux_);
inplaceReorder(oldToNew, flipFaceFlux_);
flipFaceFlux_.setCapacity(newSize);
renumberKey(oldToNew, faceZone_);
renumberKey(oldToNew, faceZoneFlip_);
inplaceReorder(oldToNew, faceZoneFlip_);
faceZoneFlip_.setCapacity(newSize);
}
@ -1097,6 +1096,18 @@ void Foam::polyTopoChange::compact
{
faces_[faceI] = faces_[faceI].reverseFace();
Swap(faceOwner_[faceI], faceNeighbour_[faceI]);
flipFaceFlux_[faceI] =
(
flipFaceFlux_[faceI]
? 0
: 1
);
faceZoneFlip_[faceI] =
(
faceZoneFlip_[faceI]
? 0
: 1
);
}
}
}
@ -2302,9 +2313,9 @@ void Foam::polyTopoChange::addMesh
faceMap_.setCapacity(faceMap_.size() + nAllFaces);
faceFromPoint_.resize(faceFromPoint_.size() + nAllFaces/100);
faceFromEdge_.resize(faceFromEdge_.size() + nAllFaces/100);
flipFaceFlux_.resize(flipFaceFlux_.size() + nAllFaces/100);
flipFaceFlux_.setCapacity(faces_.size() + nAllFaces);
faceZone_.resize(faceZone_.size() + nAllFaces/100);
faceZoneFlip_.resize(faceZoneFlip_.size() + nAllFaces/100);
faceZoneFlip_.setCapacity(faces_.size() + nAllFaces);
// Precalc offset zones
@ -2716,16 +2727,13 @@ Foam::label Foam::polyTopoChange::addFace
}
reverseFaceMap_.append(faceI);
if (flipFaceFlux)
{
flipFaceFlux_.insert(faceI);
}
flipFaceFlux_[faceI] = (flipFaceFlux ? 1 : 0);
if (zoneID >= 0)
{
faceZone_.insert(faceI, zoneID);
faceZoneFlip_.insert(faceI, zoneFlip);
}
faceZoneFlip_[faceI] = (zoneFlip ? 1 : 0);
return faceI;
}
@ -2754,14 +2762,7 @@ void Foam::polyTopoChange::modifyFace
faceNeighbour_[faceI] = nei;
region_[faceI] = patchID;
if (flipFaceFlux)
{
flipFaceFlux_.insert(faceI);
}
else
{
flipFaceFlux_.erase(faceI);
}
flipFaceFlux_[faceI] = (flipFaceFlux ? 1 : 0);
Map<label>::iterator faceFnd = faceZone_.find(faceI);
@ -2770,19 +2771,17 @@ void Foam::polyTopoChange::modifyFace
if (zoneID >= 0)
{
faceFnd() = zoneID;
faceZoneFlip_.find(faceI)() = zoneFlip;
}
else
{
faceZone_.erase(faceFnd);
faceZoneFlip_.erase(faceI);
}
}
else if (zoneID >= 0)
{
faceZone_.insert(faceI, zoneID);
faceZoneFlip_.insert(faceI, zoneFlip);
}
faceZoneFlip_[faceI] = (zoneFlip ? 1 : 0);
}
@ -2823,9 +2822,9 @@ void Foam::polyTopoChange::removeFace(const label faceI, const label mergeFaceI)
}
faceFromEdge_.erase(faceI);
faceFromPoint_.erase(faceI);
flipFaceFlux_.erase(faceI);
flipFaceFlux_[faceI] = 0;
faceZone_.erase(faceI);
faceZoneFlip_.erase(faceI);
faceZoneFlip_[faceI] = 0;
}
@ -3119,6 +3118,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChange::changeMesh
labelListList faceZonePointMap(mesh.faceZones().size());
calcFaceZonePointMap(mesh, oldFaceZoneMeshPointMaps, faceZonePointMap);
labelHashSet flipFaceFluxSet(getSetIndices(flipFaceFlux_));
return autoPtr<mapPolyMesh>
(
@ -3147,7 +3147,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChange::changeMesh
reverseFaceMap_,
reverseCellMap_,
flipFaceFlux_,
flipFaceFluxSet,
patchPointMap,
@ -3410,6 +3410,8 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChange::makeMesh
writeMeshStats(mesh, Pout);
}
labelHashSet flipFaceFluxSet(getSetIndices(flipFaceFlux_));
return autoPtr<mapPolyMesh>
(
new mapPolyMesh
@ -3437,7 +3439,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChange::makeMesh
reverseFaceMap_,
reverseCellMap_,
flipFaceFlux_,
flipFaceFluxSet,
patchPointMap,

View File

@ -171,13 +171,13 @@ class polyTopoChange
Map<label> faceFromEdge_;
//- In mapping whether to reverse the flux.
labelHashSet flipFaceFlux_;
PackedBoolList flipFaceFlux_;
//- Zone of face
Map<label> faceZone_;
//- Orientation of face in zone
Map<bool> faceZoneFlip_;
PackedBoolList faceZoneFlip_;
//- Active faces
label nActiveFaces_;
@ -216,8 +216,7 @@ class polyTopoChange
template<class T>
static void renumberKey(const labelList& map, Map<T>&);
//- Renumber elements of list according to map
static void renumber(const labelList&, DynamicList<label>&);
//- Renumber elements of container according to map
static void renumber(const labelList&, labelHashSet&);
//- Special handling of reverse maps which have <-1 in them
static void renumberReverseMap(const labelList&, DynamicList<label>&);
@ -225,6 +224,9 @@ class polyTopoChange
//- Renumber & compact elements of list according to map
static void renumberCompact(const labelList&, labelList&);
//- Get all set elements as a labelHashSet
static labelHashSet getSetIndices(const PackedBoolList&);
//- Count number of added and removed quantities from maps.
static void countMap
(

View File

@ -92,6 +92,7 @@ void Foam::setRefCell
dict
) << "Unable to set reference cell for field " << field.name()
<< nl << " Reference point " << refPointName
<< " " << refPointi
<< " found on " << sumHasRef << " domains (should be one)"
<< nl << exit(FatalIOError);
}

View File

@ -1,7 +1,7 @@
ParMGridGen = $(WM_THIRD_PARTY_DIR)/ParMGridGen-1.0
TYPE_REAL=
#if defined(SP)
#if defined(WM_SP)
TYPE_REAL=-DTYPE_REAL
#endif

View File

@ -173,9 +173,32 @@ void Foam::KinematicCloud<ParcelType>::resetSourceTerms()
}
template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::preEvolve()
{
this->dispersion().cacheFields(true);
}
template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::postEvolve()
{
if (debug)
{
this->writePositions();
}
this->dispersion().cacheFields(false);
this->postProcessing().post();
}
template<class ParcelType>
void Foam::KinematicCloud<ParcelType>::evolve()
{
preEvolve();
autoPtr<interpolation<scalar> > rhoInterpolator =
interpolation<scalar>::New
(
@ -209,11 +232,6 @@ void Foam::KinematicCloud<ParcelType>::evolve()
this->injection().inject(td);
if (debug)
{
this->writePositions();
}
if (coupled_)
{
resetSourceTerms();
@ -221,7 +239,7 @@ void Foam::KinematicCloud<ParcelType>::evolve()
Cloud<ParcelType>::move(td);
this->postProcessing().post();
postEvolve();
}

View File

@ -184,6 +184,15 @@ protected:
DimensionedField<vector, volMesh> UTrans_;
// Cloud evolution functions
//- Pre-evolve
void preEvolve();
//- Post-evolve
void postEvolve();
public:
// Constructors

View File

@ -175,9 +175,25 @@ void Foam::ReactingCloud<ParcelType>::resetSourceTerms()
}
template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::preEvolve()
{
ThermoCloud<ParcelType>::preEvolve();
}
template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::postEvolve()
{
ThermoCloud<ParcelType>::postEvolve();
}
template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::evolve()
{
preEvolve();
const volScalarField& T = this->carrierThermo().T();
const volScalarField cp = this->carrierThermo().Cp();
const volScalarField& p = this->carrierThermo().p();
@ -233,11 +249,6 @@ void Foam::ReactingCloud<ParcelType>::evolve()
this->injection().inject(td);
if (debug)
{
this->writePositions();
}
if (this->coupled())
{
resetSourceTerms();
@ -245,7 +256,7 @@ void Foam::ReactingCloud<ParcelType>::evolve()
Cloud<ParcelType>::move(td);
this->postProcessing().post();
postEvolve();
}

View File

@ -132,6 +132,15 @@ protected:
);
// Cloud evolution functions
//- Pre-evolve
void preEvolve();
//- Post-evolve
void postEvolve();
public:
// Constructors

View File

@ -129,9 +129,25 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::resetSourceTerms()
}
template<class ParcelType>
void Foam::ReactingMultiphaseCloud<ParcelType>::preEvolve()
{
ReactingCloud<ParcelType>::preEvolve();
}
template<class ParcelType>
void Foam::ReactingMultiphaseCloud<ParcelType>::postEvolve()
{
ReactingCloud<ParcelType>::postEvolve();
}
template<class ParcelType>
void Foam::ReactingMultiphaseCloud<ParcelType>::evolve()
{
preEvolve();
const volScalarField& T = this->carrierThermo().T();
const volScalarField cp = this->carrierThermo().Cp();
const volScalarField& p = this->carrierThermo().p();
@ -187,11 +203,6 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::evolve()
this->injection().inject(td);
if (debug)
{
this->writePositions();
}
if (this->coupled())
{
resetSourceTerms();
@ -199,7 +210,7 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::evolve()
Cloud<ParcelType>::move(td);
this->postProcessing().post();
postEvolve();
}

View File

@ -68,7 +68,7 @@ class ReactingMultiphaseCloud
public ReactingCloud<ParcelType>,
public reactingMultiphaseCloud
{
// Private Member Functions
// Private member functions
//- Disallow default bitwise copy construct
ReactingMultiphaseCloud(const ReactingMultiphaseCloud&);
@ -112,6 +112,17 @@ protected:
scalar dMassSurfaceReaction_;
// Protected member functions
// Cloud evolution functions
//- Pre-evolve
void preEvolve();
//- Post-evolve
void postEvolve();
public:
// Constructors

View File

@ -142,9 +142,25 @@ void Foam::ThermoCloud<ParcelType>::resetSourceTerms()
}
template<class ParcelType>
void Foam::ThermoCloud<ParcelType>::preEvolve()
{
KinematicCloud<ParcelType>::preEvolve();
}
template<class ParcelType>
void Foam::ThermoCloud<ParcelType>::postEvolve()
{
KinematicCloud<ParcelType>::postEvolve();
}
template<class ParcelType>
void Foam::ThermoCloud<ParcelType>::evolve()
{
preEvolve();
const volScalarField& T = carrierThermo_.T();
const volScalarField cp = carrierThermo_.Cp();
@ -192,11 +208,6 @@ void Foam::ThermoCloud<ParcelType>::evolve()
this->injection().inject(td);
if (debug)
{
this->writePositions();
}
if (this->coupled())
{
resetSourceTerms();
@ -204,7 +215,7 @@ void Foam::ThermoCloud<ParcelType>::evolve()
Cloud<ParcelType>::move(td);
this->postProcessing().post();
postEvolve();
}

View File

@ -118,6 +118,17 @@ protected:
DimensionedField<scalar, volMesh> hcTrans_;
// Protected member functions
// Cloud evolution functions
//- Pre-evolve
void preEvolve();
//- Post-evolve
void postEvolve();
public:
// Constructors

View File

@ -150,13 +150,13 @@ const Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity
const polyMesh& mesh = this->cloud().pMesh();
// Momentum transfer coefficient
const scalar ptc =
td.cloud().drag().ptc(U - Uc_, d, rhoc_, muc_) + ROOTVSMALL;
const scalar utc =
td.cloud().drag().utc(U - Uc_, d, rhoc_, muc_) + ROOTVSMALL;
// Momentum source due to particle forces
const vector PFCoupled =
const vector FCoupled =
mass*td.cloud().forces().calcCoupled(cellI, dt, rhoc_, rho, Uc_, U);
const vector PFNonCoupled =
const vector FNonCoupled =
mass*td.cloud().forces().calcNonCoupled(cellI, dt, rhoc_, rho, Uc_, U);
@ -165,15 +165,15 @@ const Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity
// Update velocity - treat as 3-D
const scalar As = this->areaS(d);
const vector ap = Uc_ + (PFCoupled + PFNonCoupled + Su)/(ptc*As);
const scalar bp = 6.0*ptc/(rho*d);
const vector ap = Uc_ + (FCoupled + FNonCoupled + Su)/(utc*As);
const scalar bp = 6.0*utc/(rho*d);
IntegrationScheme<vector>::integrationResult Ures =
td.cloud().UIntegrator().integrate(U, dt, ap, bp);
vector Unew = Ures.value();
dUTrans += dt*(ptc*As*(Ures.average() - Uc_) - PFCoupled);
dUTrans += dt*(utc*As*(Ures.average() - Uc_) - FCoupled);
// Apply correction to velocity and dUTrans for reduced-D cases
meshTools::constrainDirection(mesh, mesh.solutionD(), Unew);

View File

@ -37,10 +37,11 @@ License
#include "KinematicLookupTableInjection.H"
#include "ManualInjection.H"
#include "NoInjection.H"
#include "PatchInjection.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeParcelInjectionModels(ParcelType) \
#define makeParcelInjectionModels(ParcelType) \
\
makeInjectionModel(KinematicCloud<ParcelType>); \
\
@ -79,6 +80,12 @@ License
NoInjection, \
KinematicCloud, \
ParcelType \
); \
makeInjectionModelType \
( \
PatchInjection, \
KinematicCloud, \
ParcelType \
);

View File

@ -37,6 +37,7 @@ License
#include "FieldActivatedInjection.H"
#include "ManualInjection.H"
#include "NoInjection.H"
#include "PatchInjection.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -100,6 +101,13 @@ License
ParcelType, \
ThermoType \
); \
makeInjectionModelThermoType \
( \
PatchInjection, \
KinematicCloud, \
ParcelType, \
ThermoType \
); \
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -37,6 +37,7 @@ License
#include "FieldActivatedInjection.H"
#include "ManualInjection.H"
#include "NoInjection.H"
#include "PatchInjection.H"
#include "ReactingLookupTableInjection.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -102,6 +103,13 @@ License
ThermoType \
); \
makeInjectionModelThermoType \
( \
PatchInjection, \
KinematicCloud, \
ParcelType, \
ThermoType \
); \
makeInjectionModelThermoType \
( \
ReactingLookupTableInjection, \
KinematicCloud, \

View File

@ -121,6 +121,9 @@ public:
//- Flag to indicate whether model activates injection model
virtual bool active() const = 0;
//- Cache carrier fields
virtual void cacheFields(const bool store) = 0;
//- Update (disperse particles)
virtual vector update
(

View File

@ -42,7 +42,11 @@ Foam::DispersionRASModel<CloudType>::DispersionRASModel
(
"RASProperties"
)
)
),
kPtr_(NULL),
ownK_(false),
epsilonPtr_(NULL),
ownEpsilon_(false)
{}
@ -50,7 +54,56 @@ Foam::DispersionRASModel<CloudType>::DispersionRASModel
template<class CloudType>
Foam::DispersionRASModel<CloudType>::~DispersionRASModel()
{}
{
cacheFields(false);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
void Foam::DispersionRASModel<CloudType>::cacheFields(const bool store)
{
if (store)
{
tmp<volScalarField> tk = this->turbulence().k();
if (tk.isTmp())
{
kPtr_ = tk.ptr();
ownK_ = true;
}
else
{
kPtr_ = tk.operator->();
ownK_ = false;
}
tmp<volScalarField> tepsilon = this->turbulence().epsilon();
if (tepsilon.isTmp())
{
epsilonPtr_ = tepsilon.ptr();
ownEpsilon_ = true;
}
else
{
epsilonPtr_ = tepsilon.operator->();
ownEpsilon_ = false;
}
}
else
{
if (ownK_ && kPtr_)
{
delete kPtr_;
ownK_ = false;
}
if (ownEpsilon_ && epsilonPtr_)
{
delete epsilonPtr_;
ownEpsilon_ = false;
}
}
}
// ************************************************************************* //

View File

@ -50,11 +50,27 @@ class DispersionRASModel
:
public DispersionModel<CloudType>
{
// Private data
protected:
// Protected data
//- Reference to the compressible turbulence model
const compressible::RASModel& turbulence_;
// Locally cached turbulence fields
//- Turbulence k
const volScalarField* kPtr_;
//- Take ownership of the k field
bool ownK_;
//- Turbulence epsilon
const volScalarField* epsilonPtr_;
//- Take ownership of the epsilon field
bool ownEpsilon_;
public:
@ -78,6 +94,9 @@ public:
// Member Functions
//- Cache carrier fields
virtual void cacheFields(const bool store);
//- Return const access to the turbulence model
const compressible::RASModel& turbulence() const
{

View File

@ -35,7 +35,8 @@ Foam::GradientDispersionRAS<CloudType>::GradientDispersionRAS
CloudType& owner
)
:
DispersionRASModel<CloudType>(dict, owner)
DispersionRASModel<CloudType>(dict, owner),
gradkPtr_(NULL)
{}
@ -43,7 +44,9 @@ Foam::GradientDispersionRAS<CloudType>::GradientDispersionRAS
template<class CloudType>
Foam::GradientDispersionRAS<CloudType>::~GradientDispersionRAS()
{}
{
cacheFields(false);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -55,6 +58,25 @@ bool Foam::GradientDispersionRAS<CloudType>::active() const
}
template<class CloudType>
void Foam::GradientDispersionRAS<CloudType>::cacheFields(const bool store)
{
DispersionRASModel<CloudType>::cacheFields(store);
if (store)
{
gradkPtr_ = fvc::grad(*this->kPtr_).ptr();
}
else
{
if (gradkPtr_)
{
delete gradkPtr_;
}
}
}
template<class CloudType>
Foam::vector Foam::GradientDispersionRAS<CloudType>::update
(
@ -68,9 +90,9 @@ Foam::vector Foam::GradientDispersionRAS<CloudType>::update
{
const scalar cps = 0.16432;
const volScalarField& k = this->turbulence().k();
const volScalarField& epsilon = this->turbulence().epsilon();
const volVectorField gradk = fvc::grad(k);
const volScalarField& k = *this->kPtr_;
const volScalarField& epsilon = *this->epsilonPtr_;
const volVectorField& gradk = *this->gradkPtr_;
const scalar UrelMag = mag(U - Uc - UTurb);

View File

@ -51,6 +51,14 @@ class GradientDispersionRAS
:
public DispersionRASModel<CloudType>
{
protected:
// Locally cached turbulence fields
//- Gradient of k
const volVectorField* gradkPtr_;
public:
//- Runtime type information
@ -76,8 +84,11 @@ public:
//- Flag to indicate whether model activates injection model
bool active() const;
//- Cache carrier fields
virtual void cacheFields(const bool store);
//- Update (disperse particles)
vector update
virtual vector update
(
const scalar dt,
const label celli,

View File

@ -55,6 +55,13 @@ bool Foam::NoDispersion<CloudType>::active() const
}
template<class CloudType>
void Foam::NoDispersion<CloudType>::cacheFields(const bool)
{
// do nothing
}
template<class CloudType>
Foam::vector Foam::NoDispersion<CloudType>::update
(

View File

@ -72,10 +72,13 @@ public:
// Member Functions
//- Flag to indicate whether model activates injection model
bool active() const;
virtual bool active() const;
//- Cache carrier fields
virtual void cacheFields(const bool store);
//- Update (disperse particles)
vector update
virtual vector update
(
const scalar dt,
const label celli,

View File

@ -68,8 +68,8 @@ Foam::vector Foam::StochasticDispersionRAS<CloudType>::update
{
const scalar cps = 0.16432;
const volScalarField& k = this->turbulence().k();
const volScalarField& epsilon = this->turbulence().epsilon();
const volScalarField& k = *this->kPtr_;
const volScalarField& epsilon = *this->epsilonPtr_;
const scalar UrelMag = mag(U - Uc - UTurb);

View File

@ -74,10 +74,10 @@ public:
// Member Functions
//- Flag to indicate whether model activates injection model
bool active() const;
virtual bool active() const;
//- Update (disperse particles)
vector update
virtual vector update
(
const scalar dt,
const label celli,

View File

@ -64,7 +64,7 @@ const Foam::dictionary& Foam::DragModel<CloudType>::dict() const
template<class CloudType>
Foam::scalar Foam::DragModel<CloudType>::ptc
Foam::scalar Foam::DragModel<CloudType>::utc
(
const vector& Ur,
const scalar d,

View File

@ -121,8 +121,8 @@ public:
virtual scalar Cd(const scalar Re) const = 0;
//- Return momentum transfer coefficient
// Drag force per unit particle surface area = ptc(U - Up)
scalar ptc
// Drag force per unit particle surface area = utc(U - Up)
scalar utc
(
const vector& Ur,
const scalar d,

View File

@ -181,7 +181,7 @@ public:
//- Flag to identify whether model fully describes the parcel
virtual bool fullyDescribed() const;
//- Return flag to identify whether or not injection in cellI is
//- Return flag to identify whether or not injection of parcelI is
// permitted
virtual bool validInjection(const label parcelI);
};

View File

@ -280,7 +280,7 @@ bool Foam::ConeInjectionMP<CloudType>::fullyDescribed() const
template<class CloudType>
bool Foam::ConeInjectionMP<CloudType>::validInjection(const label parcelI)
bool Foam::ConeInjectionMP<CloudType>::validInjection(const label)
{
return true;
}

View File

@ -191,7 +191,7 @@ public:
//- Flag to identify whether model fully describes the parcel
virtual bool fullyDescribed() const;
//- Return flag to identify whether or not injection in cellI is
//- Return flag to identify whether or not injection of parcelI is
// permitted
virtual bool validInjection(const label parcelI);
};

View File

@ -181,7 +181,7 @@ public:
//- Flag to identify whether model fully describes the parcel
virtual bool fullyDescribed() const;
//- Return flag to identify whether or not injection in cellI is
//- Return flag to identify whether or not injection of parcelI is
// permitted
virtual bool validInjection(const label parcelI);
};

View File

@ -161,7 +161,7 @@ protected:
const scalar time1
) const = 0;
//- Additional flag to identify whether or not injection in cellI is
//- Additional flag to identify whether or not injection of parcelI is
// permitted
virtual bool validInjection(const label parcelI) = 0;

View File

@ -170,7 +170,7 @@ public:
//- Flag to identify whether model fully describes the parcel
virtual bool fullyDescribed() const;
//- Return flag to identify whether or not injection in cellI is
//- Return flag to identify whether or not injection of parcelI is
// permitted
virtual bool validInjection(const label parcelI);
};

View File

@ -105,8 +105,7 @@ Foam::ManualInjection<CloudType>::ManualInjection
}
// Determine volume of particles to inject
this->volumeTotal_ = sum(pow(diameters_, 3))
*mathematicalConstant::pi/6.0;
this->volumeTotal_ = sum(pow3(diameters_))*mathematicalConstant::pi/6.0;
}
@ -139,7 +138,7 @@ void Foam::ManualInjection<CloudType>::setPositionAndCell
(
const label parcelI,
const label,
const scalar time,
const scalar,
vector& position,
label& cellOwner
)

View File

@ -153,7 +153,7 @@ public:
//- Flag to identify whether model fully describes the parcel
virtual bool fullyDescribed() const;
//- Return flag to identify whether or not injection in cellI is
//- Return flag to identify whether or not injection of parcelI is
// permitted
virtual bool validInjection(const label parcelI);
};

View File

@ -123,9 +123,9 @@ public:
//- Flag to identify whether model fully describes the parcel
virtual bool fullyDescribed() const;
//- Return flag to identify whether or not injection in cellI is
//- Return flag to identify whether or not injection of parcelI is
// permitted
virtual bool validInjection(const label cellI);
virtual bool validInjection(const label parcelI);
};

View File

@ -0,0 +1,206 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "PatchInjection.H"
#include "DataEntry.H"
#include "pdf.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class CloudType>
Foam::label Foam::PatchInjection<CloudType>::parcelsToInject
(
const scalar time0,
const scalar time1
) const
{
if ((time0 >= 0.0) && (time0 < duration_))
{
return round(fraction_*(time1 - time0)*parcelsPerSecond_);
}
else
{
return 0;
}
}
template<class CloudType>
Foam::scalar Foam::PatchInjection<CloudType>::volumeToInject
(
const scalar time0,
const scalar time1
) const
{
if ((time0 >= 0.0) && (time0 < duration_))
{
return fraction_*volumeFlowRate_().integrate(time0, time1);
}
else
{
return 0.0;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::PatchInjection<CloudType>::PatchInjection
(
const dictionary& dict,
CloudType& owner
)
:
InjectionModel<CloudType>(dict, owner, typeName),
patchName_(this->coeffDict().lookup("patchName")),
duration_(readScalar(this->coeffDict().lookup("duration"))),
parcelsPerSecond_
(
readScalar(this->coeffDict().lookup("parcelsPerSecond"))
),
U0_(this->coeffDict().lookup("U0")),
volumeFlowRate_
(
DataEntry<scalar>::New
(
"volumeFlowRate",
this->coeffDict()
)
),
parcelPDF_
(
pdf::New
(
this->coeffDict().subDict("parcelPDF"),
owner.rndGen()
)
),
cellOwners_(),
fraction_(1.0)
{
label patchId = owner.mesh().boundaryMesh().findPatchID(patchName_);
if (patchId < 0)
{
FatalErrorIn
(
"PatchInjection<CloudType>::PatchInjection"
"("
"const dictionary&, "
"CloudType&"
")"
) << "Requested patch " << patchName_ << " not found" << nl
<< "Available patches are: " << owner.mesh().boundaryMesh().names()
<< nl << exit(FatalError);
}
const polyPatch& patch = owner.mesh().boundaryMesh()[patchId];
cellOwners_ = patch.faceCells();
label patchSize = cellOwners_.size();
label totalPatchSize = patchSize;
reduce(totalPatchSize, sumOp<scalar>());
fraction_ = patchSize/totalPatchSize;
// Set total volume to inject
this->volumeTotal_ = fraction_*volumeFlowRate_().integrate(0.0, duration_);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::PatchInjection<CloudType>::~PatchInjection()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
bool Foam::PatchInjection<CloudType>::active() const
{
return true;
}
template<class CloudType>
Foam::scalar Foam::PatchInjection<CloudType>::timeEnd() const
{
return this->SOI_ + duration_;
}
template<class CloudType>
void Foam::PatchInjection<CloudType>::setPositionAndCell
(
const label,
const label,
const scalar,
vector& position,
label& cellOwner
)
{
label cellI = this->owner().rndGen().integer(0, cellOwners_.size() - 1);
cellOwner = cellOwners_[cellI];
position = this->owner().mesh().C()[cellOwner];
}
template<class CloudType>
void Foam::PatchInjection<CloudType>::setProperties
(
const label,
const label,
const scalar,
typename CloudType::parcelType& parcel
)
{
// set particle velocity
parcel.U() = U0_;
// set particle diameter
parcel.d() = parcelPDF_->sample();
}
template<class CloudType>
bool Foam::PatchInjection<CloudType>::fullyDescribed() const
{
return false;
}
template<class CloudType>
bool Foam::PatchInjection<CloudType>::validInjection(const label)
{
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,187 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::PatchInjection
Description
Patch injection
- User specifies
- Total mass to inject
- Name of patch
- Injection duration
- Initial parcel velocity
- Injection volume flow rate
- Parcel diameters obtained by PDF model
- Parcels injected at cell centres adjacent to patch
SourceFiles
PatchInjection.C
\*---------------------------------------------------------------------------*/
#ifndef PatchInjection_H
#define PatchInjection_H
#include "InjectionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<class Type>
class DataEntry;
class pdf;
/*---------------------------------------------------------------------------*\
Class PatchInjection Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class PatchInjection
:
public InjectionModel<CloudType>
{
// Private data
//- Name of patch
const word patchName_;
//- Injection duration [s]
const scalar duration_;
//- Number of parcels to introduce per second []
const label parcelsPerSecond_;
//- Initial parcel velocity [m/s]
const vector U0_;
//- Volume flow rate of parcels to introduce relative to SOI [m^3/s]
const autoPtr<DataEntry<scalar> > volumeFlowRate_;
//- Parcel size PDF model
const autoPtr<pdf> parcelPDF_;
//- Cell owners
labelList cellOwners_;
//- Fraction of injection controlled by this processor
scalar fraction_;
protected:
// Protected member functions
//- Number of parcels to introduce over the time step relative to SOI
label parcelsToInject
(
const scalar time0,
const scalar time1
) const;
//- Volume of parcels to introduce over the time step relative to SOI
scalar volumeToInject
(
const scalar time0,
const scalar time1
) const;
public:
//- Runtime type information
TypeName("PatchInjection");
// Constructors
//- Construct from dictionary
PatchInjection
(
const dictionary& dict,
CloudType& owner
);
//- Destructor
virtual ~PatchInjection();
// Member Functions
//- Flag to indicate whether model activates injection model
bool active() const;
//- Return the end-of-injection time
scalar timeEnd() const;
// Injection geometry
//- Set the injection position and owner cell
virtual void setPositionAndCell
(
const label parcelI,
const label nParcels,
const scalar time,
vector& position,
label& cellOwner
);
virtual void setProperties
(
const label parcelI,
const label nParcels,
const scalar time,
typename CloudType::parcelType& parcel
);
//- Flag to identify whether model fully describes the parcel
virtual bool fullyDescribed() const;
//- Return flag to identify whether or not injection of parcelI is
// permitted
virtual bool validInjection(const label parcelI);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "PatchInjection.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -27,6 +27,26 @@ License
#include "PatchPostProcessing.H"
#include "IOPtrList.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template <class CloudType>
Foam::label Foam::PatchPostProcessing<CloudType>::applyToPatch
(
const label globalPatchI
) const
{
forAll(patchIds_, patchI)
{
if (patchIds_[patchI] == globalPatchI)
{
return patchI;
}
}
return -1;
}
// * * * * * * * * * * * * * protected Member Functions * * * * * * * * * * //
template<class CloudType>
@ -80,9 +100,8 @@ Foam::PatchPostProcessing<CloudType>::PatchPostProcessing
mesh_(owner.mesh()),
patchNames_(this->coeffDict().lookup("patches")),
patchData_(patchNames_.size()),
globalToLocalPatchIds_(patchNames_.size())
patchIds_(patchNames_.size())
{
labelList localToGlobal(patchNames_.size());
forAll(patchNames_, patchI)
{
label id = mesh_.boundaryMesh().findPatchID(patchNames_[patchI]);
@ -99,12 +118,7 @@ Foam::PatchPostProcessing<CloudType>::PatchPostProcessing
<< "Available patches are: " << mesh_.boundaryMesh().names() << nl
<< exit(FatalError);
}
localToGlobal[patchI] = id;
}
forAll(localToGlobal, patchI)
{
globalToLocalPatchIds_[localToGlobal[patchI]] = patchI;
patchIds_[patchI] = id;
}
}
@ -132,8 +146,8 @@ void Foam::PatchPostProcessing<CloudType>::postPatch
const label patchI
)
{
label localPatchI = globalToLocalPatchIds_[patchI];
if (patchData_[localPatchI].size() < maxStoredParcels_)
label localPatchI = applyToPatch(patchI);
if (localPatchI >= 0 && patchData_[localPatchI].size() < maxStoredParcels_)
{
patchData_[localPatchI].append(p.clone());
}

View File

@ -44,7 +44,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class PatchPostProcessing Declaration
Class PatchPostProcessing Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
@ -59,7 +59,7 @@ class PatchPostProcessing
//- Reference to the mesh
const polyMesh& mesh_;
//- Maximum number of parcels to store per patch
//- Maximum number of parcels to store
label maxStoredParcels_;
//- List of patch names
@ -68,8 +68,14 @@ class PatchPostProcessing
//- List of parcel data per patch
List<DynamicList<autoPtr<parcelType> > > patchData_;
//- Mapping from global to local patch ids
labelList globalToLocalPatchIds_;
//- Mapping from local to global patch ids
labelList patchIds_;
// Private member functions
//- Returns local patchI if patch is in patchIds_ list
label applyToPatch(const label globalPatchI) const;
protected:
@ -109,8 +115,8 @@ public:
//- Return const access to the list of patch names
inline const wordList& patchNames() const;
//- Return const mapping from global to local patch ids
inline const labelList& globalToLocalPatchIds() const;
//- Return const mapping from local to global patch ids
inline const labelList& patchIds() const;
// Evaluation

View File

@ -47,9 +47,9 @@ const Foam::wordList& Foam::PatchPostProcessing<CloudType>::patchNames() const
template<class CloudType>
const Foam::labelList&
Foam::PatchPostProcessing<CloudType>::globalToLocalPatchIds() const
Foam::PatchPostProcessing<CloudType>::patchIds() const
{
return globalToLocalPatchIds_;
return patchIds_;
}

View File

@ -181,7 +181,7 @@ public:
//- Flag to identify whether model fully describes the parcel
virtual bool fullyDescribed() const;
//- Return flag to identify whether or not injection in cellI is
//- Return flag to identify whether or not injection of parcelI is
// permitted
virtual bool validInjection(const label parcelI);
};

View File

@ -181,7 +181,7 @@ public:
return true;
}
//- Return flag to identify whether or not injection in cellI is
//- Return flag to identify whether or not injection of parcelI is
// permitted
virtual bool validInjection(const label parcelI);
};

View File

@ -266,7 +266,7 @@ public:
virtual scalar mug(scalar p, scalar T) const = 0;
//- Liquid thermal conductivity [W/(m K)]
virtual scalar K(scalar p, scalar T) const =0;
virtual scalar K(scalar p, scalar T) const = 0;
//- Vapour thermal conductivity [W/(m K)]
virtual scalar Kg(scalar p, scalar T) const = 0;

View File

@ -43,14 +43,14 @@ void Foam::hPsiMixtureThermo<MixtureType>::calculate()
forAll(TCells, celli)
{
const typename MixtureType::thermoType& mixture_ =
const typename MixtureType::thermoType& mixture =
this->cellMixture(celli);
TCells[celli] = mixture_.TH(hCells[celli], TCells[celli]);
psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]);
TCells[celli] = mixture.TH(hCells[celli], TCells[celli]);
psiCells[celli] = mixture.psi(pCells[celli], TCells[celli]);
muCells[celli] = mixture_.mu(TCells[celli]);
alphaCells[celli] = mixture_.alpha(TCells[celli]);
muCells[celli] = mixture.mu(TCells[celli]);
alphaCells[celli] = mixture.alpha(TCells[celli]);
}
forAll(T_.boundaryField(), patchi)
@ -68,28 +68,28 @@ void Foam::hPsiMixtureThermo<MixtureType>::calculate()
{
forAll(pT, facei)
{
const typename MixtureType::thermoType& mixture_ =
const typename MixtureType::thermoType& mixture =
this->patchFaceMixture(patchi, facei);
ph[facei] = mixture_.H(pT[facei]);
ph[facei] = mixture.H(pT[facei]);
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu_[facei] = mixture_.mu(pT[facei]);
palpha_[facei] = mixture_.alpha(pT[facei]);
ppsi[facei] = mixture.psi(pp[facei], pT[facei]);
pmu_[facei] = mixture.mu(pT[facei]);
palpha_[facei] = mixture.alpha(pT[facei]);
}
}
else
{
forAll(pT, facei)
{
const typename MixtureType::thermoType& mixture_ =
const typename MixtureType::thermoType& mixture =
this->patchFaceMixture(patchi, facei);
pT[facei] = mixture_.TH(ph[facei], pT[facei]);
pT[facei] = mixture.TH(ph[facei], pT[facei]);
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu_[facei] = mixture_.mu(pT[facei]);
palpha_[facei] = mixture_.alpha(pT[facei]);
ppsi[facei] = mixture.psi(pp[facei], pT[facei]);
pmu_[facei] = mixture.mu(pT[facei]);
palpha_[facei] = mixture.alpha(pT[facei]);
}
}
}

View File

@ -44,15 +44,15 @@ void Foam::hRhoMixtureThermo<MixtureType>::calculate()
forAll(TCells, celli)
{
const typename MixtureType::thermoType& mixture_ =
const typename MixtureType::thermoType& mixture =
this->cellMixture(celli);
TCells[celli] = mixture_.TH(hCells[celli], TCells[celli]);
psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]);
rhoCells[celli] = mixture_.rho(pCells[celli], TCells[celli]);
TCells[celli] = mixture.TH(hCells[celli], TCells[celli]);
psiCells[celli] = mixture.psi(pCells[celli], TCells[celli]);
rhoCells[celli] = mixture.rho(pCells[celli], TCells[celli]);
muCells[celli] = mixture_.mu(TCells[celli]);
alphaCells[celli] = mixture_.alpha(TCells[celli]);
muCells[celli] = mixture.mu(TCells[celli]);
alphaCells[celli] = mixture.alpha(TCells[celli]);
}
forAll(T_.boundaryField(), patchi)
@ -71,30 +71,30 @@ void Foam::hRhoMixtureThermo<MixtureType>::calculate()
{
forAll(pT, facei)
{
const typename MixtureType::thermoType& mixture_ =
const typename MixtureType::thermoType& mixture =
this->patchFaceMixture(patchi, facei);
ph[facei] = mixture_.H(pT[facei]);
ph[facei] = mixture.H(pT[facei]);
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
prho[facei] = mixture_.rho(pp[facei], pT[facei]);
pmu_[facei] = mixture_.mu(pT[facei]);
palpha_[facei] = mixture_.alpha(pT[facei]);
ppsi[facei] = mixture.psi(pp[facei], pT[facei]);
prho[facei] = mixture.rho(pp[facei], pT[facei]);
pmu_[facei] = mixture.mu(pT[facei]);
palpha_[facei] = mixture.alpha(pT[facei]);
}
}
else
{
forAll(pT, facei)
{
const typename MixtureType::thermoType& mixture_ =
const typename MixtureType::thermoType& mixture =
this->patchFaceMixture(patchi, facei);
pT[facei] = mixture_.TH(ph[facei], pT[facei]);
pT[facei] = mixture.TH(ph[facei], pT[facei]);
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
prho[facei] = mixture_.rho(pp[facei], pT[facei]);
pmu_[facei] = mixture_.mu(pT[facei]);
palpha_[facei] = mixture_.alpha(pT[facei]);
ppsi[facei] = mixture.psi(pp[facei], pT[facei]);
prho[facei] = mixture.rho(pp[facei], pT[facei]);
pmu_[facei] = mixture.mu(pT[facei]);
palpha_[facei] = mixture.alpha(pT[facei]);
}
}
}

View File

@ -34,7 +34,7 @@ Foam::solidMixture::solidMixture
const dictionary& thermophysicalProperties
)
:
components_(thermophysicalProperties.lookup("solidFuelComponents")),
components_(thermophysicalProperties.lookup("solidComponents")),
properties_(components_.size())
{

View File

@ -122,7 +122,7 @@ public:
//- Construct and return a clone
inline autoPtr<hConstThermo> clone() const;
// Selector from Istream
//- Selector from Istream
inline static autoPtr<hConstThermo> New(Istream& is);

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -10,6 +10,7 @@ FoamFile
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -10,6 +10,7 @@ FoamFile
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -10,46 +10,43 @@ FoamFile
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
5
(
inlet
{
type patch;
nFaces 30;
startFace 24170;
}
outlet
{
type patch;
nFaces 57;
startFace 24200;
}
upperWall
{
type wall;
nFaces 223;
startFace 24257;
}
lowerWall
{
type wall;
nFaces 250;
startFace 24480;
}
frontAndBack
{
type empty;
nFaces 24450;
startFace 24730;
}
inlet
{
type patch;
nFaces 30;
startFace 24170;
}
outlet
{
type patch;
nFaces 57;
startFace 24200;
}
upperWall
{
type wall;
nFaces 223;
startFace 24257;
}
lowerWall
{
type wall;
nFaces 250;
startFace 24480;
}
frontAndBack
{
type empty;
nFaces 24450;
startFace 24730;
}
)
// ************************************************************************* //

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -10,46 +10,43 @@ FoamFile
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
5
(
inlet
{
type patch;
nFaces 30;
startFace 24170;
}
outlet
{
type patch;
nFaces 57;
startFace 24200;
}
upperWall
{
type wall;
nFaces 223;
startFace 24257;
}
lowerWall
{
type wall;
nFaces 250;
startFace 24480;
}
frontAndBack
{
type empty;
nFaces 24450;
startFace 24730;
}
inlet
{
type patch;
nFaces 30;
startFace 24170;
}
outlet
{
type patch;
nFaces 57;
startFace 24200;
}
upperWall
{
type wall;
nFaces 223;
startFace 24257;
}
lowerWall
{
type wall;
nFaces 250;
startFace 24480;
}
frontAndBack
{
type empty;
nFaces 24450;
startFace 24730;
}
)
// ************************************************************************* //

View File

@ -1,17 +0,0 @@
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name from directory
application="XiFoam"
cases=" \
pitzDaily \
pitzDaily3D
"
for i in $cases; do
blockMesh -case $i
$application -case $i
done

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -10,46 +10,43 @@ FoamFile
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
5
(
inlet
{
type patch;
nFaces 30;
startFace 24170;
}
outlet
{
type patch;
nFaces 57;
startFace 24200;
}
upperWall
{
type wall;
nFaces 223;
startFace 24257;
}
lowerWall
{
type wall;
nFaces 250;
startFace 24480;
}
frontAndBack
{
type empty;
nFaces 24450;
startFace 24730;
}
inlet
{
type patch;
nFaces 30;
startFace 24170;
}
outlet
{
type patch;
nFaces 57;
startFace 24200;
}
upperWall
{
type wall;
nFaces 223;
startFace 24257;
}
lowerWall
{
type wall;
nFaces 250;
startFace 24480;
}
frontAndBack
{
type empty;
nFaces 24450;
startFace 24730;
}
)
// ************************************************************************* //

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

View File

@ -1,8 +1,8 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
@ -10,32 +10,31 @@ FoamFile
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
3
(
piston
{
type wall;
nFaces 1326;
startFace 79522;
}
liner
{
type wall;
nFaces 2710;
startFace 80848;
}
cylinderHead
{
type wall;
nFaces 2184;
startFace 83558;
}
piston
{
type wall;
nFaces 1326;
startFace 79522;
}
liner
{
type wall;
nFaces 2710;
startFace 80848;
}
cylinderHead
{
type wall;
nFaces 2184;
startFace 83558;
}
)
// ************************************************************************* //

View File

@ -22,7 +22,7 @@ solvers
solver PCG;
preconditioner DIC;
tolerance 1e-08;
relTol 0;
relTol 0.01;
}
U
@ -30,7 +30,7 @@ solvers
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
relTol 0.1;
}
T
@ -38,7 +38,7 @@ solvers
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
relTol 0.1;
}
k
@ -46,7 +46,7 @@ solvers
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
relTol 0.1;
}
epsilon
@ -54,7 +54,7 @@ solvers
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
relTol 0.1;
}
R
@ -62,7 +62,7 @@ solvers
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
relTol 0.1;
}
}

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 265;
boundaryField
{
ground
{
type fixedValue;
value uniform 265;
}
igloo_region0
{
type fixedValue;
value uniform 265;
}
twoFridgeFreezers_seal_0
{
type fixedValue;
value uniform 303;
}
twoFridgeFreezers_herring_1
{
type fixedValue;
value uniform 303;
}
}
// ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show More