diff --git a/.gitignore b/.gitignore index 150288aae2555094adff1f866bb0e4e950f07c9f..b030d74e096b58cee76a6ac24a608cc71b9963d2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *.orig *.bak \#*\# +.directory # CVS recovered versions - anywhere .#* @@ -47,7 +48,9 @@ doc/[Dd]oxygen/man # source packages - anywhere *.tar.bz2 *.tar.gz +*.tar *.tgz +*.gtgz # ignore the persistent .build tag in the main directory /.build diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/Make/files b/applications/solvers/Lagrangian/reactingParcelFoam/Make/files deleted file mode 100644 index ea13ecb0c59ab2c13459051e71c737ee139cc06a..0000000000000000000000000000000000000000 --- a/applications/solvers/Lagrangian/reactingParcelFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -reactingParcelFoam.C - -EXE = $(FOAM_USER_APPBIN)/reactingParcelFoam diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/createClouds.H b/applications/solvers/Lagrangian/reactingParcelFoam/createClouds.H deleted file mode 100644 index b4ec5e40569b90994c4575e1faae10cd304d1c78..0000000000000000000000000000000000000000 --- a/applications/solvers/Lagrangian/reactingParcelFoam/createClouds.H +++ /dev/null @@ -1,40 +0,0 @@ -Info << "\nConstructing gas properties" << endl; -/* -PtrList<specieConstProperties> gasProperties(Y.size()); -forAll(gasProperties, i) -{ - gasProperties.set - ( - i, - new specieConstProperties - ( - dynamic_cast<const multiComponentMixture<constTransport< - specieThermo<hConstThermo<perfectGas> > > >&> - (thermo()).speciesData()[i] - ) - ); -} -*/ -PtrList<specieReactingProperties> gasProperties(Y.size()); -forAll(gasProperties, i) -{ - gasProperties.set - ( - i, - new specieReactingProperties - ( - dynamic_cast<const reactingMixture&>(thermo()).speciesData()[i] - ) - ); -} - -Info<< "\nConstructing reacting cloud" << endl; -basicReactingCloud parcels -( - "reactingCloud1", - rho, - U, - g, - thermo(), - gasProperties -); diff --git a/applications/solvers/combustion/coalChemistryFoam/Make/files b/applications/solvers/combustion/coalChemistryFoam/Make/files index 6a1392f01cc62ffcfa923a26726558e36d3f78c9..552d73450173870f57cee6a4b126b16fd63d08be 100644 --- a/applications/solvers/combustion/coalChemistryFoam/Make/files +++ b/applications/solvers/combustion/coalChemistryFoam/Make/files @@ -1,3 +1,3 @@ coalChemistryFoam.C -EXE = $(FOAM_USER_APPBIN)/coalChemistryFoam +EXE = $(FOAM_APPBIN)/coalChemistryFoam diff --git a/applications/solvers/combustion/coalChemistryFoam/Make/options b/applications/solvers/combustion/coalChemistryFoam/Make/options index 21575a94ae65b3ef3d5dc4fa9d4004bd6b8149fb..d1dd07691bb4999db85d94725ccac1ee912e6173 100644 --- a/applications/solvers/combustion/coalChemistryFoam/Make/options +++ b/applications/solvers/combustion/coalChemistryFoam/Make/options @@ -19,7 +19,6 @@ EXE_INC = \ -I$(LIB_SRC)/ODE/lnInclude EXE_LIBS = \ - -L$(FOAM_USER_LIBBIN) \ -lfiniteVolume \ -lmeshTools \ -lcompressibleRASModels \ diff --git a/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C index 3bccc682d33ee4532a832198151c8ef984aaf87b..f5fc4faea60a3445be00566bfcad67f9904cfbbc 100644 --- a/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C +++ b/applications/solvers/combustion/coalChemistryFoam/coalChemistryFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,11 +35,11 @@ Description #include "hCombustionThermo.H" #include "turbulenceModel.H" #include "basicThermoCloud.H" -#include "coalCloud.H" +#include "CoalCloud.H" #include "chemistryModel.H" #include "chemistrySolver.H" -#include "ReactingCloudThermoTypes.H" -#include "timeActivatedExplicitSource.H" +#include "reactingThermoTypes.H" +#include "timeActivatedExplicitCellSource.H" #include "radiationModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -113,8 +113,6 @@ int main(int argc, char *argv[]) turbulence->correct(); - enthalpySource.update(); - rho = thermo->rho(); if (runTime.write()) diff --git a/applications/solvers/combustion/coalChemistryFoam/createClouds.H b/applications/solvers/combustion/coalChemistryFoam/createClouds.H index 34398f6b827944f55ee061156ef779cf9e7ccd5b..4ed459b1507d7064f1a996c6aad3e0dcac95331b 100644 --- a/applications/solvers/combustion/coalChemistryFoam/createClouds.H +++ b/applications/solvers/combustion/coalChemistryFoam/createClouds.H @@ -1,44 +1,11 @@ -Info<< "\nConstructing interpolation" << endl; - -Info << "\nConstructing gas properties" << endl; -/* -PtrList<specieConstProperties> gasProperties(Y.size()); -forAll(gasProperties, i) -{ - gasProperties.set - ( - i, - new specieConstProperties - ( - dynamic_cast<const multiComponentMixture<constTransport< - specieThermo<hConstThermo<perfectGas> > > >&> - (thermo()).speciesData()[i] - ) - ); -} -*/ -PtrList<specieReactingProperties> gasProperties(Y.size()); -forAll(gasProperties, i) -{ - gasProperties.set - ( - i, - new specieReactingProperties - ( - dynamic_cast<const reactingMixture&>(thermo()).speciesData()[i] - ) - ); -} - Info<< "\nConstructing coal cloud" << endl; -coalCloud coalParcels +CoalCloud<specieReactingProperties> coalParcels ( "coalCloud1", rho, U, g, - thermo(), - gasProperties + thermo() ); Info<< "\nConstructing limestone cloud" << endl; diff --git a/applications/solvers/combustion/coalChemistryFoam/createFields.H b/applications/solvers/combustion/coalChemistryFoam/createFields.H index ebd8a44ab63731268a87378b9c286f07a58198f8..7232cc424478db7ab9195ca6fef16e61fdf98110 100644 --- a/applications/solvers/combustion/coalChemistryFoam/createFields.H +++ b/applications/solvers/combustion/coalChemistryFoam/createFields.H @@ -105,8 +105,8 @@ volScalarField DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); - Info<< "\nConstructing explicit enthalpy source" << endl; - timeActivatedExplicitSource enthalpySource + Info<< "\nConstructing explicit enthalpy cell source" << endl; + timeActivatedExplicitCellSource enthalpySource ( "enthalpySource", mesh, diff --git a/applications/solvers/combustion/coalChemistryFoam/rhoEqn.H b/applications/solvers/combustion/coalChemistryFoam/rhoEqn.H index fdc338a9595e28279d70bbc68e4cff93ae0499ca..ce337f5acf76fdf2f21080c15ce27973d4fc93cf 100644 --- a/applications/solvers/combustion/coalChemistryFoam/rhoEqn.H +++ b/applications/solvers/combustion/coalChemistryFoam/rhoEqn.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/combustion/reactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/createFields.H index cf0532b0f3a9079454779e4cb04a1054277129b3..510f7d4236631404dea74eecb2886c3600d2cb4c 100644 --- a/applications/solvers/combustion/reactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/createFields.H @@ -37,7 +37,6 @@ volVectorField U volScalarField& p = thermo->p(); const volScalarField& psi = thermo->psi(); -const volScalarField& T = thermo->T(); volScalarField& h = thermo->h(); @@ -99,5 +98,5 @@ volScalarField dQ IOobject::AUTO_WRITE ), mesh, - dimensionedScalar("zero", dimensionSet(1,-3,-1,0,0,0,0), 0.0) + dimensionedScalar("zero", dimensionSet(1, -3, -1, 0, 0, 0, 0), 0.0) ); diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/buoyantBoussinesqPisoFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/buoyantBoussinesqPisoFoam.C index bd0ce2ac373a09d4c8816ad5fc990244d31a51d7..e3cece5b91f321694941d087e194fb3b07dec430 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/buoyantBoussinesqPisoFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPisoFoam/buoyantBoussinesqPisoFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C index 26e732cf9c17b30ac63d080b03470a3678290aa0..fafb49d84846c8ab4505a3770bfd9fc55d90dd89 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/heatTransfer/buoyantPisoFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantPisoFoam/UEqn.H index 24cfbf4f685a291b1a836fc0dfd931f9bfc526d1..d4878d063dab6ee8ed4243c61d529832d3dd9c6a 100644 --- a/applications/solvers/heatTransfer/buoyantPisoFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantPisoFoam/UEqn.H @@ -15,12 +15,10 @@ ( UEqn == - -fvc::reconstruct + fvc::reconstruct ( - ( - fvc::snGrad(pd) - + ghf*fvc::snGrad(rho) - ) * mesh.magSf() + fvc::interpolate(rho)*(g & mesh.Sf()) + - fvc::snGrad(p)*mesh.magSf() ) ); } diff --git a/applications/solvers/heatTransfer/buoyantPisoFoam/createFields.H b/applications/solvers/heatTransfer/buoyantPisoFoam/createFields.H index 103b3ea3bb531684ed48fc5fe74ac8ec588f4d99..f199713cf877086d8202d88a0b66d5e763d728d6 100644 --- a/applications/solvers/heatTransfer/buoyantPisoFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantPisoFoam/createFields.H @@ -59,27 +59,6 @@ fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) ); - Info<< "Calculating field g.h\n" << endl; - volScalarField gh("gh", g & mesh.C()); - surfaceScalarField ghf("ghf", g & mesh.Cf()); - - dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef")); - - Info<< "Creating field pd\n" << endl; - volScalarField pd - ( - IOobject - ( - "pd", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - p = pd + rho*gh + pRef; thermo->correct(); dimensionedScalar initialMass = fvc::domainIntegrate(rho); diff --git a/applications/solvers/heatTransfer/buoyantPisoFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPisoFoam/pEqn.H index 53f6688a6a8438f11c91816941e5d78b5bd47c14..7e48167d67a938b8fb52993be324d2cc01185f72 100644 --- a/applications/solvers/heatTransfer/buoyantPisoFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantPisoFoam/pEqn.H @@ -1,5 +1,5 @@ { - bool closedVolume = pd.needReference(); + bool closedVolume = p.needReference(); rho = thermo->rho(); @@ -17,38 +17,35 @@ ) ); - phi = phiU - ghf*fvc::snGrad(rho)*rhorUAf*mesh.magSf(); + phi = phiU + rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf()); for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - fvScalarMatrix pdEqn + fvScalarMatrix pEqn ( - fvm::ddt(psi, pd) - + fvc::ddt(psi)*pRef - + fvc::ddt(psi, rho)*gh + fvm::ddt(psi, p) + fvc::div(phi) - - fvm::laplacian(rhorUAf, pd) + - fvm::laplacian(rhorUAf, p) ); if (corr == nCorr-1 && nonOrth == nNonOrthCorr) { - pdEqn.solve(mesh.solver(pd.name() + "Final")); + pEqn.solve(mesh.solver(p.name() + "Final")); } else { - pdEqn.solve(mesh.solver(pd.name())); + pEqn.solve(mesh.solver(p.name())); } if (nonOrth == nNonOrthCorr) { - phi += pdEqn.flux(); + phi += pEqn.flux(); } } U += rUA*fvc::reconstruct((phi - phiU)/rhorUAf); U.correctBoundaryConditions(); - p == pd + rho*gh + pRef; DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); #include "rhoEqn.H" @@ -62,6 +59,4 @@ /fvc::domainIntegrate(thermo->psi()); rho = thermo->rho(); } - - pd == p - (rho*gh + pRef); } diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H index 71a57cd2a930c3affd56ba48b809e455d2a93e6c..aa476b4dc808f46619dd5c94fd9d8defaa10c55d 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H @@ -13,14 +13,11 @@ ( UEqn() == - -fvc::reconstruct + fvc::reconstruct ( - ( - fvc::snGrad(pd) - + ghf*fvc::snGrad(rho) - ) * mesh.magSf() + fvc::interpolate(rho)*(g & mesh.Sf()) + - fvc::snGrad(p)*mesh.magSf() ) ).initialResidual(); maxResidual = max(eqnResidual, maxResidual); - diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C index d91b6398f27144233a20adab7983689e3d000c24..b2a8c5c374211719be84f7e03b6340f55a29e2e9 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C @@ -39,15 +39,14 @@ Description int main(int argc, char *argv[]) { + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readEnvironmentalProperties.H" + #include "createFields.H" + #include "initContinuityErrs.H" -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" -# include "readEnvironmentalProperties.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" - pd.storePrevIter(); + 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(); @@ -76,7 +75,7 @@ int main(int argc, char *argv[]) << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; -# include "convergenceCheck.H" + #include "convergenceCheck.H" } Info<< "End\n" << endl; diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H index 879ee722b98ec4c6ab21ca66518c22fc31a9105c..0d9d9d5ec7fc667216c1af6937a24f50d7905986 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H @@ -51,38 +51,16 @@ ) ); - Info<< "Calculating field g.h\n" << endl; - volScalarField gh("gh", g & mesh.C()); - surfaceScalarField ghf("ghf", g & mesh.Cf()); - - dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef")); - - Info<< "Creating field pd\n" << endl; - volScalarField pd - ( - IOobject - ( - "pd", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - p = pd + rho*gh + pRef; thermo->correct(); - - label pdRefCell = 0; - scalar pdRefValue = 0.0; + label pRefCell = 0; + scalar pRefValue = 0.0; setRefCell ( - pd, + p, mesh.solutionDict().subDict("SIMPLE"), - pdRefCell, - pdRefValue + pRefCell, + pRefValue ); diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index 8d97ad9048a5a6e145d9fa0184629534df3a61e3..d592bc3c43eb47f568b79f123f27dd95654fe6ff 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -1,4 +1,6 @@ { + rho = thermo->rho(); + volScalarField rUA = 1.0/UEqn().A(); surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA)); @@ -7,60 +9,57 @@ phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf()); bool closedVolume = adjustPhi(phi, U, p); - surfaceScalarField buoyancyPhi = ghf*fvc::snGrad(rho)*rhorUAf*mesh.magSf(); - phi -= buoyancyPhi; + surfaceScalarField buoyancyPhi = + rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf()); + phi += buoyancyPhi; for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - fvScalarMatrix pdEqn + fvScalarMatrix pEqn ( - fvm::laplacian(rhorUAf, pd) == fvc::div(phi) + fvm::laplacian(rhorUAf, p) == fvc::div(phi) ); - pdEqn.setReference(pdRefCell, pdRefValue); + pEqn.setReference(pRefCell, p[pRefCell]); // retain the residual from the first iteration if (nonOrth == 0) { - eqnResidual = pdEqn.solve().initialResidual(); + eqnResidual = pEqn.solve().initialResidual(); maxResidual = max(eqnResidual, maxResidual); } else { - pdEqn.solve(); + pEqn.solve(); } if (nonOrth == nNonOrthCorr) { + // For closed-volume cases adjust the pressure and density levels + // to obey overall mass continuity + if (closedVolume) + { + p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) + /fvc::domainIntegrate(thermo->psi()); + } + // Calculate the conservative fluxes - phi -= pdEqn.flux(); + phi -= pEqn.flux(); // Explicitly relax pressure for momentum corrector - pd.relax(); + p.relax(); // Correct the momentum source with the pressure gradient flux // calculated from the relaxed pressure - U -= rUA*fvc::reconstruct((buoyancyPhi + pdEqn.flux())/rhorUAf); + U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rhorUAf); U.correctBoundaryConditions(); } } #include "continuityErrs.H" - p == pd + rho*gh + pRef; - - // For closed-volume cases adjust the pressure and density levels - // to obey overall mass continuity - if (closedVolume) - { - p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) - /fvc::domainIntegrate(thermo->psi()); - } - rho = thermo->rho(); rho.relax(); Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; - - pd == p - (rho*gh + pRef); } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/files b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/files index 9d9152930a9c359695a4e969886336ce38466f62..9b95197f541bfa2b20797804bf04054db815eb9f 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/files +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/files @@ -1,10 +1,6 @@ regionProperties/regionProperties.C -coupleManager/coupleManager.C - derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C -derivedFvPatchFields/solidWallHeatFluxTemperatureCoupled/solidWallHeatFluxTemperatureCoupledFvPatchScalarField.C -derivedFvPatchFields/solidWallTemperatureCoupled/solidWallTemperatureCoupledFvPatchScalarField.C derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.C fluid/compressibleCourantNo.C diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options index a8797ca4564489292b11cf720b6ce80816a67192..12316d6bc7b7f06ed9d1f31316b9fd5c616d7e4e 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options @@ -2,9 +2,7 @@ EXE_INC = \ -Ifluid \ -Isolid \ -IregionProperties \ - -IcoupleManager \ - -IderivedFvPatchFields/solidWallTemperatureCoupled \ - -IderivedFvPatchFields/solidWallHeatFluxTemperatureCoupled \ + -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C index faff0edba042b2976c9fca21ec5fb09a0d8d6bca..7ad940bcff1bf5910c2c78253d5068b78a80f768 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C @@ -67,6 +67,7 @@ int main(int argc, char *argv[]) while (runTime.run()) { # include "readTimeControls.H" +# include "readPIMPLEControls.H" if (fluidRegions.size()) { @@ -78,22 +79,36 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << nl << endl; - forAll(fluidRegions, i) + if (nOuterCorr != 1) { - Info<< "\nSolving for fluid region " - << fluidRegions[i].name() << endl; -# include "setRegionFluidFields.H" -# include "readFluidMultiRegionPISOControls.H" -# include "solveFluid.H" + forAll(fluidRegions, i) + { +# include "setRegionFluidFields.H" +# include "storeOldFluidFields.H" + } } - forAll(solidRegions, i) + + // --- PIMPLE loop + for (int oCorr=0; oCorr<nOuterCorr; oCorr++) { - Info<< "\nSolving for solid region " - << solidRegions[i].name() << endl; -# include "setRegionSolidFields.H" -# include "readSolidMultiRegionPISOControls.H" -# include "solveSolid.H" + forAll(fluidRegions, i) + { + Info<< "\nSolving for fluid region " + << fluidRegions[i].name() << endl; +# include "setRegionFluidFields.H" +# include "readFluidMultiRegionPIMPLEControls.H" +# include "solveFluid.H" + } + + forAll(solidRegions, i) + { + Info<< "\nSolving for solid region " + << solidRegions[i].name() << endl; +# include "setRegionSolidFields.H" +# include "readSolidMultiRegionPIMPLEControls.H" +# include "solveSolid.H" + } } runTime.write(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManager.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManager.C deleted file mode 100644 index 1668e1144c46f13024e37813296b96642fbcbc92..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManager.C +++ /dev/null @@ -1,186 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "coupleManager.H" -#include "OFstream.H" -#include "regionProperties.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::coupleManager::coupleManager(const fvPatch& patch) -: - patch_(patch), - neighbourRegionName_("undefined-neighbourRegionName"), - neighbourPatchName_("undefined-neighbourPatchName"), - neighbourFieldName_("undefined-neighbourFieldName"), - localRegion_(patch_.boundaryMesh().mesh()) -{} - - -Foam::coupleManager::coupleManager -( - const fvPatch& patch, - const dictionary& dict -) -: - patch_(patch), - neighbourRegionName_(dict.lookup("neighbourRegionName")), - neighbourPatchName_(dict.lookup("neighbourPatchName")), - neighbourFieldName_(dict.lookup("neighbourFieldName")), - localRegion_(patch_.boundaryMesh().mesh()) -{} - - -Foam::coupleManager::coupleManager -( - const coupleManager& cm -) -: - patch_(cm.patch()), - neighbourRegionName_(cm.neighbourRegionName()), - neighbourPatchName_(cm.neighbourPatchName()), - neighbourFieldName_(cm.neighbourFieldName()), - localRegion_(patch_.boundaryMesh().mesh()) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::coupleManager::~coupleManager() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::coupleManager::regionOwner() const -{ - const fvMesh& nbrRegion = neighbourRegion(); - - const regionProperties& props = - localRegion_.objectRegistry::parent().lookupObject<regionProperties> - ( - "regionProperties" - ); - - label myIndex = findIndex(props.fluidRegionNames(), localRegion_.name()); - if (myIndex == -1) - { - label i = findIndex(props.solidRegionNames(), localRegion_.name()); - - if (i == -1) - { - FatalErrorIn("coupleManager::regionOwner() const") - << "Cannot find region " << localRegion_.name() - << " neither in fluids " << props.fluidRegionNames() - << " nor in solids " << props.solidRegionNames() - << exit(FatalError); - } - myIndex = props.fluidRegionNames().size() + i; - } - label nbrIndex = findIndex(props.fluidRegionNames(), nbrRegion.name()); - if (nbrIndex == -1) - { - label i = findIndex(props.solidRegionNames(), nbrRegion.name()); - - if (i == -1) - { - FatalErrorIn("coupleManager::regionOwner() const") - << "Cannot find region " << nbrRegion.name() - << " neither in fluids " << props.fluidRegionNames() - << " nor in solids " << props.solidRegionNames() - << exit(FatalError); - } - nbrIndex = props.fluidRegionNames().size() + i; - } - - return myIndex < nbrIndex; -} - - -void Foam::coupleManager::checkCouple() const -{ - Info<< "neighbourRegionName_ = " << neighbourRegionName_ << endl; - Info<< "neighbourPatchName_ = " << neighbourPatchName_ << endl; - Info<< "neighbourFieldName_ = " << neighbourFieldName_ << endl; - - const fvPatch& nPatch = neighbourPatch(); - - if (patch_.size() != nPatch.size()) - { - FatalErrorIn("Foam::coupleManager::checkCouple()") - << "Unequal patch sizes:" << nl - << " patch name (size) = " << patch_.name() - << "(" << patch_.size() << ")" << nl - << " neighbour patch name (size) = " - << nPatch.name() << "(" << patch_.size() << ")" << nl - << abort(FatalError); - } -} - - -void Foam::coupleManager::coupleToObj() const -{ - const fvPatch& nPatch = neighbourPatch(); - - OFstream obj - ( - patch_.name() + "_to_" + nPatch.name() + "_couple.obj" - ); - const vectorField& c1 = patch_.Cf(); - const vectorField& c2 = neighbourPatch().Cf(); - - if (c1.size() != c2.size()) - { - FatalErrorIn("coupleManager::coupleToObj() const") - << "Coupled patches are of unequal size:" << nl - << " patch0 = " << patch_.name() - << "(" << patch_.size() << ")" << nl - << " patch1 = " << nPatch.name() - << "(" << nPatch.size() << ")" << nl - << abort(FatalError); - } - - forAll(c1, i) - { - obj << "v " << c1[i].x() << " " << c1[i].y() << " " << c1[i].z() << nl - << "v " << c2[i].x() << " " << c2[i].y() << " " << c2[i].z() << nl - << "l " << (2*i + 1) << " " << (2*i + 2) << endl; - } -} - - -void Foam::coupleManager::writeEntries(Ostream& os) const -{ - os.writeKeyword("neighbourRegionName"); - os << neighbourRegionName_ << token::END_STATEMENT << nl; - os.writeKeyword("neighbourPatchName"); - os << neighbourPatchName_ << token::END_STATEMENT << nl; - os.writeKeyword("neighbourFieldName"); - os << neighbourFieldName_ << token::END_STATEMENT << nl; -} - - -// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManager.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManager.H deleted file mode 100644 index f1f73d23efe8505664cb5886dd3b37a5dc6727d2..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManager.H +++ /dev/null @@ -1,170 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 - coupleManager - -Description - Object to handle the coupling of region patches. It can be queried to - return the neighbour information. - -SourceFiles - coupleManager.C - -\*---------------------------------------------------------------------------*/ - -#ifndef coupleManager_H -#define coupleManager_H - -#include "Ostream.H" -#include "dictionary.H" -#include "fvPatch.H" -#include "fvMesh.H" -#include "Time.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class coupleManager Declaration -\*---------------------------------------------------------------------------*/ - -class coupleManager -{ - // Private data - - //- Reference to the local fvPatch - const fvPatch& patch_; - - //- Name of neighbour region - word neighbourRegionName_; - - //- Name of patch on the neighbour region - word neighbourPatchName_; - - //- Name of field on the neighbour region - word neighbourFieldName_; - - //- Reference to the local region - const fvMesh& localRegion_; - - - // Private Member Functions - - //- Disallow default bitwise assignment - void operator=(const coupleManager&); - - -public: - - // Constructors - - //- Construct from fvPatch - coupleManager(const fvPatch& patch); - - //- Construct from fvPatch and dictionary - coupleManager(const fvPatch& patch, const dictionary& dict); - - //- Copy constructor - coupleManager(const coupleManager& cm); - - - // Destructor - - ~coupleManager(); - - - // Member Functions - - // Access - - //- Return a reference to the local patch - inline const fvPatch& patch() const; - - //- Return the name of the neighbour region - inline const word& neighbourRegionName() const; - - //- Return the name of the patch on the neighbour region - inline const word& neighbourPatchName() const; - - //- Return the name of the field on the neighbour region - inline const word& neighbourFieldName() const; - - //- Return a reference to the neighbour mesh - inline const fvMesh& neighbourRegion() const; - - //- Return the neighbour patch ID - inline label neighbourPatchID() const; - - //- Return a reference to the neighbour patch - inline const fvPatch& neighbourPatch() const; - - //- Return a reference to the neighbour patch field - template<class Type> - inline const fvPatchField<Type>& neighbourPatchField() const; - - //- Am I owner (= first to evaluate) of this region interface? - bool regionOwner() const; - - //- Check that the couple is valid - void checkCouple() const; - - - // Edit - - //- Return the name of the neighbour region - word& neighbourRegionName(); - - //- Return the name of the patch on the neighbour region - word& neighbourPatchName(); - - //- Return the name of the field on the neighbour region - word& neighbourFieldName(); - - - // Write - - //- Write couple to obj file - void coupleToObj() const; - - //- Write entries for patches - void writeEntries(Ostream& os) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "coupleManagerI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManagerI.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManagerI.H deleted file mode 100644 index 45e059ebae27d425e90403927352f7f36c5e8cde..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManagerI.H +++ /dev/null @@ -1,98 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 - -\*---------------------------------------------------------------------------*/ - -inline const Foam::fvPatch& Foam::coupleManager::patch() const -{ - return patch_; -}; - - -inline const Foam::word& Foam::coupleManager::neighbourRegionName() const -{ - return neighbourRegionName_; -}; - - -inline const Foam::word& Foam::coupleManager::neighbourPatchName() const -{ - return neighbourPatchName_; -}; - - -inline const Foam::word& Foam::coupleManager::neighbourFieldName() const -{ - return neighbourFieldName_; -}; - - -inline const Foam::fvMesh& Foam::coupleManager::neighbourRegion() const -{ - return localRegion_.objectRegistry::parent() - .lookupObject<fvMesh>(neighbourRegionName_); -} - - -inline Foam::label Foam::coupleManager::neighbourPatchID() const -{ - return neighbourRegion().boundaryMesh().findPatchID(neighbourPatchName_); -} - - -inline const Foam::fvPatch& Foam::coupleManager::neighbourPatch() const -{ - return neighbourRegion().boundary()[neighbourPatchID()]; -} - - -template<class Type> -inline const Foam::fvPatchField<Type>& -Foam::coupleManager::neighbourPatchField() const -{ - return neighbourPatch().lookupPatchField - <GeometricField<Type, fvPatchField, volMesh>, Type> - (neighbourFieldName_); -} - - -inline Foam::word& Foam::coupleManager::neighbourRegionName() -{ - return neighbourRegionName_; -}; - - -inline Foam::word& Foam::coupleManager::neighbourPatchName() -{ - return neighbourPatchName_; -}; - - -inline Foam::word& Foam::coupleManager::neighbourFieldName() -{ - return neighbourFieldName_; -}; - - -// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperatureCoupled/solidWallHeatFluxTemperatureCoupledFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperatureCoupled/solidWallHeatFluxTemperatureCoupledFvPatchScalarField.C deleted file mode 100644 index 07bcac29a683edc4dcb95805f63df358f7613d77..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperatureCoupled/solidWallHeatFluxTemperatureCoupledFvPatchScalarField.C +++ /dev/null @@ -1,150 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "solidWallHeatFluxTemperatureCoupledFvPatchScalarField.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" - -#include "solidWallTemperatureCoupledFvPatchScalarField.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::solidWallHeatFluxTemperatureCoupledFvPatchScalarField:: -solidWallHeatFluxTemperatureCoupledFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedGradientFvPatchScalarField(p, iF), - coupleManager_(p), - KName_("undefined-K") -{} - - -Foam::solidWallHeatFluxTemperatureCoupledFvPatchScalarField:: -solidWallHeatFluxTemperatureCoupledFvPatchScalarField -( - const solidWallHeatFluxTemperatureCoupledFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - fixedGradientFvPatchScalarField(ptf, p, iF, mapper), - coupleManager_(ptf.coupleManager_), - KName_(ptf.KName_) -{} - - -Foam::solidWallHeatFluxTemperatureCoupledFvPatchScalarField:: -solidWallHeatFluxTemperatureCoupledFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const dictionary& dict -) -: - fixedGradientFvPatchScalarField(p, iF), - coupleManager_(p, dict), - KName_(dict.lookup("K")) -{ - if (dict.found("value")) - { - fvPatchField<scalar>::operator= - ( - scalarField("value", dict, p.size()) - ); - } - else - { - evaluate(); - } -} - - -Foam::solidWallHeatFluxTemperatureCoupledFvPatchScalarField:: -solidWallHeatFluxTemperatureCoupledFvPatchScalarField -( - const solidWallHeatFluxTemperatureCoupledFvPatchScalarField& whftcsf, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedGradientFvPatchScalarField(whftcsf, iF), - coupleManager_(whftcsf.coupleManager_), - KName_(whftcsf.KName_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::solidWallHeatFluxTemperatureCoupledFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const fvPatchField<scalar>& neighbourField = - coupleManager_.neighbourPatchField<scalar>(); - - const fvPatchField<scalar>& K = - patch().lookupPatchField<volScalarField, scalar>(KName_); - - gradient() = -refCast<const solidWallTemperatureCoupledFvPatchScalarField> - (neighbourField).flux()/K; - - fixedGradientFvPatchScalarField::updateCoeffs(); -} - - -void Foam::solidWallHeatFluxTemperatureCoupledFvPatchScalarField::write -( - Ostream& os -) const -{ - fvPatchScalarField::write(os); - coupleManager_.writeEntries(os); - os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl; - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -makePatchTypeField -( - fvPatchScalarField, - solidWallHeatFluxTemperatureCoupledFvPatchScalarField -); - -} // End namespace Foam - -// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperatureCoupled/solidWallHeatFluxTemperatureCoupledFvPatchScalarField.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperatureCoupled/solidWallHeatFluxTemperatureCoupledFvPatchScalarField.H deleted file mode 100644 index b7867ca8ce4a125415906382d43c43cedb916339..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperatureCoupled/solidWallHeatFluxTemperatureCoupledFvPatchScalarField.H +++ /dev/null @@ -1,165 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 - solidWallHeatFluxTemperatureCoupledFvPatchScalarField - -Description - Fixed heat-flux boundary condition for temperature, to be used by the - conjugate heat transfer solver. - - Example usage: - myInterfacePatchName - { - type solidWallHeatFluxTemperatureCoupled; - neighbourRegionName fluid; - neighbourPatchName fluidSolidInterface; - neighbourFieldName T; - K K; - value uniform 300; - } - -SourceFiles - solidWallHeatFluxTemperatureCoupledFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef solidWallHeatFluxTemperatureCoupledFvPatchScalarField_H -#define solidWallHeatFluxTemperatureCoupledFvPatchScalarField_H - -#include "fvPatchFields.H" -#include "fixedGradientFvPatchFields.H" -#include "coupleManager.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class solidWallHeatFluxTemperatureCoupledFvPatchScalarField Declaration -\*---------------------------------------------------------------------------*/ - -class solidWallHeatFluxTemperatureCoupledFvPatchScalarField -: - public fixedGradientFvPatchScalarField -{ - // Private data - - //- Couple manager object - coupleManager coupleManager_; - - //- Name of thermal conductivity field - word KName_; - - -public: - - //- Runtime type information - TypeName("solidWallHeatFluxTemperatureCoupled"); - - - // Constructors - - //- Construct from patch and internal field - solidWallHeatFluxTemperatureCoupledFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct from patch, internal field and dictionary - solidWallHeatFluxTemperatureCoupledFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const dictionary& - ); - - //- Construct by mapping given - // solidWallHeatFluxTemperatureCoupledFvPatchScalarField - // onto a new patch - solidWallHeatFluxTemperatureCoupledFvPatchScalarField - ( - const solidWallHeatFluxTemperatureCoupledFvPatchScalarField&, - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const fvPatchFieldMapper& - ); - - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new solidWallHeatFluxTemperatureCoupledFvPatchScalarField - ( - *this - ) - ); - } - - //- Construct as copy setting internal field reference - solidWallHeatFluxTemperatureCoupledFvPatchScalarField - ( - const solidWallHeatFluxTemperatureCoupledFvPatchScalarField&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone - ( - const DimensionedField<scalar, volMesh>& iF - ) const - { - return tmp<fvPatchScalarField> - ( - new solidWallHeatFluxTemperatureCoupledFvPatchScalarField - ( - *this, - iF - ) - ); - } - - - // Member functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.C index b6bcfffa3f63f947ec0a84734b12df7ff39893a4..5bec5673108e4cd0c0684e041b6443f769c0ff55 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.C @@ -28,8 +28,62 @@ License #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "volFields.H" +#include "directMappedPatchBase.H" #include "regionProperties.H" +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +bool Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::interfaceOwner +( + const polyMesh& nbrRegion +) const +{ + const fvMesh& myRegion = patch().boundaryMesh().mesh(); + + const regionProperties& props = + myRegion.objectRegistry::parent().lookupObject<regionProperties> + ( + "regionProperties" + ); + + label myIndex = findIndex(props.fluidRegionNames(), myRegion.name()); + if (myIndex == -1) + { + label i = findIndex(props.solidRegionNames(), myRegion.name()); + + if (i == -1) + { + FatalErrorIn + ( + "solidWallMixedTemperatureCoupledFvPatchScalarField" + "::interfaceOwner(const polyMesh&) const" + ) << "Cannot find region " << myRegion.name() + << " neither in fluids " << props.fluidRegionNames() + << " nor in solids " << props.solidRegionNames() + << exit(FatalError); + } + myIndex = props.fluidRegionNames().size() + i; + } + label nbrIndex = findIndex(props.fluidRegionNames(), nbrRegion.name()); + if (nbrIndex == -1) + { + label i = findIndex(props.solidRegionNames(), nbrRegion.name()); + + if (i == -1) + { + FatalErrorIn("coupleManager::interfaceOwner(const polyMesh&) const") + << "Cannot find region " << nbrRegion.name() + << " neither in fluids " << props.fluidRegionNames() + << " nor in solids " << props.solidRegionNames() + << exit(FatalError); + } + nbrIndex = props.fluidRegionNames().size() + i; + } + + return myIndex < nbrIndex; +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::solidWallMixedTemperatureCoupledFvPatchScalarField:: @@ -40,7 +94,7 @@ solidWallMixedTemperatureCoupledFvPatchScalarField ) : mixedFvPatchScalarField(p, iF), - coupleManager_(p), + neighbourFieldName_("undefined-neighbourFieldName"), KName_("undefined-K") { this->refValue() = 0.0; @@ -60,7 +114,7 @@ solidWallMixedTemperatureCoupledFvPatchScalarField ) : mixedFvPatchScalarField(ptf, p, iF, mapper), - coupleManager_(ptf.coupleManager_), + neighbourFieldName_(ptf.neighbourFieldName_), KName_(ptf.KName_), fixesValue_(ptf.fixesValue_) {} @@ -75,14 +129,46 @@ solidWallMixedTemperatureCoupledFvPatchScalarField ) : mixedFvPatchScalarField(p, iF), - coupleManager_(p, dict), + neighbourFieldName_(dict.lookup("neighbourFieldName")), KName_(dict.lookup("K")) { + if (!isA<directMappedPatchBase>(this->patch().patch())) + { + FatalErrorIn + ( + "solidWallMixedTemperatureCoupledFvPatchScalarField::" + "solidWallMixedTemperatureCoupledFvPatchScalarField\n" + "(\n" + " const fvPatch& p,\n" + " const DimensionedField<scalar, volMesh>& iF,\n" + " const dictionary& dict\n" + ")\n" + ) << "\n patch type '" << p.type() + << "' not type '" << directMappedPatchBase::typeName << "'" + << "\n for patch " << p.name() + << " of field " << dimensionedInternalField().name() + << " in file " << dimensionedInternalField().objectPath() + << exit(FatalError); + } + fvPatchScalarField::operator=(scalarField("value", dict, p.size())); - refValue() = static_cast<scalarField>(*this); - refGrad() = 0.0; - valueFraction() = 1.0; - fixesValue_ = true; + + if (dict.found("refValue")) + { + // Full restart + refValue() = scalarField("refValue", dict, p.size()); + refGrad() = scalarField("refGradient", dict, p.size()); + valueFraction() = scalarField("valueFraction", dict, p.size()); + fixesValue_ = readBool(dict.lookup("fixesValue")); + } + else + { + // Start from user entered data. Assume fixedValue. + refValue() = *this; + refGrad() = 0.0; + valueFraction() = 1.0; + fixesValue_ = true; + } } @@ -94,7 +180,7 @@ solidWallMixedTemperatureCoupledFvPatchScalarField ) : mixedFvPatchScalarField(wtcsf, iF), - coupleManager_(wtcsf.coupleManager_), + neighbourFieldName_(wtcsf.neighbourFieldName_), KName_(wtcsf.KName_), fixesValue_(wtcsf.fixesValue_) {} @@ -116,33 +202,111 @@ void Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::updateCoeffs() return; } + // Get the coupling information from the directMappedPatchBase + const directMappedPatchBase& mpp = refCast<const directMappedPatchBase> + ( + patch().patch() + ); + const polyMesh& nbrMesh = mpp.sampleMesh(); + tmp<scalarField> intFld = patchInternalField(); + if (interfaceOwner(nbrMesh)) + { + // Note: other side information could be cached - it only needs + // to be updated the first time round the iteration (i.e. when + // switching regions) but unfortunately we don't have this information. + + const mapDistribute& distMap = mpp.map(); + const fvPatch& nbrPatch = refCast<const fvMesh> + ( + nbrMesh + ).boundary()[mpp.samplePolyPatch().index()]; + + + // Calculate the temperature by harmonic averaging + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + const solidWallMixedTemperatureCoupledFvPatchScalarField& nbrField = + refCast<const solidWallMixedTemperatureCoupledFvPatchScalarField> + ( + nbrPatch.lookupPatchField<volScalarField, scalar> + ( + neighbourFieldName_ + ) + ); + + // Swap to obtain full local values of neighbour internal field + scalarField nbrIntFld = nbrField.patchInternalField(); + mapDistribute::distribute + ( + Pstream::defaultCommsType, + distMap.schedule(), + distMap.constructSize(), + distMap.subMap(), // what to send + distMap.constructMap(), // what to receive + nbrIntFld + ); + + // Swap to obtain full local values of neighbour K*delta + scalarField nbrKDelta = nbrField.K()*nbrPatch.deltaCoeffs(); + mapDistribute::distribute + ( + Pstream::defaultCommsType, + distMap.schedule(), + distMap.constructSize(), + distMap.subMap(), // what to send + distMap.constructMap(), // what to receive + nbrKDelta + ); + + + tmp<scalarField> myKDelta = K()*patch().deltaCoeffs(); + + // Calculate common wall temperature. Reuse *this to store common value. + scalarField Twall + ( + (myKDelta()*intFld() + nbrKDelta*nbrIntFld) + / (myKDelta() + nbrKDelta) + ); + // Assign to me + fvPatchScalarField::operator=(Twall); + // Distribute back and assign to neighbour + mapDistribute::distribute + ( + Pstream::defaultCommsType, + distMap.schedule(), + nbrField.size(), + distMap.constructMap(), // reverse : what to send + distMap.subMap(), + Twall + ); + const_cast<solidWallMixedTemperatureCoupledFvPatchScalarField&> + ( + nbrField + ).fvPatchScalarField::operator=(Twall); + } + + + // Switch between fixed value (of harmonic avg) or gradient + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + label nFixed = 0; // Like snGrad but bypass switching on refValue/refGrad. - tmp<scalarField> normalGradient = - (*this-intFld()) - * patch().deltaCoeffs(); + tmp<scalarField> normalGradient = (*this-intFld())*patch().deltaCoeffs(); if (debug) { + scalar Q = gSum(K()*patch().magSf()*normalGradient()); + Info<< "solidWallMixedTemperatureCoupledFvPatchScalarField::" << "updateCoeffs() :" << " patch:" << patch().name() + << " heatFlux:" << Q << " walltemperature " - << " min:" - << returnReduce - ( - (this->size() > 0 ? min(*this) : VGREAT), - minOp<scalar>() - ) - << " max:" - << returnReduce - ( - (this->size() > 0 ? max(*this) : -VGREAT), - maxOp<scalar>() - ) + << " min:" << gMin(*this) + << " max:" << gMax(*this) << " avg:" << gAverage(*this) << endl; } @@ -150,7 +314,7 @@ void Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::updateCoeffs() forAll(*this, i) { // if outgoing flux use fixed value. - if (intFld()[i] > operator[](i)) + if (normalGradient()[i] < 0.0) { this->refValue()[i] = operator[](i); this->refGrad()[i] = 0.0; // not used @@ -185,80 +349,16 @@ void Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::updateCoeffs() } -void Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::evaluate -( - const Pstream::commsTypes -) -{ - if (!this->updated()) - { - this->updateCoeffs(); - } - - if (!coupleManager_.regionOwner()) - { - // I am the last one to evaluate. - - tmp<scalarField> intFld = patchInternalField(); - - const fvPatch& nbrPatch = coupleManager_.neighbourPatch(); - - solidWallMixedTemperatureCoupledFvPatchScalarField& nbrField = - refCast<solidWallMixedTemperatureCoupledFvPatchScalarField> - ( - const_cast<fvPatchField<scalar>&> - ( - coupleManager_.neighbourPatchField<scalar>() - ) - ); - tmp<scalarField> nbrIntFld = nbrField.patchInternalField(); - tmp<scalarField> myKDelta = K()*patch().deltaCoeffs(); - tmp<scalarField> nbrKDelta = nbrField.K()*nbrPatch.deltaCoeffs(); - - // Calculate common wall temperature and assign to both sides - scalarField::operator= - ( - (myKDelta()*intFld + nbrKDelta()*nbrIntFld) - / (myKDelta() + nbrKDelta()) - ); - - nbrField.scalarField::operator=(*this); - - if (debug) - { - Info<< "solidWallMixedTemperatureCoupledFvPatchScalarField::" - << "updateCoeffs() :" - << " patch:" << patch().name() - << " setting master and slave to wall temperature " - << " min:" - << returnReduce - ( - (this->size() > 0 ? min(*this) : VGREAT), - minOp<scalar>() - ) - << " max:" - << returnReduce - ( - (this->size() > 0 ? max(*this) : -VGREAT), - maxOp<scalar>() - ) - << " avg:" << gAverage(*this) - << endl; - } - } - - fvPatchScalarField::evaluate(); -} - - void Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::write ( Ostream& os ) const { mixedFvPatchScalarField::write(os); - coupleManager_.writeEntries(os); + os.writeKeyword("neighbourFieldName")<< neighbourFieldName_ + << token::END_STATEMENT << nl; os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl; + os.writeKeyword("fixesValue") << fixesValue_ << token::END_STATEMENT << nl; } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.H index 34c32b1abf4204864d1cc7268ecf3e5874a25d36..f4abacf648aad7283f04baa44b8ad29f856a54db 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.H @@ -37,13 +37,22 @@ Description myInterfacePatchName { type solidWallMixedTemperatureCoupled; - neighbourRegionName fluid; - neighbourPatchName fluidSolidInterface; neighbourFieldName T; K K; value uniform 300; } + Needs to be on underlying directMapped(Wall)FvPatch. + + Note: runs in parallel with arbitrary decomposition. Uses directMapped + functionality to calculate exchange. + + Note: lags interface data so both sides use same data. + - problem: schedule to calculate average would interfere + with standard processor swaps. + - so: updateCoeffs sets both to same Twall. Only need to do + this for last outer iteration but don't have access to this. + SourceFiles solidWallMixedTemperatureCoupledFvPatchScalarField.C @@ -54,7 +63,6 @@ SourceFiles #include "fvPatchFields.H" #include "mixedFvPatchFields.H" -#include "coupleManager.H" #include "fvPatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -72,14 +80,21 @@ class solidWallMixedTemperatureCoupledFvPatchScalarField { // Private data - //- Couple manager object - coupleManager coupleManager_; - + //- Name of field on the neighbour region + const word neighbourFieldName_; + //- Name of thermal conductivity field - word KName_; + const word KName_; bool fixesValue_; + + // Private Member Functions + + //- Am I or neighbour owner of interface + bool interfaceOwner(const polyMesh& nbrRegion) const; + + public: //- Runtime type information @@ -162,12 +177,6 @@ public: //- Update the coefficients associated with the patch field virtual void updateCoeffs(); - //- Evaluate the patch field - virtual void evaluate - ( - const Pstream::commsTypes commsType=Pstream::blocking - ); - //- Write virtual void write(Ostream&) const; }; diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallTemperatureCoupled/solidWallTemperatureCoupledFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallTemperatureCoupled/solidWallTemperatureCoupledFvPatchScalarField.C deleted file mode 100644 index 05bbdd1ba3fb75adce7642f1afd732f8c87d3c3d..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallTemperatureCoupled/solidWallTemperatureCoupledFvPatchScalarField.C +++ /dev/null @@ -1,156 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "solidWallTemperatureCoupledFvPatchScalarField.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::solidWallTemperatureCoupledFvPatchScalarField:: -solidWallTemperatureCoupledFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedValueFvPatchScalarField(p, iF), - coupleManager_(p), - KName_("undefined-K") -{} - - -Foam::solidWallTemperatureCoupledFvPatchScalarField:: -solidWallTemperatureCoupledFvPatchScalarField -( - const solidWallTemperatureCoupledFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - fixedValueFvPatchScalarField(ptf, p, iF, mapper), - coupleManager_(ptf.coupleManager_), - KName_(ptf.KName_) -{} - - -Foam::solidWallTemperatureCoupledFvPatchScalarField:: -solidWallTemperatureCoupledFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const dictionary& dict -) -: - fixedValueFvPatchScalarField(p, iF), - coupleManager_(p, dict), - KName_(dict.lookup("K")) -{ - if (dict.found("value")) - { - fvPatchField<scalar>::operator= - ( - scalarField("value", dict, p.size()) - ); - } - else - { - evaluate(); - } -} - - -Foam::solidWallTemperatureCoupledFvPatchScalarField:: -solidWallTemperatureCoupledFvPatchScalarField -( - const solidWallTemperatureCoupledFvPatchScalarField& wtcsf, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedValueFvPatchScalarField(wtcsf, iF), - coupleManager_(wtcsf.coupleManager_), - KName_(wtcsf.KName_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::solidWallTemperatureCoupledFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const fvPatchField<scalar>& neighbourField = - coupleManager_.neighbourPatchField<scalar>(); - - operator==(neighbourField); - - fixedValueFvPatchScalarField::updateCoeffs(); -} - - -void Foam::solidWallTemperatureCoupledFvPatchScalarField::write -( - Ostream& os -) const -{ - fvPatchScalarField::write(os); - coupleManager_.writeEntries(os); - os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl; - writeEntry("value", os); -} - - -Foam::tmp<Foam::scalarField> -Foam::solidWallTemperatureCoupledFvPatchScalarField::flux() const -{ - const fvPatchScalarField& Kw = - patch().lookupPatchField<volScalarField, scalar>(KName_); - - const fvPatchScalarField& Tw = *this; - - return Tw.snGrad()*Kw; -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -makePatchTypeField -( - fvPatchScalarField, - solidWallTemperatureCoupledFvPatchScalarField -); - -} // End namespace Foam - -// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallTemperatureCoupled/solidWallTemperatureCoupledFvPatchScalarField.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallTemperatureCoupled/solidWallTemperatureCoupledFvPatchScalarField.H deleted file mode 100644 index 22fd168175134eb812ac447caac3d397dee21df3..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallTemperatureCoupled/solidWallTemperatureCoupledFvPatchScalarField.H +++ /dev/null @@ -1,160 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 - solidWallHeatFluxCoupledFvPatchScalarField - -Description - Fixed value boundary condition for temperature, to be used by the - conjugate heat transfer solver. - - Example usage: - myInterfacePatchName - { - type solidWallTemperatureCoupled; - neighbourRegionName fluid; - neighbourPatchName fluidSolidInterface; - neighbourFieldName T; - K K; - value uniform 300; - } - -SourceFiles - solidWallTemperatureCoupledFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef solidWallTemperatureCoupledFvPatchScalarField_H -#define solidWallTemperatureCoupledFvPatchScalarField_H - -#include "fvPatchFields.H" -#include "fixedValueFvPatchFields.H" -#include "coupleManager.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class solidWallTemperatureCoupledFvPatchScalarField Declaration -\*---------------------------------------------------------------------------*/ - -class solidWallTemperatureCoupledFvPatchScalarField -: - public fixedValueFvPatchScalarField -{ - // Private data - - //- Couple manager object - coupleManager coupleManager_; - - //- Name of thermal conductivity field - word KName_; - - -public: - - //- Runtime type information - TypeName("solidWallTemperatureCoupled"); - - - // Constructors - - //- Construct from patch and internal field - solidWallTemperatureCoupledFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct from patch, internal field and dictionary - solidWallTemperatureCoupledFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const dictionary& - ); - - //- Construct by mapping given solidWallTemperatureCoupledFvPatchScalarField - // onto a new patch - solidWallTemperatureCoupledFvPatchScalarField - ( - const solidWallTemperatureCoupledFvPatchScalarField&, - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const fvPatchFieldMapper& - ); - - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new solidWallTemperatureCoupledFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - solidWallTemperatureCoupledFvPatchScalarField - ( - const solidWallTemperatureCoupledFvPatchScalarField&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone - ( - const DimensionedField<scalar, volMesh>& iF - ) const - { - return tmp<fvPatchScalarField> - ( - new solidWallTemperatureCoupledFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - //- (intensive) flux - tmp<scalarField> flux() const; - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H index e719d92433926797b7850dc356ade232228ba502..65467f80864609f9225e9d058b9568890c500988 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H @@ -14,12 +14,10 @@ ( UEqn() == - -fvc::reconstruct + fvc::reconstruct ( - ( - fvc::snGrad(pd) - + ghf*fvc::snGrad(rho) - ) * mesh.magSf() + fvc::interpolate(rho)*(g & mesh.Sf()) + - fvc::snGrad(p)*mesh.magSf() ) ); } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H index 1f6e50de0a3872b76c239e920f054d5e1cb54ea2..fd9624685f8fcc07cc4f82d014676fb469bbd064 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H @@ -6,43 +6,15 @@ PtrList<surfaceScalarField> phiFluid(fluidRegions.size()); PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size()); PtrList<volScalarField> DpDtFluid(fluidRegions.size()); - PtrList<volScalarField> ghFluid(fluidRegions.size()); - PtrList<surfaceScalarField> ghfFluid(fluidRegions.size()); - PtrList<volScalarField> pdFluid(fluidRegions.size()); List<scalar> initialMassFluid(fluidRegions.size()); - dimensionedScalar pRef - ( - "pRef", - dimensionSet(1, -1, -2, 0, 0), - rp.lookup("pRef") - ); - // Populate fluid field pointer lists forAll(fluidRegions, i) { Info<< "*** Reading fluid mesh thermophysical properties for region " << fluidRegions[i].name() << nl << endl; - Info<< " Adding to pdFluid\n" << endl; - pdFluid.set - ( - i, - new volScalarField - ( - IOobject - ( - "pd", - runTime.timeName(), - fluidRegions[i], - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - fluidRegions[i] - ) - ); - Info<< " Adding to thermoFluid\n" << endl; thermoFluid.set ( @@ -145,6 +117,7 @@ i, new volScalarField ( + "DpDt", fvc::DDt ( surfaceScalarField @@ -157,36 +130,5 @@ ) ); - const dictionary& environmentalProperties = - fluidRegions[i].lookupObject<IOdictionary> - ("environmentalProperties"); - dimensionedVector g(environmentalProperties.lookup("g")); - - Info<< " Adding to ghFluid\n" << endl; - ghFluid.set - ( - i, - new volScalarField - ( - "gh", - g & fluidRegions[i].C() - ) - ); - ghfFluid.set - ( - i, - new surfaceScalarField - ( - "ghf", - g & fluidRegions[i].Cf() - ) - ); - - Info<< " Updating p from pd\n" << endl; - thermoFluid[i].p() == pdFluid[i] + rhoFluid[i]*ghFluid[i] + pRef; - thermoFluid[i].correct(); - initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value(); } - - diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/hEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/hEqn.H index 7f2202d5937d4e17ab988aef292979339269aabb..e070537db2c701e27baafd6cf64ef015e3898100 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/hEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/hEqn.H @@ -1,5 +1,5 @@ { - tmp<fvScalarMatrix> hEqn + fvScalarMatrix hEqn ( fvm::ddt(rho, h) + fvm::div(phi, h) @@ -7,8 +7,16 @@ == DpDt ); - hEqn().relax(); - hEqn().solve(); + if (oCorr == nOuterCorr-1) + { + hEqn.relax(); + hEqn.solve(mesh.solver("hFinal")); + } + else + { + hEqn.relax(); + hEqn.solve(); + } thermo.correct(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H index e297989809aaa930b9c0be00e3049842869e44aa..a264b68fe5eab2388d38ca1aaf75a3f416db2330 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H @@ -1,5 +1,5 @@ { - bool closedVolume = pd.needReference(); + bool closedVolume = p.needReference(); rho = thermo.rho(); @@ -17,31 +17,34 @@ ) ); - phi = phiU - ghf*fvc::snGrad(rho)*rhorUAf*mesh.magSf(); + phi = phiU + fvc::interpolate(rho)*(g & mesh.Sf())*rhorUAf; for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - fvScalarMatrix pdEqn + fvScalarMatrix pEqn ( - fvm::ddt(psi, pd) - + fvc::ddt(psi)*pRef - + fvc::ddt(psi, rho)*gh + fvm::ddt(psi, p) + fvc::div(phi) - - fvm::laplacian(rho*rUA, pd) + - fvm::laplacian(rhorUAf, p) ); - if (corr == nCorr-1 && nonOrth == nNonOrthCorr) + if + ( + oCorr == nOuterCorr-1 + && corr == nCorr-1 + && nonOrth == nNonOrthCorr + ) { - pdEqn.solve(mesh.solver(pd.name() + "Final")); + pEqn.solve(mesh.solver(p.name() + "Final")); } else { - pdEqn.solve(mesh.solver(pd.name())); + pEqn.solve(mesh.solver(p.name())); } if (nonOrth == nNonOrthCorr) { - phi += pdEqn.flux(); + phi += pEqn.flux(); } } @@ -49,27 +52,24 @@ U += rUA*fvc::reconstruct((phi - phiU)/rhorUAf); U.correctBoundaryConditions(); - // Update pressure field (including bc) - p == pd + rho*gh + pRef; + // Update pressure substantive derivative DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); // Solve continuity -# include "rhoEqn.H" + #include "rhoEqn.H" // Update continuity errors -# include "compressibleContinuityErrors.H" + #include "compressibleContinuityErrors.H" // For closed-volume cases adjust the pressure and density levels // to obey overall mass continuity if (closedVolume) { - p += (massIni - fvc::domainIntegrate(psi*p))/fvc::domainIntegrate(psi); + p += (massIni - fvc::domainIntegrate(psi*p)) + /fvc::domainIntegrate(psi); rho = thermo.rho(); } // Update thermal conductivity K = thermoFluid[i].Cp()*turb.alphaEff(); - - // Update pd (including bc) - pd == p - (rho*gh + pRef); } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPIMPLEControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPIMPLEControls.H new file mode 100644 index 0000000000000000000000000000000000000000..413c0225f0a34a82b3af1751011d7e8af7b935ba --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPIMPLEControls.H @@ -0,0 +1,9 @@ + const dictionary& pimple = mesh.solutionDict().subDict("PIMPLE"); + + int nCorr(readInt(pimple.lookup("nCorrectors"))); + + int nNonOrthCorr = + pimple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0); + + bool momentumPredictor = + pimple.lookupOrDefault<Switch>("momentumPredictor", true); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/rhoEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/rhoEqn.H deleted file mode 100644 index a6b0ac9fe1c0c27d1f2479f27ab3715c87537cd9..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/rhoEqn.H +++ /dev/null @@ -1 +0,0 @@ - solve(fvm::ddt(rho) + fvc::div(phi)); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H index 35a64418a8c6cbd1d488970f1d665420a2f752b6..72c9bbc4faf7e81c0fd759466c210a536929ff2c 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H @@ -7,12 +7,15 @@ surfaceScalarField& phi = phiFluid[i]; compressible::turbulenceModel& turb = turbulence[i]; volScalarField& DpDt = DpDtFluid[i]; - const volScalarField& gh = ghFluid[i]; - const surfaceScalarField& ghf = ghfFluid[i]; - volScalarField& pd = pdFluid[i]; volScalarField& p = thermo.p(); const volScalarField& psi = thermo.psi(); volScalarField& h = thermo.h(); const dimensionedScalar massIni("massIni", dimMass, initialMassFluid[i]); + + const dictionary& environmentalProperties = + fluidRegions[i].lookupObject<IOdictionary> + ("environmentalProperties"); + + const dimensionedVector g(environmentalProperties.lookup("g")); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveFluid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveFluid.H index 19ec50cac253986322e9155df1c2bcc0d7632c4a..86dd4344c15310f219bfb9bda406b22f2ffe7585 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveFluid.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveFluid.H @@ -1,15 +1,18 @@ -# include "rhoEqn.H" - for (int ocorr=0; ocorr<nOuterCorr; ocorr++) - { - # include "UEqn.H" +if (oCorr == 0) +{ + #include "rhoEqn.H" +} - # include "hEqn.H" +#include "UEqn.H" - // --- PISO loop +#include "hEqn.H" - for (int corr=0; corr<nCorr; corr++) - { - # include "pEqn.H" - } - } - turb.correct(); +// --- PISO loop +for (int corr=0; corr<nCorr; corr++) +{ + #include "pEqn.H" +} + +turb.correct(); + +rho = thermo.rho(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/storeOldFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/storeOldFluidFields.H new file mode 100644 index 0000000000000000000000000000000000000000..f63e85458e25253209094f92995e0c3c91858fc5 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/storeOldFluidFields.H @@ -0,0 +1,2 @@ + p.storePrevIter(); + rho.storePrevIter(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/readPIMPLEControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/readPIMPLEControls.H new file mode 100644 index 0000000000000000000000000000000000000000..42793d9b9fdb82a890b5994673f07ade7745a659 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/readPIMPLEControls.H @@ -0,0 +1,7 @@ + // We do not have a top-level mesh. Construct the fvSolution for + // the runTime instead. + fvSolution solutionDict(runTime); + + const dictionary& pimple = solutionDict.subDict("PIMPLE"); + + int nOuterCorr(readInt(pimple.lookup("nOuterCorrectors"))); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPIMPLEControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPIMPLEControls.H new file mode 100644 index 0000000000000000000000000000000000000000..e23883c5fae11f298e0459feaacacc4c73af8dbe --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPIMPLEControls.H @@ -0,0 +1,4 @@ + const dictionary& pimple = mesh.solutionDict().subDict("PIMPLE"); + + int nNonOrthCorr = + pimple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPISOControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPISOControls.H index 6373e79d49c0869238a30a138aef81a7af905d05..ce6a1c5bb2626f82eb411bc20b4f57b64e3271ff 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPISOControls.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPISOControls.H @@ -1,4 +1,4 @@ - dictionary piso = solidRegions[i].solutionDict().subDict("PISO"); + const dictionary& piso = solidRegions[i].solutionDict().subDict("PISO"); int nNonOrthCorr = 0; if (piso.found("nNonOrthogonalCorrectors")) diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H index 04c90d2c4c108f479145e86e64c980f7d6296cba..f9e80e3d72385e7f6ae80107cc3b65921904c35f 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H @@ -1,4 +1,4 @@ -// fvMesh& mesh = solidRegions[i]; + fvMesh& mesh = solidRegions[i]; volScalarField& rho = rhos[i]; volScalarField& cp = cps[i]; diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H index 5fa731824f375adfeb3e2175f280de55da5cd4b2..ce8b1d0f408d4ec033f88c37846a8c7ab80e61b0 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H @@ -1,10 +1,13 @@ { for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - solve + tmp<fvScalarMatrix> TEqn ( - fvm::ddt(rho*cp, T) - fvm::laplacian(K, T) + fvm::ddt(rho*cp, T) + - fvm::laplacian(K, T) ); + TEqn().relax(); + TEqn().solve(); } Info<< "Min/max T:" << min(T) << ' ' << max(T) << endl; diff --git a/applications/solvers/lagrangian/reactingParcelFoam/Make/files b/applications/solvers/lagrangian/reactingParcelFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..3710ca4e2df104e37cd2c720455d658fd102d2d0 --- /dev/null +++ b/applications/solvers/lagrangian/reactingParcelFoam/Make/files @@ -0,0 +1,3 @@ +reactingParcelFoam.C + +EXE = $(FOAM_APPBIN)/reactingParcelFoam diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/Make/options b/applications/solvers/lagrangian/reactingParcelFoam/Make/options similarity index 100% rename from applications/solvers/Lagrangian/reactingParcelFoam/Make/options rename to applications/solvers/lagrangian/reactingParcelFoam/Make/options diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/UEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H similarity index 100% rename from applications/solvers/Lagrangian/reactingParcelFoam/UEqn.H rename to applications/solvers/lagrangian/reactingParcelFoam/UEqn.H diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H similarity index 100% rename from applications/solvers/Lagrangian/reactingParcelFoam/YEqn.H rename to applications/solvers/lagrangian/reactingParcelFoam/YEqn.H diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/additionalOutput.H b/applications/solvers/lagrangian/reactingParcelFoam/additionalOutput.H similarity index 100% rename from applications/solvers/Lagrangian/reactingParcelFoam/additionalOutput.H rename to applications/solvers/lagrangian/reactingParcelFoam/additionalOutput.H diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/chemistry.H b/applications/solvers/lagrangian/reactingParcelFoam/chemistry.H similarity index 100% rename from applications/solvers/Lagrangian/reactingParcelFoam/chemistry.H rename to applications/solvers/lagrangian/reactingParcelFoam/chemistry.H diff --git a/applications/solvers/lagrangian/reactingParcelFoam/createClouds.H b/applications/solvers/lagrangian/reactingParcelFoam/createClouds.H new file mode 100644 index 0000000000000000000000000000000000000000..fcab29c923c274b45ec86647cb3b5eb3a54ecc7b --- /dev/null +++ b/applications/solvers/lagrangian/reactingParcelFoam/createClouds.H @@ -0,0 +1,9 @@ +Info<< "\nConstructing reacting cloud" << endl; +BasicReactingCloud<specieReactingProperties> parcels +( + "reactingCloud1", + rho, + U, + g, + thermo() +); diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H similarity index 100% rename from applications/solvers/Lagrangian/reactingParcelFoam/createFields.H rename to applications/solvers/lagrangian/reactingParcelFoam/createFields.H diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/hEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/hEqn.H similarity index 100% rename from applications/solvers/Lagrangian/reactingParcelFoam/hEqn.H rename to applications/solvers/lagrangian/reactingParcelFoam/hEqn.H diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H similarity index 100% rename from applications/solvers/Lagrangian/reactingParcelFoam/pEqn.H rename to applications/solvers/lagrangian/reactingParcelFoam/pEqn.H diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C similarity index 96% rename from applications/solvers/Lagrangian/reactingParcelFoam/reactingParcelFoam.C rename to applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C index ea57f0da0e3e5bc2155fd8288dd44e71d1af4cf5..3c2182d2bc36156e3b02a2e195e4d94be92ac425 100644 --- a/applications/solvers/Lagrangian/reactingParcelFoam/reactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,10 +34,10 @@ Description #include "fvCFD.H" #include "hCombustionThermo.H" #include "turbulenceModel.H" -#include "basicReactingCloud.H" +#include "BasicReactingCloud.H" #include "chemistryModel.H" #include "chemistrySolver.H" -#include "ReactingCloudThermoTypes.H" +#include "reactingThermoTypes.H" #include "radiationModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/readChemistryProperties.H b/applications/solvers/lagrangian/reactingParcelFoam/readChemistryProperties.H similarity index 100% rename from applications/solvers/Lagrangian/reactingParcelFoam/readChemistryProperties.H rename to applications/solvers/lagrangian/reactingParcelFoam/readChemistryProperties.H diff --git a/applications/solvers/Lagrangian/reactingParcelFoam/rhoEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/rhoEqn.H similarity index 95% rename from applications/solvers/Lagrangian/reactingParcelFoam/rhoEqn.H rename to applications/solvers/lagrangian/reactingParcelFoam/rhoEqn.H index e30e721004d7e251eb23e74182c475149f5bd2b4..1b2882a2b7b7e6bd09521babeb2cda56feb5f0aa 100644 --- a/applications/solvers/Lagrangian/reactingParcelFoam/rhoEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/rhoEqn.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/Make/files b/applications/solvers/lagrangian/trackedReactingParcelFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..90e8aa5b4bbda928a7b5c9c7993b24ffdcbf0bab --- /dev/null +++ b/applications/solvers/lagrangian/trackedReactingParcelFoam/Make/files @@ -0,0 +1,3 @@ +trackedReactingParcelFoam.C + +EXE = $(FOAM_APPBIN)/trackedReactingParcelFoam diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/Make/options b/applications/solvers/lagrangian/trackedReactingParcelFoam/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..54d7b744d4c7a23d0992ee5c6b127cc63cbc6c93 --- /dev/null +++ b/applications/solvers/lagrangian/trackedReactingParcelFoam/Make/options @@ -0,0 +1,38 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I${LIB_SRC}/meshTools/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ + -I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ + -I$(LIB_SRC)/ODE/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lmeshTools \ + -lcompressibleRASModels \ + -lcompressibleLESModels \ + -llagrangian \ + -llagrangianIntermediate \ + -lspecie \ + -lbasicThermophysicalModels \ + -lliquids \ + -lliquidMixture \ + -lsolids \ + -lsolidMixture \ + -lthermophysicalFunctions \ + -lcombustionThermophysicalModels \ + -lchemistryModel \ + -lradiation \ + -lODE diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/UEqn.H b/applications/solvers/lagrangian/trackedReactingParcelFoam/UEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..c82307305b8cba5e0877a7f0a13784ab2f66978b --- /dev/null +++ b/applications/solvers/lagrangian/trackedReactingParcelFoam/UEqn.H @@ -0,0 +1,47 @@ + fvVectorMatrix UEqn + ( + fvm::ddt(rho, U) + + fvm::div(phi, U) + + turbulence->divDevRhoReff(U) + == + rho.dimensionedInternalField()*g + + reactingParcels.SU() + ); + + UEqn.relax(); + + tmp<volScalarField> trAU; + tmp<volTensorField> trTU; + + if (pressureImplicitPorosity) + { + tmp<volTensorField> tTU = tensor(I)*UEqn.A(); + pZones.addResistance(UEqn, tTU()); + trTU = inv(tTU()); + trTU().rename("rAU"); + + volVectorField gradp = fvc::grad(p); + + for (int UCorr=0; UCorr<nUCorr; UCorr++) + { + U = trTU() & (UEqn.H() - gradp); + } + U.correctBoundaryConditions(); + } + else + { + pZones.addResistance(UEqn); + + solve + ( + UEqn == -fvc::grad(p) + ); + + trAU = 1.0/UEqn.A(); + trAU().rename("rAU"); + } + + if (momentumPredictor) + { + solve(UEqn == -fvc::grad(p)); + } diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/trackedReactingParcelFoam/YEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..8f77f23bc2f3f3799ed84830c75eab4bbd5b438b --- /dev/null +++ b/applications/solvers/lagrangian/trackedReactingParcelFoam/YEqn.H @@ -0,0 +1,46 @@ + +tmp<fv::convectionScheme<scalar> > mvConvection +( + fv::convectionScheme<scalar>::New + ( + mesh, + fields, + phi, + mesh.divScheme("div(phi,Yi_h)") + ) +); + + +{ + label inertIndex = -1; + volScalarField Yt = 0.0*Y[0]; + + for (label i=0; i<Y.size(); i++) + { + if (Y[i].name() != inertSpecie) + { + volScalarField& Yi = Y[i]; + solve + ( + fvm::ddt(rho, Yi) + + mvConvection->fvmDiv(phi, Yi) + - fvm::laplacian(turbulence->muEff(), Yi) + == + reactingParcels.Srho(i) + + kappa*chemistry.RR(i)().dimensionedInternalField() + + pointMassSources.Su(i) + ); + + Yi.max(0.0); + Yt += Yi; + } + else + { + inertIndex = i; + } + } + + Y[inertIndex] = scalar(1) - Yt; + Y[inertIndex].max(0.0); + +} diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/additionalOutput.H b/applications/solvers/lagrangian/trackedReactingParcelFoam/additionalOutput.H new file mode 100644 index 0000000000000000000000000000000000000000..9edd35eb7cab9acd294ba6a9e73b6ee8087b1c0d --- /dev/null +++ b/applications/solvers/lagrangian/trackedReactingParcelFoam/additionalOutput.H @@ -0,0 +1,48 @@ +{ + tmp<volScalarField> tdQ + ( + new volScalarField + ( + IOobject + ( + "dQ", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar + ( + "zero", + dimensionSet(1, -3, -1, 0, 0, 0, 0), + 0.0 + ) + ) + ); + + scalarField& dQ = tdQ(); + + scalarField cp(dQ.size(), 0.0); + + forAll(Y, i) + { + volScalarField RRi = chemistry.RR(i); + + forAll(h, celli) + { + scalar Ti = T[celli]; + cp[celli] += Y[i][celli]*chemistry.specieThermo()[i].Cp(Ti); + scalar hi = chemistry.specieThermo()[i].h(Ti); + scalar RR = RRi[celli]; + dQ[celli] -= hi*RR; + } + } + + forAll(dQ, celli) + { + dQ[celli] /= cp[celli]; + } + + tdQ().write(); +} diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/chemistry.H b/applications/solvers/lagrangian/trackedReactingParcelFoam/chemistry.H new file mode 100644 index 0000000000000000000000000000000000000000..07b1e9953b0db867186f6c668d27a9415a26c265 --- /dev/null +++ b/applications/solvers/lagrangian/trackedReactingParcelFoam/chemistry.H @@ -0,0 +1,25 @@ +{ + Info << "Solving chemistry" << endl; + + chemistry.solve + ( + runTime.value() - runTime.deltaT().value(), + runTime.deltaT().value() + ); + + // turbulent time scale + if (turbulentReaction) + { + DimensionedField<scalar, volMesh> tk = + Cmix*sqrt(turbulence->muEff()/rho/turbulence->epsilon()); + DimensionedField<scalar, volMesh> tc = + chemistry.tc()().dimensionedInternalField(); + + // Chalmers PaSR model + kappa = (runTime.deltaT() + tc)/(runTime.deltaT() + tc + tk); + } + else + { + kappa = 1.0; + } +} diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/createClouds.H b/applications/solvers/lagrangian/trackedReactingParcelFoam/createClouds.H new file mode 100644 index 0000000000000000000000000000000000000000..aaf91c81cc6ce8c5ba6248863458b17d98b4fd79 --- /dev/null +++ b/applications/solvers/lagrangian/trackedReactingParcelFoam/createClouds.H @@ -0,0 +1,9 @@ +Info<< "\nConstructing reacting cloud" << endl; +BasicTrackedReactingCloud<specieReactingProperties> reactingParcels +( + "reactingCloud1", + rho, + U, + g, + thermo() +); diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/trackedReactingParcelFoam/createFields.H new file mode 100644 index 0000000000000000000000000000000000000000..b9cea162f4a863babc5ef3536cf68e2451c84297 --- /dev/null +++ b/applications/solvers/lagrangian/trackedReactingParcelFoam/createFields.H @@ -0,0 +1,111 @@ + Info<< "Reading thermophysical properties" << nl << endl; + + autoPtr<hCombustionThermo> thermo + ( + hCombustionThermo::New(mesh) + ); + + combustionMixture& composition = thermo->composition(); + PtrList<volScalarField>& Y = composition.Y(); + + word inertSpecie(thermo->lookup("inertSpecie")); + + volScalarField& p = thermo->p(); + volScalarField& h = thermo->h(); + const volScalarField& T = thermo->T(); + const volScalarField& psi = thermo->psi(); + + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + thermo->rho() + ); + + Info<< "Reading field U" << nl << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + +# include "compressibleCreatePhi.H" + + DimensionedField<scalar, volMesh> kappa + ( + IOobject + ( + "kappa", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("zero", dimless, 0.0) + ); + + Info<< "Creating turbulence model" << nl << endl; + autoPtr<compressible::turbulenceModel> turbulence + ( + compressible::turbulenceModel::New + ( + rho, + U, + phi, + thermo() + ) + ); + + Info<< "Creating field DpDt" << nl << endl; + volScalarField DpDt = + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + + Info << "Constructing chemical mechanism" << nl << endl; + chemistryModel chemistry + ( + thermo(), + rho + ); + + multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; + + forAll (Y, i) + { + fields.add(Y[i]); + } + fields.add(h); + + Info<< "Creating porous zones" << nl << endl; + porousZones pZones(mesh); + Switch pressureImplicitPorosity(false); + + label nUCorr = 0; + if (pZones.size()) + { + // nUCorrectors for pressureImplicitPorosity + if (mesh.solutionDict().subDict("PISO").found("nUCorrectors")) + { + mesh.solutionDict().subDict("PISO").lookup("nUCorrectors") + >> nUCorr; + } + + if (nUCorr > 0) + { + pressureImplicitPorosity = true; + } + } + diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/createMulticomponentPointSources.H b/applications/solvers/lagrangian/trackedReactingParcelFoam/createMulticomponentPointSources.H new file mode 100644 index 0000000000000000000000000000000000000000..52de65dc5050296f6aca81542b733afe5252e704 --- /dev/null +++ b/applications/solvers/lagrangian/trackedReactingParcelFoam/createMulticomponentPointSources.H @@ -0,0 +1,8 @@ +Info<< "\nConstructing multi-component mass flow rate point sources" << endl; +timeActivatedExplicitMulticomponentPointSource pointMassSources +( + "pointMassSources", + mesh, + Y, + dimMass/dimVolume/dimTime +); diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/hEqn.H b/applications/solvers/lagrangian/trackedReactingParcelFoam/hEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..32e71555369290be7d019af0f4d6ad15473ee064 --- /dev/null +++ b/applications/solvers/lagrangian/trackedReactingParcelFoam/hEqn.H @@ -0,0 +1,20 @@ +{ + fvScalarMatrix hEqn + ( + fvm::ddt(rho, h) + + fvm::div(phi, h) + - fvm::laplacian(turbulence->alphaEff(), h) + == + DpDt + + reactingParcels.Sh() + + radiation->Sh(thermo()) + ); + + hEqn.relax(); + + hEqn.solve(); + + thermo->correct(); + + radiation->correct(); +} diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/trackedReactingParcelFoam/pEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..b6207ce0c4df93ff1272e297b0eb5c7553976c1c --- /dev/null +++ b/applications/solvers/lagrangian/trackedReactingParcelFoam/pEqn.H @@ -0,0 +1,110 @@ +rho = thermo->rho(); + +if (pressureImplicitPorosity) +{ + U = trTU()&UEqn.H(); +} +else +{ + U = trAU()*UEqn.H(); +} + +if (transonic) +{ + surfaceScalarField phid + ( + "phid", + fvc::interpolate(thermo->psi()) + *( + (fvc::interpolate(U) & mesh.Sf()) +// + fvc::ddtPhiCorr(rUA, rho, U, phi) + ) + ); + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + tmp<fvScalarMatrix> lapTerm; + + if (pressureImplicitPorosity) + { + lapTerm = fvm::laplacian(rho*trTU(), p); + } + else + { + lapTerm = fvm::laplacian(rho*trAU(), p); + } + + fvScalarMatrix pEqn + ( + fvm::ddt(psi, p) + + fvm::div(phid, p) + - lapTerm() + == + reactingParcels.Srho() + + pointMassSources.Su() + ); + + pEqn.solve(); + + if (nonOrth == nNonOrthCorr) + { + phi == pEqn.flux(); + } + } +} +else +{ + phi = + fvc::interpolate(rho) + *( + (fvc::interpolate(U) & mesh.Sf()) + + fvc::ddtPhiCorr(trAU(), rho, U, phi) + ); + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + tmp<fvScalarMatrix> lapTerm; + + if (pressureImplicitPorosity) + { + lapTerm = fvm::laplacian(rho*trTU(), p); + } + else + { + lapTerm = fvm::laplacian(rho*trAU(), p); + } + + fvScalarMatrix pEqn + ( + fvm::ddt(psi, p) + + fvc::div(phi) + - lapTerm() + == + reactingParcels.Srho() + + pointMassSources.Su() + ); + + pEqn.solve(); + + if (nonOrth == nNonOrthCorr) + { + phi += pEqn.flux(); + } + } +} + +#include "rhoEqn.H" +#include "compressibleContinuityErrs.H" + +if (pressureImplicitPorosity) +{ + U -= trTU()&fvc::grad(p); +} +else +{ + U -= trAU()*fvc::grad(p); +} +U.correctBoundaryConditions(); + +DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/readChemistryProperties.H b/applications/solvers/lagrangian/trackedReactingParcelFoam/readChemistryProperties.H new file mode 100644 index 0000000000000000000000000000000000000000..1a60e6fb34645a004fd39321f7a54d3bd5b45381 --- /dev/null +++ b/applications/solvers/lagrangian/trackedReactingParcelFoam/readChemistryProperties.H @@ -0,0 +1,22 @@ +Info<< "Reading chemistry properties\n" << endl; + +IOdictionary chemistryProperties +( + IOobject + ( + "chemistryProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) +); + +Switch turbulentReaction(chemistryProperties.lookup("turbulentReaction")); + +dimensionedScalar Cmix("Cmix", dimless, 1.0); + +if (turbulentReaction) +{ + chemistryProperties.lookup("Cmix") >> Cmix; +} diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/rhoEqn.H b/applications/solvers/lagrangian/trackedReactingParcelFoam/rhoEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..faadc1ecfbb1c8347bc8e6b1b6102f1a0ab911c4 --- /dev/null +++ b/applications/solvers/lagrangian/trackedReactingParcelFoam/rhoEqn.H @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2007 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 + +Global + rhoEqn + +Description + Solve the continuity for density. + +\*---------------------------------------------------------------------------*/ + +{ + solve + ( + fvm::ddt(rho) + + fvc::div(phi) + == + reactingParcels.Srho() + + pointMassSources.Su() + ); +} + +// ************************************************************************* // diff --git a/applications/solvers/lagrangian/trackedReactingParcelFoam/trackedReactingParcelFoam.C b/applications/solvers/lagrangian/trackedReactingParcelFoam/trackedReactingParcelFoam.C new file mode 100644 index 0000000000000000000000000000000000000000..62af964eba7dad29b1c2517c025d02af76df1c38 --- /dev/null +++ b/applications/solvers/lagrangian/trackedReactingParcelFoam/trackedReactingParcelFoam.C @@ -0,0 +1,121 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +Application + +Description + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "hCombustionThermo.H" +#include "turbulenceModel.H" +#include "BasicTrackedReactingCloud.H" +#include "chemistryModel.H" +#include "chemistrySolver.H" +#include "reactingThermoTypes.H" +#include "radiationModel.H" +#include "porousZones.H" +#include "timeActivatedExplicitMulticomponentPointSource.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + + #include "createTime.H" + #include "createMesh.H" + #include "readChemistryProperties.H" + #include "readEnvironmentalProperties.H" + #include "createFields.H" + #include "createRadiationModel.H" + #include "createClouds.H" + #include "createMulticomponentPointSources.H" + #include "readPISOControls.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" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + reactingParcels.evolve(); + + reactingParcels.info(); + + #include "chemistry.H" + #include "rhoEqn.H" + + // --- PIMPLE loop + for (int ocorr=1; ocorr<=nOuterCorr; ocorr++) + { + #include "UEqn.H" + #include "YEqn.H" + + // --- PISO loop + for (int corr=1; corr<=nCorr; corr++) + { + #include "hEqn.H" + #include "pEqn.H" + } + + Info<< "T gas min/max = " << min(T).value() << ", " + << max(T).value() << endl; + } + + turbulence->correct(); + + rho = thermo->rho(); + + if (runTime.write()) + { + #include "additionalOutput.H" + } + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return(0); +} + + +// ************************************************************************* // diff --git a/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/Make/files b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/files similarity index 100% rename from applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/Make/files rename to applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/files diff --git a/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/Make/options b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options similarity index 100% rename from applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/Make/options rename to applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options diff --git a/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/createFields.H b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/createFields.H similarity index 100% rename from applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/createFields.H rename to applications/solvers/lagrangian/uncoupledKinematicParcelFoam/createFields.H diff --git a/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C similarity index 97% rename from applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C rename to applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C index 786146219b622aa7a8b7ec6625080ec6f148f22c..e4c2b396652630423cc6ed925e55a61b0203ce03 100644 --- a/applications/solvers/Lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C +++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/UEqn.H b/applications/solvers/multiphase/compressibleInterDyMFoam/UEqn.H index 1576f6ba787b037d97c84368836912f0c7d129dd..138e58fc7f72b23abdcba18deef3da53e3b6b951 100644 --- a/applications/solvers/multiphase/compressibleInterDyMFoam/UEqn.H +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/UEqn.H @@ -24,10 +24,10 @@ == fvc::reconstruct ( - ( + fvc::interpolate(rho)*(g & mesh.Sf()) + + ( fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - - ghf*fvc::snGrad(rho) - - fvc::snGrad(pd) + - fvc::snGrad(p) ) * mesh.magSf() ) ); diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/correctPhi.H b/applications/solvers/multiphase/compressibleInterDyMFoam/correctPhi.H index 4152105784639530f725c53b7b561841b798c624..d82a03edb59a2d419420700638404e6f90b197c8 100644 --- a/applications/solvers/multiphase/compressibleInterDyMFoam/correctPhi.H +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/correctPhi.H @@ -12,7 +12,7 @@ IOobject::NO_WRITE ), mesh, - dimensionedScalar("pcorr", pd.dimensions(), 0.0), + dimensionedScalar("pcorr", p.dimensions(), 0.0), pcorrTypes ); diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H b/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H index dc04fb454680bbeadec55c8946227270601651c7..6b8e67cc4920d3da95a06c22b81db6dee407bc84 100644 --- a/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H @@ -1,9 +1,9 @@ - Info<< "Reading field pd\n" << endl; - volScalarField pd + Info<< "Reading field p\n" << endl; + volScalarField p ( IOobject ( - "pd", + "p", runTime.timeName(), mesh, IOobject::MUST_READ, @@ -88,24 +88,6 @@ dimensionedScalar pMin(twoPhaseProperties.lookup("pMin")); - volScalarField p - ( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - max - ( - (pd + gh*(alpha1*rho10 + alpha2*rho20)) - /(1.0 - gh*(alpha1*psi1 + alpha2*psi2)), - pMin - ) - ); - volScalarField rho1 = rho10 + psi1*p; volScalarField rho2 = rho20 + psi2*p; @@ -152,11 +134,11 @@ ); - wordList pcorrTypes(pd.boundaryField().types()); + wordList pcorrTypes(p.boundaryField().types()); - for (label i=0; i<pd.boundaryField().size(); i++) + for (label i=0; i<p.boundaryField().size(); i++) { - if (pd.boundaryField()[i].fixesValue()) + if (p.boundaryField()[i].fixesValue()) { pcorrTypes[i] = fixedValueFvPatchScalarField::typeName; } diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H index 7e4b37061fdede3fccc625875cc38c447657a198..e6004eb9de9f6d157dd5a42637540fa3d70c6ddb 100644 --- a/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H @@ -2,17 +2,17 @@ volScalarField rUA = 1.0/UEqn.A(); surfaceScalarField rUAf = fvc::interpolate(rUA); - tmp<fvScalarMatrix> pdEqnComp; + tmp<fvScalarMatrix> pEqnComp; if (transonic) { - pdEqnComp = - (fvm::ddt(pd) + fvm::div(phi, pd) - fvm::Sp(fvc::div(phi), pd)); + pEqnComp = + (fvm::ddt(p) + fvm::div(phi, p) - fvm::Sp(fvc::div(phi), p)); } else { - pdEqnComp = - (fvm::ddt(pd) + fvc::div(phi, pd) - fvc::Sp(fvc::div(phi), pd)); + pEqnComp = + (fvm::ddt(p) + fvc::div(phi, p) - fvc::Sp(fvc::div(phi), p)); } @@ -26,16 +26,16 @@ phi = phiU + ( - fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - - ghf*fvc::snGrad(rho) - )*rUAf*mesh.magSf(); + fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf() + + fvc::interpolate(rho)*(g & mesh.Sf()) + )*rUAf; for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - fvScalarMatrix pdEqnIncomp + fvScalarMatrix pEqnIncomp ( fvc::div(phi) - - fvm::laplacian(rUAf, pd) + - fvm::laplacian(rUAf, p) ); if @@ -51,9 +51,9 @@ max(alpha1, scalar(0))*(psi1/rho1) + max(alpha2, scalar(0))*(psi2/rho2) ) - *pdEqnComp() - + pdEqnIncomp, - mesh.solver(pd.name() + "Final") + *pEqnComp() + + pEqnIncomp, + mesh.solver(p.name() + "Final") ); } else @@ -64,8 +64,8 @@ max(alpha1, scalar(0))*(psi1/rho1) + max(alpha2, scalar(0))*(psi2/rho2) ) - *pdEqnComp() - + pdEqnIncomp + *pEqnComp() + + pEqnIncomp ); } @@ -73,26 +73,21 @@ { dgdt = (pos(alpha2)*(psi2/rho2) - pos(alpha1)*(psi1/rho1)) - *(pdEqnComp & pd); - phi += pdEqnIncomp.flux(); + *(pEqnComp & p); + phi += pEqnIncomp.flux(); } } U += rUA*fvc::reconstruct((phi - phiU)/rUAf); U.correctBoundaryConditions(); - p = max - ( - (pd + gh*(alpha1*rho10 + alpha2*rho20)) - /(1.0 - gh*(alpha1*psi1 + alpha2*psi2)), - pMin - ); + p.max(pMin); rho1 = rho10 + psi1*p; rho2 = rho20 + psi2*p; Info<< "max(U) " << max(mag(U)).value() << endl; - Info<< "min(pd) " << min(pd).value() << endl; + Info<< "min(p) " << min(p).value() << endl; // Make the fluxes relative to the mesh motion fvc::makeRelative(phi, U); diff --git a/applications/solvers/multiphase/compressibleInterFoam/UEqn.H b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H index 528e0aaafd892c2995fa94848c0d59b66af41942..0b1a9ac029d776dbd57da20f91c14da8ee88f5a7 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/UEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H @@ -24,10 +24,10 @@ == fvc::reconstruct ( - ( + fvc::interpolate(rho)*(g & mesh.Sf()) + + ( fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - - ghf*fvc::snGrad(rho) - - fvc::snGrad(pd) + - fvc::snGrad(p) ) * mesh.magSf() ) ); diff --git a/applications/solvers/multiphase/compressibleInterFoam/createFields.H b/applications/solvers/multiphase/compressibleInterFoam/createFields.H index 1f579d245bdcac21f647ac2a90a516b5f612b3c9..3e6904d383e677c976ac8daacd110b31af414f75 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/createFields.H +++ b/applications/solvers/multiphase/compressibleInterFoam/createFields.H @@ -1,9 +1,9 @@ - Info<< "Reading field pd\n" << endl; - volScalarField pd + Info<< "Reading field p\n" << endl; + volScalarField p ( IOobject ( - "pd", + "p", runTime.timeName(), mesh, IOobject::MUST_READ, @@ -46,11 +46,6 @@ #include "createPhi.H" - Info<< "Calculating field g.h\n" << endl; - volScalarField gh("gh", g & mesh.C()); - surfaceScalarField ghf("ghf", g & mesh.Cf()); - - Info<< "Reading transportProperties\n" << endl; twoPhaseMixture twoPhaseProperties(U, phi); @@ -88,24 +83,6 @@ dimensionedScalar pMin(twoPhaseProperties.lookup("pMin")); - volScalarField p - ( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - max - ( - (pd + gh*(alpha1*rho10 + alpha2*rho20)) - /(1.0 - gh*(alpha1*psi1 + alpha2*psi2)), - pMin - ) - ); - volScalarField rho1 = rho10 + psi1*p; volScalarField rho2 = rho20 + psi2*p; diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H index ebf24498ade0bd1d1572d6055da8b5bccd369ffa..9d2dc23916babb9c6c94acd2b53125c8cfee1dad 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -2,17 +2,17 @@ volScalarField rUA = 1.0/UEqn.A(); surfaceScalarField rUAf = fvc::interpolate(rUA); - tmp<fvScalarMatrix> pdEqnComp; + tmp<fvScalarMatrix> pEqnComp; if (transonic) { - pdEqnComp = - (fvm::ddt(pd) + fvm::div(phi, pd) - fvm::Sp(fvc::div(phi), pd)); + pEqnComp = + (fvm::ddt(p) + fvm::div(phi, p) - fvm::Sp(fvc::div(phi), p)); } else { - pdEqnComp = - (fvm::ddt(pd) + fvc::div(phi, pd) - fvc::Sp(fvc::div(phi), pd)); + pEqnComp = + (fvm::ddt(p) + fvc::div(phi, p) - fvc::Sp(fvc::div(phi), p)); } @@ -26,16 +26,16 @@ phi = phiU + ( - fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - - ghf*fvc::snGrad(rho) - )*rUAf*mesh.magSf(); + fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf() + + fvc::interpolate(rho)*(g & mesh.Sf()) + )*rUAf; for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - fvScalarMatrix pdEqnIncomp + fvScalarMatrix pEqnIncomp ( fvc::div(phi) - - fvm::laplacian(rUAf, pd) + - fvm::laplacian(rUAf, p) ); solve @@ -44,31 +44,27 @@ max(alpha1, scalar(0))*(psi1/rho1) + max(alpha2, scalar(0))*(psi2/rho2) ) - *pdEqnComp() - + pdEqnIncomp + *pEqnComp() + + pEqnIncomp ); if (nonOrth == nNonOrthCorr) { dgdt = (pos(alpha2)*(psi2/rho2) - pos(alpha1)*(psi1/rho1)) - *(pdEqnComp & pd); - phi += pdEqnIncomp.flux(); + *(pEqnComp & p); + phi += pEqnIncomp.flux(); } } U += rUA*fvc::reconstruct((phi - phiU)/rUAf); U.correctBoundaryConditions(); - p = max - ( - (pd + gh*(alpha1*rho10 + alpha2*rho20))/(1.0 - gh*(alpha1*psi1 + alpha2*psi2)), - pMin - ); + p.max(pMin); rho1 = rho10 + psi1*p; rho2 = rho20 + psi2*p; Info<< "max(U) " << max(mag(U)).value() << endl; - Info<< "min(pd) " << min(pd).value() << endl; + Info<< "min(p) " << min(p).value() << endl; } diff --git a/applications/solvers/multiphase/interDyMFoam/correctPhi.H b/applications/solvers/multiphase/interDyMFoam/correctPhi.H index c975c9b37416e10a066bb578ac05b531a4217473..1f7845f347d25a2e9e45cdbd6539e1998022f5e4 100644 --- a/applications/solvers/multiphase/interDyMFoam/correctPhi.H +++ b/applications/solvers/multiphase/interDyMFoam/correctPhi.H @@ -12,7 +12,7 @@ IOobject::NO_WRITE ), mesh, - dimensionedScalar("pcorr", pd.dimensions(), 0.0), + dimensionedScalar("pcorr", p.dimensions(), 0.0), pcorrTypes ); @@ -27,7 +27,7 @@ fvm::laplacian(rAUf, pcorr) == fvc::div(phi) ); - pcorrEqn.setReference(pdRefCell, pdRefValue); + pcorrEqn.setReference(pRefCell, pRefValue); pcorrEqn.solve(); if (nonOrth == nNonOrthCorr) diff --git a/applications/solvers/multiphase/interDyMFoam/createFields.H b/applications/solvers/multiphase/interDyMFoam/createFields.H index bcceb9d748193843a3124b585b538497b61e9d22..26644e17f472fe4dd8605280c0ed8e5a1ee0a5dd 100644 --- a/applications/solvers/multiphase/interDyMFoam/createFields.H +++ b/applications/solvers/multiphase/interDyMFoam/createFields.H @@ -1,9 +1,9 @@ - Info<< "Reading field pd\n" << endl; - volScalarField pd + Info<< "Reading field p\n" << endl; + volScalarField p ( IOobject ( - "pd", + "p", runTime.timeName(), mesh, IOobject::MUST_READ, @@ -92,47 +92,17 @@ incompressible::turbulenceModel::New(U, phi, twoPhaseProperties) ); - wordList pcorrTypes(pd.boundaryField().types()); + wordList pcorrTypes(p.boundaryField().types()); - for (label i=0; i<pd.boundaryField().size(); i++) + for (label i=0; i<p.boundaryField().size(); i++) { - if (pd.boundaryField()[i].fixesValue()) + if (p.boundaryField()[i].fixesValue()) { pcorrTypes[i] = fixedValueFvPatchScalarField::typeName; } } - volScalarField p - ( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - pd + rho*(g & mesh.C()) - ); - - label pdRefCell = 0; - scalar pdRefValue = 0.0; - setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue); - + label pRefCell = 0; scalar pRefValue = 0.0; - - if (pd.needReference()) - { - pRefValue = readScalar - ( - mesh.solutionDict().subDict("PISO").lookup("pRefValue") - ); - - p += dimensionedScalar - ( - "p", - p.dimensions(), - pRefValue - getRefCellValue(p, pdRefCell) - ); - } + setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); diff --git a/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C index 046503a8c459abc2f1c6caeb958c39a2ee985668..cf8ec8eb323bdc42352669aae04249baa07426f1 100644 --- a/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C +++ b/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C @@ -114,18 +114,6 @@ int main(int argc, char *argv[]) #include "pEqn.H" } - p = pd + rho*gh; - - if (pd.needReference()) - { - p += dimensionedScalar - ( - "p", - p.dimensions(), - pRefValue - getRefCellValue(p, pdRefCell) - ); - } - turbulence->correct(); runTime.write(); diff --git a/applications/solvers/multiphase/interDyMFoam/pEqn.H b/applications/solvers/multiphase/interDyMFoam/pEqn.H index f8ff18f60631c3cd66f02a8b9b4e8adc5ceb19e9..8825661c8307d70f2c8cb8bf6f18675579aaf6cb 100644 --- a/applications/solvers/multiphase/interDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/interDyMFoam/pEqn.H @@ -7,38 +7,38 @@ phi = phiU + ( - fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - - ghf*fvc::snGrad(rho) - )*rAUf*mesh.magSf(); + fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf() + + fvc::interpolate(rho)*(g & mesh.Sf()) + )*rAUf; - if (pd.needReference()) + if (p.needReference()) { fvc::makeRelative(phi, U); - adjustPhi(phi, U, pd); + adjustPhi(phi, U, p); fvc::makeAbsolute(phi, U); } for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - fvScalarMatrix pdEqn + fvScalarMatrix pEqn ( - fvm::laplacian(rAUf, pd) == fvc::div(phi) + fvm::laplacian(rAUf, p) == fvc::div(phi) ); - pdEqn.setReference(pdRefCell, pdRefValue); + pEqn.setReference(pRefCell, pRefValue); if (corr == nCorr-1 && nonOrth == nNonOrthCorr) { - pdEqn.solve(mesh.solver(pd.name() + "Final")); + pEqn.solve(mesh.solver(p.name() + "Final")); } else { - pdEqn.solve(mesh.solver(pd.name())); + pEqn.solve(mesh.solver(p.name())); } if (nonOrth == nNonOrthCorr) { - phi -= pdEqn.flux(); + phi -= pEqn.flux(); } } diff --git a/applications/solvers/multiphase/interFoam/UEqn.H b/applications/solvers/multiphase/interFoam/UEqn.H index 528e0aaafd892c2995fa94848c0d59b66af41942..0b1a9ac029d776dbd57da20f91c14da8ee88f5a7 100644 --- a/applications/solvers/multiphase/interFoam/UEqn.H +++ b/applications/solvers/multiphase/interFoam/UEqn.H @@ -24,10 +24,10 @@ == fvc::reconstruct ( - ( + fvc::interpolate(rho)*(g & mesh.Sf()) + + ( fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - - ghf*fvc::snGrad(rho) - - fvc::snGrad(pd) + - fvc::snGrad(p) ) * mesh.magSf() ) ); diff --git a/applications/solvers/multiphase/interFoam/correctPhi.H b/applications/solvers/multiphase/interFoam/correctPhi.H index 171e1670f47dbdf29d3904c47af7d196b706296e..642aa1c5d2a88c157d1d704f555c9b87ddefcc48 100644 --- a/applications/solvers/multiphase/interFoam/correctPhi.H +++ b/applications/solvers/multiphase/interFoam/correctPhi.H @@ -1,11 +1,11 @@ { # include "continuityErrs.H" - wordList pcorrTypes(pd.boundaryField().types()); + wordList pcorrTypes(p.boundaryField().types()); - for (label i=0; i<pd.boundaryField().size(); i++) + for (label i=0; i<p.boundaryField().size(); i++) { - if (pd.boundaryField()[i].fixesValue()) + if (p.boundaryField()[i].fixesValue()) { pcorrTypes[i] = fixedValueFvPatchScalarField::typeName; } @@ -22,7 +22,7 @@ IOobject::NO_WRITE ), mesh, - dimensionedScalar("pcorr", pd.dimensions(), 0.0), + dimensionedScalar("pcorr", p.dimensions(), 0.0), pcorrTypes ); @@ -37,7 +37,7 @@ fvm::laplacian(rUAf, pcorr) == fvc::div(phi) ); - pcorrEqn.setReference(pdRefCell, pdRefValue); + pcorrEqn.setReference(pRefCell, pRefValue); pcorrEqn.solve(); if (nonOrth == nNonOrthCorr) diff --git a/applications/solvers/multiphase/interFoam/createFields.H b/applications/solvers/multiphase/interFoam/createFields.H index 70637747528a9851a51dad21b021fead0adc3761..622d5d578c977d745f94419f993145222842d8a9 100644 --- a/applications/solvers/multiphase/interFoam/createFields.H +++ b/applications/solvers/multiphase/interFoam/createFields.H @@ -1,9 +1,9 @@ - Info<< "Reading field pd\n" << endl; - volScalarField pd + Info<< "Reading field p\n" << endl; + volScalarField p ( IOobject ( - "pd", + "p", runTime.timeName(), mesh, IOobject::MUST_READ, @@ -83,45 +83,9 @@ ); - Info<< "Calculating field g.h\n" << endl; - volScalarField gh("gh", g & mesh.C()); - surfaceScalarField ghf("ghf", g & mesh.Cf()); - - - volScalarField p - ( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - pd + rho*gh - ); - - - label pdRefCell = 0; - scalar pdRefValue = 0.0; - setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue); - + label pRefCell = 0; scalar pRefValue = 0.0; - - if (pd.needReference()) - { - pRefValue = readScalar - ( - mesh.solutionDict().subDict("PISO").lookup("pRefValue") - ); - - p += dimensionedScalar - ( - "p", - p.dimensions(), - pRefValue - getRefCellValue(p, pdRefCell) - ); - } + setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); // Construct interface from alpha1 distribution diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C index 4dd86bd8f72fafbdbcb9db63cea841d79b6d1d26..b111351c39dbaef4cbb3eaaa3ef08707221baf14 100644 --- a/applications/solvers/multiphase/interFoam/interFoam.C +++ b/applications/solvers/multiphase/interFoam/interFoam.C @@ -89,18 +89,6 @@ int main(int argc, char *argv[]) #include "continuityErrs.H" - p = pd + rho*gh; - - if (pd.needReference()) - { - p += dimensionedScalar - ( - "p", - p.dimensions(), - pRefValue - getRefCellValue(p, pdRefCell) - ); - } - turbulence->correct(); runTime.write(); diff --git a/applications/solvers/multiphase/interFoam/pEqn.H b/applications/solvers/multiphase/interFoam/pEqn.H index e5afbb8e4f24606318afe045faac8554960b04e5..25482fa9944a76a7de7ec2e94ced844068f420fa 100644 --- a/applications/solvers/multiphase/interFoam/pEqn.H +++ b/applications/solvers/multiphase/interFoam/pEqn.H @@ -12,33 +12,33 @@ phi = phiU + ( - fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - - ghf*fvc::snGrad(rho) - )*rUAf*mesh.magSf(); + fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf() + + fvc::interpolate(rho)*(g & mesh.Sf()) + )*rUAf; - adjustPhi(phi, U, pd); + adjustPhi(phi, U, p); for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - fvScalarMatrix pdEqn + fvScalarMatrix pEqn ( - fvm::laplacian(rUAf, pd) == fvc::div(phi) + fvm::laplacian(rUAf, p) == fvc::div(phi) ); - pdEqn.setReference(pdRefCell, pdRefValue); + pEqn.setReference(pRefCell, pRefValue); if (corr == nCorr-1 && nonOrth == nNonOrthCorr) { - pdEqn.solve(mesh.solver(pd.name() + "Final")); + pEqn.solve(mesh.solver(p.name() + "Final")); } else { - pdEqn.solve(mesh.solver(pd.name())); + pEqn.solve(mesh.solver(p.name())); } if (nonOrth == nNonOrthCorr) { - phi -= pdEqn.flux(); + phi -= pEqn.flux(); } } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H index c59137c7b87a9be3c799e03567dc8209341798f5..757e37a2cfdc7d9dbdacd0621120452219ac2a2c 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H @@ -25,10 +25,10 @@ == fvc::reconstruct ( - ( + fvc::interpolate(rho)*(g & mesh.Sf()) + + ( fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - - ghf*fvc::snGrad(rho) - - fvc::snGrad(pd) + - fvc::snGrad(p) ) * mesh.magSf() ) ); diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/correctPhi.H b/applications/solvers/multiphase/interPhaseChangeFoam/correctPhi.H index 171e1670f47dbdf29d3904c47af7d196b706296e..642aa1c5d2a88c157d1d704f555c9b87ddefcc48 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/correctPhi.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/correctPhi.H @@ -1,11 +1,11 @@ { # include "continuityErrs.H" - wordList pcorrTypes(pd.boundaryField().types()); + wordList pcorrTypes(p.boundaryField().types()); - for (label i=0; i<pd.boundaryField().size(); i++) + for (label i=0; i<p.boundaryField().size(); i++) { - if (pd.boundaryField()[i].fixesValue()) + if (p.boundaryField()[i].fixesValue()) { pcorrTypes[i] = fixedValueFvPatchScalarField::typeName; } @@ -22,7 +22,7 @@ IOobject::NO_WRITE ), mesh, - dimensionedScalar("pcorr", pd.dimensions(), 0.0), + dimensionedScalar("pcorr", p.dimensions(), 0.0), pcorrTypes ); @@ -37,7 +37,7 @@ fvm::laplacian(rUAf, pcorr) == fvc::div(phi) ); - pcorrEqn.setReference(pdRefCell, pdRefValue); + pcorrEqn.setReference(pRefCell, pRefValue); pcorrEqn.solve(); if (nonOrth == nNonOrthCorr) diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H b/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H index 5e727dea3eca4828580cadaf9a10531a7719fd62..98d166214b2ca5d34fa2aa554dfab679e16df7ee 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H @@ -1,9 +1,9 @@ - Info<< "Reading field pd\n" << endl; - volScalarField pd + Info<< "Reading field p\n" << endl; + volScalarField p ( IOobject ( - "pd", + "p", runTime.timeName(), mesh, IOobject::MUST_READ, @@ -66,26 +66,9 @@ rho.oldTime(); - label pdRefCell = 0; - scalar pdRefValue = 0.0; - setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue); - - Info<< "Calculating field g.h" << endl; - volScalarField gh("gh", g & mesh.C()); - surfaceScalarField ghf("ghf", g & mesh.Cf()); - - volScalarField p - ( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - pd + rho*gh - ); + label pRefCell = 0; + scalar pRefValue = 0.0; + setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); // Construct interface from alpha1 distribution diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H index 0037d71cf52ce5dd50dd298767b27987d4e03e38..4f290157f64bbf3de676acc26c9f5e708af91ba6 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H @@ -13,11 +13,11 @@ phi = phiU + ( - fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) - - ghf*fvc::snGrad(rho) - )*rUAf*mesh.magSf(); + fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf() + + fvc::interpolate(rho)*(g & mesh.Sf()) + )*rUAf; - adjustPhi(phi, U, pd); + adjustPhi(phi, U, p); Pair<tmp<volScalarField> > vDotP = twoPhaseProperties->vDotP(); const volScalarField& vDotcP = vDotP[0](); @@ -25,31 +25,29 @@ for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - fvScalarMatrix pdEqn + fvScalarMatrix pEqn ( - fvc::div(phi) - fvm::laplacian(rUAf, pd) - + (vDotvP - vDotcP)*(rho*gh - pSat) + fvm::Sp(vDotvP - vDotcP, pd) + fvc::div(phi) - fvm::laplacian(rUAf, p) + - (vDotvP - vDotcP)*pSat + fvm::Sp(vDotvP - vDotcP, p) ); - pdEqn.setReference(pdRefCell, pdRefValue); + pEqn.setReference(pRefCell, pRefValue); if (corr == nCorr-1 && nonOrth == nNonOrthCorr) { - pdEqn.solve(mesh.solver(pd.name() + "Final")); + pEqn.solve(mesh.solver(p.name() + "Final")); } else { - pdEqn.solve(mesh.solver(pd.name())); + pEqn.solve(mesh.solver(p.name())); } if (nonOrth == nNonOrthCorr) { - phi += pdEqn.flux(); + phi += pEqn.flux(); } } - p = pd + rho*gh; - U += rUA*fvc::reconstruct((phi - phiU)/rUAf); U.correctBoundaryConditions(); } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H index 5ce0c0c08847df8fd9b99161e8feb3962b3006bf..17686b592c4750443414cec36260eaa98f1a3205 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H @@ -24,10 +24,10 @@ == fvc::reconstruct ( - ( + fvc::interpolate(rho)*(g & mesh.Sf()) + + ( mixture.surfaceTensionForce() - - ghf*fvc::snGrad(rho) - - fvc::snGrad(pd) + - fvc::snGrad(p) ) * mesh.magSf() ) ); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/createFields.H b/applications/solvers/multiphase/multiphaseInterFoam/createFields.H index 07650fd4ddaf26054f94c303fdb1259f525244a3..fb6449629402a36f340e711e6ef89d7b64da8d96 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/createFields.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/createFields.H @@ -1,9 +1,9 @@ - Info<< "Reading field pd\n" << endl; - volScalarField pd + Info<< "Reading field p\n" << endl; + volScalarField p ( IOobject ( - "pd", + "p", runTime.timeName(), mesh, IOobject::MUST_READ, @@ -45,45 +45,9 @@ rho.oldTime(); - Info<< "Calculating field g.h\n" << endl; - volScalarField gh("gh", g & mesh.C()); - surfaceScalarField ghf("ghf", g & mesh.Cf()); - - - volScalarField p - ( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - pd + rho*gh - ); - - - label pdRefCell = 0; - scalar pdRefValue = 0.0; - setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue); - + label pRefCell = 0; scalar pRefValue = 0.0; - - if (pd.needReference()) - { - pRefValue = readScalar - ( - mesh.solutionDict().subDict("PISO").lookup("pRefValue") - ); - - p += dimensionedScalar - ( - "p", - p.dimensions(), - pRefValue - getRefCellValue(p, pdRefCell) - ); - } + setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); // Construct incompressible turbulence model diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C index c5fdb5f3c2e36d8ae693a7aead0ee0a71168d482..b6968ca1a11c4a8b664b2c1721c0d608a884dad4 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C @@ -81,18 +81,6 @@ int main(int argc, char *argv[]) #include "continuityErrs.H" - p = pd + rho*gh; - - if (pd.needReference()) - { - p += dimensionedScalar - ( - "p", - p.dimensions(), - pRefValue - getRefCellValue(p, pdRefCell) - ); - } - turbulence->correct(); runTime.write(); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H index 3fd1e3e60614032c75793b4b5767387e6ac9ab84..9d7e36dc95a0e695946f20a2e0fb4d9f80512b56 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/pEqn.H @@ -12,33 +12,33 @@ phi = phiU + ( - mixture.surfaceTensionForce() - - ghf*fvc::snGrad(rho) - )*rUAf*mesh.magSf(); + mixture.surfaceTensionForce()*mesh.magSf() + + fvc::interpolate(rho)*(g & mesh.Sf()) + )*rUAf; - adjustPhi(phi, U, pd); + adjustPhi(phi, U, p); for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - fvScalarMatrix pdEqn + fvScalarMatrix pEqn ( - fvm::laplacian(rUAf, pd) == fvc::div(phi) + fvm::laplacian(rUAf, p) == fvc::div(phi) ); - pdEqn.setReference(pdRefCell, pdRefValue); + pEqn.setReference(pRefCell, pRefValue); if (corr == nCorr-1) { - pdEqn.solve(mesh.solver(pd.name() + "Final")); + pEqn.solve(mesh.solver(p.name() + "Final")); } else { - pdEqn.solve(mesh.solver(pd.name())); + pEqn.solve(mesh.solver(p.name())); } if (nonOrth == nNonOrthCorr) { - phi -= pdEqn.flux(); + phi -= pEqn.flux(); } } diff --git a/applications/solvers/multiphase/settlingFoam/UEqn.H b/applications/solvers/multiphase/settlingFoam/UEqn.H index ac4c18ab19dc4b70fe0770f23e0a24bc4af3eebd..04e9194363d9ee4edc6aaa65e032fcebcaeddfca 100644 --- a/applications/solvers/multiphase/settlingFoam/UEqn.H +++ b/applications/solvers/multiphase/settlingFoam/UEqn.H @@ -22,10 +22,8 @@ == fvc::reconstruct ( - ( - - ghf*fvc::snGrad(rho) - - fvc::snGrad(p) - )*mesh.magSf() + fvc::interpolate(rho)*(g & mesh.Sf()) + - fvc::snGrad(p)*mesh.magSf() ) ); } diff --git a/applications/solvers/multiphase/settlingFoam/createFields.H b/applications/solvers/multiphase/settlingFoam/createFields.H index b13649c3124ddaf5ba06c5e13e3b090b746798ec..7c8445a71d4465bae5514c86afbf83f6611ce057 100644 --- a/applications/solvers/multiphase/settlingFoam/createFields.H +++ b/applications/solvers/multiphase/settlingFoam/createFields.H @@ -337,6 +337,3 @@ ), mut + mul ); - - Info<< "Calculating field (g.h)f\n" << endl; - surfaceScalarField ghf = surfaceScalarField("ghf", g & mesh.Cf()); diff --git a/applications/solvers/multiphase/settlingFoam/pEqn.H b/applications/solvers/multiphase/settlingFoam/pEqn.H index 65b954c6da84e1fe6b98ee5a99f295f7a14ff324..b4fc05b32ab56f04646427310478e9cc92429b11 100644 --- a/applications/solvers/multiphase/settlingFoam/pEqn.H +++ b/applications/solvers/multiphase/settlingFoam/pEqn.H @@ -15,7 +15,7 @@ phi = ); surfaceScalarField phiU("phiU", phi); -phi -= ghf*fvc::snGrad(rho)*rUAf*mesh.magSf(); +phi += fvc::interpolate(rho)*(g & mesh.Sf())*rUAf; for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H index 5a945697caa2ffa30846b7fc1831c8b92dbde7fb..18b915b16bde8f4f8bda4b5a13daf8d99b3b74cb 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H @@ -14,7 +14,14 @@ //- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf())) ); - UEqn.relax(); + if (oCorr == nOuterCorr-1) + { + UEqn.relax(1); + } + else + { + UEqn.relax(); + } if (momentumPredictor) { @@ -22,9 +29,11 @@ ( UEqn == - -fvc::reconstruct + fvc::reconstruct ( - mesh.magSf()*(fvc::snGrad(pd) + ghf*fvc::snGrad(rho)) - ) + fvc::interpolate(rho)*(g & mesh.Sf()) + - mesh.magSf()*fvc::snGrad(p) + ), + mesh.solver(oCorr == nOuterCorr-1 ? "UFinal" : "U") ); } diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H index c12602536870ab39e1a63a81062b143d5d360c00..8194753c8fca0674fc224b189f88851e4cb24d34 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H @@ -3,7 +3,12 @@ ( fvm::ddt(alpha1) + fvm::div(phi, alpha1) - - fvm::laplacian(Dab, alpha1) + //- fvm::Sp(fvc::div(phi), alpha1) + - fvm::laplacian + ( + Dab + alphatab*turbulence->nut(), alpha1, + "laplacian(Dab,alpha1)" + ) ); alpha1Eqn.solve(); diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H index a38135dc19a968cd10cf38beec6b3a35a4e4165b..b61566d924db04be243167e57d2250845b3c0b3c 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H @@ -1,9 +1,9 @@ - Info<< "Reading field pd\n" << endl; - volScalarField pd + Info<< "Reading field p\n" << endl; + volScalarField p ( IOobject ( - "pd", + "p", runTime.timeName(), mesh, IOobject::MUST_READ, @@ -50,6 +50,9 @@ dimensionedScalar Dab(twoPhaseProperties.lookup("Dab")); + // Read the reciprocal of the turbulent Schmidt number + dimensionedScalar alphatab(twoPhaseProperties.lookup("alphatab")); + // Need to store rho for ddt(rho, U) volScalarField rho("rho", alpha1*rho1 + (scalar(1) - alpha1)*rho2); rho.oldTime(); @@ -72,45 +75,9 @@ ); - Info<< "Calculating field g.h\n" << endl; - volScalarField gh("gh", g & mesh.C()); - surfaceScalarField ghf("gh", g & mesh.Cf()); - - - volScalarField p - ( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - pd + rho*gh - ); - - - label pdRefCell = 0; - scalar pdRefValue = 0.0; - setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue); - + label pRefCell = 0; scalar pRefValue = 0.0; - - if (pd.needReference()) - { - pRefValue = readScalar - ( - mesh.solutionDict().subDict("PISO").lookup("pRefValue") - ); - - p += dimensionedScalar - ( - "p", - p.dimensions(), - pRefValue - getRefCellValue(p, pdRefCell) - ); - } + setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue); // Construct incompressible turbulence model diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H index eaa0cef6294ad14b8b4bfdc7b54201ae811ae26d..7ba3cdba8a6a2badce20af6292008e62487f23b7 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/pEqn.H @@ -7,26 +7,37 @@ surfaceScalarField phiU ( "phiU", - (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi) + (fvc::interpolate(U) & mesh.Sf()) + + fvc::ddtPhiCorr(rUA, rho, U, phi) ); - phi = phiU - ghf*fvc::snGrad(rho)*rUAf*mesh.magSf(); - - adjustPhi(phi, U, pd); + phi = phiU + fvc::interpolate(rho)*(g & mesh.Sf())*rUAf; for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - fvScalarMatrix pdEqn + fvScalarMatrix pEqn ( - fvm::laplacian(rUAf, pd) == fvc::div(phi) + fvm::laplacian(rUAf, p) == fvc::div(phi) ); - pdEqn.setReference(pdRefCell, pdRefValue); - pdEqn.solve(); + pEqn.setReference(pRefCell, pRefValue); + + if + ( + corr == nCorr-1 + && nonOrth == nNonOrthCorr + ) + { + pEqn.solve(mesh.solver(p.name() + "Final")); + } + else + { + pEqn.solve(mesh.solver(p.name())); + } if (nonOrth == nNonOrthCorr) { - phi -= pdEqn.flux(); + phi -= pEqn.flux(); } } diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C index 1caf455708079ff2f4f04733c388aa070393ba8a..63991f149e513901c1e15dda5effeeda7567ca28 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C @@ -40,53 +40,52 @@ Description int main(int argc, char *argv[]) { - -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" -# include "readEnvironmentalProperties.H" -# include "initContinuityErrs.H" -# include "createFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readEnvironmentalProperties.H" + #include "readPIMPLEControls.H" + #include "initContinuityErrs.H" + #include "createFields.H" + #include "readTimeControls.H" + #include "CourantNo.H" + #include "setInitialDeltaT.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; - while (runTime.loop()) + while (runTime.run()) { - Info<< "Time = " << runTime.timeName() << nl << endl; + #include "readPIMPLEControls.H" + #include "readTimeControls.H" + #include "CourantNo.H" + #include "setDeltaT.H" -# include "readPISOControls.H" -# include "CourantNo.H" + runTime++; - twoPhaseProperties.correct(); + Info<< "Time = " << runTime.timeName() << nl << endl; -# include "alphaEqn.H" + // --- Pressure-velocity PIMPLE corrector loop + for (int oCorr=0; oCorr<nOuterCorr; oCorr++) + { + twoPhaseProperties.correct(); -# include "UEqn.H" + #include "alphaEqn.H" - // --- PISO loop - for (int corr=0; corr<nCorr; corr++) - { -# include "pEqn.H" - } + #include "UEqn.H" -# include "continuityErrs.H" + // --- PISO loop + for (int corr=0; corr<nCorr; corr++) + { + #include "pEqn.H" + } - p = pd + rho*gh; + #include "continuityErrs.H" - if (pd.needReference()) - { - p += dimensionedScalar - ( - "p", - p.dimensions(), - pRefValue - getRefCellValue(p, pdRefCell) - ); + turbulence->correct(); } - turbulence->correct(); - runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" diff --git a/applications/test/directMappedPatch/Make/files b/applications/test/directMappedPatch/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..65f39a47b8e09776cb7c8259d27f73a15663e335 --- /dev/null +++ b/applications/test/directMappedPatch/Make/files @@ -0,0 +1,4 @@ + +testDirectMappedPatch.C + +EXE = $(FOAM_USER_APPBIN)/testDirectMappedPatch diff --git a/applications/test/directMappedPatch/Make/options b/applications/test/directMappedPatch/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..d76bd10c8fa52345df9ce1be79cdeae2b41dde84 --- /dev/null +++ b/applications/test/directMappedPatch/Make/options @@ -0,0 +1,6 @@ +EXE_INC = \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -lfiniteVolume diff --git a/applications/test/directMappedPatch/testDirectMappedPatch.C b/applications/test/directMappedPatch/testDirectMappedPatch.C new file mode 100644 index 0000000000000000000000000000000000000000..dd27ff6955d92b5adf9023913b2966b0ee38f748 --- /dev/null +++ b/applications/test/directMappedPatch/testDirectMappedPatch.C @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 + +Application + testDirectMappedPatch + +Description + Test direct mapped b.c. by mapping face centres (mesh.C().boundaryField()). + +\*---------------------------------------------------------------------------*/ + + +#include "argList.H" +#include "fvMesh.H" +#include "volFields.H" +#include "meshTools.H" +#include "Time.H" +#include "OFstream.H" +#include "volFields.H" +#include "directMappedFixedValueFvPatchFields.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +// Main program: + +int main(int argc, char *argv[]) +{ +# include "addTimeOptions.H" +# include "setRootCase.H" +# include "createTime.H" +# include "createMesh.H" + + wordList patchFieldTypes + ( + mesh.boundaryMesh().size(), + calculatedFvPatchVectorField::typeName + ); + + forAll(mesh.boundaryMesh(), patchI) + { + if (isA<directMappedPolyPatch>(mesh.boundaryMesh()[patchI])) + { + patchFieldTypes[patchI] = + directMappedFixedValueFvPatchVectorField::typeName; + } + } + + Pout<< "patchFieldTypes:" << patchFieldTypes << endl; + + volVectorField cc + ( + IOobject + ( + "cc", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedVector("zero", dimLength, vector::zero), + patchFieldTypes + ); + + cc.internalField() = mesh.C().internalField(); + cc.boundaryField().updateCoeffs(); + + forAll(cc.boundaryField(), patchI) + { + if + ( + isA<directMappedFixedValueFvPatchVectorField> + ( + cc.boundaryField()[patchI] + ) + ) + { + Pout<< "Detected a directMapped patch:" << patchI << endl; + + OFstream str(mesh.boundaryMesh()[patchI].name() + ".obj"); + Pout<< "Writing mapped values to " << str.name() << endl; + + label vertI = 0; + const fvPatchVectorField& fvp = cc.boundaryField()[patchI]; + + forAll(fvp, i) + { + meshTools::writeOBJ(str, fvp.patch().Cf()[i]); + vertI++; + meshTools::writeOBJ(str, fvp[i]); + vertI++; + str << "l " << vertI-1 << ' ' << vertI << nl; + } + } + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/test/extendedStencil/Make/files b/applications/test/extendedStencil/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..236668cde8f9c8da6ac1f75d1e0d9de0f36ad04f --- /dev/null +++ b/applications/test/extendedStencil/Make/files @@ -0,0 +1,4 @@ + +testExtendedStencil.C + +EXE = $(FOAM_USER_APPBIN)/testExtendedStencil diff --git a/applications/test/extendedStencil/Make/options b/applications/test/extendedStencil/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..b733f6ac04019776e5ae1378c65835fcd6209972 --- /dev/null +++ b/applications/test/extendedStencil/Make/options @@ -0,0 +1,6 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +EXE_LIBS = \ + -lfiniteVolume diff --git a/applications/test/extendedStencil/testExtendedStencil.C b/applications/test/extendedStencil/testExtendedStencil.C new file mode 100644 index 0000000000000000000000000000000000000000..b8db2b89bf993552dd8582ba0c77c2cef58b121a --- /dev/null +++ b/applications/test/extendedStencil/testExtendedStencil.C @@ -0,0 +1,499 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 + +Application + testExtendedStencil + +Description + Test app for determining extended stencil. + +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "fvMesh.H" +#include "volFields.H" +#include "Time.H" +#include "mapDistribute.H" +#include "OFstream.H" +#include "meshTools.H" +//#include "FECCellToFaceStencil.H" +//#include "CFCCellToFaceStencil.H" +//#include "CPCCellToFaceStencil.H" +//#include "CECCellToFaceStencil.H" +//#include "extendedCentredCellToFaceStencil.H" +//#include "extendedUpwindCellToFaceStencil.H" + +//#include "centredCFCCellToFaceStencilObject.H" +//#include "centredFECCellToFaceStencilObject.H" +//#include "centredCPCCellToFaceStencilObject.H" +//#include "centredCECCellToFaceStencilObject.H" + +//#include "upwindFECCellToFaceStencilObject.H" +//#include "upwindCPCCellToFaceStencilObject.H" +//#include "upwindCECCellToFaceStencilObject.H" + +//#include "upwindCFCCellToFaceStencilObject.H" +#include "centredCFCFaceToCellStencilObject.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +void writeStencilOBJ +( + const fileName& fName, + const point& fc, + const List<point>& stencilCc +) +{ + OFstream str(fName); + label vertI = 0; + + meshTools::writeOBJ(str, fc); + vertI++; + + forAll(stencilCc, i) + { + meshTools::writeOBJ(str, stencilCc[i]); + vertI++; + str << "l 1 " << vertI << nl; + } +} + + +// Stats +void writeStencilStats(const labelListList& stencil) +{ + label sumSize = 0; + label nSum = 0; + label minSize = labelMax; + label maxSize = labelMin; + + forAll(stencil, i) + { + const labelList& sCells = stencil[i]; + + if (sCells.size() > 0) + { + sumSize += sCells.size(); + nSum++; + minSize = min(minSize, sCells.size()); + maxSize = max(maxSize, sCells.size()); + } + } + reduce(sumSize, sumOp<label>()); + reduce(nSum, sumOp<label>()); + sumSize /= nSum; + + reduce(minSize, minOp<label>()); + reduce(maxSize, maxOp<label>()); + + Info<< "Stencil size :" << nl + << " average : " << sumSize << nl + << " min : " << minSize << nl + << " max : " << maxSize << nl + << endl; +} + + +// Main program: + +int main(int argc, char *argv[]) +{ +# include "addTimeOptions.H" +# include "setRootCase.H" +# include "createTime.H" + + // Get times list + instantList Times = runTime.times(); +# include "checkTimeOptions.H" + runTime.setTime(Times[startTime], startTime); +# include "createMesh.H" + + // Force calculation of extended edge addressing + const labelListList& edgeFaces = mesh.edgeFaces(); + const labelListList& edgeCells = mesh.edgeCells(); + const labelListList& pointCells = mesh.pointCells(); + Info<< "dummy:" << edgeFaces.size() + edgeCells.size() + pointCells.size() + << endl; + + + // Centred, semi-extended stencil (edge cells only) + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +// { +// //const FECCellToFaceStencil cfcStencil(mesh); +// //const extendedCentredCellToFaceStencil addressing +// //( +// // cfcStencil +// //); +// const extendedCentredStencil& addressing = +// centredFECCellToFaceStencilObject::New +// ( +// mesh +// ); +// +// Info<< "faceEdgeCell:" << endl; +// writeStencilStats(addressing.stencil()); +// +// // Collect stencil cell centres +// List<List<point> > stencilPoints(mesh.nFaces()); +// addressing.collectData +// ( +// mesh.C(), +// stencilPoints +// ); +// +// forAll(stencilPoints, faceI) +// { +// writeStencilOBJ +// ( +// runTime.path()/"faceEdgeCell" + Foam::name(faceI) + ".obj", +// mesh.faceCentres()[faceI], +// stencilPoints[faceI] +// ); +// } +// } + + + + +// // Centred, face stencil +// // ~~~~~~~~~~~~~~~~~~~~~ +// +// { +// const extendedCentredCellToFaceStencil& addressing = +// centredCFCCellToFaceStencilObject::New +// ( +// mesh +// ); +// +// Info<< "cellFaceCell:" << endl; +// writeStencilStats(addressing.stencil()); +// +// +// //// Do some interpolation. +// //{ +// // const labelListList& stencil = addressing.stencil(); +// // List<List<scalar> > stencilWeights(stencil.size()); +// // forAll(stencil, faceI) +// // { +// // const labelList& fStencil = stencil[faceI]; +// // +// // if (fStencil.size() > 0) +// // { +// // // Uniform weights +// // stencilWeights[faceI] = scalarList +// // ( +// // fStencil.size(), +// // 1.0/fStencil.size() +// // ); +// // } +// // } +// // +// // tmp<surfaceVectorField> tfc +// // ( +// // addressing.weightedSum(mesh.C(), stencilWeights) +// // ); +// //} +// +// +// // Collect stencil cell centres +// List<List<point> > stencilPoints(mesh.nFaces()); +// addressing.collectData +// ( +// mesh.C(), +// stencilPoints +// ); +// +// forAll(stencilPoints, faceI) +// { +// if (stencilPoints[faceI].size() >= 15) +// { +// writeStencilOBJ +// ( +// runTime.path()/"centredFace" + Foam::name(faceI) + ".obj", +// mesh.faceCentres()[faceI], +// stencilPoints[faceI] +// ); +// } +// } +// } + + +// // Centred, point stencil +// // ~~~~~~~~~~~~~~~~~~~~~~ +// +// { +// //const extendedCentredCellToFaceStencil& addressing = +// //centredCPCStencilObject::New +// //( +// // mesh +// //); +// // +// //Info<< "cellPointCell:" << endl; +// //writeStencilStats(addressing.stencil()); +// // +// // +// //// Collect stencil cell centres +// //List<List<point> > stencilPoints(mesh.nFaces()); +// //addressing.collectData +// //( +// // mesh.C(), +// // stencilPoints +// //); +// // +// //forAll(stencilPoints, faceI) +// //{ +// // writeStencilOBJ +// // ( +// // runTime.path()/"centredPoint" + Foam::name(faceI) + ".obj", +// // mesh.faceCentres()[faceI], +// // stencilPoints[faceI] +// // ); +// //} +// } + + + +// // Centred, edge stencil +// // ~~~~~~~~~~~~~~~~~~~~~~ +// +// { +// //const extendedCentredCellToFaceStencil& addressing = +// //centredCECStencilObject::New +// //( +// // mesh +// //); +// // +// //Info<< "cellEdgeCell:" << endl; +// //writeStencilStats(addressing.stencil()); +// // +// // +// //// Collect stencil cell centres +// //List<List<point> > stencilPoints(mesh.nFaces()); +// //addressing.collectData +// //( +// // mesh.C(), +// // stencilPoints +// //); +// // +// //forAll(stencilPoints, faceI) +// //{ +// // writeStencilOBJ +// // ( +// // runTime.path()/"centredEdge" + Foam::name(faceI) + ".obj", +// // mesh.faceCentres()[faceI], +// // stencilPoints[faceI] +// // ); +// //} +// } + + + + // Upwind, semi-extended stencil + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + //{ + // const extendedUpwindCellToFaceStencil& addressing = + // upwindFECCellToFaceStencilObject::New + // ( + // mesh, + // 0.5 + // ); + // + // Info<< "upwind-faceEdgeCell:" << endl; + // writeStencilStats(addressing.ownStencil()); + // + // { + // // Collect stencil cell centres + // List<List<point> > ownPoints(mesh.nFaces()); + // addressing.collectData + // ( + // addressing.ownMap(), + // addressing.ownStencil(), + // mesh.C(), + // ownPoints + // ); + // + // forAll(ownPoints, faceI) + // { + // writeStencilOBJ + // ( + // runTime.path()/"ownFEC" + Foam::name(faceI) + ".obj", + // mesh.faceCentres()[faceI], + // ownPoints[faceI] + // ); + // } + // } + // { + // // Collect stencil cell centres + // List<List<point> > neiPoints(mesh.nFaces()); + // addressing.collectData + // ( + // addressing.neiMap(), + // addressing.neiStencil(), + // mesh.C(), + // neiPoints + // ); + // + // forAll(neiPoints, faceI) + // { + // writeStencilOBJ + // ( + // runTime.path()/"neiFEC" + Foam::name(faceI) + ".obj", + // mesh.faceCentres()[faceI], + // neiPoints[faceI] + // ); + // } + // } + //} + + + + // Upwind, extended stencil + // ~~~~~~~~~~~~~~~~~~~~~~~~ + + //{ + // const extendedUpwindCellToFaceStencil& addressing = + // upwindCFCCellToFaceStencilObject::New + // ( + // mesh, + // 0.5 + // ); + // + // Info<< "upwind-cellFaceCell:" << endl; + // writeStencilStats(addressing.ownStencil()); + // + // { + // // Collect stencil cell centres + // List<List<point> > ownPoints(mesh.nFaces()); + // addressing.collectData + // ( + // addressing.ownMap(), + // addressing.ownStencil(), + // mesh.C(), + // ownPoints + // ); + // + // forAll(ownPoints, faceI) + // { + // writeStencilOBJ + // ( + // runTime.path()/"ownCFC" + Foam::name(faceI) + ".obj", + // mesh.faceCentres()[faceI], + // ownPoints[faceI] + // ); + // } + // } + // { + // // Collect stencil cell centres + // List<List<point> > neiPoints(mesh.nFaces()); + // addressing.collectData + // ( + // addressing.neiMap(), + // addressing.neiStencil(), + // mesh.C(), + // neiPoints + // ); + // + // forAll(neiPoints, faceI) + // { + // writeStencilOBJ + // ( + // runTime.path()/"neiCFC" + Foam::name(faceI) + ".obj", + // mesh.faceCentres()[faceI], + // neiPoints[faceI] + // ); + // } + // } + //} + + + + //---- CELL CENTRED STENCIL ----- + + // Centred, cell stencil + // ~~~~~~~~~~~~~~~~~~~~~ + + { + const extendedCentredFaceToCellStencil& addressing = + centredCFCFaceToCellStencilObject::New + ( + mesh + ); + + Info<< "cellFaceCell:" << endl; + writeStencilStats(addressing.stencil()); + + // Collect stencil face centres + List<List<point> > stencilPoints(mesh.nCells()); + addressing.collectData + ( + mesh.Cf(), + stencilPoints + ); + + forAll(stencilPoints, cellI) + { + writeStencilOBJ + ( + runTime.path()/"centredCell" + Foam::name(cellI) + ".obj", + mesh.cellCentres()[cellI], + stencilPoints[cellI] + ); + } + } + + +//XXXXXX +// // Evaluate +// List<List<scalar> > stencilData(faceStencils.size()); +// collectStencilData +// ( +// distMap, +// faceStencils, +// vf, +// stencilData +// ); +// for(label faci = 0; faci < mesh.nInternalFaces(); faci++) +// { +// const scalarList& stData = stencilData[faceI]; +// const scalarList& stWeight = fit[faceI]; +// +// forAll(stData, i) +// { +// sf[faceI] += stWeight[i]*stData[i]; +// } +// } +// See finiteVolume/lnInclude/leastSquaresGrad.C +//XXXXXX + + Pout<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index bbaab8b01d5aaa463e01049c03dab2306326ce9f..89477520816024a4934fab977c33523148eab2d9 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -816,6 +816,8 @@ int main(int argc, char *argv[]) // Pre-filtering: flip "owner" boundary or wrong oriented internal // faces and move to neighbour + + boolList fm(faces.size(), false); forAll (faces, facei) { if @@ -824,6 +826,7 @@ int main(int argc, char *argv[]) || (neighbour[facei] != -1 && owner[facei] > neighbour[facei]) ) { + fm[facei] = true; faces[facei] = faces[facei].reverseFace(); Swap(owner[facei], neighbour[facei]); } @@ -1175,7 +1178,7 @@ int main(int argc, char *argv[]) false, // flipFaceFlux -1, // patchID faceZonei, // zoneID - false // zoneFlip + fm[facei] // zoneFlip ); } diff --git a/applications/utilities/mesh/conversion/polyDualMesh/meshDualiser.C b/applications/utilities/mesh/conversion/polyDualMesh/meshDualiser.C index ad7affddaeec4ed9d1ba8dbb4ea1a09fca6e0643..dfc1fbb20e651bb85c0ea2edee738d3e111234ae 100644 --- a/applications/utilities/mesh/conversion/polyDualMesh/meshDualiser.C +++ b/applications/utilities/mesh/conversion/polyDualMesh/meshDualiser.C @@ -1077,7 +1077,7 @@ void Foam::meshDualiser::setRefinement { label pointI = multiCellFeaturePoints[i]; - if (pointToDualCells_[pointI].size()) + if (pointToDualCells_[pointI].size() > 0) { FatalErrorIn ( diff --git a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C index e2bf673ce26375af9422b21a9e5ca3451988c247..a410c1d8922b14000fedc606a662eb82e5b07bb4 100644 --- a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C +++ b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C @@ -25,22 +25,34 @@ License Description Calculate the dual of a polyMesh. Adheres to all the feature&patch edges. - Feature angle: - convex features : point becomes single boundary cell with multiple - boundary faces. - concave features: point becomes multiple boundary cells. - -splitAllFaces: +Usage + + - polyDualMesh featureAngle + + Detects any boundary edge > angle and creates multiple boundary faces + for it. Normal behaviour is to have each point become a cell + (1.5 behaviour) + + @param -concaveMultiCells + Creates multiple cells for each point on a concave edge. Might limit + the amount of distortion on some meshes. + + @param -splitAllFaces Normally only constructs a single face between two cells. This single face might be too distorted. splitAllFaces will create a single face for every original cell the face passes through. The mesh will thus have multiple faces inbetween two cells! (so is not strictly upper-triangular anymore - checkMesh will complain) - -doNotPreserveFaceZones: + + @param -doNotPreserveFaceZones: By default all faceZones are preserved by marking all faces, edges and points on them as features. The -doNotPreserveFaceZones disables this behaviour. + Note: is just a driver for meshDualiser. Substitute your own + simpleMarkFeatures to have different behaviour. + \*---------------------------------------------------------------------------*/ #include "argList.H" @@ -70,6 +82,7 @@ void simpleMarkFeatures const polyMesh& mesh, const PackedBoolList& isBoundaryEdge, const scalar featureAngle, + const bool concaveMultiCells, const bool doNotPreserveFaceZones, labelList& featureFaces, @@ -182,7 +195,7 @@ void simpleMarkFeatures - allBoundary[f0].centre(allBoundary.points()) ); - if ((c1c0 & n0) > SMALL) + if (concaveMultiCells && (c1c0 & n0) > SMALL) { // Found concave edge. Make into multiCell features Info<< "Detected concave feature edge:" << edgeI @@ -230,7 +243,7 @@ void simpleMarkFeatures if (doNotPreserveFaceZones) { - if (faceZones.size()) + if (faceZones.size() > 0) { WarningIn("simpleMarkFeatures(..)") << "Detected " << faceZones.size() @@ -240,7 +253,7 @@ void simpleMarkFeatures } else { - if (faceZones.size()) + if (faceZones.size() > 0) { Info<< "Detected " << faceZones.size() << " faceZones. Preserving these by marking their" @@ -345,6 +358,7 @@ int main(int argc, char *argv[]) argList::validArgs.append("feature angle[0-180]"); argList::validOptions.insert("splitAllFaces", ""); + argList::validOptions.insert("concaveMultiCells", ""); argList::validOptions.insert("doNotPreserveFaceZones", ""); argList::validOptions.insert("overwrite", ""); @@ -381,11 +395,25 @@ int main(int argc, char *argv[]) const bool splitAllFaces = args.optionFound("splitAllFaces"); + if (splitAllFaces) + { + Info<< "Splitting all internal faces to create multiple faces" + << " between two cells." << nl + << endl; + } + const bool overwrite = args.optionFound("overwrite"); const bool doNotPreserveFaceZones = args.optionFound ( "doNotPreserveFaceZones" ); + const bool concaveMultiCells = args.optionFound("concaveMultiCells"); + if (concaveMultiCells) + { + Info<< "Generating multiple cells for points on concave feature edges." + << nl << endl; + } + // Face(centre)s that need inclusion in the dual mesh labelList featureFaces; @@ -393,7 +421,7 @@ int main(int argc, char *argv[]) labelList featureEdges; // Points (that become a single cell) that need inclusion in the dual mesh labelList singleCellFeaturePoints; - // Points (that become a mulitple cells) ,, + // Points (that become a multiple cells) ,, labelList multiCellFeaturePoints; // Sample implementation of feature detection. @@ -402,6 +430,7 @@ int main(int argc, char *argv[]) mesh, isBoundaryEdge, featureAngle, + concaveMultiCells, doNotPreserveFaceZones, featureFaces, diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C index 95ec6c5b8ae8e12a02dd5df4b63cbefc9537eac2..74e505394d0572af18ab603d20e73f31b414b327 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C @@ -23,7 +23,8 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Description - Extrude mesh from existing patch or from patch read from file. + Extrude mesh from existing patch (flipped so has inwards pointing + normals) or from patch read from file. Note: Merges close points so be careful. Type of extrusion prescribed by run-time selectable model. @@ -52,43 +53,34 @@ using namespace Foam; int main(int argc, char *argv[]) { - #include "setRoots.H" + #include "setRootCase.H" #include "createTimeExtruded.H" - if (args.optionFound("sourceCase") == args.optionFound("surface")) - { - FatalErrorIn(args.executable()) - << "Specify either -sourceCase and -sourcePatch" - " or -surface options\n" - " to specify the source of the patch to extrude" - << exit(FatalError); - } - autoPtr<extrudedMesh> meshPtr(NULL); - autoPtr<extrudeModel> model + IOdictionary dict ( - extrudeModel::New + IOobject ( - IOdictionary - ( - IOobject - ( - "extrudeProperties", - runTimeExtruded.constant(), - runTimeExtruded, - IOobject::MUST_READ - ) - ) + "extrudeProperties", + runTimeExtruded.constant(), + runTimeExtruded, + IOobject::MUST_READ ) ); - if (args.optionFound("sourceCase")) + autoPtr<extrudeModel> model(extrudeModel::New(dict)); + + const word sourceType(dict.lookup("constructFrom")); + + autoPtr<faceMesh> fMesh; + + if (sourceType == "patch") { - fileName sourceCasePath(args.option("sourceCase")); + fileName sourceCasePath(dict.lookup("sourceCase")); fileName sourceRootDir = sourceCasePath.path(); fileName sourceCaseDir = sourceCasePath.name(); - word patchName(args.option("sourcePatch")); + word patchName(dict.lookup("sourcePatch")); Info<< "Extruding patch " << patchName << " on mesh " << sourceCasePath << nl @@ -114,75 +106,69 @@ int main(int argc, char *argv[]) } const polyPatch& pp = mesh.boundaryMesh()[patchID]; + fMesh.reset(new faceMesh(pp.localFaces(), pp.localPoints())); + fMesh().flip(); { fileName surfName(patchName + ".sMesh"); - Info<< "Writing patch as surfaceMesh to " << surfName << nl << endl; - - faceMesh fMesh(pp.localFaces(), pp.localPoints()); + Info<< "Writing (flipped) patch as surfaceMesh to " + << surfName << nl << endl; OFstream os(surfName); - os << fMesh << nl; + os << fMesh() << nl; } - - meshPtr.reset - ( - new extrudedMesh - ( - IOobject - ( - extrudedMesh::defaultRegion, - runTimeExtruded.constant(), - runTimeExtruded - ), - pp, - model() - ) - ); } - else + else if (sourceType == "surface") { // Read from surface - fileName surfName(args.option("surface")); + fileName surfName(dict.lookup("surface")); Info<< "Extruding surfaceMesh read from file " << surfName << nl << endl; IFstream is(surfName); - faceMesh fMesh(is); + fMesh.reset(new faceMesh(is)); - Info<< "Read patch from file " << surfName << ':' << nl - << " points : " << fMesh.points().size() << nl - << " faces : " << fMesh.size() << nl + Info<< "Read patch from file " << surfName << nl << endl; + } + else + { + FatalErrorIn(args.executable()) + << "Illegal 'constructFrom' specification. Should either be " + << "patch or surface." << exit(FatalError); + } - meshPtr.reset + + Info<< "Extruding patch with :" << nl + << " points : " << fMesh().points().size() << nl + << " faces : " << fMesh().size() << nl + << " normals[0] : " << fMesh().faceNormals()[0] + << nl + << endl; + + extrudedMesh mesh + ( + IOobject ( - new extrudedMesh - ( - IOobject - ( - extrudedMesh::defaultRegion, - runTimeExtruded.constant(), - runTimeExtruded - ), - fMesh, - model() - ) - ); - } - extrudedMesh& mesh = meshPtr(); + extrudedMesh::defaultRegion, + runTimeExtruded.constant(), + runTimeExtruded + ), + fMesh(), + model() + ); const boundBox& bb = mesh.globalData().bb(); const vector span = bb.span(); const scalar mergeDim = 1E-4 * bb.minDim(); - Info<< "Mesh bounding box:" << bb << nl - << " with span:" << span << nl - << "Merge distance :" << mergeDim << nl + Info<< "Mesh bounding box : " << bb << nl + << " with span : " << span << nl + << "Merge distance : " << mergeDim << nl << endl; const polyBoundaryMesh& patches = mesh.boundaryMesh(); @@ -250,7 +236,8 @@ int main(int argc, char *argv[]) // Merging front and back patch faces // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - if (args.optionFound("mergeFaces")) + Switch mergeFaces(dict.lookup("mergeFaces")); + if (mergeFaces) { Info<< "Assuming full 360 degree axisymmetric case;" << " stitching faces on patches " diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C index 6da971a1bf0e2d048976c808abbaa0dea944908c..3d2c883ea1901edb740f8afdd7de3c9b634858a2 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeModel/wedge/wedge.C @@ -88,7 +88,8 @@ point wedge::operator() } else { - sliceAngle = angle_*(layer + 1)/nLayers_; + //sliceAngle = angle_*(layer + 1)/nLayers_; + sliceAngle = angle_*layer/nLayers_; } // Find projection onto axis (or rather decompose surfacePoint diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeProperties b/applications/utilities/mesh/generation/extrudeMesh/extrudeProperties index ecbe160a150ab5f1b16ecad4e5fd423a64edc278..20de7b21524b083cf6cc37a684a971bcda890059 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeProperties +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeProperties @@ -14,23 +14,41 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -extrudeModel wedge; +// Where to get surface from: either from surface ('surface') or +// from (flipped) patch of existing case ('patch') +constructFrom patch; //surface; + +// If construct from (flipped) patch +sourceCase "../cavity"; +sourcePatch movingWall; + +// If construct from surface +surface "movingWall.sMesh"; + + +// Do front and back need to be merged? +mergeFaces false; + +//- Linear extrusion in point-normal direction //extrudeModel linearNormal; +//- Wedge extrusion. If nLayers is 1 assumes symmetry around plane. +extrudeModel wedge; +//- Extrudes into sphere around (0 0 0) //extrudeModel linearRadial; //extrudeModel sigmaRadial; -nLayers 1; +nLayers 6; wedgeCoeffs { - axisPt (0 0 0); - axis (0 -1 0); - angle 2.0; + axisPt (0 0.1 0); + axis (1 0 0); + angle 90.0; // For nLayers=1 assume symmetry so angle/2 on each side } linearNormalCoeffs { - thickness 0.1; + thickness 0.05; } linearRadialCoeffs @@ -47,3 +65,4 @@ sigmaRadialCoeffs // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C b/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C index bcbcb3ddb78c20a6ee0ca35055a13d5488945310..b258c594451332958c13cdda37c9bbfeb28dd459 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C @@ -117,7 +117,7 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces quad[2] = surfaceEdges[i][0] + nextLayerOffset; quad[3] = surfaceEdges[i][1] + nextLayerOffset; - eFaces[facei++] = face(quad); + eFaces[facei++] = face(quad).reverseFace(); } // Faces between layer and layer+1 @@ -130,7 +130,7 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces ( surfaceFaces[i].reverseFace() + nextLayerOffset - ); + ).reverseFace(); } } } @@ -152,7 +152,7 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces label ownerFace = extrudePatch.edgeFaces()[i][0]; - if (!sameOrder(surfaceFaces[ownerFace], e)) + if (sameOrder(surfaceFaces[ownerFace], e)) { reverse(quad); } @@ -164,7 +164,7 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces // Top faces forAll(surfaceFaces, i) { - eFaces[facei++] = face(surfaceFaces[i]); + eFaces[facei++] = face(surfaceFaces[i]).reverseFace(); } // Bottom faces @@ -175,7 +175,7 @@ Foam::Xfer<Foam::faceList> Foam::extrudedMesh::extrudedFaces ( surfaceFaces[i].reverseFace() + nLayers*surfacePoints.size() - ); + ).reverseFace(); } // return points for transferring diff --git a/applications/utilities/mesh/generation/extrudeMesh/faceMesh.H b/applications/utilities/mesh/generation/extrudeMesh/faceMesh.H index 818ce58f00e80a363432e08f19bc919e5e1042cf..c8e1075f52e5f31ceba4f8930ad6be4dbab9158e 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/faceMesh.H +++ b/applications/utilities/mesh/generation/extrudeMesh/faceMesh.H @@ -78,6 +78,18 @@ public: {} + // Member Functions + + void flip() + { + forAll(*this, i) + { + face& f = operator[](i); + f = f.reverseFace(); + } + clearOut(); + } + // IOstream Operators friend Ostream& operator<<(Ostream& os, const faceMesh& fm) @@ -85,7 +97,8 @@ public: return os << fm.points() << token::NL - << static_cast<PrimitivePatch<face, Foam::List, pointField> >(fm); + << static_cast<PrimitivePatch<face, Foam::List, pointField> > + (fm); } }; diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 706866bd2a1df6def0525cd0b00366edeec313c7..6f086523dd2204170a516d19f0955cc6e68f5e1f 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -96,7 +96,7 @@ void writeMesh const fvMesh& mesh = meshRefiner.mesh(); meshRefiner.printMeshInfo(debug, msg); - Info<< "Writing mesh to time " << mesh.time().timeName() << endl; + Info<< "Writing mesh to time " << meshRefiner.timeName() << endl; meshRefiner.write(meshRefinement::MESH|meshRefinement::SCALARLEVELS, ""); if (debug & meshRefinement::OBJINTERSECTIONS) @@ -104,7 +104,7 @@ void writeMesh meshRefiner.write ( meshRefinement::OBJINTERSECTIONS, - mesh.time().path()/mesh.time().timeName() + mesh.time().path()/meshRefiner.timeName() ); } Info<< "Written mesh in = " @@ -115,6 +115,7 @@ void writeMesh int main(int argc, char *argv[]) { + argList::validOptions.insert("overwrite", ""); # include "setRootCase.H" # include "createTime.H" runTime.functionObjects().off(); @@ -123,6 +124,9 @@ int main(int argc, char *argv[]) Info<< "Read mesh in = " << runTime.cpuTimeIncrement() << " s" << endl; + const bool overwrite = args.optionFound("overwrite"); + + // Check patches and faceZones are synchronised mesh.boundaryMesh().checkParallelSync(true); meshRefinement::checkCoupledFaceZones(mesh); @@ -170,6 +174,13 @@ int main(int argc, char *argv[]) const dictionary& layerDict = meshDict.subDict("addLayersControls"); + const scalar mergeDist = getMergeDistance + ( + mesh, + readScalar(meshDict.lookup("mergeTolerance")) + ); + + // Debug // ~~~~~ @@ -192,8 +203,9 @@ int main(int argc, char *argv[]) IOobject ( "abc", // dummy name - mesh.time().constant(), // directory - "triSurface", // instance + //mesh.time().constant(), // instance + mesh.time().findInstance("triSurface", word::null),// instance + "triSurface", // local mesh.time(), // registry IOobject::MUST_READ, IOobject::NO_WRITE @@ -235,6 +247,34 @@ int main(int argc, char *argv[]) << mesh.time().cpuTimeIncrement() << " s" << nl << endl; + // Refinement engine + // ~~~~~~~~~~~~~~~~~ + + Info<< nl + << "Determining initial surface intersections" << nl + << "-----------------------------------------" << nl + << endl; + + // Main refinement engine + meshRefinement meshRefiner + ( + mesh, + mergeDist, // tolerance used in sorting coordinates + overwrite, // overwrite mesh files? + surfaces, // for surface intersection refinement + shells // for volume (inside/outside) refinement + ); + Info<< "Calculated surface intersections in = " + << mesh.time().cpuTimeIncrement() << " s" << nl << endl; + + // Some stats + meshRefiner.printMeshInfo(debug, "Initial mesh"); + + meshRefiner.write + ( + debug&meshRefinement::OBJINTERSECTIONS, + mesh.time().path()/meshRefiner.timeName() + ); // Add all the surface regions as patches @@ -265,9 +305,8 @@ int main(int argc, char *argv[]) forAll(regNames, i) { - label patchI = meshRefinement::addPatch + label patchI = meshRefiner.addMeshedPatch ( - mesh, regNames[i], wallPolyPatch::typeName ); @@ -308,45 +347,10 @@ int main(int argc, char *argv[]) << exit(FatalError); } - const scalar mergeDist = getMergeDistance - ( - mesh, - readScalar(meshDict.lookup("mergeTolerance")) - ); - - // Mesh distribution engine (uses tolerance to reconstruct meshes) fvMeshDistribute distributor(mesh, mergeDist); - // Refinement engine - // ~~~~~~~~~~~~~~~~~ - - Info<< nl - << "Determining initial surface intersections" << nl - << "-----------------------------------------" << nl - << endl; - - // Main refinement engine - meshRefinement meshRefiner - ( - mesh, - mergeDist, // tolerance used in sorting coordinates - surfaces, // for surface intersection refinement - shells // for volume (inside/outside) refinement - ); - Info<< "Calculated surface intersections in = " - << mesh.time().cpuTimeIncrement() << " s" << nl << endl; - - // Some stats - meshRefiner.printMeshInfo(debug, "Initial mesh"); - - meshRefiner.write - ( - debug&meshRefinement::OBJINTERSECTIONS, - mesh.time().path()/mesh.time().timeName() - ); - @@ -370,6 +374,11 @@ int main(int argc, char *argv[]) // Refinement parameters refinementParameters refineParams(refineDict); + if (!overwrite) + { + const_cast<Time&>(mesh.time())++; + } + refineDriver.doRefine(refineDict, refineParams, wantSnap, motionDict); writeMesh @@ -391,6 +400,11 @@ int main(int argc, char *argv[]) // Snap parameters snapParameters snapParams(snapDict); + if (!overwrite) + { + const_cast<Time&>(mesh.time())++; + } + snapDriver.doSnap(snapDict, motionDict, snapParams); writeMesh @@ -403,15 +417,16 @@ int main(int argc, char *argv[]) if (wantLayers) { - autoLayerDriver layerDriver - ( - meshRefiner, - globalToPatch - ); + autoLayerDriver layerDriver(meshRefiner); // Layer addition parameters layerParameters layerParams(layerDict, mesh.boundaryMesh()); + if (!overwrite) + { + const_cast<Time&>(mesh.time())++; + } + layerDriver.doLayers ( layerDict, @@ -435,7 +450,7 @@ int main(int argc, char *argv[]) Info<< "End\n" << endl; - return 0; + return(0); } diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index 65dd679ecd73fc3bd6688aecb0964566465bf042..a26179507a167b9ec254643ebcab8cadde3ed420 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -566,7 +566,7 @@ int main(int argc, char *argv[]) IOobject ( "cellProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::MUST_READ, @@ -579,7 +579,7 @@ int main(int argc, char *argv[]) IOobject ( "boundaryProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::MUST_READ, @@ -603,7 +603,7 @@ int main(int argc, char *argv[]) IOobject ( "faceProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::MUST_READ, @@ -645,7 +645,7 @@ int main(int argc, char *argv[]) IOobject ( "pointProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::MUST_READ, diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposeParDict b/applications/utilities/parallelProcessing/decomposePar/decomposeParDict index 0c566d50812ffcdbd856d09f12ebac9244177468..aad15ee459b6e01cdf6fabba08eb2fa5b8c2a4dd 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposeParDict +++ b/applications/utilities/parallelProcessing/decomposePar/decomposeParDict @@ -55,7 +55,17 @@ metisCoeffs } scotchCoeffs -{} +{ + //processorWeights + //( + // 1 + // 1 + // 1 + // 1 + //); + //writeGraph true; + //strategy "b"; +} manualCoeffs { diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C index 2940577d163722f8dcabbd761ef70215f252d77b..e310cc758f0809cc6ae1e49fe95add7c5614bae3 100644 --- a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C +++ b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C @@ -269,7 +269,7 @@ bool domainDecomposition::writeDecomposition() IOobject ( this->polyMesh::name(), // region name of undecomposed mesh - "constant", + pointsInstance(), processorDb ), xferMove(procPoints), @@ -620,7 +620,7 @@ bool domainDecomposition::writeDecomposition() IOobject ( "pointProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::NO_READ, @@ -635,7 +635,7 @@ bool domainDecomposition::writeDecomposition() IOobject ( "faceProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::NO_READ, @@ -650,7 +650,7 @@ bool domainDecomposition::writeDecomposition() IOobject ( "cellProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::NO_READ, @@ -665,7 +665,7 @@ bool domainDecomposition::writeDecomposition() IOobject ( "boundaryProcAddressing", - "constant", + procMesh.facesInstance(), procMesh.meshSubDir, procMesh, IOobject::NO_READ, diff --git a/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.C b/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.C index 15eb039bfd847dbeddb8dd6414c57711d72cad5b..f5a6451c1266b6a0e02c165c3501c037c7f85b64 100644 --- a/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.C +++ b/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.C @@ -56,13 +56,12 @@ processorVolPatchFieldDecomposer const unallocLabelList& addressingSlice ) : - addressing_(addressingSlice.size()), - weights_(addressingSlice.size()) + directAddressing_(addressingSlice.size()) { const labelList& own = mesh.faceOwner(); const labelList& neighb = mesh.faceNeighbour(); - forAll (addressing_, i) + forAll (directAddressing_, i) { // Subtract one to align addressing. label ai = mag(addressingSlice[i]) - 1; @@ -74,18 +73,14 @@ processorVolPatchFieldDecomposer // on the parallel boundary. // Give face the value of the neighbour. - addressing_[i].setSize(1); - weights_[i].setSize(1); - weights_[i][0] = 1.0; - if (addressingSlice[i] >= 0) { // I have the owner so use the neighbour value - addressing_[i][0] = neighb[ai]; + directAddressing_[i] = neighb[ai]; } else { - addressing_[i][0] = own[ai]; + directAddressing_[i] = own[ai]; } } else @@ -96,12 +91,7 @@ processorVolPatchFieldDecomposer // up the different (face) list of data), so I will // just grab the value from the owner cell - addressing_[i].setSize(1); - weights_[i].setSize(1); - - addressing_[i][0] = own[ai]; - - weights_[i][0] = 1.0; + directAddressing_[i] = own[ai]; } } } diff --git a/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.H b/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.H index 9641bf031b86af158c15d3c5b6078404be782c14..89b69a17813895772c74686a47c921fcff44b277 100644 --- a/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.H +++ b/applications/utilities/parallelProcessing/decomposePar/fvFieldDecomposer.H @@ -96,15 +96,16 @@ public: }; - //- Processor patch field decomposer class + //- Processor patch field decomposer class. Maps either owner or + // neighbour data (no interpolate anymore - processorFvPatchField + // holds neighbour data) class processorVolPatchFieldDecomposer : public fvPatchFieldMapper { // Private data - labelListList addressing_; - scalarListList weights_; + labelList directAddressing_; public: @@ -120,27 +121,23 @@ public: label size() const { - return addressing_.size(); + return directAddressing_.size(); } bool direct() const { - return false; - } - - const labelListList& addressing() const - { - return addressing_; + return true; } - const scalarListList& weights() const + const unallocLabelList& directAddressing() const { - return weights_; + return directAddressing_; } }; - //- Processor patch field decomposer class + //- Processor patch field decomposer class. Surface field is assumed + // to have direction (so manipulates sign when mapping) class processorSurfacePatchFieldDecomposer : public fvPatchFieldMapper diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C index 64452a05f70c00bffbfc7ab792e545a4cda369a7..90a597e57888a3e2155b7deba0efb09e90f04a12 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C @@ -178,7 +178,6 @@ void writeAllDataBinary } - template<class Type> void writeAllFaceData ( @@ -275,7 +274,7 @@ template<class Type> bool writePatchField ( const Foam::Field<Type>& pf, - const Foam::label patchI, + const Foam::label patchi, const Foam::label ensightPatchI, const Foam::faceSets& boundaryFaceSet, const Foam::ensightMesh::nFacePrimitives& nfp, @@ -335,7 +334,7 @@ template<class Type> bool writePatchFieldBinary ( const Foam::Field<Type>& pf, - const Foam::label patchI, + const Foam::label patchi, const Foam::label ensightPatchI, const Foam::faceSets& boundaryFaceSet, const Foam::ensightMesh::nFacePrimitives& nfp, @@ -406,34 +405,27 @@ void writePatchField const Time& runTime = eMesh.mesh().time(); const List<faceSets>& boundaryFaceSets = eMesh.boundaryFaceSets(); - const HashTable<labelList>& allPatchNames = eMesh.allPatchNames(); - const HashTable<label>& patchIndices = eMesh.patchIndices(); + const wordList& allPatchNames = eMesh.allPatchNames(); + const List<labelList>& allPatchProcs = eMesh.allPatchProcs(); const HashTable<ensightMesh::nFacePrimitives>& nPatchPrims = eMesh.nPatchPrims(); - label patchI = -1; - - if (patchIndices.found(patchName)) - { - patchI = patchIndices.find(patchName)(); - } - label ensightPatchI = eMesh.patchPartOffset(); - for - ( - HashTable<labelList>::const_iterator iter = - allPatchNames.begin(); - iter != allPatchNames.end(); - ++iter - ) + label patchi = -1; + + forAll(allPatchNames, i) { - if (iter.key() == patchName) break; + if (allPatchNames[i] == patchName) + { + patchi = i; + break; + } ensightPatchI++; } - const labelList& patchProcessors = allPatchNames.find(patchName)(); + const labelList& patchProcessors = allPatchProcs[patchi]; word pfName = patchName + '.' + fieldName; @@ -472,14 +464,14 @@ void writePatchField ensightFile << pTraits<Type>::typeName << nl; } - if (patchI >= 0) + if (patchi >= 0) { writePatchField ( pf, - patchI, + patchi, ensightPatchI, - boundaryFaceSets[patchI], + boundaryFaceSets[patchi], nPatchPrims.find(patchName)(), patchProcessors, ensightFile @@ -507,6 +499,7 @@ void writePatchField } } + template<class Type> void ensightFieldAscii ( @@ -527,8 +520,8 @@ void ensightFieldAscii const cellSets& meshCellSets = eMesh.meshCellSets(); const List<faceSets>& boundaryFaceSets = eMesh.boundaryFaceSets(); - const HashTable<labelList>& allPatchNames = eMesh.allPatchNames(); - const HashTable<label>& patchIndices = eMesh.patchIndices(); + const wordList& allPatchNames = eMesh.allPatchNames(); + const List<labelList>& allPatchProcs = eMesh.allPatchProcs(); const wordHashSet& patchNames = eMesh.patchNames(); const HashTable<ensightMesh::nFacePrimitives>& nPatchPrims = eMesh.nPatchPrims(); @@ -623,30 +616,23 @@ void ensightFieldAscii label ensightPatchI = eMesh.patchPartOffset(); - for - ( - HashTable<labelList>::const_iterator iter = allPatchNames.begin(); - iter != allPatchNames.end(); - ++iter - ) + forAll(allPatchNames, patchi) { - const word& patchName = iter.key(); - const labelList& patchProcessors = iter(); + const word& patchName = allPatchNames[patchi]; + const labelList& patchProcessors = allPatchProcs[patchi]; if (patchNames.empty() || patchNames.found(patchName)) { - if (patchIndices.found(patchName)) + if (mesh.boundary()[patchi].size()) { - label patchI = patchIndices.find(patchName)(); - if ( writePatchField ( - vf.boundaryField()[patchI], - patchI, + vf.boundaryField()[patchi], + patchi, ensightPatchI, - boundaryFaceSets[patchI], + boundaryFaceSets[patchi], nPatchPrims.find(patchName)(), patchProcessors, ensightFile @@ -708,8 +694,8 @@ void ensightFieldBinary const cellSets& meshCellSets = eMesh.meshCellSets(); const List<faceSets>& boundaryFaceSets = eMesh.boundaryFaceSets(); - const HashTable<labelList>& allPatchNames = eMesh.allPatchNames(); - const HashTable<label>& patchIndices = eMesh.patchIndices(); + const wordList& allPatchNames = eMesh.allPatchNames(); + const List<labelList>& allPatchProcs = eMesh.allPatchProcs(); const wordHashSet& patchNames = eMesh.patchNames(); const HashTable<ensightMesh::nFacePrimitives>& nPatchPrims = eMesh.nPatchPrims(); @@ -726,7 +712,11 @@ void ensightFieldBinary { // set the filename of the ensight file fileName ensightFileName(timeFile + "." + fieldObject.name()); - ensightFilePtr = new std::ofstream((postProcPath/ensightFileName).c_str(), ios_base::out | ios_base::binary | ios_base::trunc); + ensightFilePtr = new std::ofstream + ( + (postProcPath/ensightFileName).c_str(), + ios_base::out | ios_base::binary | ios_base::trunc + ); // Check on file opened? } @@ -787,38 +777,62 @@ void ensightFieldBinary } } - writeAllDataBinary("penta6", vf, prisms, meshCellSets.nPrisms, ensightFile); - writeAllDataBinary("pyramid5", vf, pyrs, meshCellSets.nPyrs, ensightFile); - writeAllDataBinary("tetra4", vf, tets, meshCellSets.nTets, ensightFile); - writeAllDataBinary("nfaced", vf, polys, meshCellSets.nPolys, ensightFile); + writeAllDataBinary + ( + "penta6", + vf, + prisms, + meshCellSets.nPrisms, + ensightFile + ); + + writeAllDataBinary + ( + "pyramid5", + vf, + pyrs, + meshCellSets.nPyrs, + ensightFile + ); + + writeAllDataBinary + ( + "tetra4", + vf, + tets, + meshCellSets.nTets, + ensightFile + ); + + writeAllDataBinary + ( + "nfaced", + vf, + polys, + meshCellSets.nPolys, + ensightFile + ); } label ensightPatchI = eMesh.patchPartOffset(); - for - ( - HashTable<labelList>::const_iterator iter = allPatchNames.begin(); - iter != allPatchNames.end(); - ++iter - ) + forAll(allPatchNames, patchi) { - const word& patchName = iter.key(); - const labelList& patchProcessors = iter(); + const word& patchName = allPatchNames[patchi]; + const labelList& patchProcessors = allPatchProcs[patchi]; if (patchNames.empty() || patchNames.found(patchName)) { - if (patchIndices.found(patchName)) + if (mesh.boundary()[patchi].size()) { - label patchI = patchIndices.find(patchName)(); - if ( writePatchFieldBinary ( - vf.boundaryField()[patchI], - patchI, + vf.boundaryField()[patchi], + patchi, ensightPatchI, - boundaryFaceSets[patchI], + boundaryFaceSets[patchi], nPatchPrims.find(patchName)(), patchProcessors, ensightFile @@ -859,6 +873,7 @@ void ensightFieldBinary } } + template<class Type> void ensightField ( diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C index 079145a0c567597811b54295430bf454d350c24e..c3262e6b9c4d3d98e1eacb8d5f50af6cb45fedb9 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C @@ -28,6 +28,7 @@ License #include "Time.H" #include "ensightMesh.H" #include "fvMesh.H" +#include "globalMeshData.H" #include "PstreamCombineReduceOps.H" #include "processorPolyPatch.H" #include "cellModeller.H" @@ -40,43 +41,37 @@ License namespace Foam { + //- Proxy-class to hold the patch processor list combination operator + class concatPatchProcs + { -class concatPatchNames -{ - -public: + public: - void operator() - ( - HashTable<labelList>& x, - const HashTable<labelList>& y - ) const - { - forAllConstIter(HashTable<labelList>, y, iter) + void operator() + ( + List<labelList>& x, + const List<labelList>& y + ) const { - HashTable<labelList>::iterator xiter = x.find(iter.key()); - - if (xiter == x.end()) - { - x.insert(iter.key(), iter()); - } - else + forAll(y, i) { - labelList& xPatches = xiter(); - const labelList& yPatches = iter(); - - label offset = xPatches.size(); - xPatches.setSize(offset + yPatches.size()); + const labelList& yPatches = y[i]; - forAll(yPatches, i) + if (yPatches.size()) { - xPatches[i + offset] = yPatches[i]; + labelList& xPatches = x[i]; + + label offset = xPatches.size(); + xPatches.setSize(offset + yPatches.size()); + + forAll(yPatches, i) + { + xPatches[i + offset] = yPatches[i]; + } } } } - } -}; - + }; } // End namespace Foam @@ -95,7 +90,7 @@ Foam::ensightMesh::ensightMesh meshCellSets_(mesh_.nCells()), boundaryFaceSets_(mesh_.boundary().size()), allPatchNames_(0), - patchIndices_(0), + allPatchProcs_(0), patchNames_(0), nPatchPrims_(0) { @@ -109,32 +104,24 @@ Foam::ensightMesh::ensightMesh if (!args.optionFound("noPatches")) { - forAll (mesh_.boundaryMesh(), patchI) + allPatchNames_ = wordList::subList + ( + mesh_.boundaryMesh().names(), mesh_.boundary().size() + - mesh_.globalData().processorPatches().size() + ); + + allPatchProcs_.setSize(allPatchNames_.size()); + + forAll (allPatchProcs_, patchi) { - if - ( - typeid(mesh_.boundaryMesh()[patchI]) - != typeid(processorPolyPatch) - ) + if (mesh_.boundary()[patchi].size()) { - if (!allPatchNames_.found(mesh_.boundaryMesh()[patchI].name())) - { - allPatchNames_.insert - ( - mesh_.boundaryMesh()[patchI].name(), - labelList(1, Pstream::myProcNo()) - ); - - patchIndices_.insert - ( - mesh_.boundaryMesh()[patchI].name(), - patchI - ); - } + allPatchProcs_[patchi].setSize(1); + allPatchProcs_[patchi][0] = Pstream::myProcNo(); } } - combineReduce(allPatchNames_, concatPatchNames()); + combineReduce(allPatchProcs_, concatPatchProcs()); if (args.optionFound("patches")) { @@ -142,7 +129,7 @@ Foam::ensightMesh::ensightMesh if (patchNameList.empty()) { - patchNameList = allPatchNames_.toc(); + patchNameList = allPatchNames_; } forAll (patchNameList, i) @@ -230,15 +217,15 @@ Foam::ensightMesh::ensightMesh if (!args.optionFound("noPatches")) { - forAll (mesh.boundary(), patchI) + forAll (mesh.boundary(), patchi) { - if (mesh.boundary()[patchI].size()) + if (mesh.boundary()[patchi].size()) { - const polyPatch& p = mesh.boundaryMesh()[patchI]; + const polyPatch& p = mesh.boundaryMesh()[patchi]; - labelList& tris = boundaryFaceSets_[patchI].tris; - labelList& quads = boundaryFaceSets_[patchI].quads; - labelList& polys = boundaryFaceSets_[patchI].polys; + labelList& tris = boundaryFaceSets_[patchi].tris; + labelList& quads = boundaryFaceSets_[patchi].quads; + labelList& polys = boundaryFaceSets_[patchi].polys; tris.setSize(p.size()); quads.setSize(p.size()); @@ -274,21 +261,19 @@ Foam::ensightMesh::ensightMesh } - forAllConstIter(HashTable<labelList>, allPatchNames_, iter) + forAll(allPatchNames_, patchi) { - const word& patchName = iter.key(); + const word& patchName = allPatchNames_[patchi]; nFacePrimitives nfp; if (patchNames_.empty() || patchNames_.found(patchName)) { - if (patchIndices_.found(patchName)) + if (mesh.boundary()[patchi].size()) { - label patchI = patchIndices_.find(patchName)(); - - nfp.nPoints = mesh.boundaryMesh()[patchI].localPoints().size(); - nfp.nTris = boundaryFaceSets_[patchI].tris.size(); - nfp.nQuads = boundaryFaceSets_[patchI].quads.size(); - nfp.nPolys = boundaryFaceSets_[patchI].polys.size(); + nfp.nPoints = mesh.boundaryMesh()[patchi].localPoints().size(); + nfp.nTris = boundaryFaceSets_[patchi].tris.size(); + nfp.nQuads = boundaryFaceSets_[patchi].quads.size(); + nfp.nPolys = boundaryFaceSets_[patchi].polys.size(); } } @@ -1052,13 +1037,13 @@ void Foam::ensightMesh::writeAscii label ensightPatchI = patchPartOffset_; - forAllConstIter(HashTable<labelList>, allPatchNames_, iter) + forAll(allPatchNames_, patchi) { - const labelList& patchProcessors = iter(); + const word& patchName = allPatchNames_[patchi]; + const labelList& patchProcessors = allPatchProcs_[patchi]; - if (patchNames_.empty() || patchNames_.found(iter.key())) + if (patchNames_.empty() || patchNames_.found(patchName)) { - const word& patchName = iter.key(); const nFacePrimitives& nfp = nPatchPrims_.find(patchName)(); const labelList *trisPtr = NULL; @@ -1068,14 +1053,13 @@ void Foam::ensightMesh::writeAscii const pointField *patchPointsPtr = NULL; const faceList *patchFacesPtr = NULL; - if (patchIndices_.found(iter.key())) + if (mesh_.boundary()[patchi].size()) { - label patchI = patchIndices_.find(iter.key())(); - const polyPatch& p = mesh_.boundaryMesh()[patchI]; + const polyPatch& p = mesh_.boundaryMesh()[patchi]; - trisPtr = &boundaryFaceSets_[patchI].tris; - quadsPtr = &boundaryFaceSets_[patchI].quads; - polysPtr = &boundaryFaceSets_[patchI].polys; + trisPtr = &boundaryFaceSets_[patchi].tris; + quadsPtr = &boundaryFaceSets_[patchi].quads; + polysPtr = &boundaryFaceSets_[patchi].polys; patchPointsPtr = &(p.localPoints()); patchFacesPtr = &(p.localFaces()); @@ -1265,7 +1249,7 @@ void Foam::ensightMesh::writeBinary { writeEnsDataBinary("part",ensightGeometryFile); writeEnsDataBinary(1,ensightGeometryFile); - writeEnsDataBinary("FOAM cells",ensightGeometryFile); + writeEnsDataBinary("internalMesh",ensightGeometryFile); writeEnsDataBinary("coordinates",ensightGeometryFile); writeEnsDataBinary(nPoints,ensightGeometryFile); @@ -1379,14 +1363,14 @@ void Foam::ensightMesh::writeBinary label ensightPatchI = patchPartOffset_; label iCount = 0; - forAllConstIter(HashTable<labelList>, allPatchNames_, iter) + forAll(allPatchNames_, patchi) { iCount ++; - const labelList& patchProcessors = iter(); + const word& patchName = allPatchNames_[patchi]; + const labelList& patchProcessors = allPatchProcs_[patchi]; - if (patchNames_.empty() || patchNames_.found(iter.key())) + if (patchNames_.empty() || patchNames_.found(patchName)) { - const word& patchName = iter.key(); const nFacePrimitives& nfp = nPatchPrims_.find(patchName)(); const labelList *trisPtr = NULL; @@ -1396,14 +1380,13 @@ void Foam::ensightMesh::writeBinary const pointField *patchPointsPtr = NULL; const faceList *patchFacesPtr = NULL; - if (patchIndices_.found(iter.key())) + if (mesh_.boundary()[patchi].size()) { - label patchI = patchIndices_.find(iter.key())(); - const polyPatch& p = mesh_.boundaryMesh()[patchI]; + const polyPatch& p = mesh_.boundaryMesh()[patchi]; - trisPtr = &boundaryFaceSets_[patchI].tris; - quadsPtr = &boundaryFaceSets_[patchI].quads; - polysPtr = &boundaryFaceSets_[patchI].polys; + trisPtr = &boundaryFaceSets_[patchi].tris; + quadsPtr = &boundaryFaceSets_[patchi].quads; + polysPtr = &boundaryFaceSets_[patchi].polys; patchPointsPtr = &(p.localPoints()); patchFacesPtr = &(p.localFaces()); @@ -1424,7 +1407,7 @@ void Foam::ensightMesh::writeBinary writeEnsDataBinary("part",ensightGeometryFile); writeEnsDataBinary(ensightPatchI++,ensightGeometryFile); //writeEnsDataBinary(patchName.c_str(),ensightGeometryFile); - writeEnsDataBinary(iter.key().c_str(),ensightGeometryFile); + writeEnsDataBinary(patchName.c_str(),ensightGeometryFile); writeEnsDataBinary("coordinates",ensightGeometryFile); writeEnsDataBinary(nfp.nPoints,ensightGeometryFile); diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H index 6a3cb824708bb7a3e7543f327acc69fc2c918379..4ddb084d3d054c34961fb8e1d4c3a5a3bcb3db52 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H @@ -91,9 +91,9 @@ class ensightMesh List<faceSets> boundaryFaceSets_; - HashTable<labelList> allPatchNames_; + wordList allPatchNames_; - HashTable<label> patchIndices_; + List<labelList> allPatchProcs_; wordHashSet patchNames_; @@ -269,14 +269,14 @@ public: return boundaryFaceSets_; } - const HashTable<labelList>& allPatchNames() const + const wordList& allPatchNames() const { return allPatchNames_; } - const HashTable<label>& patchIndices() const + const List<labelList>& allPatchProcs() const { - return patchIndices_; + return allPatchProcs_; } const wordHashSet& patchNames() const diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C index 9bce0df59f259b5849ab9209e2ef6a94c78c264b..74ac3c5676bbeac0ae3b6da5d57348f6ff7d83a3 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C @@ -90,6 +90,9 @@ Usage The quoting is required to avoid shell expansions and to pass the information as a single argument. + @param -useTimeName \n + use the time index in the VTK file name instead of the time index + Note mesh subset is handled by vtkMesh. Slight inconsistency in interpolation: on the internal field it interpolates the whole volfield @@ -242,6 +245,7 @@ int main(int argc, char *argv[]) argList::validOptions.insert("excludePatches","patches to exclude"); argList::validOptions.insert("noFaceZones",""); argList::validOptions.insert("noLinks",""); + argList::validOptions.insert("useTimeName",""); # include "setRootCase.H" # include "createTime.H" @@ -250,6 +254,7 @@ int main(int argc, char *argv[]) bool doFaceZones = !args.optionFound("noFaceZones"); bool doLinks = !args.optionFound("noLinks"); bool binary = !args.optionFound("ascii"); + bool useTimeName = args.optionFound("useTimeName"); if (binary && (sizeof(floatScalar) != 4 || sizeof(label) != 4)) { @@ -359,6 +364,16 @@ int main(int argc, char *argv[]) Info<< "Time: " << runTime.timeName() << endl; + word timeDesc = ""; + if (useTimeName) + { + timeDesc = runTime.timeName(); + } + else + { + timeDesc = name(runTime.timeIndex()); + } + // Check for new polyMesh/ and update mesh, fvMeshSubset and cell // decomposition. polyMesh::readUpdateState meshState = vMesh.readUpdate(); @@ -388,7 +403,7 @@ int main(int argc, char *argv[]) ( fvPath/set.name()/set.name() + "_" - + name(timeI) + + timeDesc + ".vtk" ); @@ -411,7 +426,7 @@ int main(int argc, char *argv[]) ( fvPath/set.name()/set.name() + "_" - + name(timeI) + + timeDesc + ".vtk" ); @@ -548,7 +563,7 @@ int main(int argc, char *argv[]) ( fvPath/vtkName + "_" - + name(timeI) + + timeDesc + ".vtk" ); @@ -654,8 +669,8 @@ int main(int argc, char *argv[]) fvPath /"surfaceFields" /"surfaceFields" - + "_" - + name(timeI) + + "_" + + timeDesc + ".vtk" ); @@ -689,7 +704,7 @@ int main(int argc, char *argv[]) patchFileName = fvPath/"allPatches"/cellSetName + "_" - + name(timeI) + + timeDesc + ".vtk"; } else @@ -697,7 +712,7 @@ int main(int argc, char *argv[]) patchFileName = fvPath/"allPatches"/"allPatches" + "_" - + name(timeI) + + timeDesc + ".vtk"; } @@ -767,7 +782,7 @@ int main(int argc, char *argv[]) patchFileName = fvPath/pp.name()/cellSetName + "_" - + name(timeI) + + timeDesc + ".vtk"; } else @@ -775,7 +790,7 @@ int main(int argc, char *argv[]) patchFileName = fvPath/pp.name()/pp.name() + "_" - + name(timeI) + + timeDesc + ".vtk"; } @@ -867,7 +882,7 @@ int main(int argc, char *argv[]) patchFileName = fvPath/pp.name()/cellSetName + "_" - + name(timeI) + + timeDesc + ".vtk"; } else @@ -875,7 +890,7 @@ int main(int argc, char *argv[]) patchFileName = fvPath/pp.name()/pp.name() + "_" - + name(timeI) + + timeDesc + ".vtk"; } @@ -931,7 +946,7 @@ int main(int argc, char *argv[]) fileName lagrFileName ( fvPath/cloud::prefix/cloudDirs[i]/cloudDirs[i] - + "_" + name(timeI) + ".vtk" + + "_" + timeDesc + ".vtk" ); Info<< " Lagrangian: " << lagrFileName << endl; diff --git a/applications/utilities/postProcessing/lagrangian/particleTracks/Make/files b/applications/utilities/postProcessing/lagrangian/particleTracks/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..316b0f6ade74d966f2dd2aa14124e4701c2ec5dc --- /dev/null +++ b/applications/utilities/postProcessing/lagrangian/particleTracks/Make/files @@ -0,0 +1,3 @@ +particleTracks.C + +EXE = $(FOAM_APPBIN)/particleTracks diff --git a/applications/utilities/postProcessing/lagrangian/particleTracks/Make/options b/applications/utilities/postProcessing/lagrangian/particleTracks/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..1adeeefa12999bb91513d9e0b16a0a52a9fc15d2 --- /dev/null +++ b/applications/utilities/postProcessing/lagrangian/particleTracks/Make/options @@ -0,0 +1,7 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -llagrangian diff --git a/applications/utilities/postProcessing/lagrangian/particleTracks/createFields.H b/applications/utilities/postProcessing/lagrangian/particleTracks/createFields.H new file mode 100644 index 0000000000000000000000000000000000000000..aef0139de1db22ae157c16f641ec0b2e54947d47 --- /dev/null +++ b/applications/utilities/postProcessing/lagrangian/particleTracks/createFields.H @@ -0,0 +1,22 @@ +IOdictionary propsDict +( + IOobject + ( + "particleTrackProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ + ) +); + +word cloudName(propsDict.lookup("cloudName")); + +label sampleFrequency(readLabel(propsDict.lookup("sampleFrequency"))); + +// outputMode: compositeFile, filePerTrack +//word outputmode(propsDict.lookup("outputMode")) + +label maxPositions(readLabel(propsDict.lookup("maxPositions"))); + +// outputFormat: raw, vtk +//word outputFormat(propsDict.lookup("outputFormat")); diff --git a/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C b/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C new file mode 100644 index 0000000000000000000000000000000000000000..0555309348f58078907baaa15c99b606ae7e8861 --- /dev/null +++ b/applications/utilities/postProcessing/lagrangian/particleTracks/particleTracks.C @@ -0,0 +1,270 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +Application + particleTracks + +Description + Generates a VTK file of particle tracks for cases that were computed using + a tracked-parcel-type cloud + +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "Cloud.H" +#include "IOdictionary.H" +#include "fvMesh.H" +#include "Time.H" +#include "timeSelector.H" +#include "OFstream.H" +#include "passiveParticle.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ +# include "setRootCase.H" + +# include "createTime.H" + instantList timeDirs = timeSelector::select0(runTime, args); +# include "createMesh.H" +# include "createFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "Scanning times to determine track data" << nl << endl; + + labelList maxIds(Pstream::nProcs(), -1); + forAll(timeDirs, timeI) + { + runTime.setTime(timeDirs[timeI], timeI); + Info<< "Time = " << runTime.timeName() << endl; + + IOobject origProcHeader + ( + "origProc", + runTime.timeName(), + cloud::prefix/cloudName, + mesh, + IOobject::MUST_READ + ); + IOobject idHeader + ( + "id", + runTime.timeName(), + cloud::prefix/cloudName, + mesh, + IOobject::MUST_READ + ); + if (idHeader.headerOk() && origProcHeader.headerOk()) + { + IOField<label> origProc(origProcHeader); + IOField<label> id(idHeader); + forAll(id, i) + { + maxIds[origProc[i]] = max(maxIds[origProc[i]], id[i]); + } + } + } + Pstream::listCombineGather(maxIds, maxOp<label>()); + Pstream::listCombineScatter(maxIds); + labelList numIds = maxIds + 1; + + // calc starting ids for particles on each processor + List<label> startIds(numIds.size(), 0); + for (label i = 0; i < numIds.size()-1; i++) + { + startIds[i+1] += startIds[i] + numIds[i]; + } + label nParticle = startIds[startIds.size()-1] + numIds[startIds.size()-1]; + + // number of tracks to generate + label nTracks = nParticle/sampleFrequency; + + // storage for all particle tracks + List<DynamicList<vector> > allTracks(nTracks); + + Info<< "\nGenerating " << nTracks << " particle tracks" << nl << endl; + forAll(timeDirs, timeI) + { + runTime.setTime(timeDirs[timeI], timeI); + Info<< "Time = " << runTime.timeName() << endl; + + IOobject positionsHeader + ( + "positions", + runTime.timeName(), + cloud::prefix/cloudName, + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ); + + IOobject origProcHeader + ( + "origProc", + runTime.timeName(), + cloud::prefix/cloudName, + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ); + + IOobject idHeader + ( + "id", + runTime.timeName(), + cloud::prefix/cloudName, + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ); + + if + ( + positionsHeader.headerOk() + && origProcHeader.headerOk() + && idHeader.headerOk() + ) + { + Info<< " Reading particle positions" << endl; + Cloud<passiveParticle> myCloud(mesh, cloudName, false); + + Info<< " Reading particle id" << endl; + IOField<label> id(idHeader); + + Info<< " Reading particle origProc" << endl; + IOField<label> origProc(origProcHeader); + + // collect the track data on the master processor + label i = 0; + List<pointField> allPositions(Pstream::nProcs()); + allPositions[Pstream::myProcNo()].setSize(myCloud.size()); + forAllConstIter(Cloud<passiveParticle>, myCloud, iter) + { + allPositions[Pstream::myProcNo()][i++] = iter().position(); + } + Pstream::gatherList(allPositions); + + List<labelList> allIds(Pstream::nProcs()); + allIds[Pstream::myProcNo()] = id; + Pstream::gatherList(allIds); + + List<labelList> allOrigProcs(Pstream::nProcs()); + allOrigProcs[Pstream::myProcNo()] = origProc; + Pstream::gatherList(allOrigProcs); + + Info<< " Constructing tracks" << nl << endl; + if (Pstream::master()) + { + forAll(allPositions, procI) + { + forAll(allPositions[procI], i) + { + label globalId = + startIds[allOrigProcs[procI][i]] + + allIds[procI][i]; + + if (globalId % sampleFrequency == 0) + { + label trackId = globalId/sampleFrequency; + if (allTracks[trackId].size() < maxPositions) + { + allTracks[trackId].append + ( + allPositions[procI][i] + ); + } + } + } + } + } + } + else + { + Info<< " No particles read" << nl << endl; + } + } + + if (Pstream::master()) + { + Info<< "\nWriting particle tracks" << nl << endl; + + OFstream vtkTracks("particleTracks.vtk"); + + // Total number of points in tracks + 1 per track + label nPoints = 0; + forAll(allTracks, trackI) + { + nPoints += allTracks[trackI].size(); + } + + vtkTracks + << "# vtk DataFile Version 2.0" << nl + << "particleTracks" << nl + << "ASCII" << nl + << "DATASET POLYDATA" << nl + << "POINTS " << nPoints << " float" << nl; + + // Write track points to file + forAll(allTracks, trackI) + { + forAll(allTracks[trackI], i) + { + const vector& pt = allTracks[trackI][i]; + vtkTracks << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl; + } + } + + // write track (line) connectivity to file + vtkTracks << "LINES " << nTracks << ' ' << nPoints+nTracks << nl; + + // Write ids of track points to file + label globalPtI = 0; + forAll(allTracks, trackI) + { + vtkTracks << allTracks[trackI].size(); + + forAll(allTracks[trackI], i) + { + vtkTracks << ' ' << globalPtI; + globalPtI++; + } + + vtkTracks << nl; + } + + Info<< "end" << endl; + } + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C b/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C index dc92aade57b699d0a6b4816c1825684b304b2575..54acae002582bfa1dcb5e09c5c20255be2c7bac4 100644 --- a/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C +++ b/applications/utilities/postProcessing/patch/patchIntegrate/patchIntegrate.C @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) // Give patch area if (isType<cyclicPolyPatch>(mesh.boundaryMesh()[patchi])) { - Info<< " Cyclic patch area: " << nl; + Info<< " Cyclic patch vector area: " << nl; label nFaces = mesh.boundaryMesh()[patchi].size(); vector sum1 = vector::zero; vector sum2 = vector::zero; @@ -92,12 +92,18 @@ int main(int argc, char *argv[]) Info<< " - half 1 = " << sum1 << ", " << mag(sum1) << nl << " - half 2 = " << sum2 << ", " << mag(sum2) << nl << " - total = " << (sum1 + sum2) << ", " - << mag(sum1 + sum2) << endl;; + << mag(sum1 + sum2) << endl; + Info<< " Cyclic patch area magnitude = " + << gSum(mesh.magSf().boundaryField()[patchi])/2.0 << endl; } else { - Info<< " Patch area = " + Info<< " Area vector of patch " + << patchName << '[' << patchi << ']' << " = " << gSum(mesh.Sf().boundaryField()[patchi]) << endl; + Info<< " Area magnitude of patch " + << patchName << '[' << patchi << ']' << " = " + << gSum(mesh.magSf().boundaryField()[patchi]) << endl; } // Read field and calc integral @@ -107,15 +113,26 @@ int main(int argc, char *argv[]) << fieldName << endl; volScalarField field(fieldHeader, mesh); - vector sumField = gSum - ( - mesh.Sf().boundaryField()[patchi] - *field.boundaryField()[patchi] - ); - Info<< " Integral of " << fieldName << " over patch " + Info<< " Integral of " << fieldName + << " over vector area of patch " << patchName << '[' << patchi << ']' << " = " - << sumField << nl; + << gSum + ( + mesh.Sf().boundaryField()[patchi] + *field.boundaryField()[patchi] + ) + << nl; + + Info<< " Integral of " << fieldName + << " over area magnitude of patch " + << patchName << '[' << patchi << ']' << " = " + << gSum + ( + mesh.magSf().boundaryField()[patchi] + *field.boundaryField()[patchi] + ) + << nl; } else if ( diff --git a/applications/utilities/postProcessing/wall/yPlusLES/Make/options b/applications/utilities/postProcessing/wall/yPlusLES/Make/options index 79fbbac91eff3fd29abdd775aa543a905a0c1162..f6131ce41c17a8d8d5b852fe0e1f07e1d62308f6 100644 --- a/applications/utilities/postProcessing/wall/yPlusLES/Make/options +++ b/applications/utilities/postProcessing/wall/yPlusLES/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/incompressible/LES/LESModel \ -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ diff --git a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C index 82ee27fa0ab6580cfcece3f9854718ded7abe196..67dc0df3f0e8c333fb2996255b047c34f8455f3c 100644 --- a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C +++ b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C @@ -34,6 +34,7 @@ Description #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" #include "LESModel.H" #include "nearWallDist.H" +#include "wallDist.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,7 +50,18 @@ int main(int argc, char *argv[]) { runTime.setTime(timeDirs[timeI], timeI); Info<< "Time = " << runTime.timeName() << endl; - mesh.readUpdate(); + fvMesh::readUpdateState state = mesh.readUpdate(); + + // Wall distance + if (timeI == 0 || state != fvMesh::UNCHANGED) + { + Info<< "Calculating wall distance\n" << endl; + wallDist y(mesh, true); + Info<< "Writing wall distance to field " + << y.name() << nl << endl; + y.write(); + } + volScalarField yPlus ( @@ -116,6 +128,9 @@ int main(int argc, char *argv[]) } } + Info<< "Writing yPlus to field " + << yPlus.name() << nl << endl; + yPlus.write(); } diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/Make/options b/applications/utilities/postProcessing/wall/yPlusRAS/Make/options index 89632547e0815e442b8f0082777fabb715fbc981..9ec5fca52baaa1f55b00483950ab4cf2ad1f9909 100644 --- a/applications/utilities/postProcessing/wall/yPlusRAS/Make/options +++ b/applications/utilities/postProcessing/wall/yPlusRAS/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \ diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C index 7d1e4796f2b5f75ae740b31169a522bbc9dfbd9d..a93712263e6aafbc375270c815609afc5aae904f 100644 --- a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C +++ b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C @@ -34,6 +34,7 @@ Description #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" #include "RASModel.H" #include "wallFvPatch.H" +#include "wallDist.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,7 +50,17 @@ int main(int argc, char *argv[]) { runTime.setTime(timeDirs[timeI], timeI); Info<< "Time = " << runTime.timeName() << endl; - mesh.readUpdate(); + fvMesh::readUpdateState state = mesh.readUpdate(); + + // Wall distance + if (timeI == 0 || state != fvMesh::UNCHANGED) + { + Info<< "Calculating wall distance\n" << endl; + wallDist y(mesh, true); + Info<< "Writing wall distance to field " + << y.name() << nl << endl; + y.write(); + } volScalarField yPlus ( @@ -106,6 +117,9 @@ int main(int argc, char *argv[]) } } + Info<< "Writing yPlus to field " + << yPlus.name() << nl << endl; + yPlus.write(); } diff --git a/applications/utilities/surface/surfaceRedistributePar/Make/files b/applications/utilities/surface/surfaceRedistributePar/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..4825ff735d6d625bfcb39fae4fb9c7a13bda5742 --- /dev/null +++ b/applications/utilities/surface/surfaceRedistributePar/Make/files @@ -0,0 +1,3 @@ +surfaceRedistributePar.C + +EXE = $(FOAM_APPBIN)/surfaceRedistributePar diff --git a/applications/utilities/surface/surfaceRedistributePar/Make/options b/applications/utilities/surface/surfaceRedistributePar/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..2db41f545a2fde53b3cf2d357bc790d25f6fbed5 --- /dev/null +++ b/applications/utilities/surface/surfaceRedistributePar/Make/options @@ -0,0 +1,7 @@ +EXE_INC = \ + -I$(LIB_SRC)/triSurface/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +EXE_LIBS = \ + -lmeshTools \ + -ltriSurface diff --git a/applications/utilities/surface/surfaceRedistributePar/surfaceRedistributePar.C b/applications/utilities/surface/surfaceRedistributePar/surfaceRedistributePar.C new file mode 100644 index 0000000000000000000000000000000000000000..cdb041ce350d19b6f79e893bd114d014f32e4e09 --- /dev/null +++ b/applications/utilities/surface/surfaceRedistributePar/surfaceRedistributePar.C @@ -0,0 +1,295 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 + +Application + surfaceRedistributePar + +Description + (Re)distribution of triSurface. Either takes an undecomposed surface + or an already decomposed surface and redistribute it so each processor + has all triangles that overlap its mesh. + +Note + - best decomposition option is hierarchGeomDecomp since + guarantees square decompositions. + - triangles might be present on multiple processors. + - merging uses geometric tolerance so take care with writing precision. + +\*---------------------------------------------------------------------------*/ + +#include "treeBoundBox.H" +#include "FixedList.H" +#include "argList.H" +#include "Time.H" +#include "polyMesh.H" +#include "distributedTriSurfaceMesh.H" +#include "mapDistribute.H" +#include "triSurfaceFields.H" +#include "Pair.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Print on master all the per-processor surface stats. +void writeProcStats +( + const triSurface& s, + const List<List<treeBoundBox> >& meshBb +) +{ + // Determine surface bounding boxes, faces, points + List<treeBoundBox> surfBb(Pstream::nProcs()); + { + surfBb[Pstream::myProcNo()] = boundBox(s.points(), false); + Pstream::gatherList(surfBb); + Pstream::scatterList(surfBb); + } + + labelList nPoints(Pstream::nProcs()); + nPoints[Pstream::myProcNo()] = s.points().size(); + Pstream::gatherList(nPoints); + Pstream::scatterList(nPoints); + + labelList nFaces(Pstream::nProcs()); + nFaces[Pstream::myProcNo()] = s.size(); + Pstream::gatherList(nFaces); + Pstream::scatterList(nFaces); + + forAll(surfBb, procI) + { + const List<treeBoundBox>& bbs = meshBb[procI]; + + Info<< "processor" << procI << endl + << "\tMesh bounds : " << bbs[0] << nl; + for (label i = 1; i < bbs.size(); i++) + { + Info<< "\t " << bbs[i]<< nl; + } + Info<< "\tSurface bounding box : " << surfBb[procI] << nl + << "\tTriangles : " << nFaces[procI] << nl + << "\tVertices : " << nPoints[procI] + << endl; + } + Info<< endl; +} + + +// Main program: + +int main(int argc, char *argv[]) +{ + argList::validArgs.append("triSurfaceMesh"); + argList::validArgs.append("distributionType"); + + argList::validOptions.insert("keepNonMapped", ""); +# include "setRootCase.H" +# include "createTime.H" + runTime.functionObjects().off(); + + fileName surfFileName(args.additionalArgs()[0]); + Info<< "Reading surface from " << surfFileName << nl << endl; + + const word distType(args.additionalArgs()[1]); + + Info<< "Using distribution method " + << distributedTriSurfaceMesh::distributionTypeNames_[distType] + << " " << distType << nl << endl; + + bool keepNonMapped = args.options().found("keepNonMapped"); + + if (keepNonMapped) + { + Info<< "Preserving surface outside of mesh bounds." << nl << endl; + } + else + { + Info<< "Removing surface outside of mesh bounds." << nl << endl; + } + + + if (!Pstream::parRun()) + { + FatalErrorIn(args.executable()) + << "Please run this program on the decomposed case." + << " It will read surface " << surfFileName + << " and decompose it such that it overlaps the mesh bounding box." + << exit(FatalError); + } + + +# include "createPolyMesh.H" + + Random rndGen(653213); + + // Determine mesh bounding boxes: + List<List<treeBoundBox> > meshBb(Pstream::nProcs()); + { + meshBb[Pstream::myProcNo()] = List<treeBoundBox> + ( + 1, + treeBoundBox + ( + boundBox(mesh.points(), false) + ).extend(rndGen, 1E-3) + ); + Pstream::gatherList(meshBb); + Pstream::scatterList(meshBb); + } + + IOobject io + ( + surfFileName, // name + //runTime.findInstance("triSurface", surfFileName), // instance + runTime.constant(), // instance + "triSurface", // local + runTime, // registry + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + + const fileName actualPath(io.filePath()); + fileName localPath(actualPath); + localPath.replace(runTime.rootPath() + '/', ""); + + if (actualPath == io.objectPath()) + { + Info<< "Loading local (decomposed) surface " << localPath << nl <<endl; + } + else + { + Info<< "Loading undecomposed surface " << localPath << nl << endl; + } + + + // Create dummy dictionary for bounding boxes if does not exist. + if (!isFile(actualPath / "Dict")) + { + dictionary dict; + dict.add("bounds", meshBb[Pstream::myProcNo()]); + dict.add("distributionType", distType); + dict.add("mergeDistance", SMALL); + + IOdictionary ioDict + ( + IOobject + ( + io.name() + "Dict", + io.instance(), + io.local(), + io.db(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + dict + ); + + Info<< "Writing dummy bounds dictionary to " << ioDict.name() + << nl << endl; + + ioDict.regIOobject::writeObject + ( + IOstream::ASCII, + IOstream::currentVersion, + ioDict.time().writeCompression() + ); + } + + + // Load surface + distributedTriSurfaceMesh surfMesh(io); + Info<< "Loaded surface" << nl << endl; + + + // Generate a test field + { + const triSurface& s = static_cast<const triSurface&>(surfMesh); + + autoPtr<triSurfaceVectorField> fcPtr + ( + new triSurfaceVectorField + ( + IOobject + ( + surfMesh.searchableSurface::name(), // name + surfMesh.searchableSurface::instance(), // instance + surfMesh.searchableSurface::local(), // local + surfMesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + surfMesh, + dimLength + ) + ); + triSurfaceVectorField& fc = fcPtr(); + + forAll(fc, triI) + { + fc[triI] = s[triI].centre(s.points()); + } + + // Steal pointer and store object on surfMesh + fcPtr.ptr()->store(); + } + + + // Write per-processor stats + Info<< "Before redistribution:" << endl; + writeProcStats(surfMesh, meshBb); + + + // Do redistribution + Info<< "Redistributing surface" << nl << endl; + autoPtr<mapDistribute> faceMap; + autoPtr<mapDistribute> pointMap; + surfMesh.distribute + ( + meshBb[Pstream::myProcNo()], + keepNonMapped, + faceMap, + pointMap + ); + faceMap.clear(); + pointMap.clear(); + + Info<< endl; + + + // Write per-processor stats + Info<< "After redistribution:" << endl; + writeProcStats(surfMesh, meshBb); + + + Info<< "Writing surface." << nl << endl; + surfMesh.searchableSurface::write(); + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/bin/foamClearPolyMesh b/bin/foamClearPolyMesh index dcc507b811d39dbdd4ac0d57a3fc7b7589cc4488..1af677459dfbe7808bead2d18e9c795f5e8dcb1c 100755 --- a/bin/foamClearPolyMesh +++ b/bin/foamClearPolyMesh @@ -109,7 +109,7 @@ fi # -# remove files and subdirectories +# remove files (mesh itself, modifiers, snappyHexMesh ones) and subdirectories # echo "Clearing ${caseDir:-.}/$meshDir" 1>&2 @@ -126,6 +126,10 @@ for i in \ meshModifiers \ parallelData \ sets \ + cellLevel \ + pointLevel \ + refinementHistory \ + surfaceIndex \ ; do rm -rf $meshDir/$i diff --git a/bin/foamTemplates/foamScript b/bin/foamTemplates/foamScript index 6dd5781ac1af9aef4c4d809bfa235f1547533d9b..e8a160860c298189fb416e8ccdd8cacdedadd5ca 100644 --- a/bin/foamTemplates/foamScript +++ b/bin/foamTemplates/foamScript @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License diff --git a/bin/foamTemplates/source/foamAppTemplate.C b/bin/foamTemplates/source/foamAppTemplate.C index 2c75d7e107e02b0ee790ca1c0c49a5724bb2536b..46c089c1a865c2884cd4f62323db9f5c67442dce 100644 --- a/bin/foamTemplates/source/foamAppTemplate.C +++ b/bin/foamTemplates/source/foamAppTemplate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/foamTemplates/source/foamTemplate.C b/bin/foamTemplates/source/foamTemplate.C index 97251605e82048d4607ab495094cdc129e7659a8..903fe66b5f50909b991291f4608f89491a96da35 100644 --- a/bin/foamTemplates/source/foamTemplate.C +++ b/bin/foamTemplates/source/foamTemplate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/foamTemplates/source/foamTemplate.H b/bin/foamTemplates/source/foamTemplate.H index 963fc74cdf486bc0e0f9baae13fd52b659086c36..e0b6cf21577a30947428b32ef1da7e8947d5900b 100644 --- a/bin/foamTemplates/source/foamTemplate.H +++ b/bin/foamTemplates/source/foamTemplate.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/foamTemplates/source/foamTemplateI.H b/bin/foamTemplates/source/foamTemplateI.H index 42bc929311152d7464c792bf0b3378adda1da890..10e8e4fec8ff30bc0e113d06c5081a217cfb6944 100644 --- a/bin/foamTemplates/source/foamTemplateI.H +++ b/bin/foamTemplates/source/foamTemplateI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/foamTemplates/source/foamTemplateIO.C b/bin/foamTemplates/source/foamTemplateIO.C index 2d95dc47de4b741469a521ac8d96da5110843cd1..d9119ed354a4bce766750b5afd1a4c997245db29 100644 --- a/bin/foamTemplates/source/foamTemplateIO.C +++ b/bin/foamTemplates/source/foamTemplateIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/foamTemplates/source/newSource b/bin/foamTemplates/source/newSource old mode 100755 new mode 100644 index a06d1bcc732219f35c4772a1d22622b24c87880e..927ad36b31d407b723573fc2eef6abcaf03990c5 --- a/bin/foamTemplates/source/newSource +++ b/bin/foamTemplates/source/newSource @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License diff --git a/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.C b/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.C index 674341d11c2243dcd463f75119270915273dd2f6..5acafb25e79133c97b4a9a7ee277d687e01ab14f 100644 --- a/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.C +++ b/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.H b/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.H index 79250a7019e8a81a4689ce6bf062315d49fde131..fa32697e0a82449b8b9c7642ac06a3d6100db9b5 100644 --- a/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.H +++ b/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/foamTemplates/sourceTemplate/foamTemplateTemplateI.H b/bin/foamTemplates/sourceTemplate/foamTemplateTemplateI.H index 42bc929311152d7464c792bf0b3378adda1da890..10e8e4fec8ff30bc0e113d06c5081a217cfb6944 100644 --- a/bin/foamTemplates/sourceTemplate/foamTemplateTemplateI.H +++ b/bin/foamTemplates/sourceTemplate/foamTemplateTemplateI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/foamTemplates/sourceTemplate/foamTemplateTemplateIO.C b/bin/foamTemplates/sourceTemplate/foamTemplateTemplateIO.C index 41bd21f5c359b520241fbcf98f3d860ee96c83ae..1c805f6f6a39e5883e96d06d9f4b4531902c811b 100644 --- a/bin/foamTemplates/sourceTemplate/foamTemplateTemplateIO.C +++ b/bin/foamTemplates/sourceTemplate/foamTemplateTemplateIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/bin/foamTemplates/sourceTemplate/newSourceTemplate b/bin/foamTemplates/sourceTemplate/newSourceTemplate old mode 100755 new mode 100644 index 238c6f43316623b2772853197c30e9fb33aa359c..b62a7f4c0e9f45150c30218f83bf8b28c5574f07 --- a/bin/foamTemplates/sourceTemplate/newSourceTemplate +++ b/bin/foamTemplates/sourceTemplate/newSourceTemplate @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License diff --git a/etc/apps/paraview3/bashrc b/etc/apps/paraview3/bashrc index f49288b36ec26ad2c712a9f824cfd5b3ddc4a9ce..6536eb32ce6425f2efd66f0e0530b9ae3750dc1c 100644 --- a/etc/apps/paraview3/bashrc +++ b/etc/apps/paraview3/bashrc @@ -46,8 +46,8 @@ do fi done -paraviewMajor=paraview-3.5 -export ParaView_VERSION=3.5-cvs +paraviewMajor=paraview-3.6 +export ParaView_VERSION=3.6 export ParaView_INST_DIR=$WM_THIRD_PARTY_DIR/paraview-$ParaView_VERSION export ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER diff --git a/etc/apps/paraview3/cshrc b/etc/apps/paraview3/cshrc index 1c500f4962544271b887b812dff67f268cf89c04..66c7e1a54f283c56121c74164e482b7b221d437d 100644 --- a/etc/apps/paraview3/cshrc +++ b/etc/apps/paraview3/cshrc @@ -44,8 +44,8 @@ foreach cmake ( cmake-2.6.4 cmake-2.6.2 cmake-2.4.6 ) endif end -set paraviewMajor=paraview-3.5 -setenv ParaView_VERSION 3.5-cvs +set paraviewMajor=paraview-3.6 +setenv ParaView_VERSION 3.6 setenv ParaView_INST_DIR $WM_THIRD_PARTY_DIR/paraview-$ParaView_VERSION setenv ParaView_DIR $ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER diff --git a/etc/controlDict b/etc/controlDict index c5f3831a30c143a6b1ee1fabf780c353080e8682..d7824f102ed9972cfb96cad9569659231d200daf 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -95,6 +95,7 @@ DebugSwitches Euler 0; EulerImplicit 0; EulerRotation 0; + extendedCellToFaceStencil 0; FDIC 0; FaceCellWave 0; GAMG 0; diff --git a/src/OSspecific/POSIX/signals/sigFpe.C b/src/OSspecific/POSIX/signals/sigFpe.C index 813364d366779395a04efd49558e37cefd227ba0..bdcc1d08bdd99785ae0ca761a8671b6ad23244e9 100644 --- a/src/OSspecific/POSIX/signals/sigFpe.C +++ b/src/OSspecific/POSIX/signals/sigFpe.C @@ -177,7 +177,7 @@ Foam::sigFpe::~sigFpe() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::sigFpe::set() +void Foam::sigFpe::set(const bool verbose) { if (oldAction_.sa_handler) { @@ -190,6 +190,12 @@ void Foam::sigFpe::set() if (env("FOAM_SIGFPE")) { + if (verbose) + { + Info<< "SigFpe : Enabling floating point exception trapping" + << " (FOAM_SIGFPE)." << endl; + } + # ifdef LINUX_GNUC feenableexcept @@ -240,6 +246,12 @@ void Foam::sigFpe::set() if (env("FOAM_SETNAN")) { + if (verbose) + { + Info<< "SetNaN : Initialising allocated memory to NaN" + << " (FOAM_SETNAN)." << endl; + } + # ifdef LINUX_GNUC // Set our malloc diff --git a/src/OSspecific/POSIX/signals/sigFpe.H b/src/OSspecific/POSIX/signals/sigFpe.H index 6d9fe7623ccf7d6aa2520efe3938e3ebafb641d6..46755873de60d020e70ff50eea209addc167dcf7 100644 --- a/src/OSspecific/POSIX/signals/sigFpe.H +++ b/src/OSspecific/POSIX/signals/sigFpe.H @@ -107,7 +107,7 @@ public: // Member functions - void set(); + void set(const bool verbose); }; diff --git a/src/OSspecific/POSIX/signals/sigInt.C b/src/OSspecific/POSIX/signals/sigInt.C index 922374fa7347e81b812cf10fe2f25b3337a1b25e..1f3555ec8746d86f7fc06a09ed0823185c006969 100644 --- a/src/OSspecific/POSIX/signals/sigInt.C +++ b/src/OSspecific/POSIX/signals/sigInt.C @@ -81,7 +81,7 @@ Foam::sigInt::~sigInt() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::sigInt::set() +void Foam::sigInt::set(const bool verbose) { if (oldAction_.sa_handler) { diff --git a/src/OSspecific/POSIX/signals/sigInt.H b/src/OSspecific/POSIX/signals/sigInt.H index 49cf7ea41e354c8a6c89ad28b1dbe5c31272fefe..1f89c47f97ea6dcb28741af7922b3146570aa901 100644 --- a/src/OSspecific/POSIX/signals/sigInt.H +++ b/src/OSspecific/POSIX/signals/sigInt.H @@ -78,7 +78,7 @@ public: // Member functions - void set(); + void set(const bool verbose); }; diff --git a/src/OSspecific/POSIX/signals/sigQuit.C b/src/OSspecific/POSIX/signals/sigQuit.C index 890d4d3430e3ad9eafcf8a3c15a16b7f08ff2aa2..7c67c903bc98772df9726a8c7bda5b491781b27d 100644 --- a/src/OSspecific/POSIX/signals/sigQuit.C +++ b/src/OSspecific/POSIX/signals/sigQuit.C @@ -83,7 +83,7 @@ Foam::sigQuit::~sigQuit() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::sigQuit::set() +void Foam::sigQuit::set(const bool verbose) { if (oldAction_.sa_handler) { diff --git a/src/OSspecific/POSIX/signals/sigQuit.H b/src/OSspecific/POSIX/signals/sigQuit.H index c130416a687a76f477b88d8df708c7f7da512dc5..23890cc6dbae3d24f352a87b420118bd04c52cc5 100644 --- a/src/OSspecific/POSIX/signals/sigQuit.H +++ b/src/OSspecific/POSIX/signals/sigQuit.H @@ -78,7 +78,7 @@ public: // Member functions - void set(); + void set(const bool verbose); }; diff --git a/src/OSspecific/POSIX/signals/sigSegv.C b/src/OSspecific/POSIX/signals/sigSegv.C index 270a21461979d4232b3df8f5586f67ff094fb119..14ab77ffe326c878e7cf1507c3d0cebb3e8b328f 100644 --- a/src/OSspecific/POSIX/signals/sigSegv.C +++ b/src/OSspecific/POSIX/signals/sigSegv.C @@ -83,7 +83,7 @@ Foam::sigSegv::~sigSegv() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::sigSegv::set() +void Foam::sigSegv::set(const bool verbose) { if (oldAction_.sa_handler) { diff --git a/src/OSspecific/POSIX/signals/sigSegv.H b/src/OSspecific/POSIX/signals/sigSegv.H index 2c405c9565bd665c303c76c60957a6a39e18be6e..5aae61de7d3319b1f9f5dbc950d13cf290671fd6 100644 --- a/src/OSspecific/POSIX/signals/sigSegv.H +++ b/src/OSspecific/POSIX/signals/sigSegv.H @@ -78,7 +78,7 @@ public: // Member functions - void set(); + void set(const bool verbose); }; diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index c99ee23fa5105c25076fc4bb5b73769c74751864..c3902bc9c5ea2215ee7d4d58d3f7a3870d35a573 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -72,6 +72,7 @@ primitiveLists = primitives/Lists $(primitiveLists)/boolList.C $(primitiveLists)/labelIOList.C $(primitiveLists)/scalarList.C +$(primitiveLists)/scalarIOList.C $(primitiveLists)/vectorList.C $(primitiveLists)/sphericalTensorList.C $(primitiveLists)/symmTensorList.C diff --git a/src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.C b/src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.C index 8fcc3bd982ece6f33764891971d3d4e67bbc5cfe..fcb2fbdebe9e84708f5bb6a71d4538db4738a1dc 100644 --- a/src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.C +++ b/src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.C @@ -63,6 +63,21 @@ Foam::IOPtrList<T>::IOPtrList(const IOobject& io) } +template<class T> +Foam::IOPtrList<T>::IOPtrList(const IOobject& io, const label s) +: + regIOobject(io), + PtrList<T>(s) +{ + if (io.readOpt() != IOobject::NO_READ) + { + FatalErrorIn("IOPtrList<T>::IOPtrList(const IOobject&, const label)") + << "NO_READ must be set if specifying size" << nl + << exit(FatalError); + } +} + + template<class T> Foam::IOPtrList<T>::IOPtrList(const IOobject& io, const PtrList<T>& list) : diff --git a/src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.H b/src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.H index 9a2e8ce5afe2ad9462d45ac02dd911a84d2728fa..bc2232056f4aed9f7518674b11db746c7f2b5429 100644 --- a/src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.H +++ b/src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.H @@ -70,6 +70,9 @@ public: //- Construct from IOobject IOPtrList(const IOobject&); + //- Construct from IOobject with given size + IOPtrList(const IOobject&, const label); + //- Construct from IOobject and a PtrList IOPtrList(const IOobject&, const PtrList<T>&); diff --git a/src/OpenFOAM/db/regIOobject/regIOobject.C b/src/OpenFOAM/db/regIOobject/regIOobject.C index a5a5e8e1e3dfbe847b6d4b5667e8faaf8af5149a..0f27c101f1b9fdaee9182429abc7f30091129300 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobject.C +++ b/src/OpenFOAM/db/regIOobject/regIOobject.C @@ -140,7 +140,7 @@ bool Foam::regIOobject::checkIn() { WarningIn("regIOobject::checkIn()") << "failed to register object " << objectPath() - << " the name already exists in the objectRegistry" + << " the name already exists in the objectRegistry" << endl; } } diff --git a/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.C b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.C new file mode 100644 index 0000000000000000000000000000000000000000..783581f5c5727429db49881491c64a4978a6ad15 --- /dev/null +++ b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.C @@ -0,0 +1,112 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "DynamicField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * Static Members * * * * * * * * * * * * * * // + +template<class Type> +const char* const DynamicField<Type>::typeName("DynamicField"); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Type> +DynamicField<Type>::DynamicField(Istream& is) +: + Field<Type>(is), + capacity_(Field<Type>::size()) +{} + + +template<class Type> +tmp<DynamicField<Type> > DynamicField<Type>::clone() const +{ + return tmp<DynamicField<Type> >(new DynamicField<Type>(*this)); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +void DynamicField<Type>::setSize(const label nElem) +{ + // allocate more capacity? + if (nElem > capacity_) + { + capacity_ = max(nElem, label(1 + capacity_*2)); + + Field<Type>::setSize(capacity_); + } + + // adjust addressed size + Field<Type>::size(nElem); +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * IOstream Operator * * * * * * * * * * * * * // + +template<class Type> +Ostream& operator<<(Ostream& os, const DynamicField<Type>& f) +{ + os << static_cast<const Field<Type>&>(f); + return os; +} + + +template<class Type> +Ostream& operator<<(Ostream& os, const tmp<DynamicField<Type> >& tf) +{ + os << tf(); + tf.clear(); + return os; +} + + +template<class Type> +Istream& operator>>(Istream& is, DynamicField<Type>& lst) +{ + is >> static_cast<Field<Type>&>(lst); + lst.capacity_ = lst.Field<Type>::size(); + + return is; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H new file mode 100644 index 0000000000000000000000000000000000000000..79c9cd4bae2f48d2273199ce81afc4a7aa2e06c2 --- /dev/null +++ b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H @@ -0,0 +1,227 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::DynamicField + +Description + Dynamically sized Field. WIP. + +SourceFiles + DynamicField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef DynamicField_H +#define DynamicField_H + +#include "Field.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +template<class Type> +class DynamicField; + +template<class Type> +Ostream& operator<<(Ostream&, const DynamicField<Type>&); + +template<class Type> +Ostream& operator<<(Ostream&, const tmp<DynamicField<Type> >&); + +template<class Type> +Istream& operator>>(Istream&, DynamicField<Type>&); + + +/*---------------------------------------------------------------------------*\ + Class DynamicField Declaration +\*---------------------------------------------------------------------------*/ + +#include "CintDefs.H" + +template<class Type> +class DynamicField +: + public Field<Type> //private Field<Type> +{ + + // Private data + + //- The capacity (allocated size) of the underlying field. + label capacity_; + + + //- Construct given size and initial value + DynamicField(const label, const Type&); + + //- Construct as copy of tmp<DynamicField> +# ifdef ConstructFromTmp + DynamicField(const tmp<DynamicField<Type> >&); +# endif + + //- Construct from a dictionary entry + DynamicField(const word&, const dictionary&, const label); + +public: + + // Static data members + + static const char* const typeName; + + + // Static Member Functions + + //- Return a null field + inline static const DynamicField<Type>& null() + { + return *reinterpret_cast< DynamicField<Type>* >(0); + } + + + // Constructors + + //- Construct null + // Used for temporary fields which are initialised after construction + DynamicField(); + + //- Construct given size + // Used for temporary fields which are initialised after construction + explicit inline DynamicField(const label); + + //- Construct as copy of a UList\<Type\> + explicit inline DynamicField(const UList<Type>&); + + //- Construct by transferring the List contents + explicit inline DynamicField(const Xfer<List<Type> >&); + + //- Construct by 1 to 1 mapping from the given field + inline DynamicField + ( + const UList<Type>& mapF, + const labelList& mapAddressing + ); + + //- Construct by interpolative mapping from the given field + inline DynamicField + ( + const UList<Type>& mapF, + const labelListList& mapAddressing, + const scalarListList& weights + ); + + //- Construct by mapping from the given field + inline DynamicField + ( + const UList<Type>& mapF, + const FieldMapper& map + ); + + //- Construct as copy + inline DynamicField(const DynamicField<Type>&); + + //- Construct as copy or re-use as specified. + inline DynamicField(DynamicField<Type>&, bool reUse); + + //- Construct by transferring the Field contents + inline DynamicField(const Xfer<DynamicField<Type> >&); + + //- Construct from Istream + inline DynamicField(Istream&); + + //- Clone + tmp<DynamicField<Type> > clone() const; + + + // Member Functions + + //- Size of the underlying storage. + inline label capacity() const; + + //- Append an element at the end of the list + inline void append(const Type&); + + //- Alter the addressed list size. + // New space will be allocated if required. + // Use this to resize the list prior to using the operator[] for + // setting values (as per List usage). + void setSize(const label nElem); + + // Member operators + + inline void operator=(const DynamicField<Type>&); + inline void operator=(const UList<Type>&); + inline void operator=(const tmp<DynamicField<Type> >&); + + //- Return element of Field. + inline Type& operator[](const label i); + + //- Return element of constant Field. + inline const Type& operator[](const label) const; + + // IOstream operators + + friend Ostream& operator<< + #ifndef __CINT__ + <Type> + #endif + (Ostream&, const DynamicField<Type>&); + + friend Ostream& operator<< + #ifndef __CINT__ + <Type> + #endif + (Ostream&, const tmp<DynamicField<Type> >&); + + friend Istream& operator>> + #ifndef __CINT__ + <Type> + #endif + (Istream&, DynamicField<Type>&); +}; + +#include "CintUndefs.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "DynamicFieldI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "DynamicField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/Fields/DynamicField/DynamicFieldI.H b/src/OpenFOAM/fields/Fields/DynamicField/DynamicFieldI.H new file mode 100644 index 0000000000000000000000000000000000000000..8680fbff25a1a81c3562d44f3944cb3f429a95d0 --- /dev/null +++ b/src/OpenFOAM/fields/Fields/DynamicField/DynamicFieldI.H @@ -0,0 +1,221 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "DynamicField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Type> +DynamicField<Type>::DynamicField() +: + Field<Type>(), + capacity_(0) +{} + + +template<class Type> +DynamicField<Type>::DynamicField(const label size) +: + Field<Type>(size), + capacity_(Field<Type>::size()) +{ + Field<Type>::size(0); +} + + +template<class Type> +inline Foam::DynamicField<Type>::DynamicField +( + const UList<Type>& lst +) +: + Field<Type>(lst), + capacity_(Field<Type>::size()) +{} + + +template<class Type> +inline Foam::DynamicField<Type>::DynamicField +( + const Xfer<List<Type> >& lst +) +: + Field<Type>(lst), + capacity_(Field<Type>::size()) +{} + + +template<class Type> +DynamicField<Type>::DynamicField +( + const UList<Type>& mapF, + const labelList& mapAddressing +) +: + Field<Type>(mapF, mapAddressing), + capacity_(Field<Type>::size()) +{} + + +template<class Type> +DynamicField<Type>::DynamicField +( + const UList<Type>& mapF, + const labelListList& mapAddressing, + const scalarListList& weights +) +: + Field<Type>(mapF, mapAddressing, weights), + capacity_(Field<Type>::size()) +{} + + +//- Construct by mapping from the given field +template<class Type> +DynamicField<Type>::DynamicField +( + const UList<Type>& mapF, + const FieldMapper& map +) +: + DynamicField<Type>(mapF, map), + capacity_(Field<Type>::size()) +{} + + +template<class Type> +DynamicField<Type>::DynamicField(const DynamicField<Type>& f) +: + Field<Type>(f), + capacity_(Field<Type>::size()) +{} + + +template<class Type> +DynamicField<Type>::DynamicField(DynamicField<Type>& f, bool reUse) +: + Field<Type>(f, reUse), + capacity_(Field<Type>::size()) +{} + + +template<class Type> +DynamicField<Type>::DynamicField(const Xfer<DynamicField<Type> >& f) +: + Field<Type>(f), + capacity_(Field<Type>::size()) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +Foam::label DynamicField<Type>::capacity() const +{ + return capacity_; +} + + +template<class Type> +void DynamicField<Type>::append(const Type& t) +{ + label elemI = Field<Type>::size(); + setSize(elemI + 1); + + this->operator[](elemI) = t; +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +template<class Type> +void DynamicField<Type>::operator=(const DynamicField<Type>& rhs) +{ + if (this == &rhs) + { + FatalErrorIn("DynamicField<Type>::operator=(const DynamicField<Type>&)") + << "attempted assignment to self" + << abort(FatalError); + } + + Field<Type>::operator=(rhs); + capacity_ = Field<Type>::size(); +} + + +template<class Type> +void DynamicField<Type>::operator=(const UList<Type>& rhs) +{ + Field<Type>::operator=(rhs); + capacity_ = Field<Type>::size(); +} + + +template<class Type> +void DynamicField<Type>::operator=(const tmp<DynamicField>& rhs) +{ + if (this == &(rhs())) + { + FatalErrorIn("DynamicField<Type>::operator=(const tmp<DynamicField>&)") + << "attempted assignment to self" + << abort(FatalError); + } + + // This is dodgy stuff, don't try it at home. + DynamicField* fieldPtr = rhs.ptr(); + List<Type>::transfer(*fieldPtr); + delete fieldPtr; + capacity_ = Field<Type>::size(); +} + + +template<class Type> +Type& DynamicField<Type>::operator[](const label i) +{ + return Field<Type>::operator[](i); +} + + +template<class Type> +const Type& DynamicField<Type>::operator[](const label i) const +{ + return Field<Type>::operator[](i); +} + + +// * * * * * * * * * * * * * * * IOstream Operator * * * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index 4a45b56f4516358e835530e8d81ae4c60ac22f6f..df698693940e49279bbc3078941af1090a0c232c 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -526,10 +526,10 @@ Foam::argList::argList // Switch on signal trapping. We have to wait until after Pstream::init // since this sets up its own ones. - sigFpe_.set(); - sigInt_.set(); - sigQuit_.set(); - sigSegv_.set(); + sigFpe_.set(bannerEnabled); + sigInt_.set(bannerEnabled); + sigQuit_.set(bannerEnabled); + sigSegv_.set(bannerEnabled); if (Pstream::master() && bannerEnabled) { diff --git a/src/OpenFOAM/meshes/MeshObject/MeshObject.C b/src/OpenFOAM/meshes/MeshObject/MeshObject.C index 68f05c2f82b58136ab9ac14c8865287369cec943..8b7947525a67d3bada4e8cc56aebbd97260ca900 100644 --- a/src/OpenFOAM/meshes/MeshObject/MeshObject.C +++ b/src/OpenFOAM/meshes/MeshObject/MeshObject.C @@ -137,7 +137,7 @@ const Type& Foam::MeshObject<Mesh, Type>::New { if (!mesh.thisDb().objectRegistry::foundObject<Type>(Type::typeName)) { - return store(new Type(mesh, d3, d4)); + return store(new Type(mesh, d1, d2, d3, d4)); } else { diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H index 5f7ed0a2b269f283af2a0c5f9f1d624c2bb83d97..c74d82b182d556b080368ee1e920579041f1871b 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.H @@ -84,6 +84,9 @@ public: //- Start of procI+1 data inline const labelList& offsets() const; + //- my local size + inline label localSize() const; + //- Global sum of localSizes inline label size() const; diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H index b01ed6e8ba8240ffd7903f721c4102663baeb5dc..65f5d2d9d06f4c50e49a0232184f0dd1aedeca92 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H @@ -34,6 +34,17 @@ inline const Foam::labelList& Foam::globalIndex::offsets() const } +inline Foam::label Foam::globalIndex::localSize() const +{ + return + ( + Pstream::myProcNo() == 0 + ? offsets_[Pstream::myProcNo()] + : offsets_[Pstream::myProcNo()] - offsets_[Pstream::myProcNo()-1] + ); +} + + inline Foam::label Foam::globalIndex::size() const { return offsets_[Pstream::nProcs()-1]; diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C index 4bd093e6412905bda8b5402d828fbdd362777ab0..cc4278e22180486f75e545660af5b85ff5dd2ce8 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C @@ -273,6 +273,15 @@ Foam::mapDistribute::mapDistribute } +Foam::mapDistribute::mapDistribute(const mapDistribute& map) +: + constructSize_(map.constructSize_), + subMap_(map.subMap_), + constructMap_(map.constructMap_), + schedulePtr_() +{} + + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::mapDistribute::compact(const boolList& elemIsUsed) @@ -413,4 +422,24 @@ void Foam::mapDistribute::compact(const boolList& elemIsUsed) } +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +void Foam::mapDistribute::operator=(const mapDistribute& rhs) +{ + // Check for assignment to self + if (this == &rhs) + { + FatalErrorIn + ( + "Foam::mapDistribute::operator=(const Foam::mapDistribute&)" + ) << "Attempted assignment to self" + << abort(FatalError); + } + constructSize_ = rhs.constructSize_; + subMap_ = rhs.subMap_; + constructMap_ = rhs.constructMap_; + schedulePtr_.clear(); +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H index 3ccf81047697164d8cb2e7ed2a004a9feb8157f5..d2cfe64ca53c0dde02c3d424d5236b415728151d 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H @@ -81,16 +81,6 @@ class mapDistribute mutable autoPtr<List<labelPair> > schedulePtr_; - // Private Member Functions - - //- Disallow default bitwise copy construct - mapDistribute(const mapDistribute&); - - //- Disallow default bitwise assignment - void operator=(const mapDistribute&); - - - public: // Constructors @@ -120,6 +110,9 @@ public: const labelList& recvProcs ); + //- Construct copy + mapDistribute(const mapDistribute&); + // Member Functions @@ -262,6 +255,11 @@ public: "mapDistribute::updateMesh(const mapPolyMesh&)" ); } + + // Member Operators + + void operator=(const mapDistribute&); + }; diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelCompositionModels.C b/src/OpenFOAM/primitives/Lists/scalarIOList.C similarity index 81% rename from src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelCompositionModels.C rename to src/OpenFOAM/primitives/Lists/scalarIOList.C index 7010ab4f2cd60f267c18f9181262d873ce58453f..2d30cd4c25eeb989d22db756fad9496b7424e0b7 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelCompositionModels.C +++ b/src/OpenFOAM/primitives/Lists/scalarIOList.C @@ -22,27 +22,25 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -\*---------------------------------------------------------------------------*/ +Description + Declaration of scalar IOList containers -#include "basicReactingParcel.H" -#include "ReactingCloud.H" +\*---------------------------------------------------------------------------*/ -#include "SinglePhaseMixture.H" +#include "scalarIOList.H" +#include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeCompositionModel(ReactingCloud<basicReactingParcel>); - - // Add instances of composition model to the table - makeCompositionModelType + defineTemplateTypeNameAndDebugWithName(scalarIOList, "scalarList", 0); + defineTemplateTypeNameAndDebugWithName ( - SinglePhaseMixture, - ReactingCloud, - basicReactingParcel + scalarListIOList, + "scalarListList", + 0 ); -}; - +} // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/submodels/makeBasicThermoParcelDragModels.C b/src/OpenFOAM/primitives/Lists/scalarIOList.H similarity index 80% rename from src/lagrangian/intermediate/parcels/derived/basicThermoParcel/submodels/makeBasicThermoParcelDragModels.C rename to src/OpenFOAM/primitives/Lists/scalarIOList.H index aaeacca70c8c756689284602ed52ea9eb95e9598..5c91ea000f60061cfc289c0bc62713fcb0e7800d 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/submodels/makeBasicThermoParcelDragModels.C +++ b/src/OpenFOAM/primitives/Lists/scalarIOList.H @@ -22,23 +22,30 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Typedef + Foam::scalarIOList + +Description + Scalar container classes + \*---------------------------------------------------------------------------*/ -#include "basicThermoParcel.H" -#include "KinematicCloud.H" -#include "NoDrag.H" -#include "SphereDrag.H" +#ifndef scalarIOList_H +#define scalarIOList_H + +#include "scalarList.H" +#include "IOList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeDragModel(KinematicCloud<basicThermoParcel>); + typedef IOList<scalar> scalarIOList; + typedef IOList<scalarList> scalarListIOList; +} - // Add instances of drag model to the table - makeDragModelType(NoDrag, KinematicCloud, basicThermoParcel); - makeDragModelType(SphereDrag, KinematicCloud, basicThermoParcel); -}; +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#endif // ************************************************************************* // diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C index 5bb4a0ee2d03b8b5a24ec8bbdfb59b2a5ed2c153..3c2221f8d04f9e2289ac5d1e3029cd6cf4d09355 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C @@ -148,6 +148,7 @@ Foam::scalar Foam::autoHexMeshDriver::getMergeDistance(const scalar mergeTol) Foam::autoHexMeshDriver::autoHexMeshDriver ( fvMesh& mesh, + const bool overwrite, const dictionary& dict, const dictionary& decomposeDict ) @@ -292,6 +293,41 @@ Foam::autoHexMeshDriver::autoHexMeshDriver meshRefinement::checkCoupledFaceZones(mesh_); + // Refinement engine + // ~~~~~~~~~~~~~~~~~ + + { + Info<< nl + << "Determining initial surface intersections" << nl + << "-----------------------------------------" << nl + << endl; + + // Main refinement engine + meshRefinerPtr_.reset + ( + new meshRefinement + ( + mesh, + mergeDist_, // tolerance used in sorting coordinates + overwrite, + surfaces(), + shells() + ) + ); + Info<< "Calculated surface intersections in = " + << mesh_.time().cpuTimeIncrement() << " s" << endl; + + // Some stats + meshRefinerPtr_().printMeshInfo(debug_, "Initial mesh"); + + meshRefinerPtr_().write + ( + debug_&meshRefinement::OBJINTERSECTIONS, + mesh_.time().path()/meshRefinerPtr_().timeName() + ); + } + + // Add all the surface regions as patches // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -319,9 +355,8 @@ Foam::autoHexMeshDriver::autoHexMeshDriver forAll(regNames, i) { - label patchI = meshRefinement::addPatch + label patchI = meshRefinerPtr_().addMeshedPatch ( - mesh, regNames[i], wallPolyPatch::typeName ); @@ -404,40 +439,6 @@ Foam::autoHexMeshDriver::autoHexMeshDriver // Mesh distribution engine (uses tolerance to reconstruct meshes) distributorPtr_.reset(new fvMeshDistribute(mesh_, mergeDist_)); } - - - // Refinement engine - // ~~~~~~~~~~~~~~~~~ - - { - Info<< nl - << "Determining initial surface intersections" << nl - << "-----------------------------------------" << nl - << endl; - - // Main refinement engine - meshRefinerPtr_.reset - ( - new meshRefinement - ( - mesh, - mergeDist_, // tolerance used in sorting coordinates - surfaces(), - shells() - ) - ); - Info<< "Calculated surface intersections in = " - << mesh_.time().cpuTimeIncrement() << " s" << endl; - - // Some stats - meshRefinerPtr_().printMeshInfo(debug_, "Initial mesh"); - - meshRefinerPtr_().write - ( - debug_&meshRefinement::OBJINTERSECTIONS, - mesh_.time().path()/mesh_.time().timeName() - ); - } } @@ -448,7 +449,7 @@ void Foam::autoHexMeshDriver::writeMesh(const string& msg) const const meshRefinement& meshRefiner = meshRefinerPtr_(); meshRefiner.printMeshInfo(debug_, msg); - Info<< "Writing mesh to time " << mesh_.time().timeName() << endl; + Info<< "Writing mesh to time " << meshRefiner.timeName() << endl; meshRefiner.write(meshRefinement::MESH|meshRefinement::SCALARLEVELS, ""); if (debug_ & meshRefinement::OBJINTERSECTIONS) @@ -456,7 +457,7 @@ void Foam::autoHexMeshDriver::writeMesh(const string& msg) const meshRefiner.write ( meshRefinement::OBJINTERSECTIONS, - mesh_.time().path()/mesh_.time().timeName() + mesh_.time().path()/meshRefiner.timeName() ); } Info<< "Written mesh in = " @@ -522,11 +523,7 @@ void Foam::autoHexMeshDriver::doMesh() const dictionary& shrinkDict = dict_.subDict("shrinkDict"); PtrList<dictionary> surfaceDicts(dict_.lookup("surfaces")); - autoLayerDriver layerDriver - ( - meshRefinerPtr_(), - globalToPatch_ - ); + autoLayerDriver layerDriver(meshRefinerPtr_()); // Get all the layer specific params layerParameters layerParams diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.H b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.H index c0b7668d0ac6e68c56ab8a5a6546a61ce48b289d..02eba5afbe95025f2124860158b9f9f0196e68c7 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.H +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.H @@ -174,6 +174,7 @@ public: autoHexMeshDriver ( fvMesh& mesh, + const bool overwrite, const dictionary& meshDict, const dictionary& decomposeDict ); diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C index 01ab952c165a5997df49085828e556fb41d6d209..fea25e35eb8a6e64bfd01564cda14d42299d1403 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C @@ -75,7 +75,7 @@ Foam::label Foam::autoLayerDriver::mergePatchFacesUndo labelHashSet boundaryCells(mesh.nFaces()-mesh.nInternalFaces()); { - labelList patchIDs(meshRefinement::addedPatches(globalToPatch_)); + labelList patchIDs(meshRefiner_.meshedPatches()); const polyBoundaryMesh& patches = mesh.boundaryMesh(); @@ -159,12 +159,16 @@ Foam::label Foam::autoLayerDriver::mergePatchFacesUndo mesh.clearOut(); } + if (meshRefiner_.overwrite()) + { + mesh.setInstance(meshRefiner_.oldInstance()); + } + faceCombiner.updateMesh(map); meshRefiner_.updateMesh(map, labelList(0)); - for (label iteration = 0; iteration < 100; iteration++) { Info<< nl @@ -313,6 +317,11 @@ Foam::label Foam::autoLayerDriver::mergePatchFacesUndo mesh.clearOut(); } + if (meshRefiner_.overwrite()) + { + mesh.setInstance(meshRefiner_.oldInstance()); + } + faceCombiner.updateMesh(map); // Renumber restore maps @@ -336,7 +345,7 @@ Foam::label Foam::autoLayerDriver::mergePatchFacesUndo if (debug) { Pout<< "Writing merged-faces mesh to time " - << mesh.time().timeName() << nl << endl; + << meshRefiner_.timeName() << nl << endl; mesh.write(); } } @@ -380,6 +389,11 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::autoLayerDriver::doRemovePoints mesh.clearOut(); } + if (meshRefiner_.overwrite()) + { + mesh.setInstance(meshRefiner_.oldInstance()); + } + pointRemover.updateMesh(map); meshRefiner_.updateMesh(map, labelList(0)); @@ -433,6 +447,11 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::autoLayerDriver::doRestorePoints mesh.clearOut(); } + if (meshRefiner_.overwrite()) + { + mesh.setInstance(meshRefiner_.oldInstance()); + } + pointRemover.updateMesh(map); meshRefiner_.updateMesh(map, labelList(0)); @@ -656,7 +675,7 @@ Foam::label Foam::autoLayerDriver::mergeEdgesUndo if (debug) { Pout<< "Writing merged-edges mesh to time " - << mesh.time().timeName() << nl << endl; + << meshRefiner_.timeName() << nl << endl; mesh.write(); } } @@ -2446,14 +2465,9 @@ void Foam::autoLayerDriver::getLayerCellsFaces // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::autoLayerDriver::autoLayerDriver -( - meshRefinement& meshRefiner, - const labelList& globalToPatch -) +Foam::autoLayerDriver::autoLayerDriver(meshRefinement& meshRefiner) : - meshRefiner_(meshRefiner), - globalToPatch_(globalToPatch) + meshRefiner_(meshRefiner) {} @@ -2729,7 +2743,7 @@ void Foam::autoLayerDriver::addLayers IOobject ( "pointMedialDist", - mesh.time().timeName(), + meshRefiner_.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE, @@ -2744,7 +2758,7 @@ void Foam::autoLayerDriver::addLayers IOobject ( "dispVec", - mesh.time().timeName(), + meshRefiner_.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE, @@ -2759,7 +2773,7 @@ void Foam::autoLayerDriver::addLayers IOobject ( "medialRatio", - mesh.time().timeName(), + meshRefiner_.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE, @@ -2911,7 +2925,7 @@ void Foam::autoLayerDriver::addLayers ); const_cast<Time&>(mesh.time())++; - Info<< "Writing shrunk mesh to " << mesh.time().timeName() << endl; + Info<< "Writing shrunk mesh to " << meshRefiner_.timeName() << endl; // See comment in autoSnapDriver why we should not remove meshPhi // using mesh.clearPout(). @@ -3012,6 +3026,11 @@ void Foam::autoLayerDriver::addLayers //?neccesary? Update fields newMesh.updateMesh(map); + if (meshRefiner_.overwrite()) + { + newMesh.setInstance(meshRefiner_.oldInstance()); + } + // Update numbering on addLayer: // - cell/point labels to be newMesh. // - patchFaces to remain in oldMesh order. @@ -3034,7 +3053,7 @@ void Foam::autoLayerDriver::addLayers if (debug) { - Info<< "Writing layer mesh to " << mesh.time().timeName() << endl; + Info<< "Writing layer mesh to " << meshRefiner_.timeName() << endl; newMesh.write(); cellSet addedCellSet ( @@ -3113,6 +3132,11 @@ void Foam::autoLayerDriver::addLayers mesh.clearOut(); } + if (meshRefiner_.overwrite()) + { + mesh.setInstance(meshRefiner_.oldInstance()); + } + meshRefiner_.updateMesh(map, labelList(0)); @@ -3181,8 +3205,6 @@ void Foam::autoLayerDriver::doLayers << "----------------------------------" << nl << endl; - const_cast<Time&>(mesh.time())++; - Info<< "Using mesh parameters " << motionDict << nl << endl; // Merge coplanar boundary faces diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H index 164fd88ce04e5b06c33ef1c48d8745ea34a8dcc0..12569570069144b603074002ea3ad7af8c3bb91f 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H @@ -101,9 +101,6 @@ class autoLayerDriver //- Mesh+surface meshRefinement& meshRefiner_; - //- From surface region to patch - const labelList globalToPatch_; - // Private Member Functions @@ -509,11 +506,7 @@ public: // Constructors //- Construct from components - autoLayerDriver - ( - meshRefinement& meshRefiner, - const labelList& globalToPatch - ); + autoLayerDriver(meshRefinement& meshRefiner); // Member Functions diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C index 9c4e0a17c521b8e06b4b2ecceb18ed80bb917d06..0ac24a5574aad7e415a2bf4dbc489bb310d4e728 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C @@ -344,8 +344,8 @@ void Foam::autoRefineDriver::removeInsideCells if (debug) { Pout<< "Writing subsetted mesh to time " - << mesh.time().timeName() << '.' << endl; - meshRefiner_.write(debug, mesh.time().path()/mesh.time().timeName()); + << meshRefiner_.timeName() << '.' << endl; + meshRefiner_.write(debug, mesh.time().path()/meshRefiner_.timeName()); Pout<< "Dumped mesh in = " << mesh.time().cpuTimeIncrement() << " s\n" << nl << endl; } @@ -561,11 +561,11 @@ void Foam::autoRefineDriver::zonify if (debug) { Pout<< "Writing zoned mesh to time " - << mesh.time().timeName() << '.' << endl; + << meshRefiner_.timeName() << '.' << endl; meshRefiner_.write ( debug, - mesh.time().path()/mesh.time().timeName() + mesh.time().path()/meshRefiner_.timeName() ); } @@ -653,8 +653,8 @@ void Foam::autoRefineDriver::splitAndMergeBaffles if (debug) { Pout<< "Writing handleProblemCells mesh to time " - << mesh.time().timeName() << '.' << endl; - meshRefiner_.write(debug, mesh.time().path()/mesh.time().timeName()); + << meshRefiner_.timeName() << '.' << endl; + meshRefiner_.write(debug, mesh.time().path()/meshRefiner_.timeName()); } } @@ -680,7 +680,7 @@ void Foam::autoRefineDriver::mergePatchFaces ( Foam::cos(45*mathematicalConstant::pi/180.0), Foam::cos(45*mathematicalConstant::pi/180.0), - meshRefinement::addedPatches(globalToPatch_) + meshRefiner_.meshedPatches() ); if (debug) @@ -712,9 +712,6 @@ void Foam::autoRefineDriver::doRefine const fvMesh& mesh = meshRefiner_.mesh(); - const_cast<Time&>(mesh.time())++; - - // Check that all the keep points are inside the mesh. refineParams.findCells(mesh); diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C index 011417c29ecd92107e34ff596c9ba506a60cb50a..41475a321af054c67f083d2ebc9fadfb8c0d5d22 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C @@ -557,7 +557,7 @@ Foam::tmp<Foam::scalarField> Foam::autoSnapDriver::edgePatchDist // IOobject // ( // "pointDist", - // mesh.DB().timeName(), + // meshRefiner_.timeName(), // mesh.DB(), // IOobject::NO_READ, // IOobject::AUTO_WRITE @@ -580,7 +580,7 @@ Foam::tmp<Foam::scalarField> Foam::autoSnapDriver::edgePatchDist // pointDist[pointI] /= mesh.pointEdges()[pointI].size(); // } // Info<< "Writing patch distance to " << pointDist.name() - // << " at time " << mesh.DB().timeName() << endl; + // << " at time " << meshRefiner_.timeName() << endl; // // pointDist.write(); //} @@ -750,7 +750,7 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::autoSnapDriver::createZoneBaffles { const_cast<Time&>(mesh.time())++; Pout<< "Writing baffled mesh to time " - << mesh.time().timeName() << endl; + << meshRefiner_.timeName() << endl; mesh.write(); } } @@ -830,35 +830,6 @@ Foam::scalarField Foam::autoSnapDriver::calcSnapDistance } -//// Invert globalToPatch_ to get the patches related to surfaces. -//Foam::labelList Foam::autoSnapDriver::getSurfacePatches() const -//{ -// // Set of patches originating from surface -// labelHashSet surfacePatchSet(globalToPatch_.size()); -// -// forAll(globalToPatch_, i) -// { -// if (globalToPatch_[i] != -1) -// { -// surfacePatchSet.insert(globalToPatch_[i]); -// } -// } -// -// const fvMesh& mesh = meshRefiner_.mesh(); -// -// DynamicList<label> surfacePatches(surfacePatchSet.size()); -// -// for (label patchI = 0; patchI < mesh.boundaryMesh().size(); patchI++) -// { -// if (surfacePatchSet.found(patchI)) -// { -// surfacePatches.append(patchI); -// } -// } -// return surfacePatches.shrink(); -//} - - void Foam::autoSnapDriver::preSmoothPatch ( const snapParameters& snapParams, @@ -928,7 +899,7 @@ void Foam::autoSnapDriver::preSmoothPatch if (debug) { const_cast<Time&>(mesh.time())++; - Pout<< "Writing patch smoothed mesh to time " << mesh.time().timeName() + Pout<< "Writing patch smoothed mesh to time " << meshRefiner_.timeName() << endl; mesh.write(); @@ -1222,7 +1193,7 @@ void Foam::autoSnapDriver::smoothDisplacement if (debug) { const_cast<Time&>(mesh.time())++; - Pout<< "Writing smoothed mesh to time " << mesh.time().timeName() + Pout<< "Writing smoothed mesh to time " << meshRefiner_.timeName() << endl; // Moving mesh creates meshPhi. Can be cleared out by a mesh.clearOut @@ -1284,7 +1255,7 @@ void Foam::autoSnapDriver::scaleMesh if (debug) { const_cast<Time&>(mesh.time())++; - Pout<< "Writing scaled mesh to time " << mesh.time().timeName() + Pout<< "Writing scaled mesh to time " << meshRefiner_.timeName() << endl; mesh.write(); @@ -1476,10 +1447,8 @@ void Foam::autoSnapDriver::doSnap << "--------------" << nl << endl; - const_cast<Time&>(mesh.time())++; - // Get the labels of added patches. - labelList adaptPatchIDs(meshRefinement::addedPatches(globalToPatch_)); + labelList adaptPatchIDs(meshRefiner_.meshedPatches()); // Create baffles (pairs of faces that share the same points) // Baffles stored as owner and neighbour face that have been created. diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H index 5d9b2bc357d0e2dff037bcfccc9d27ae08613114..cdf8673d75d425d82c0633b0a93364c731e42429 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H @@ -170,9 +170,6 @@ public: const indirectPrimitivePatch& ) const; - ////- Get patches generated for surfaces. - //labelList getSurfacePatches() const; - //- Smooth the mesh (patch and internal) to increase visibility // of surface points (on castellated mesh) w.r.t. surface. void preSmoothPatch diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C index 6a021f9e8a75d0628a811eefa3623f8c77c8b767..7e90beae6f6699b8231773e40e3c76f2f9a06f5d 100644 --- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C +++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C @@ -84,12 +84,15 @@ void Foam::meshRefinement::calcNeighbourData const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + labelHashSet addedPatchIDSet(meshedPatches()); + forAll(patches, patchI) { const polyPatch& pp = patches[patchI]; const unallocLabelList& faceCells = pp.faceCells(); const vectorField::subField faceCentres = pp.faceCentres(); + const vectorField::subField faceAreas = pp.faceAreas(); label bFaceI = pp.start()-mesh_.nInternalFaces(); @@ -102,6 +105,36 @@ void Foam::meshRefinement::calcNeighbourData bFaceI++; } } + else if (addedPatchIDSet.found(patchI)) + { + // Face was introduced from cell-cell intersection. Try to + // reconstruct other side cell(centre). Three possibilities: + // - cells same size. + // - preserved cell smaller. Not handled. + // - preserved cell larger. + forAll(faceCells, i) + { + // Extrapolate the face centre. + vector fn = faceAreas[i]; + fn /= mag(fn)+VSMALL; + + label own = faceCells[i]; + label ownLevel = cellLevel[own]; + label faceLevel = meshCutter_.getAnchorLevel(pp.start()+i); + + // Normal distance from face centre to cell centre + scalar d = ((faceCentres[i] - cellCentres[own]) & fn); + if (faceLevel > ownLevel) + { + // Other cell more refined. Adjust normal distance + d *= 0.5; + } + neiLevel[bFaceI] = cellLevel[ownLevel]; + // Calculate other cell centre by extrapolation + neiCc[bFaceI] = faceCentres[i] + d*fn; + bFaceI++; + } + } else { forAll(faceCells, i) @@ -432,6 +465,11 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::doRemoveCells mesh_.clearOut(); } + if (overwrite_) + { + mesh_.setInstance(oldInstance_); + } + // Update local mesh data cellRemover.updateMesh(map); @@ -784,12 +822,15 @@ Foam::meshRefinement::meshRefinement ( fvMesh& mesh, const scalar mergeDistance, + const bool overwrite, const refinementSurfaces& surfaces, const shellSurfaces& shells ) : mesh_(mesh), mergeDistance_(mergeDistance), + overwrite_(overwrite), + oldInstance_(mesh.pointsInstance()), surfaces_(surfaces), shells_(shells), meshCutter_ @@ -1166,8 +1207,6 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::meshRefinement::balance // Helper function to get intersected faces Foam::labelList Foam::meshRefinement::intersectedFaces() const { - // Mark all faces that will become baffles - label nBoundaryFaces = 0; forAll(surfaceIndex_, faceI) @@ -1193,10 +1232,7 @@ Foam::labelList Foam::meshRefinement::intersectedFaces() const // Helper function to get points used by faces -Foam::labelList Foam::meshRefinement::intersectedPoints -( -// const labelList& globalToPatch -) const +Foam::labelList Foam::meshRefinement::intersectedPoints() const { const faceList& faces = mesh_.faces(); @@ -1221,9 +1257,10 @@ Foam::labelList Foam::meshRefinement::intersectedPoints } //// Insert all meshed patches. - //forAll(globalToPatch, i) + //labelList adaptPatchIDs(meshedPatches()); + //forAll(adaptPatchIDs, i) //{ - // label patchI = globalToPatch[i]; + // label patchI = adaptPatchIDs[i]; // // if (patchI != -1) // { @@ -1262,27 +1299,6 @@ Foam::labelList Foam::meshRefinement::intersectedPoints } -Foam::labelList Foam::meshRefinement::addedPatches -( - const labelList& globalToPatch -) -{ - labelList patchIDs(globalToPatch.size()); - label addedI = 0; - - forAll(globalToPatch, i) - { - if (globalToPatch[i] != -1) - { - patchIDs[addedI++] = globalToPatch[i]; - } - } - patchIDs.setSize(addedI); - - return patchIDs; -} - - //- Create patch from set of patches Foam::autoPtr<Foam::indirectPrimitivePatch> Foam::meshRefinement::makePatch ( @@ -1372,7 +1388,7 @@ Foam::tmp<Foam::pointVectorField> Foam::meshRefinement::makeDisplacementField IOobject ( "pointDisplacement", - mesh.time().timeName(), + mesh.time().timeName(), //timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE @@ -1653,6 +1669,53 @@ Foam::label Foam::meshRefinement::addPatch } +Foam::label Foam::meshRefinement::addMeshedPatch +( + const word& name, + const word& type +) +{ + label meshedI = findIndex(meshedPatches_, name); + + if (meshedI != -1) + { + // Already there. Get corresponding polypatch + return mesh_.boundaryMesh().findPatchID(name); + } + else + { + // Add patch + label patchI = addPatch(mesh_, name, type); + + // Store + label sz = meshedPatches_.size(); + meshedPatches_.setSize(sz+1); + meshedPatches_[sz] = name; + + return patchI; + } +} + + +Foam::labelList Foam::meshRefinement::meshedPatches() const +{ + labelList patchIDs(meshedPatches_.size()); + forAll(meshedPatches_, i) + { + patchIDs[i] = mesh_.boundaryMesh().findPatchID(meshedPatches_[i]); + + if (patchIDs[i] == -1) + { + FatalErrorIn("meshRefinement::meshedPatches() const") + << "Problem : did not find patch " << meshedPatches_[i] + << abort(FatalError); + } + } + + return patchIDs; +} + + Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMeshRegions ( const point& keepPoint @@ -2000,6 +2063,20 @@ void Foam::meshRefinement::printMeshInfo(const bool debug, const string& msg) } +//- Return either time().constant() or oldInstance +Foam::word Foam::meshRefinement::timeName() const +{ + if (overwrite_ && mesh_.time().timeIndex() == 0) + { + return oldInstance_; + } + else + { + return mesh_.time().timeName(); + } +} + + void Foam::meshRefinement::dumpRefinementLevel() const { volScalarField volRefLevel @@ -2007,7 +2084,7 @@ void Foam::meshRefinement::dumpRefinementLevel() const IOobject ( "cellLevel", - mesh_.time().timeName(), + timeName(), mesh_, IOobject::NO_READ, IOobject::AUTO_WRITE, @@ -2034,7 +2111,7 @@ void Foam::meshRefinement::dumpRefinementLevel() const IOobject ( "pointLevel", - mesh_.time().timeName(), + timeName(), mesh_, IOobject::NO_READ, IOobject::NO_WRITE, diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.H b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.H index 06004c8a6e00bc12c093cb36afb2782638b4b2d3..93ce3ceeb8fb3043d0b8435ef22209d6ee073711 100644 --- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.H +++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.H @@ -110,6 +110,12 @@ private: //- tolerance used for sorting coordinates (used in 'less' routine) const scalar mergeDistance_; + //- overwrite the mesh? + const bool overwrite_; + + //- Instance of mesh upon construction. Used when in overwrite_ mode. + const word oldInstance_; + //- All surface-intersection interaction const refinementSurfaces& surfaces_; @@ -125,6 +131,10 @@ private: //- user supplied face based data. List<Tuple2<mapType, labelList> > userFaceData_; + //- Meshed patches - are treated differently. Stored as wordList since + // order changes. + wordList meshedPatches_; + // Private Member Functions @@ -163,9 +173,6 @@ private: //- Find any intersection of surface. Store in surfaceIndex_. void updateIntersections(const labelList& changedFaces); - //- Set instance of all local IOobjects - void setInstance(const fileName&); - //- Remove cells. Put exposedFaces into exposedPatchIDs. autoPtr<mapPolyMesh> doRemoveCells ( @@ -400,12 +407,11 @@ private: const labelList& globalToPatch ) const; - //- Initial test of marking faces using geometric information. - labelList markFacesOnProblemCellsGeometric - ( - const dictionary& motionDict, - const labelList& globalToPatch - ) const; + ////- Initial test of marking faces using geometric information. + //labelList markFacesOnProblemCellsGeometric + //( + // const dictionary& motionDict + //) const; // Baffle merging @@ -475,6 +481,7 @@ public: ( fvMesh& mesh, const scalar mergeDistance, + const bool overwrite, const refinementSurfaces&, const shellSurfaces& ); @@ -499,6 +506,18 @@ public: return mergeDistance_; } + //- Overwrite the mesh? + bool overwrite() const + { + return overwrite_; + } + + //- (points)instance of mesh upon construction + const word& oldInstance() const + { + return oldInstance_; + } + //- reference to surface search engines const refinementSurfaces& surfaces() const { @@ -578,9 +597,6 @@ public: //- Get points on surfaces with intersection and boundary faces. labelList intersectedPoints() const; - //- Get added patches (inverse of globalToPatch) - static labelList addedPatches(const labelList& globalToPatch); - //- Create patch from set of patches static autoPtr<indirectPrimitivePatch> makePatch ( @@ -688,9 +704,16 @@ public: // Other topo changes - //- Helper function to add patch to mesh + //- Helper:add patch to mesh. Update all registered fields. + // Use addMeshedPatch to add patches originating from surfaces. static label addPatch(fvMesh&, const word& name, const word& type); + //- Add patch originating from meshing. Update meshedPatches_. + label addMeshedPatch(const word& name, const word& type); + + //- Get patchIDs for patches added in addMeshedPatch. + labelList meshedPatches() const; + //- Split mesh. Keep part containing point. autoPtr<mapPolyMesh> splitMeshRegions(const point& keepPoint); @@ -699,7 +722,11 @@ public: //- Update for external change to mesh. changedFaces are in new mesh // face labels. - void updateMesh(const mapPolyMesh&, const labelList& changedFaces); + void updateMesh + ( + const mapPolyMesh&, + const labelList& changedFaces + ); // Restoring : is where other processes delete and reinsert data. @@ -757,6 +784,13 @@ public: //- Print some mesh stats. void printMeshInfo(const bool, const string&) const; + //- Replacement for Time::timeName() : return oldInstance (if + // overwrite_) + word timeName() const; + + //- Set instance of all local IOobjects + void setInstance(const fileName&); + //- Write mesh and all data bool write() const; diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C index 3904f960737a3e9a84b8e4366ca71b49bfa31f4c..baa2e5d463b10845b076713ce6112b99634dd4e1 100644 --- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C +++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C @@ -226,7 +226,13 @@ void Foam::meshRefinement::getBafflePatches label vertI = 0; if (debug&OBJINTERSECTIONS) { - str.reset(new OFstream(mesh_.time().timePath()/"intersections.obj")); + str.reset + ( + new OFstream + ( + mesh_.time().path()/timeName()/"intersections.obj" + ) + ); Pout<< "getBafflePatches : Writing surface intersections to file " << str().name() << nl << endl; @@ -461,6 +467,11 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles mesh_.clearOut(); } + if (overwrite()) + { + mesh_.setInstance(oldInstance()); + } + //- Redo the intersections on the newly create baffle faces. Note that // this changes also the cell centre positions. faceSet baffledFacesSet(mesh_, "baffledFacesSet", 2*nBaffles); @@ -820,6 +831,11 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::mergeBaffles mesh_.clearOut(); } + if (overwrite()) + { + mesh_.setInstance(oldInstance()); + } + // Update intersections. Recalculate intersections on merged faces since // this seems to give problems? Note: should not be nessecary since // baffles preserve intersections from when they were created. @@ -1482,7 +1498,7 @@ void Foam::meshRefinement::baffleAndSplitMesh if (debug) { - Pout<< "Writing baffled mesh to time " << mesh_.time().timeName() + Pout<< "Writing baffled mesh to time " << timeName() << endl; write(debug, runTime.path()/"baffles"); Pout<< "Dumped debug data in = " @@ -1511,11 +1527,7 @@ void Foam::meshRefinement::baffleAndSplitMesh perpendicularAngle, globalToPatch ) - //markFacesOnProblemCellsGeometric - //( - // motionDict, - // globalToPatch - //) + //markFacesOnProblemCellsGeometric(motionDict) ); Info<< "Analyzed problem cells in = " << runTime.cpuTimeIncrement() << " s\n" << nl << endl; @@ -1569,7 +1581,7 @@ void Foam::meshRefinement::baffleAndSplitMesh if (debug) { Pout<< "Writing extra baffled mesh to time " - << mesh_.time().timeName() << endl; + << timeName() << endl; write(debug, runTime.path()/"extraBaffles"); Pout<< "Dumped debug data in = " << runTime.cpuTimeIncrement() << " s\n" << nl << endl; @@ -1604,9 +1616,9 @@ void Foam::meshRefinement::baffleAndSplitMesh if (debug) { - Pout<< "Writing subsetted mesh to time " << mesh_.time().timeName() + Pout<< "Writing subsetted mesh to time " << timeName() << endl; - write(debug, runTime.timePath()); + write(debug, runTime.path()/timeName()); Pout<< "Dumped debug data in = " << runTime.cpuTimeIncrement() << " s\n" << nl << endl; } @@ -1665,7 +1677,7 @@ void Foam::meshRefinement::baffleAndSplitMesh // Split off (with optional buffer layers) unreachable areas of mesh. -Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh +Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh ( const label nBufferLayers, const labelList& globalToPatch, @@ -1998,6 +2010,11 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::dupNonManifoldPoints() mesh_.clearOut(); } + if (overwrite()) + { + mesh_.setInstance(oldInstance()); + } + // Update intersections. Is mapping only (no faces created, positions stay // same) so no need to recalculate intersections. updateMesh(map, labelList(0)); @@ -2429,6 +2446,11 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify mesh_.clearOut(); } + if (overwrite()) + { + mesh_.setInstance(oldInstance()); + } + // None of the faces has changed, only the zones. Still... updateMesh(map, labelList()); diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementMerge.C b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementMerge.C index 7ad77e83bf2bc300fdec8492065239fec6141d9f..b1461cea77c00c17589eeb11153ebf2d415499bd 100644 --- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementMerge.C +++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementMerge.C @@ -29,10 +29,6 @@ License #include "polyTopoChange.H" #include "removePoints.H" - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // Merge faces that are in-line. @@ -108,6 +104,11 @@ Foam::label Foam::meshRefinement::mergePatchFaces mesh_.clearOut(); } + if (overwrite()) + { + mesh_.setInstance(oldInstance()); + } + faceCombiner.updateMesh(map); // Get the kept faces that need to be recalculated. @@ -203,6 +204,11 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::mergeEdges mesh_.clearOut(); } + if (overwrite()) + { + mesh_.setInstance(oldInstance()); + } + pointRemover.updateMesh(map); // Get the kept faces that need to be recalculated. diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementProblemCells.C b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementProblemCells.C index ea1e8a083cd24cac69c384129668cf6fecb1a7cf..fb0a7e2121f020576494e848ad8b6116f71fbcdd 100644 --- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementProblemCells.C +++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementProblemCells.C @@ -136,15 +136,13 @@ Foam::Map<Foam::label> Foam::meshRefinement::findEdgeConnectedProblemCells const labelList& globalToPatch ) const { - labelList adaptPatchIDs(meshRefinement::addedPatches(globalToPatch)); - - // Construct addressing engine. + // Construct addressing engine from all patches added for meshing. autoPtr<indirectPrimitivePatch> ppPtr ( meshRefinement::makePatch ( mesh_, - adaptPatchIDs + meshedPatches() ) ); const indirectPrimitivePatch& pp = ppPtr(); @@ -386,11 +384,6 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells const labelList& pointLevel = meshCutter_.pointLevel(); const polyBoundaryMesh& patches = mesh_.boundaryMesh(); - // Swap neighbouring cell centres and cell level - labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces()); - pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces()); - calcNeighbourData(neiLevel, neiCc); - // Per internal face (boundary faces not used) the patch that the // baffle should get (or -1) labelList facePatch(mesh_.nFaces(), -1); @@ -403,7 +396,7 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells // Fill boundary data. All elements on meshed patches get marked. // Get the labels of added patches. - labelList adaptPatchIDs(meshRefinement::addedPatches(globalToPatch)); + labelList adaptPatchIDs(meshedPatches()); forAll(adaptPatchIDs, i) { @@ -427,6 +420,12 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells } } + // Swap neighbouring cell centres and cell level + labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces()); + pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces()); + calcNeighbourData(neiLevel, neiCc); + + // Count of faces marked for baffling label nBaffleFaces = 0; @@ -961,20 +960,16 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells //// test to find nearest surface and checks which faces would get squashed. //Foam::labelList Foam::meshRefinement::markFacesOnProblemCellsGeometric //( -// const dictionary& motionDict, -// const labelList& globalToPatch +// const dictionary& motionDict //) const //{ -// // Get the labels of added patches. -// labelList adaptPatchIDs(meshRefinement::addedPatches(globalToPatch)); -// // // Construct addressing engine. // autoPtr<indirectPrimitivePatch> ppPtr // ( // meshRefinement::makePatch // ( // mesh_, -// adaptPatchIDs +// meshedPatches() // ) // ); // const indirectPrimitivePatch& pp = ppPtr(); diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C index 7aabbc6321cf9132e9e5c271d46e15abd7e00673..e35607a5980172c0d90377eae1f38efeeca6614f 100644 --- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C +++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C @@ -1232,6 +1232,11 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::refine mesh_.clearOut(); } + if (overwrite()) + { + mesh_.setInstance(oldInstance()); + } + // Update intersection info updateMesh(map, getChangedFaces(map, cellsToRefine)); @@ -1256,12 +1261,12 @@ Foam::meshRefinement::refineAndBalance if (debug) { Pout<< "Writing refined but unbalanced " << msg - << " mesh to time " << mesh_.time().timeName() << endl; + << " mesh to time " << timeName() << endl; write ( debug, mesh_.time().path() - /mesh_.time().timeName() + /timeName() ); Pout<< "Dumped debug data in = " << mesh_.time().cpuTimeIncrement() << " s" << endl; @@ -1299,12 +1304,11 @@ Foam::meshRefinement::refineAndBalance if (debug) { Pout<< "Writing balanced " << msg - << " mesh to time " << mesh_.time().timeName() << endl; + << " mesh to time " << timeName() << endl; write ( debug, - mesh_.time().path() - /mesh_.time().timeName() + mesh_.time().path()/timeName() ); Pout<< "Dumped debug data in = " << mesh_.time().cpuTimeIncrement() << " s" << endl; diff --git a/src/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C b/src/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C index 4f847636b59daa3216e056da4a544b4501df55b3..761ca5b44718a454bef04a01da36cf1376c43283 100644 --- a/src/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C +++ b/src/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C @@ -115,6 +115,28 @@ bool Foam::trackedParticle::move(trackedParticle::trackData& td) } +bool Foam::trackedParticle::hitPatch +( + const polyPatch&, + trackedParticle::trackData& td, + const label patchI +) +{ + return false; +} + + +bool Foam::trackedParticle::hitPatch +( + const polyPatch&, + int&, + const label +) +{ + return false; +} + + void Foam::trackedParticle::hitWedgePatch ( const wedgePolyPatch&, diff --git a/src/autoMesh/autoHexMesh/trackedParticle/trackedParticle.H b/src/autoMesh/autoHexMesh/trackedParticle/trackedParticle.H index ab7ab06d20c9a513e481e3e89b645c898e11992a..3e2d12a1d2f16b84b3881883a7813d40a9026ec6 100644 --- a/src/autoMesh/autoHexMesh/trackedParticle/trackedParticle.H +++ b/src/autoMesh/autoHexMesh/trackedParticle/trackedParticle.H @@ -169,6 +169,21 @@ public: bool move(trackData&); + //- Overridable function to handle the particle hitting a patch + // Executed before other patch-hitting functions + bool hitPatch + ( + const polyPatch&, + trackedParticle::trackData& td, + const label patchI + ); + bool hitPatch + ( + const polyPatch&, + int&, + const label patchI + ); + //- Overridable function to handle the particle hitting a wedge void hitWedgePatch ( diff --git a/src/decompositionMethods/decompositionMethods/scotchDecomp/scotchDecomp.C b/src/decompositionMethods/decompositionMethods/scotchDecomp/scotchDecomp.C index a33e49b82889148fb6d3db92ff7d51dd3d2bc80e..994a82419285a24da2695f3e3850ee4580d1f8ac 100644 --- a/src/decompositionMethods/decompositionMethods/scotchDecomp/scotchDecomp.C +++ b/src/decompositionMethods/decompositionMethods/scotchDecomp/scotchDecomp.C @@ -75,6 +75,24 @@ extern "C" } +// Hack: scotch generates floating point errors so need to switch of error +// trapping! +#if defined(linux) || defined(linuxAMD64) || defined(linuxIA64) +# define LINUX +#endif + +#if defined(LINUX) && defined(__GNUC__) +# define LINUX_GNUC +#endif + +#ifdef LINUX_GNUC +# ifndef __USE_GNU +# define __USE_GNU +# endif +# include <fenv.h> +#endif + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -113,13 +131,30 @@ Foam::label Foam::scotchDecomp::decompose { // Strategy // ~~~~~~~~ + // Default. SCOTCH_Strat stradat; check(SCOTCH_stratInit(&stradat), "SCOTCH_stratInit"); - //SCOTCH_stratGraphMap(&stradat, &argv[i][2]); - //fprintf(stdout, "S\tStrat="); - //SCOTCH_stratSave(&stradat, stdout); - //fprintf(stdout, "\n"); + + if (decompositionDict_.found("scotchCoeffs")) + { + const dictionary& scotchCoeffs = + decompositionDict_.subDict("scotchCoeffs"); + + + string strategy; + if (scotchCoeffs.readIfPresent("strategy", strategy)) + { + if (debug) + { + Info<< "scotchDecomp : Using strategy " << strategy << endl; + } + SCOTCH_stratGraphMap(&stradat, strategy.c_str()); + //fprintf(stdout, "S\tStrat="); + //SCOTCH_stratSave(&stradat, stdout); + //fprintf(stdout, "\n"); + } + } // Graph @@ -153,37 +188,40 @@ Foam::label Foam::scotchDecomp::decompose const dictionary& scotchCoeffs = decompositionDict_.subDict("scotchCoeffs"); - Switch writeGraph(scotchCoeffs.lookup("writeGraph")); - - if (writeGraph) + if (scotchCoeffs.found("writeGraph")) { - OFstream str(mesh_.time().path() / mesh_.name() + ".grf"); - - Info<< "Dumping Scotch graph file to " << str.name() << endl - << "Use this in combination with gpart." << endl; - - label version = 0; - str << version << nl; - // Numer of vertices - str << xadj.size()-1 << ' ' << adjncy.size() << nl; - // Numbering starts from 0 - label baseval = 0; - // Has weights? - label hasEdgeWeights = 0; - label hasVertexWeights = 0; - label numericflag = 10*hasEdgeWeights+hasVertexWeights; - str << baseval << ' ' << numericflag << nl; - for (label cellI = 0; cellI < xadj.size()-1; cellI++) - { - label start = xadj[cellI]; - label end = xadj[cellI+1]; - str << end-start; + Switch writeGraph(scotchCoeffs.lookup("writeGraph")); - for (label i = start; i < end; i++) + if (writeGraph) + { + OFstream str(mesh_.time().path() / mesh_.name() + ".grf"); + + Info<< "Dumping Scotch graph file to " << str.name() << endl + << "Use this in combination with gpart." << endl; + + label version = 0; + str << version << nl; + // Numer of vertices + str << xadj.size()-1 << ' ' << adjncy.size() << nl; + // Numbering starts from 0 + label baseval = 0; + // Has weights? + label hasEdgeWeights = 0; + label hasVertexWeights = 0; + label numericflag = 10*hasEdgeWeights+hasVertexWeights; + str << baseval << ' ' << numericflag << nl; + for (label cellI = 0; cellI < xadj.size()-1; cellI++) { - str << ' ' << adjncy[i]; + label start = xadj[cellI]; + label end = xadj[cellI+1]; + str << end-start; + + for (label i = start; i < end; i++) + { + str << ' ' << adjncy[i]; + } + str << nl; } - str << nl; } } } @@ -195,12 +233,36 @@ Foam::label Foam::scotchDecomp::decompose SCOTCH_Arch archdat; check(SCOTCH_archInit(&archdat), "SCOTCH_archInit"); - check - ( - // SCOTCH_archCmpltw for weighted. - SCOTCH_archCmplt(&archdat, nProcessors_), - "SCOTCH_archCmplt" - ); + + List<label> processorWeights; + if (decompositionDict_.found("scotchCoeffs")) + { + const dictionary& scotchCoeffs = + decompositionDict_.subDict("scotchCoeffs"); + + scotchCoeffs.readIfPresent("processorWeights", processorWeights); + } + if (processorWeights.size()) + { + if (debug) + { + Info<< "scotchDecomp : Using procesor weights " << processorWeights + << endl; + } + check + ( + SCOTCH_archCmpltw(&archdat, nProcessors_, processorWeights.begin()), + "SCOTCH_archCmpltw" + ); + } + else + { + check + ( + SCOTCH_archCmplt(&archdat, nProcessors_), + "SCOTCH_archCmplt" + ); + } //SCOTCH_Mapping mapdat; @@ -209,6 +271,16 @@ Foam::label Foam::scotchDecomp::decompose //SCOTCH_graphMapExit(&grafdat, &mapdat); + // Hack:switch off fpu error trapping +# ifdef LINUX_GNUC + int oldExcepts = fedisableexcept + ( + FE_DIVBYZERO + | FE_INVALID + | FE_OVERFLOW + ); +# endif + finalDecomp.setSize(xadj.size()-1); finalDecomp = 0; check @@ -223,6 +295,11 @@ Foam::label Foam::scotchDecomp::decompose "SCOTCH_graphMap" ); +# ifdef LINUX_GNUC + feenableexcept(oldExcepts); +# endif + + //finalDecomp.setSize(xadj.size()-1); //check diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.H b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.H index 71bfdbe92816ee196930ebe8505b4409ceda0608..d986946b578e18a92c3157af25bf131c34200e62 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.H +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.H @@ -185,8 +185,6 @@ class hexRef8 const bool searchForward, const label wantedLevel ) const; - //- Gets level such that the face has four points <= level. - label getAnchorLevel(const label faceI) const; ////- Print levels of list of points. //void printLevels(Ostream&, const labelList&) const; @@ -370,6 +368,9 @@ public: // Refinement + //- Gets level such that the face has four points <= level. + label getAnchorLevel(const label faceI) const; + //- Given valid mesh and current cell level and proposed // cells to refine calculate any clashes (due to 2:1) and return // ok list of cells to refine. diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C index d2728f8b9d634d40aa563b009502d909d9c493fe..5e7a0b010bec6621e7340df8853e3f516f9add28 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C @@ -383,6 +383,35 @@ void Foam::polyTopoChange::checkFace << " own:" << own << " nei:" << nei << " patchI:" << patchI << abort(FatalError); } + if (faceI >= 0 && faceI < faces_.size() && faceRemoved(faceI)) + { + FatalErrorIn + ( + "polyTopoChange::checkFace(const face&, const label" + ", const label, const label, const label)" + ) << "Face already marked for removal" + << nl + << "f:" << f + << " faceI(-1 if added face):" << faceI + << " own:" << own << " nei:" << nei + << " patchI:" << patchI << abort(FatalError); + } + forAll(f, fp) + { + if (f[fp] < points_.size() && pointRemoved(f[fp])) + { + FatalErrorIn + ( + "polyTopoChange::checkFace(const face&, const label" + ", const label, const label, const label)" + ) << "Face uses removed vertices" + << nl + << "f:" << f + << " faceI(-1 if added face):" << faceI + << " own:" << own << " nei:" << nei + << " patchI:" << patchI << abort(FatalError); + } + } } diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 6e5b476daa3203877ee0f7bd2a4a8a9c49c26e15..313110bd43ad9541a65a0d4199803aa3420141c3 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -39,26 +39,41 @@ fvMeshMapper = fvMesh/fvMeshMapper $(fvMeshMapper)/fvPatchMapper.C $(fvMeshMapper)/fvSurfaceMapper.C + extendedStencil = fvMesh/extendedStencil -$(extendedStencil)/extendedStencil.C -$(extendedStencil)/extendedUpwindStencil.C -$(extendedStencil)/extendedCentredStencil.C - -$(extendedStencil)/faceStencil/faceStencil.C -$(extendedStencil)/faceStencil/faceEdgeCellStencil.C -$(extendedStencil)/faceStencil/cellFaceCellStencil.C -$(extendedStencil)/faceStencil/cellPointCellStencil.C -$(extendedStencil)/faceStencil/cellEdgeCellStencil.C - -$(extendedStencil)/extendedStencilMeshObjects/centredCECStencilObject.C -$(extendedStencil)/extendedStencilMeshObjects/centredCFCStencilObject.C -$(extendedStencil)/extendedStencilMeshObjects/centredCPCStencilObject.C -$(extendedStencil)/extendedStencilMeshObjects/centredFECStencilObject.C - -$(extendedStencil)/extendedStencilMeshObjects/upwindCECStencilObject.C -$(extendedStencil)/extendedStencilMeshObjects/upwindCFCStencilObject.C -$(extendedStencil)/extendedStencilMeshObjects/upwindCPCStencilObject.C -$(extendedStencil)/extendedStencilMeshObjects/upwindFECStencilObject.C + +cellToCell = $(extendedStencil)/cellToCell +$(cellToCell)/fullStencils/cellToCellStencil.C +$(cellToCell)/fullStencils/CFCCellToCellStencil.C +$(cellToCell)/fullStencils/CPCCellToCellStencil.C +$(cellToCell)/fullStencils/CECCellToCellStencil.C + +cellToFace = $(extendedStencil)/cellToFace +$(cellToFace)/fullStencils/cellToFaceStencil.C +$(cellToFace)/fullStencils/CFCCellToFaceStencil.C +$(cellToFace)/fullStencils/CECCellToFaceStencil.C +$(cellToFace)/fullStencils/CPCCellToFaceStencil.C +$(cellToFace)/fullStencils/FECCellToFaceStencil.C +$(cellToFace)/extendedCellToFaceStencil.C +$(cellToFace)/extendedCentredCellToFaceStencil.C +$(cellToFace)/extendedUpwindCellToFaceStencil.C +$(cellToFace)/MeshObjects/centredCECCellToFaceStencilObject.C +$(cellToFace)/MeshObjects/centredCFCCellToFaceStencilObject.C +$(cellToFace)/MeshObjects/centredCPCCellToFaceStencilObject.C +$(cellToFace)/MeshObjects/centredFECCellToFaceStencilObject.C +$(cellToFace)/MeshObjects/upwindCECCellToFaceStencilObject.C +$(cellToFace)/MeshObjects/upwindCFCCellToFaceStencilObject.C +$(cellToFace)/MeshObjects/upwindCPCCellToFaceStencilObject.C +$(cellToFace)/MeshObjects/upwindFECCellToFaceStencilObject.C +$(cellToFace)/MeshObjects/pureUpwindCFCCellToFaceStencilObject.C + +faceToCell = $(extendedStencil)/faceToCell +$(faceToCell)/fullStencils/faceToCellStencil.C +$(faceToCell)/fullStencils/CFCFaceToCellStencil.C +$(faceToCell)/extendedFaceToCellStencil.C +$(faceToCell)/extendedCentredFaceToCellStencil.C +$(faceToCell)/MeshObjects/centredCFCFaceToCellStencilObject.C + fvPatchFields = fields/fvPatchFields $(fvPatchFields)/fvPatchField/fvPatchFields.C @@ -202,6 +217,10 @@ $(schemes)/quadraticFit/quadraticFit.C $(schemes)/quadraticLinearUpwindFit/quadraticLinearUpwindFit.C $(schemes)/quadraticUpwindFit/quadraticUpwindFit.C $(schemes)/cubicUpwindFit/cubicUpwindFit.C +/* +$(schemes)/quadraticLinearPureUpwindFit/quadraticLinearPureUpwindFit.C +*/ +$(schemes)/linearPureUpwindFit/linearPureUpwindFit.C limitedSchemes = $(surfaceInterpolation)/limitedSchemes $(limitedSchemes)/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationSchemes.C @@ -297,18 +316,32 @@ $(laplacianSchemes)/gaussLaplacianScheme/gaussLaplacianSchemes.C finiteVolume/fvc/fvcMeshPhi.C -cfdTools/general/findRefCell/findRefCell.C -cfdTools/general/adjustPhi/adjustPhi.C -cfdTools/general/bound/bound.C -cfdTools/general/porousMedia/porousZone.C -cfdTools/general/porousMedia/porousZones.C -cfdTools/general/MRF/MRFZone.C -cfdTools/general/MRF/MRFZones.C -cfdTools/general/fieldSources/pressureGradientExplicitSource/pressureGradientExplicitSource.C -cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.C -cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C -cfdTools/general/SRF/SRFModel/SRFModel/newSRFModel.C -cfdTools/general/SRF/SRFModel/rpm/rpm.C -cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C +general = cfdTools/general +$(general)/findRefCell/findRefCell.C +$(general)/adjustPhi/adjustPhi.C +$(general)/bound/bound.C + +porousMedia = $(general)/porousMedia +$(porousMedia)/porousZone.C +$(porousMedia)/porousZones.C + +MRF = $(general)/MRF +$(MRF)/MRFZone.C +$(MRF)/MRFZones.C + +SRF = $(general)/SRF +$(SRF)/SRFModel/SRFModel/SRFModel.C +$(SRF)/SRFModel/SRFModel/newSRFModel.C +$(SRF)/SRFModel/rpm/rpm.C +$(SRF)/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C + +fieldSources = $(general)/fieldSources +$(fieldSources)/pressureGradientExplicitSource/pressureGradientExplicitSource.C +$(fieldSources)/timeActivatedExplicitSource/timeActivatedExplicitSource.C +$(fieldSources)/timeActivatedExplicitCellSource/timeActivatedExplicitCellSource.C + +$(fieldSources)/timeActivatedExplicitMulticomponentPointSource/timeActivatedExplicitMulticomponentPointSource.C +$(fieldSources)/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourceProperties.C +$(fieldSources)/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourcePropertiesIO.C LIB = $(FOAM_LIBBIN)/libfiniteVolume diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C index ce32ad5b84c2ac57f520161ad93bd8ec1f8a14d5..3618d87ef5dfa6ea4ea03003cf5928d4d3c3c2e0 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C @@ -312,6 +312,31 @@ void Foam::MRFZone::addCoriolis(fvVectorMatrix& UEqn) const } +void Foam::MRFZone::addCoriolis +( + const volScalarField& rho, + fvVectorMatrix& UEqn +) const +{ + if (cellZoneID_ == -1) + { + return; + } + + const labelList& cells = mesh_.cellZones()[cellZoneID_]; + const scalarField& V = mesh_.V(); + vectorField& Usource = UEqn.source(); + const vectorField& U = UEqn.psi(); + const vector& Omega = Omega_.value(); + + forAll(cells, i) + { + label celli = cells[i]; + Usource[celli] -= V[celli]*rho[celli]*(Omega ^ U[celli]); + } +} + + void Foam::MRFZone::relativeVelocity(volVectorField& U) const { const volVectorField& C = mesh_.C(); diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H index 9fa3085914151d22df5fe9c59b0fef097878749d..d5554a5b0810ea1fab45d5474df22397db3390d7 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H @@ -154,6 +154,9 @@ public: //- Add the Coriolis force contribution to the momentum equation void addCoriolis(fvVectorMatrix& UEqn) const; + //- Add the Coriolis force contribution to the momentum equation + void addCoriolis(const volScalarField& rho, fvVectorMatrix& UEqn) const; + //- Make the given absolute velocity relative within the MRF region void relativeVelocity(volVectorField& U) const; diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZones.C b/src/finiteVolume/cfdTools/general/MRF/MRFZones.C index 3e6854e3de3de0e92d8ace6ae528d9febf31b5b5..5ef8b3ee83ffbac7bdb843f8873d842aedd5208d 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZones.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZones.C @@ -65,6 +65,19 @@ void Foam::MRFZones::addCoriolis(fvVectorMatrix& UEqn) const } +void Foam::MRFZones::addCoriolis +( + const volScalarField& rho, + fvVectorMatrix& UEqn +) const +{ + forAll(*this, i) + { + operator[](i).addCoriolis(rho, UEqn); + } +} + + void Foam::MRFZones::relativeVelocity(volVectorField& U) const { forAll(*this, i) diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZones.H b/src/finiteVolume/cfdTools/general/MRF/MRFZones.H index 8895963606eaa46f167d3e4213ba5195d9d9322c..6e979903a9b803fa4b897863876b3f23765517ff 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZones.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZones.H @@ -76,6 +76,9 @@ public: //- Add the Coriolis force contribution to the momentum equation void addCoriolis(fvVectorMatrix& UEqn) const; + //- Add the Coriolis force contribution to the momentum equation + void addCoriolis(const volScalarField& rho, fvVectorMatrix& UEqn) const; + //- Make the given absolute velocity relative within the MRF region void relativeVelocity(volVectorField& U) const; diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitCellSource/timeActivatedExplicitCellSource.C b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitCellSource/timeActivatedExplicitCellSource.C new file mode 100644 index 0000000000000000000000000000000000000000..624adadf67f938b02c247c34dcaca254becba9bc --- /dev/null +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitCellSource/timeActivatedExplicitCellSource.C @@ -0,0 +1,175 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "timeActivatedExplicitCellSource.H" +#include "volFields.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::timeActivatedExplicitCellSource::updateCellSet() +{ + cellSelector_->applyToSet(topoSetSource::NEW, selectedCellSet_); + + Info<< " " << name_ << ": selected " + << returnReduce(selectedCellSet_.size(), sumOp<label>()) + << " cells" << nl << endl; + + V_ = scalarField(selectedCellSet_.size(), 1.0); + if (volumeType_ == vtAbsolute) + { + label i = 0; + forAllConstIter(cellSet, selectedCellSet_, iter) + { + V_[i++] = mesh_.V()[iter.key()]; + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::timeActivatedExplicitCellSource::timeActivatedExplicitCellSource +( + const word& name, + const fvMesh& mesh, + const dimensionSet& dims +) +: + timeActivatedExplicitSource(name, mesh, dims), + onValue_(readScalar(lookup("onValue"))), + offValue_(readScalar(lookup("offValue"))), + V_(0), + cellSource_(lookup("cellSource")), + cellSelector_ + ( + topoSetSource::New + ( + cellSource_, + mesh, + subDict(cellSource_ + "Coeffs") + ) + ), + selectedCellSet_ + ( + mesh, + name + "SourceCellSet", + mesh.nCells()/10 + 1 // Reasonable size estimate. + ) +{ + // Create the cell set + updateCellSet(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::scalar Foam::timeActivatedExplicitCellSource::onValue() const +{ + return onValue_; +} + + +Foam::scalar Foam::timeActivatedExplicitCellSource::offValue() const +{ + return offValue_; +} + + +Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > +Foam::timeActivatedExplicitCellSource::Su() +{ + tmp<DimensionedField<scalar, volMesh> > tSource + ( + new DimensionedField<scalar, volMesh> + ( + IOobject + ( + name_ + "Su", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimensions_, 0.0) + ) + ); + + scalar value = offValue_; + if + ( + active_ + && (runTime_.time().value() >= timeStart_) + && (runTime_.time().value() <= timeStart_ + duration_) + ) + { + // Update the cell set if the mesh is changing + if (mesh_.changing()) + { + updateCellSet(); + } + + value = onValue_; + } + + DimensionedField<scalar, volMesh>& sourceField = tSource(); + + label i = 0; + forAllConstIter(cellSet, selectedCellSet_, iter) + { + sourceField[iter.key()] = value/V_[i++]; + } + + return tSource; +} + + +bool Foam::timeActivatedExplicitCellSource::read() +{ + if (timeActivatedExplicitSource::read()) + { + lookup("onValue") >> onValue_; + lookup("offValue") >> offValue_; + lookup("cellSource") >> cellSource_; + cellSelector_ = + topoSetSource::New + ( + cellSource_, + mesh_, + subDict(cellSource_ + "Coeffs") + ); + updateCellSet(); + + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitCellSource/timeActivatedExplicitCellSource.H b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitCellSource/timeActivatedExplicitCellSource.H new file mode 100644 index 0000000000000000000000000000000000000000..96dfb3a5e822609beccce827aa97d5e88f98afdf --- /dev/null +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitCellSource/timeActivatedExplicitCellSource.H @@ -0,0 +1,143 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::timeActivatedExplicitSourceNew + +Description + Creates a cell set source that is activated at a given time, and remains + active for a specified duration. The source value is either in specific + (XX/m3) or absolute (XX) units. + +SourceFiles + timeActivatedExplicitCellSource.C + +\*---------------------------------------------------------------------------*/ + +#ifndef timeActivatedExplicitCellSource_H +#define timeActivatedExplicitCellSource_H + +#include "timeActivatedExplicitSource.H" +#include "topoSetSource.H" +#include "cellSet.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class timeActivatedExplicitCellSource Declaration +\*---------------------------------------------------------------------------*/ + +class timeActivatedExplicitCellSource +: + public timeActivatedExplicitSource +{ +private: + + // Private member functions + + //- Update the cell set that the source is acting on + void updateCellSet(); + + + // Private Member Functions + + //- Disallow default bitwise copy construct + timeActivatedExplicitCellSource(const timeActivatedExplicitCellSource&); + + //- Disallow default bitwise assignment + void operator=(const timeActivatedExplicitCellSource&); + + +protected: + + // Protected data + + // Source properties + + //- Value when "on" + scalar onValue_; + + //- Value when "off" + scalar offValue_; + + + // Cell set + + //- Cell volumes + scalarList V_; + + //- Name of cell source (XXXToCell) + word cellSource_; + + //- Method by which the cells will be selected + autoPtr<topoSetSource> cellSelector_; + + //- Set of selected cells + cellSet selectedCellSet_; + + +public: + + // Constructors + + //- Construct from explicit source name and mesh + timeActivatedExplicitCellSource + ( + const word&, + const fvMesh&, + const dimensionSet& + ); + + + // Member Functions + + // Access + + //- Return the "on" value + virtual scalar onValue() const; + + //- Return the "off" value + virtual scalar offValue() const; + + //- Return a tmp field of the source + virtual tmp<DimensionedField<scalar, volMesh> > Su(); + + + //- Read properties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourceProperties.C b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourceProperties.C new file mode 100644 index 0000000000000000000000000000000000000000..5d7ad2ac46b509fbafb1b6448d98395be7ab9cf3 --- /dev/null +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourceProperties.C @@ -0,0 +1,87 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "pointSourceProperties.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::pointSourceProperties::pointSourceProperties() +: + name_("unknownPointSourceName"), + timeStart_(0.0), + duration_(0.0), + location_(point::zero), + fieldData_() +{} + + +Foam::pointSourceProperties::pointSourceProperties(const dictionary& dict) +: + name_(dict.name().name()), + timeStart_(readScalar(dict.lookup("timeStart"))), + duration_(readScalar(dict.lookup("duration"))), + location_(dict.lookup("location")), + fieldData_(dict.lookup("fieldData")) +{} + + +Foam::pointSourceProperties::pointSourceProperties +( + const pointSourceProperties& psp +) +: + name_(psp.name_), + timeStart_(psp.timeStart_), + duration_(psp.duration_), + location_(psp.location_), + fieldData_(psp.fieldData_) +{} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +void Foam::pointSourceProperties::operator=(const pointSourceProperties& rhs) +{ + // Check for assignment to self + if (this == &rhs) + { + FatalErrorIn + ( + "pointSourceProperties::operator=(const pointSourceProperties&)" + ) << "Attempted assignment to self" << nl + << abort(FatalError); + } + + // Set updated values + name_ = rhs.name_; + timeStart_ = rhs.timeStart_; + duration_ = rhs.duration_; + location_ = rhs.location_; + fieldData_ = rhs.fieldData_;} + + + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourceProperties.H b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourceProperties.H new file mode 100644 index 0000000000000000000000000000000000000000..c83e3fc6662634ff92882909fdbc54721bfa2f58 --- /dev/null +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourceProperties.H @@ -0,0 +1,158 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::pointSourceProperties + +Description + Helper class to describe point source properties + +SourceFiles + pointSourceProperties.C + +\*---------------------------------------------------------------------------*/ + +#ifndef pointSourceProperties_H +#define pointSourceProperties_H + +#include "IOdictionary.H" +#include "fvMesh.H" +#include "Time.H" +#include "Tuple2.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class pointSourceProperties Declaration +\*---------------------------------------------------------------------------*/ + +class pointSourceProperties +{ +protected: + + // Protected data + + typedef Tuple2<word, scalar> fieldNameValuePair; + + //- Source name + word name_; + + //- Time start + scalar timeStart_; + + //- Duration + scalar duration_; + + //- Point location + point location_; + + //- List of source field name vs value pairs + List<fieldNameValuePair> fieldData_; + + +public: + + // Constructors + + //- Construct null + pointSourceProperties(); + + //- Construct from dictionary + pointSourceProperties(const dictionary& dict); + + //- Construct from Istream + pointSourceProperties(Istream& is); + + //- Copy constructor + pointSourceProperties(const pointSourceProperties&); + + + // Member Functions + + // Access + + //- Return const access to the source name + inline const word& name() const; + + //- Return const access to the time start + inline scalar timeStart() const; + + //- Return const access to the time end + inline scalar timeEnd() const; + + //- Return const access to the duration + inline scalar duration() const; + + //- Return const access to the point location + inline const point& location() const; + + //- Return const access to the source field name vs value pairs + inline const List<fieldNameValuePair>& fieldData() const; + + + // Edit + + //- Return access to the source name + inline word& name(); + + //- Return access to the time start + inline scalar& timeStart(); + + //- Return access to the duration + inline scalar& duration(); + + //- Return access to the point location + inline point& location(); + + //- Return access to the source field name vs value pairs + inline List<fieldNameValuePair>& fieldData(); + + + // Member Operators + + void operator=(const pointSourceProperties&); + + // IOstream operators + + friend Istream& operator>>(Istream&, pointSourceProperties&); + friend Ostream& operator<<(Ostream&, const pointSourceProperties&); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "pointSourcePropertiesI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourcePropertiesI.H b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourcePropertiesI.H new file mode 100644 index 0000000000000000000000000000000000000000..60d02c2d5d14f295bee2ad0e2390c121312b52bf --- /dev/null +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourcePropertiesI.H @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "pointSourceProperties.H" + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline const Foam::word& Foam::pointSourceProperties::name() const +{ + return name_; +} + + +inline Foam::scalar Foam::pointSourceProperties::timeStart() const +{ + return timeStart_; +} + + +inline Foam::scalar Foam::pointSourceProperties::timeEnd() const +{ + return timeStart_ + duration_; +} + + +inline Foam::scalar Foam::pointSourceProperties::duration() const +{ + return duration_; +} + + +inline const Foam::point& Foam::pointSourceProperties::location() const +{ + return location_; +} + + +inline const Foam::List<Foam::pointSourceProperties::fieldNameValuePair>& +Foam::pointSourceProperties::fieldData() const +{ + return fieldData_; +} + + +inline Foam::word& Foam::pointSourceProperties::name() +{ + return name_; +} + + +inline Foam::scalar& Foam::pointSourceProperties::timeStart() +{ + return timeStart_; +} + + +inline Foam::scalar& Foam::pointSourceProperties::duration() +{ + return duration_; +} + + +inline Foam::point& Foam::pointSourceProperties::location() +{ + return location_; +} + + +inline Foam::List<Foam::pointSourceProperties::fieldNameValuePair>& +Foam::pointSourceProperties::fieldData() +{ + return fieldData_; +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourcePropertiesIO.C b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourcePropertiesIO.C new file mode 100644 index 0000000000000000000000000000000000000000..5b0ca2e63efa8751afa1425704cb5d3f72d31d25 --- /dev/null +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/pointSourceProperties/pointSourcePropertiesIO.C @@ -0,0 +1,88 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "pointSourceProperties.H" +#include "dictionaryEntry.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::pointSourceProperties::pointSourceProperties(Istream& is) +: + name_("unknownPointSourceName"), + timeStart_(0.0), + duration_(0.0), + location_(point::zero), + fieldData_() +{ + is.check("pointSourceProperties(Istream&)"); + + const dictionaryEntry entry(dictionary::null, is); + + name_ = entry.keyword(); + entry.lookup("timeStart") >> timeStart_; + entry.lookup("duration") >> duration_; + entry.lookup("location") >> location_; + entry.lookup("fieldData") >> fieldData_; +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::Istream& Foam::operator>>(Istream& is, pointSourceProperties& psp) +{ + is.check("Istream& operator>>(Istream&, pointSourceProperties&)"); + + const dictionaryEntry entry(dictionary::null, is); + + psp.name_ = entry.keyword(); + entry.lookup("timeStart") >> psp.timeStart_; + entry.lookup("duration") >> psp.duration_; + entry.lookup("location") >> psp.location_; + entry.lookup("fieldData") >> psp.fieldData_; + + return is; +} + + +Foam::Ostream& Foam::operator<<(Ostream& os, const pointSourceProperties& psp) +{ + os.check("Ostream& operator<<(Ostream&, const pointSourceProperties&)"); + + os << psp.name_ << nl << token::BEGIN_BLOCK << nl; + os.writeKeyword("timeStart") << psp.timeStart_ << token::END_STATEMENT << nl; + os.writeKeyword("duration") << psp.duration_ << token::END_STATEMENT << nl; + os.writeKeyword("location") << psp.location_ << token::END_STATEMENT << nl; + os.writeKeyword("fieldData") << psp.fieldData_ << token::END_STATEMENT << nl; + os << token::END_BLOCK << nl; + + os.check("Ostream& operator<<(Ostream&, const pointSourceProperties&)"); + + return os; +} + + + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/timeActivatedExplicitMulticomponentPointSource.C b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/timeActivatedExplicitMulticomponentPointSource.C new file mode 100644 index 0000000000000000000000000000000000000000..221b7949b4365c9bad6c6753e1cac6b831e579d5 --- /dev/null +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/timeActivatedExplicitMulticomponentPointSource.C @@ -0,0 +1,292 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "timeActivatedExplicitMulticomponentPointSource.H" +#include "volFields.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +Foam::label +Foam::timeActivatedExplicitMulticomponentPointSource::carrierFieldId +( + const word& fieldName +) +{ + forAll(carrierFields_, fieldI) + { + if (carrierFields_[fieldI].name() == fieldName) + { + return fieldI; + } + } + + return -1; +} + + +void Foam::timeActivatedExplicitMulticomponentPointSource::updateAddressing() +{ + forAll(pointSources_, sourceI) + { + const pointSourceProperties& psp = pointSources_[sourceI]; + bool foundCell = false; + label cid = mesh_.findCell(psp.location()); + if (cid >= 0) + { + foundCell = mesh_.pointInCell(psp.location(), cid); + } + reduce(foundCell, orOp<bool>()); + if (!foundCell) + { + label cid = mesh_.findNearestCell(psp.location()); + if (cid >= 0) + { + foundCell = mesh_.pointInCell(psp.location(), cid); + } + } + reduce(foundCell, orOp<bool>()); + + if (!foundCell) + { + FatalErrorIn + ( + "timeActivatedExplicitMulticomponentPointSource::" + "updateAddressing()" + ) << "Unable to find location " << psp.location() << " in mesh " + << "for source " << psp.name() << nl + << exit(FatalError); + } + else + { + cellOwners_[sourceI] = cid; + } + + fieldIds_[sourceI].setSize(psp.fieldData().size()); + forAll(psp.fieldData(), fieldI) + { + const word& fieldName = psp.fieldData()[fieldI].first(); + label cfid = carrierFieldId(fieldName); + if (cfid < 0) + { + FatalErrorIn + ( + "timeActivatedExplicitMulticomponentPointSource::" + "updateAddressing()" + ) << "Unable to find field " << fieldName << " in carrier " + << "fields for source " << psp.name() << nl + << exit(FatalError); + } + else + { + fieldIds_[sourceI][fieldI] = cfid; + } + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::timeActivatedExplicitMulticomponentPointSource:: +timeActivatedExplicitMulticomponentPointSource +( + const word& name, + const fvMesh& mesh, + const PtrList<volScalarField>& carrierFields, + const dimensionSet& dims +) +: + IOdictionary + ( + IOobject + ( + name + "Properties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ), + name_(name), + mesh_(mesh), + runTime_(mesh.time()), + dimensions_(dims), + carrierFields_(carrierFields), + active_(lookup("active")), + pointSources_(lookup("pointSources")), + cellOwners_(pointSources_.size()), + fieldIds_(pointSources_.size()) +{ + // Initialise the field addressing + updateAddressing(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > +Foam::timeActivatedExplicitMulticomponentPointSource::Su +( + const label fieldI +) +{ + if (mesh_.changing()) + { + updateAddressing(); + } + + tmp<DimensionedField<scalar, volMesh> > tSource + ( + new DimensionedField<scalar, volMesh> + ( + IOobject + ( + name_ + carrierFields_[fieldI].name() + "Su", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimensions_, 0.0) + ) + ); + + if (active_) + { + DimensionedField<scalar, volMesh>& sourceField = tSource(); + + const scalarField& V = mesh_.V(); + const scalar dt = runTime_.deltaT().value(); + + forAll(pointSources_, sourceI) + { + const pointSourceProperties& psp = pointSources_[sourceI]; + + forAll(fieldIds_[sourceI], i) + { + if + ( + fieldIds_[sourceI][i] == fieldI + && (runTime_.time().value() >= psp.timeStart()) + && (runTime_.time().value() <= psp.timeEnd()) + ) + { + const label cid = cellOwners_[sourceI]; + if (cid >= 0) + { + sourceField[cid] += + dt*psp.fieldData()[i].second()/V[cid]; + } + } + } + } + } + + return tSource; +} + + +Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > +Foam::timeActivatedExplicitMulticomponentPointSource::Su() +{ + if (mesh_.changing()) + { + updateAddressing(); + } + + tmp<DimensionedField<scalar, volMesh> > tSource + ( + new DimensionedField<scalar, volMesh> + ( + IOobject + ( + name_ + "TotalSu", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimensions_, 0.0) + ) + ); + + if (active_) + { + DimensionedField<scalar, volMesh>& sourceField = tSource(); + + const scalarField& V = mesh_.V(); + const scalar dt = runTime_.deltaT().value(); + + forAll(pointSources_, sourceI) + { + const pointSourceProperties& psp = pointSources_[sourceI]; + + forAll(fieldIds_[sourceI], i) + { + if + ( + (runTime_.time().value() >= psp.timeStart()) + && (runTime_.time().value() <= psp.timeEnd()) + ) + { + const label cid = cellOwners_[sourceI]; + if (cid >= 0) + { + sourceField[cid] += + dt*psp.fieldData()[i].second()/V[cid]; + } + } + } + } + } + + return tSource; +} + + +bool Foam::timeActivatedExplicitMulticomponentPointSource::read() +{ + if (regIOobject::read()) + { + lookup("active") >> active_; + lookup("pointSources") >> pointSources_; + + cellOwners_.setSize(pointSources_.size()); + + updateAddressing(); + + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/timeActivatedExplicitMulticomponentPointSource.H b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/timeActivatedExplicitMulticomponentPointSource.H new file mode 100644 index 0000000000000000000000000000000000000000..a1d74268f90d8ba9db44cddc03b8f70316bc776b --- /dev/null +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitMulticomponentPointSource/timeActivatedExplicitMulticomponentPointSource.H @@ -0,0 +1,185 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::timeActivatedExplicitMulticomponentPointSourceNew + +Description + Provides a mechanism to introduce point sources to a set of carrier fields. + Carrier fields are supplied on consruction, and interrogated to provide the + field indices of the sources. + + Source values are assumed to be in <quantity>/s, and divided through by the + cell volumes before being returned, e.g. for a kg/s source + + Properties are described in a <name>Properties dictionary + + active true; // are sources active (true/false) + + pointSources + ( + source1 // source name + { + timeStart 0.0; + duration 1.0; + location (0 0 0); + fieldData + ( + (H2O 0.1) // kg/s + (O2 0.05) // kg/s + ); + } + source2 // source name + { + timeStart 0.5; + duration 2.0; + location (1 1 1); + fieldData + ( + (NO 0.1) // kg/s + (CO2 0.05) // kg/s + (H2 0.001) // kg/s + ); + } + ); + + +SourceFiles + timeActivatedExplicitMulticomponentPointSourceNew.C + +\*---------------------------------------------------------------------------*/ + +#ifndef timeActivatedExplicitMulticomponentPointSource_H +#define timeActivatedExplicitMulticomponentPointSource_H + +#include "IOdictionary.H" +#include "fvMesh.H" +#include "Time.H" +#include "pointSourceProperties.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class timeActivatedExplicitMulitcomponentPointSource Declaration +\*---------------------------------------------------------------------------*/ + +class timeActivatedExplicitMulticomponentPointSource +: + public IOdictionary +{ +protected: + + // Protected data + + //- Name of the source + word name_; + + //- Reference to the mesh + const fvMesh& mesh_; + + //- Reference to time database + const Time& runTime_; + + //- Source dimensions + const dimensionSet& dimensions_; + + //- Reference to the multicomponent carrier fields + const PtrList<volScalarField>& carrierFields_; + + //- Active flag + bool active_; + + //- List of point source properties + List<pointSourceProperties> pointSources_; + + //- List of cell owners for point source locations + List<label> cellOwners_; + + //- List of field ids for each source + List<labelList> fieldIds_; + + + // Protected Member Functions + + //- Return the id of field given its name + label carrierFieldId(const word& fieldName); + + //- Update the addressing between source and carrier fields + void updateAddressing(); + + //- Disallow default bitwise copy construct + timeActivatedExplicitMulticomponentPointSource + ( + const timeActivatedExplicitMulticomponentPointSource& + ); + + //- Disallow default bitwise assignment + void operator=(const timeActivatedExplicitMulticomponentPointSource&); + + +public: + + // Constructors + + //- Construct from components + timeActivatedExplicitMulticomponentPointSource + ( + const word&, + const fvMesh&, + const PtrList<volScalarField>&, + const dimensionSet& + ); + + + // Member Functions + + // Access + + //- Return a tmp field of the source for field fieldI + virtual tmp<DimensionedField<scalar, volMesh> > Su + ( + const label fieldI + ); + + //- Return a tmp field of the total source + virtual tmp<DimensionedField<scalar, volMesh> > Su(); + + + //- Read properties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.C b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.C index 48de23bfe239d49755f674995ac405fb20409362..c59b74a770eba9dc0aba0fbca48068d46a22e6ba 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.C @@ -44,33 +44,11 @@ const Foam::NamedEnum<Foam::timeActivatedExplicitSource::volumeType, 2> Foam::timeActivatedExplicitSource::volumeTypeNames_; -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void Foam::timeActivatedExplicitSource::updateCellSet() -{ - cellSelector_->applyToSet(topoSetSource::NEW, selectedCellSet_); - - Info<< " " << sourceName_ << ": selected " - << returnReduce(selectedCellSet_.size(), sumOp<label>()) - << " cells" << nl << endl; - - V_ = scalarField(selectedCellSet_.size(), 1.0); - if (volumeType_ == vtAbsolute) - { - label i = 0; - forAllConstIter(cellSet, selectedCellSet_, iter) - { - V_[i++] = mesh_.V()[iter.key()]; - } - } -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::timeActivatedExplicitSource::timeActivatedExplicitSource ( - const word& sourceName, + const word& name, const fvMesh& mesh, const dimensionSet& dims ) @@ -79,104 +57,72 @@ Foam::timeActivatedExplicitSource::timeActivatedExplicitSource ( IOobject ( - sourceName + "Properties", + name + "Properties", mesh.time().constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ) ), - sourceName_(sourceName), mesh_(mesh), runTime_(mesh.time()), + name_(name), + active_(lookup("active")), dimensions_(dims), volumeType_(volumeTypeNames_.read(lookup("volumeType"))), timeStart_(readScalar(lookup("timeStart"))), - duration_(readScalar(lookup("duration"))), - onValue_(readScalar(lookup("onValue"))), - offValue_(readScalar(lookup("offValue"))), - currentValue_(0.0), - V_(0), - cellSource_(lookup("cellSource")), - cellSelector_ - ( - topoSetSource::New - ( - cellSource_, - mesh, - subDict(cellSource_ + "Coeffs") - ) - ), - selectedCellSet_ - ( - mesh, - sourceName + "SourceCellSet", - mesh.nCells()/10 + 1 // Reasonable size estimate. - ) -{ - // Create the cell set - updateCellSet(); + duration_(readScalar(lookup("duration"))) +{} + - // Initialise the value - update(); +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +const Foam::fvMesh& Foam::timeActivatedExplicitSource::mesh() const +{ + return mesh_; } -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +const Foam::Time& Foam::timeActivatedExplicitSource::runTime() const +{ + return runTime_; +} -Foam::scalar Foam::timeActivatedExplicitSource::timeStart() const + +const Foam::word& Foam::timeActivatedExplicitSource::name() const { - return timeStart_; + return name_; } -Foam::scalar Foam::timeActivatedExplicitSource::duration() const +const Foam::Switch& Foam::timeActivatedExplicitSource::active() const { - return duration_; + return active_; } -const Foam::dimensionedScalar -Foam::timeActivatedExplicitSource::currentValue() const +const Foam::dimensionSet& Foam::timeActivatedExplicitSource::dimensions() const { - return dimensionedScalar - ( - sourceName_, - dimensions_, - currentValue_ - ); + return dimensions_; } -Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> > -Foam::timeActivatedExplicitSource::Su() const +const Foam::timeActivatedExplicitSource::volumeType& +Foam::timeActivatedExplicitSource::volume() const { - tmp<DimensionedField<scalar, volMesh> > tSource - ( - new DimensionedField<scalar, volMesh> - ( - IOobject - ( - sourceName_ + "Su", - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedScalar("zero", dimensions_, 0.0) - ) - ); + return volumeType_; +} - DimensionedField<scalar, volMesh>& sourceField = tSource(); - label i = 0; - forAllConstIter(cellSet, selectedCellSet_, iter) - { - sourceField[iter.key()] = currentValue_/V_[i++]; - } +Foam::scalar Foam::timeActivatedExplicitSource::timeStart() const +{ + return timeStart_; +} + - return tSource; +Foam::scalar Foam::timeActivatedExplicitSource::duration() const +{ + return duration_; } @@ -184,22 +130,18 @@ bool Foam::timeActivatedExplicitSource::read() { if (regIOobject::read()) { - volumeType_ = volumeTypeNames_.read(lookup("volumeType")); - lookup("timeStart") >> duration_; - lookup("duration") >> duration_; - lookup("onValue") >> onValue_; - lookup("offValue") >> offValue_; - lookup("cellSource") >> cellSource_; - cellSelector_ = - topoSetSource::New - ( - cellSource_, - mesh_, - subDict(cellSource_ + "Coeffs") - ); - updateCellSet(); - - return true; + lookup("active") >> active_; + if (active_) + { + volumeType_ = volumeTypeNames_.read(lookup("volumeType")); + lookup("timeStart") >> duration_; + lookup("duration") >> duration_; + return true; + } + else + { + return false; + } } else { @@ -208,28 +150,6 @@ bool Foam::timeActivatedExplicitSource::read() } -void Foam::timeActivatedExplicitSource::update() -{ - // Set the source value - if - ( - (runTime_.time().value() >= timeStart_) - && (runTime_.time().value() <= timeStart_ + duration_) - ) - { - currentValue_ = onValue_; - } - else - { - currentValue_ = offValue_; - } - - // Update the cell set if the mesh is changing - if (mesh_.changing()) - { - updateCellSet(); - } -} // ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.H b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.H index f258bc1f7fce14d91ea23891c74604ceb19dd041..15bccc582f3a620bc5fa40e6334b828cf6b61968 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.H @@ -23,15 +23,20 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::timeActivatedExplicitSourceNew + Foam::timeActivatedExplicitSource Description - Creates a cell set source that is activated at a given time, and remains - active for a specified duration. The source value is either in specific - (XX/m3) or absolute (XX) units. + Base class for field sources. Provides: + - name + - references to mesh and time + - dimensions + - volume type + - startTime + - duration + - read (from <sourceName>Properties dictionary) SourceFiles - timeActivatedExplicitSourceNew.C + timeActivatedExplicitSource.C \*---------------------------------------------------------------------------*/ @@ -40,8 +45,6 @@ SourceFiles #include "IOdictionary.H" #include "autoPtr.H" -#include "topoSetSource.H" -#include "cellSet.H" #include "fvMesh.H" #include "Time.H" #include "NamedEnum.H" @@ -72,19 +75,19 @@ public: private: - // Private member functions + // Private Member Functions - //- Update the cell set that the source is acting on - void updateCellSet(); + //- Disallow default bitwise copy construct + timeActivatedExplicitSource(const timeActivatedExplicitSource&); + + //- Disallow default bitwise assignment + void operator=(const timeActivatedExplicitSource&); protected: // Protected data - //- Name of the source - word sourceName_; - //- Reference to the mesh const fvMesh& mesh_; @@ -94,6 +97,12 @@ protected: // Source properties + //- Name of the source + word name_; + + //- Active flag + Switch active_; + //- Dimensions const dimensionSet dimensions_; @@ -106,39 +115,6 @@ protected: //- Duration [s] scalar duration_; - //- Value when "on" - scalar onValue_; - - //- Value when "off" - scalar offValue_; - - //- Current source value - scalar currentValue_; - - - // Cell set - - //- Cell volumes - scalarList V_; - - //- Name of cell source (XXXToCell) - word cellSource_; - - //- Method by which the cells will be selected - autoPtr<topoSetSource> cellSelector_; - - //- Set of selected cells - cellSet selectedCellSet_; - - - // Protected Member Functions - - //- Disallow default bitwise copy construct - timeActivatedExplicitSource(const timeActivatedExplicitSource&); - - //- Disallow default bitwise assignment - void operator=(const timeActivatedExplicitSource&); - public: @@ -157,24 +133,33 @@ public: // Access - //- Return the start time - scalar timeStart() const; + //- Return the reference to the mesh + virtual const fvMesh& mesh() const; - //- Return the duration - scalar duration() const; + //- Return the reference to the time database + virtual const Time& runTime() const; + + //- Return the source name + virtual const word& name() const; + + //- Return the active flag + virtual const Switch& active() const; + + //- Return the dimensions + virtual const dimensionSet& dimensions() const; - //- Return the current value of the source - const dimensionedScalar currentValue() const; + //- Return the volume type + virtual const volumeType& volume() const; - //- Return a tmp field of the source - virtual tmp<DimensionedField<scalar, volMesh> > Su() const; + //- Return the start time + virtual scalar timeStart() const; + + //- Return the duration + virtual scalar duration() const; //- Read properties dictionary virtual bool read(); - - //- Update - virtual void update(); }; diff --git a/src/finiteVolume/cfdTools/general/findRefCell/findRefCell.C b/src/finiteVolume/cfdTools/general/findRefCell/findRefCell.C index ed450ea4883c6ff4652872a4a5f7eae633e2f129..370b13747d204dad917ba3da9b4bdc6af2176252 100644 --- a/src/finiteVolume/cfdTools/general/findRefCell/findRefCell.C +++ b/src/finiteVolume/cfdTools/general/findRefCell/findRefCell.C @@ -108,7 +108,7 @@ void Foam::setRefCell " bool\n" ")", dict - ) << "Unable to set reference cell for field" << field.name() + ) << "Unable to set reference cell for field " << field.name() << nl << " Please supply either " << refCellName << " or " << refPointName << nl << exit(FatalIOError); diff --git a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C index 686120b62d77e7c79803d7e56d2dcd961a67e178..f13e344375efb3cd476a9263a643ada04fcd78a4 100644 --- a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C +++ b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C @@ -79,6 +79,8 @@ Foam::porousZone::porousZone D_("D", dimensionSet(0, -2, 0, 0, 0), tensor::zero), F_("F", dimensionSet(0, -1, 0, 0, 0), tensor::zero) { + Info<< "Creating porous zone: " << name_ << endl; + if (cellZoneID_ == -1 && !Pstream::parRun()) { FatalErrorIn diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C index c31f5acc5c3888b49479e7f11b791ae28d51c25c..b6f48ff6ada8e214e41f83c848bafabdb32de46e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C @@ -113,7 +113,17 @@ void fixedFluxBuoyantPressureFvPatchScalarField::updateCoeffs() const fvPatchField<scalar>& rho = patch().lookupPatchField<volScalarField, scalar>("rho"); - gradient() = -rho.snGrad()*(g.value() & patch().Cf()); + // If the variable name is "pd" assume it is p - rho*g.h + // and set the gradient appropriately. + // Otherwise assume the variable is the static pressure. + if (dimensionedInternalField().name() == "pd") + { + gradient() = -rho.snGrad()*(g.value() & patch().Cf()); + } + else + { + gradient() = rho*(g.value() & patch().nf()); + } fixedGradientFvPatchScalarField::updateCoeffs(); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H index 3ce584bf873cef5a8a88804dd0076b82145be4c5..8e433cb8f167f0304ec840bb270c4521c9230e5b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.H @@ -26,7 +26,10 @@ Class Foam::fixedFluxBuoyantPressureFvPatchScalarField Description - Foam::fixedFluxBuoyantPressureFvPatchScalarField + Set the pressure gradient boundary condition appropriately for buoyant flow. + + If the variable name is "pd" assume it is p - rho*g.h and set the gradient + appropriately. Otherwise assume the variable is the static pressure. SourceFiles fixedFluxBuoyantPressureFvPatchScalarField.C diff --git a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C index cafab73fb158e6492a6b9e908ad8265a7519399a..1df55b7e17b8be53c0c950a885143b0e9d6bec80 100644 --- a/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C +++ b/src/finiteVolume/finiteVolume/laplacianSchemes/gaussLaplacianScheme/gaussLaplacianScheme.C @@ -21,7 +21,7 @@ License 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 "gaussLaplacianScheme.H" diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGrad.H b/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGrad.H index bc170c14666a1f8a0d1533737a256d46d0d02d4e..035bb1d6dba485422291895e14000961dd692c54 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGrad.H +++ b/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGrad.H @@ -39,7 +39,7 @@ SourceFiles #include "snGradScheme.H" #include "quadraticFitSnGradData.H" -#include "extendedStencil.H" +#include "extendedCellToFaceStencil.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -133,7 +133,7 @@ public: centralWeight_ ); - const extendedStencil& stencil = qfd.stencil(); + const extendedCellToFaceStencil& stencil = qfd.stencil(); const List<scalarList>& f = qfd.fit(); tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > sft diff --git a/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGradData.H b/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGradData.H index 12d5c90f5435544be324296bb441e8af30381148..bedb0570cca700cde959041c1b6bea8a5b4de147 100644 --- a/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGradData.H +++ b/src/finiteVolume/finiteVolume/snGradSchemes/quadraticFitSnGrad/quadraticFitSnGradData.H @@ -38,7 +38,7 @@ SourceFiles #include "MeshObject.H" #include "fvMesh.H" -#include "extendedStencil.H" +#include "extendedCellToFaceStencil.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -62,7 +62,7 @@ class quadraticFitSnGradData const label minSize_; //- Extended stencil addressing - extendedStencil stencil_; + extendedCellToFaceStencil stencil_; //- For each cell in the mesh store the values which multiply the // values of the stencil to obtain the gradient for each direction @@ -107,7 +107,7 @@ public: // Member functions //- Return reference to the stencil - const extendedStencil& stencil() const + const extendedCellToFaceStencil& stencil() const { return stencil_; } diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C index 5ad5dca8cdd5a90e84948eb6aac18199a3130340..5eae3a9f80a1ce3f9401f07fd8759a5d67789a68 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C @@ -480,7 +480,7 @@ void Foam::fvMatrix<Type>::setReference const bool forceReference ) { - if (celli >= 0 && (psi_.needReference() || forceReference)) + if ((forceReference || psi_.needReference()) && celli >= 0) { source()[celli] += diag()[celli]*value; diag()[celli] += diag()[celli]; diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellEdgeCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.C similarity index 90% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellEdgeCellStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.C index 034106f13abdb06dc5d6e4db73d777aed2d57177..b6d2dfa91ef4656621c6bb48611414d45e52b7ea 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellEdgeCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.C @@ -24,16 +24,13 @@ License \*---------------------------------------------------------------------------*/ -#include "cellEdgeCellStencil.H" +#include "CECCellToCellStencil.H" #include "syncTools.H" -//#include "meshTools.H" -//#include "OFstream.H" -//#include "Time.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // Calculates per edge the neighbour data (= edgeCells) -void Foam::cellEdgeCellStencil::calcEdgeBoundaryData +void Foam::CECCellToCellStencil::calcEdgeBoundaryData ( const boolList& isValidBFace, const labelList& boundaryEdges, @@ -72,7 +69,7 @@ void Foam::cellEdgeCellStencil::calcEdgeBoundaryData // Calculates per cell the neighbour data (= cell or boundary in global // numbering). First element is always cell itself! -void Foam::cellEdgeCellStencil::calcCellStencil +void Foam::CECCellToCellStencil::calcCellStencil ( labelListList& globalCellCells ) const @@ -189,20 +186,12 @@ void Foam::cellEdgeCellStencil::calcCellStencil // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::cellEdgeCellStencil::cellEdgeCellStencil(const polyMesh& mesh) +Foam::CECCellToCellStencil::CECCellToCellStencil(const polyMesh& mesh) : - faceStencil(mesh) + cellToCellStencil(mesh) { // Calculate per cell the (edge) connected cells (in global numbering) - labelListList globalCellCells; - calcCellStencil(globalCellCells); - - // Add stencils of neighbouring cells to create faceStencil - labelListList faceStencil; - calcFaceStencil(globalCellCells, faceStencil); - - // Transfer to *this - transfer(faceStencil); + calcCellStencil(*this); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellEdgeCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.H similarity index 84% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellEdgeCellStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.H index 2cc8b21e33cc92d3632af49c47304bb213cde2e7..27303ffd9f448c984c28eda028cd7448beadc349 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellEdgeCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CECCellToCellStencil.H @@ -23,19 +23,19 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::cellEdgeCellStencil + Foam::CECCellToCellStencil Description SourceFiles - cellEdgeCellStencil.C + CECCellToCellStencil.C \*---------------------------------------------------------------------------*/ -#ifndef cellEdgeCellStencil_H -#define cellEdgeCellStencil_H +#ifndef CECCellToCellStencil_H +#define CECCellToCellStencil_H -#include "faceStencil.H" +#include "cellToCellStencil.H" #include "boolList.H" #include "HashSet.H" #include "Map.H" @@ -47,12 +47,12 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class cellEdgeCellStencil Declaration + Class CECCellToCellStencil Declaration \*---------------------------------------------------------------------------*/ -class cellEdgeCellStencil +class CECCellToCellStencil : - public faceStencil + public cellToCellStencil { // Private Member Functions @@ -68,10 +68,10 @@ class cellEdgeCellStencil //- Disallow default bitwise copy construct - cellEdgeCellStencil(const cellEdgeCellStencil&); + CECCellToCellStencil(const CECCellToCellStencil&); //- Disallow default bitwise assignment - void operator=(const cellEdgeCellStencil&); + void operator=(const CECCellToCellStencil&); public: @@ -79,7 +79,7 @@ public: // Constructors //- Construct from all cells and boundary faces - explicit cellEdgeCellStencil(const polyMesh&); + explicit CECCellToCellStencil(const polyMesh&); }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellFaceCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.C similarity index 89% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellFaceCellStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.C index 263ebf0d041e85b9f2237c708d86b947b906c1db..7c718cacfd44256700210b1740abe0190da989b2 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellFaceCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "cellFaceCellStencil.H" +#include "CFCCellToCellStencil.H" #include "syncTools.H" #include "SortableList.H" #include "emptyPolyPatch.H" @@ -32,7 +32,7 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // Calculates per face the neighbour data (= cell or boundary face) -void Foam::cellFaceCellStencil::calcFaceBoundaryData +void Foam::CFCCellToCellStencil::calcFaceBoundaryData ( labelList& neiGlobal ) const @@ -85,7 +85,7 @@ void Foam::cellFaceCellStencil::calcFaceBoundaryData // Calculates per cell the neighbour data (= cell or boundary in global // numbering). First element is always cell itself! -void Foam::cellFaceCellStencil::calcCellStencil(labelListList& globalCellCells) +void Foam::CFCCellToCellStencil::calcCellStencil(labelListList& globalCellCells) const { const label nBnd = mesh().nFaces()-mesh().nInternalFaces(); @@ -147,20 +147,12 @@ void Foam::cellFaceCellStencil::calcCellStencil(labelListList& globalCellCells) // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::cellFaceCellStencil::cellFaceCellStencil(const polyMesh& mesh) +Foam::CFCCellToCellStencil::CFCCellToCellStencil(const polyMesh& mesh) : - faceStencil(mesh) + cellToCellStencil(mesh) { // Calculate per cell the (face) connected cells (in global numbering) - labelListList globalCellCells; - calcCellStencil(globalCellCells); - - // Add stencils of neighbouring cells to create faceStencil - labelListList faceStencil; - calcFaceStencil(globalCellCells, faceStencil); - - // Transfer to *this - transfer(faceStencil); + calcCellStencil(*this); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellFaceCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.H similarity index 82% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellFaceCellStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.H index 174c4b7feec5ecc5871cab0727ae972c093621f0..c524b8d3eac9e9fe8583bfa228d6ba942be5f06a 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellFaceCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CFCCellToCellStencil.H @@ -23,19 +23,19 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::cellFaceCellStencil + Foam::CFCCellToCellStencil Description SourceFiles - cellFaceCellStencil.C + CFCCellToCellStencil.C \*---------------------------------------------------------------------------*/ -#ifndef cellFaceCellStencil_H -#define cellFaceCellStencil_H +#ifndef CFCCellToCellStencil_H +#define CFCCellToCellStencil_H -#include "faceStencil.H" +#include "cellToCellStencil.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -43,12 +43,12 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class cellFaceCellStencil Declaration + Class CFCCellToCellStencil Declaration \*---------------------------------------------------------------------------*/ -class cellFaceCellStencil +class CFCCellToCellStencil : - public faceStencil + public cellToCellStencil { // Private Member Functions @@ -57,17 +57,17 @@ class cellFaceCellStencil void calcCellStencil(labelListList& globalCellCells) const; //- Disallow default bitwise copy construct - cellFaceCellStencil(const cellFaceCellStencil&); + CFCCellToCellStencil(const CFCCellToCellStencil&); //- Disallow default bitwise assignment - void operator=(const cellFaceCellStencil&); + void operator=(const CFCCellToCellStencil&); public: // Constructors //- Construct from mesh - explicit cellFaceCellStencil(const polyMesh& mesh); + explicit CFCCellToCellStencil(const polyMesh& mesh); }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellPointCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.C similarity index 90% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellPointCellStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.C index 67b5be9a325baa700aaaaa3045798b3e0df2a1e2..af6de874b6edf459f7903b3c98c19b569c0cdc99 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellPointCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.C @@ -24,13 +24,13 @@ License \*---------------------------------------------------------------------------*/ -#include "cellPointCellStencil.H" +#include "CPCCellToCellStencil.H" #include "syncTools.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // Calculates per point the neighbour data (= pointCells) -void Foam::cellPointCellStencil::calcPointBoundaryData +void Foam::CPCCellToCellStencil::calcPointBoundaryData ( const boolList& isValidBFace, const labelList& boundaryPoints, @@ -69,7 +69,7 @@ void Foam::cellPointCellStencil::calcPointBoundaryData // Calculates per cell the neighbour data (= cell or boundary in global // numbering). First element is always cell itself! -void Foam::cellPointCellStencil::calcCellStencil +void Foam::CPCCellToCellStencil::calcCellStencil ( labelListList& globalCellCells ) const @@ -154,20 +154,13 @@ void Foam::cellPointCellStencil::calcCellStencil // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::cellPointCellStencil::cellPointCellStencil(const polyMesh& mesh) +Foam::CPCCellToCellStencil::CPCCellToCellStencil(const polyMesh& mesh) : - faceStencil(mesh) + cellToCellStencil(mesh) { // Calculate per cell the (point) connected cells (in global numbering) labelListList globalCellCells; - calcCellStencil(globalCellCells); - - // Add stencils of neighbouring cells to create faceStencil - labelListList faceStencil; - calcFaceStencil(globalCellCells, faceStencil); - - // Transfer to *this - transfer(faceStencil); + calcCellStencil(*this); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellPointCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.H similarity index 84% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellPointCellStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.H index 6bd318338b4ada8c23927d4b20c8f9354da3f50a..848e9044ab1c1a2fd5bb9b51ab7597714e138186 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/cellPointCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/CPCCellToCellStencil.H @@ -23,19 +23,19 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::cellPointCellStencil + Foam::CPCCellToCellStencil Description SourceFiles - cellPointCellStencil.C + CPCCellToCellStencil.C \*---------------------------------------------------------------------------*/ -#ifndef cellPointCellStencil_H -#define cellPointCellStencil_H +#ifndef CPCCellToCellStencil_H +#define CPCCellToCellStencil_H -#include "faceStencil.H" +#include "cellToCellStencil.H" #include "boolList.H" #include "HashSet.H" #include "Map.H" @@ -46,12 +46,12 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class cellPointCellStencil Declaration + Class CPCCellToCellStencil Declaration \*---------------------------------------------------------------------------*/ -class cellPointCellStencil +class CPCCellToCellStencil : - public faceStencil + public cellToCellStencil { // Private Member Functions @@ -67,10 +67,10 @@ class cellPointCellStencil //- Disallow default bitwise copy construct - cellPointCellStencil(const cellPointCellStencil&); + CPCCellToCellStencil(const CPCCellToCellStencil&); //- Disallow default bitwise assignment - void operator=(const cellPointCellStencil&); + void operator=(const CPCCellToCellStencil&); public: @@ -78,7 +78,7 @@ public: // Constructors //- Construct from all cells and boundary faces - explicit cellPointCellStencil(const polyMesh&); + explicit CPCCellToCellStencil(const polyMesh&); }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.C new file mode 100644 index 0000000000000000000000000000000000000000..37af71f5e4884c97f6c11cc1aa4a3e6dfb6511a5 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.C @@ -0,0 +1,350 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "cellToCellStencil.H" +#include "syncTools.H" +#include "SortableList.H" +#include "emptyPolyPatch.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +// Merge two list and guarantee global0,global1 are first. +void Foam::cellToCellStencil::merge +( + const label global0, + const label global1, + const labelList& listA, + labelList& listB +) +{ + sort(listB); + + // See if global0, global1 already present in listB + label nGlobalInsert = 0; + + if (global0 != -1) + { + label index0 = findSortedIndex(listB, global0); + if (index0 == -1) + { + nGlobalInsert++; + } + } + + if (global1 != -1) + { + label index1 = findSortedIndex(listB, global1); + if (index1 == -1) + { + nGlobalInsert++; + } + } + + + // For all in listA see if they are present + label nInsert = 0; + + forAll(listA, i) + { + label elem = listA[i]; + + if (elem != global0 && elem != global1) + { + if (findSortedIndex(listB, elem) == -1) + { + nInsert++; + } + } + } + + // Extend B with nInsert and whether global0,global1 need to be inserted. + labelList result(listB.size() + nGlobalInsert + nInsert); + + label resultI = 0; + + // Insert global0,1 first + if (global0 != -1) + { + result[resultI++] = global0; + } + if (global1 != -1) + { + result[resultI++] = global1; + } + + + // Insert listB + forAll(listB, i) + { + label elem = listB[i]; + + if (elem != global0 && elem != global1) + { + result[resultI++] = elem; + } + } + + + // Insert listA + forAll(listA, i) + { + label elem = listA[i]; + + if (elem != global0 && elem != global1) + { + if (findSortedIndex(listB, elem) == -1) + { + result[resultI++] = elem; + } + } + } + + if (resultI != result.size()) + { + FatalErrorIn("cellToCellStencil::merge(..)") + << "problem" << abort(FatalError); + } + + listB.transfer(result); +} + + +// Merge two list and guarantee globalI is first. +void Foam::cellToCellStencil::merge +( + const label globalI, + const labelList& pGlobals, + labelList& cCells +) +{ + labelHashSet set; + forAll(cCells, i) + { + if (cCells[i] != globalI) + { + set.insert(cCells[i]); + } + } + + forAll(pGlobals, i) + { + if (pGlobals[i] != globalI) + { + set.insert(pGlobals[i]); + } + } + + cCells.setSize(set.size()+1); + label n = 0; + cCells[n++] = globalI; + + forAllConstIter(labelHashSet, set, iter) + { + cCells[n++] = iter.key(); + } +} + + +void Foam::cellToCellStencil::validBoundaryFaces(boolList& isValidBFace) const +{ + const polyBoundaryMesh& patches = mesh().boundaryMesh(); + + isValidBFace.setSize(mesh().nFaces()-mesh().nInternalFaces(), true); + + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + + if (pp.coupled() || isA<emptyPolyPatch>(pp)) + { + label bFaceI = pp.start()-mesh().nInternalFaces(); + forAll(pp, i) + { + isValidBFace[bFaceI++] = false; + } + } + } +} + + +Foam::autoPtr<Foam::indirectPrimitivePatch> +Foam::cellToCellStencil::allCoupledFacesPatch() const +{ + const polyBoundaryMesh& patches = mesh().boundaryMesh(); + + label nCoupled = 0; + + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + + if (pp.coupled()) + { + nCoupled += pp.size(); + } + } + labelList coupledFaces(nCoupled); + nCoupled = 0; + + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + + if (pp.coupled()) + { + label faceI = pp.start(); + + forAll(pp, i) + { + coupledFaces[nCoupled++] = faceI++; + } + } + } + + return autoPtr<indirectPrimitivePatch> + ( + new indirectPrimitivePatch + ( + IndirectList<face> + ( + mesh().faces(), + coupledFaces + ), + mesh().points() + ) + ); +} + + +void Foam::cellToCellStencil::unionEqOp::operator() +( + labelList& x, + const labelList& y +) const +{ + if (y.size()) + { + if (x.empty()) + { + x = y; + } + else + { + labelHashSet set(x); + forAll(y, i) + { + set.insert(y[i]); + } + x = set.toc(); + } + } +} + + +void Foam::cellToCellStencil::insertFaceCells +( + const label exclude0, + const label exclude1, + const boolList& isValidBFace, + const labelList& faceLabels, + labelHashSet& globals +) const +{ + const labelList& own = mesh().faceOwner(); + const labelList& nei = mesh().faceNeighbour(); + + forAll(faceLabels, i) + { + label faceI = faceLabels[i]; + + label globalOwn = globalNumbering().toGlobal(own[faceI]); + if (globalOwn != exclude0 && globalOwn != exclude1) + { + globals.insert(globalOwn); + } + + if (mesh().isInternalFace(faceI)) + { + label globalNei = globalNumbering().toGlobal(nei[faceI]); + if (globalNei != exclude0 && globalNei != exclude1) + { + globals.insert(globalNei); + } + } + else + { + label bFaceI = faceI-mesh().nInternalFaces(); + + if (isValidBFace[bFaceI]) + { + label globalI = globalNumbering().toGlobal + ( + mesh().nCells() + + bFaceI + ); + + if (globalI != exclude0 && globalI != exclude1) + { + globals.insert(globalI); + } + } + } + } +} + + +Foam::labelList Foam::cellToCellStencil::calcFaceCells +( + const boolList& isValidBFace, + const labelList& faceLabels, + labelHashSet& globals +) const +{ + globals.clear(); + + insertFaceCells + ( + -1, + -1, + isValidBFace, + faceLabels, + globals + ); + + return globals.toc(); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::cellToCellStencil::cellToCellStencil(const polyMesh& mesh) +: + mesh_(mesh), + globalNumbering_(mesh_.nCells()+mesh_.nFaces()-mesh_.nInternalFaces()) +{} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.H new file mode 100644 index 0000000000000000000000000000000000000000..08b7b0fb2fd171d4f2ec29e36ae2f38557c6f92c --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToCell/fullStencils/cellToCellStencil.H @@ -0,0 +1,152 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::cellToCellStencil + +Description + baseclass for extended cell centred addressing. Contains per cell a + list of neighbouring cells and/or boundaryfaces in global addressing. + +SourceFiles + cellToCellStencil.C + +\*---------------------------------------------------------------------------*/ + +#ifndef cellToCellStencil_H +#define cellToCellStencil_H + +#include "globalIndex.H" +#include "boolList.H" +#include "HashSet.H" +#include "indirectPrimitivePatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class polyMesh; + +/*---------------------------------------------------------------------------*\ + Class cellToCellStencil Declaration +\*---------------------------------------------------------------------------*/ + +class cellToCellStencil +: + public labelListList +{ + // Private data + + const polyMesh& mesh_; + + //- Global numbering for cells and boundary faces + const globalIndex globalNumbering_; + + + // Private Member Functions + + //- Disallow default bitwise assignment + void operator=(const cellToCellStencil&); + + +protected: + + //- Merge two lists. + static void merge + ( + const label, + const label, + const labelList&, + labelList& + ); + + //- Merge two lists. + static void merge(const label, const labelList&, labelList&); + + //- Valid boundary faces (not empty and not coupled) + void validBoundaryFaces(boolList& isValidBFace) const; + + //- Return patch of all coupled faces. + autoPtr<indirectPrimitivePatch> allCoupledFacesPatch() const; + + //- Combine operator for labelLists + class unionEqOp + { + public: + void operator()( labelList& x, const labelList& y ) const; + }; + + //- Collect cell neighbours of faces in global numbering + void insertFaceCells + ( + const label exclude0, + const label exclude1, + const boolList& nonEmptyFace, + const labelList& faceLabels, + labelHashSet& globals + ) const; + + //- Collect cell neighbours of faces in global numbering + labelList calcFaceCells + ( + const boolList& nonEmptyFace, + const labelList& faceLabels, + labelHashSet& globals + ) const; + + +public: + + // Constructors + + //- Construct from mesh + explicit cellToCellStencil(const polyMesh&); + + + // Member Functions + + const polyMesh& mesh() const + { + return mesh_; + } + + //- Global numbering for cells and boundary faces + const globalIndex& globalNumbering() const + { + return globalNumbering_; + } + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.C new file mode 100644 index 0000000000000000000000000000000000000000..ddc33f39e2023dc12decceaabe838221a5f545d4 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.C @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "centredCECCellToFaceStencilObject.H" + + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(centredCECCellToFaceStencilObject, 0); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCPCStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.H similarity index 66% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCPCStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.H index 183c0808ccd69c8389a7f376f5126597746d0403..b639ee910aad8fbe5232af4bf325c15cd60eece1 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCPCStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCECCellToFaceStencilObject.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::centredCPCStencilObject + Foam::centredCECCellToFaceStencilObject Description @@ -31,11 +31,11 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef centredCPCStencilObject_H -#define centredCPCStencilObject_H +#ifndef centredCECCellToFaceStencilObject_H +#define centredCECCellToFaceStencilObject_H -#include "extendedCentredStencil.H" -#include "cellPointCellStencil.H" +#include "extendedCentredCellToFaceStencil.H" +#include "CECCellToFaceStencil.H" #include "MeshObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,35 +44,42 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class centredCPCStencilObject Declaration + Class centredCECCellToFaceStencilObject Declaration \*---------------------------------------------------------------------------*/ -class centredCPCStencilObject +class centredCECCellToFaceStencilObject : - public MeshObject<fvMesh, centredCPCStencilObject>, - public extendedCentredStencil + public MeshObject<fvMesh, centredCECCellToFaceStencilObject>, + public extendedCentredCellToFaceStencil { public: - TypeName("centredCFCStencil"); + TypeName("centredCECCellToFaceStencil"); // Constructors //- Construct from uncompacted face stencil - explicit centredCPCStencilObject + explicit centredCECCellToFaceStencilObject ( const fvMesh& mesh ) : - MeshObject<fvMesh, centredCPCStencilObject>(mesh), - extendedCentredStencil(cellPointCellStencil(mesh)) - {} + MeshObject<fvMesh, centredCECCellToFaceStencilObject>(mesh), + extendedCentredCellToFaceStencil(CECCellToFaceStencil(mesh)) + { + if (extendedCellToFaceStencil::debug) + { + Info<< "Generated centred stencil " << type() + << nl << endl; + writeStencilStats(Info, stencil(), map()); + } + } // Destructor - virtual ~centredCPCStencilObject() + virtual ~centredCECCellToFaceStencilObject() {} }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.C new file mode 100644 index 0000000000000000000000000000000000000000..675b9298700f200ff4c05aee4fbc25b8a79a864f --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.C @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "centredCFCCellToFaceStencilObject.H" + + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(centredCFCCellToFaceStencilObject, 0); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.H new file mode 100644 index 0000000000000000000000000000000000000000..d6961220b5f13f64e0beda7dd989105a50f5069a --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCFCCellToFaceStencilObject.H @@ -0,0 +1,94 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::centredCFCCellToFaceStencilObject + +Description + +SourceFiles + +\*---------------------------------------------------------------------------*/ + +#ifndef centredCFCCellToFaceStencilObject_H +#define centredCFCCellToFaceStencilObject_H + +#include "extendedCentredCellToFaceStencil.H" +#include "CFCCellToFaceStencil.H" +#include "MeshObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class centredCFCCellToFaceStencilObject Declaration +\*---------------------------------------------------------------------------*/ + +class centredCFCCellToFaceStencilObject +: + public MeshObject<fvMesh, centredCFCCellToFaceStencilObject>, + public extendedCentredCellToFaceStencil +{ + +public: + + TypeName("centredCFCCellToFaceStencil"); + + // Constructors + + //- Construct from uncompacted face stencil + explicit centredCFCCellToFaceStencilObject + ( + const fvMesh& mesh + ) + : + MeshObject<fvMesh, centredCFCCellToFaceStencilObject>(mesh), + extendedCentredCellToFaceStencil(CFCCellToFaceStencil(mesh)) + { + if (extendedCellToFaceStencil::debug) + { + Info<< "Generated centred stencil " << type() + << nl << endl; + writeStencilStats(Info, stencil(), map()); + } + } + + + //- Destructor + virtual ~centredCFCCellToFaceStencilObject() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.C new file mode 100644 index 0000000000000000000000000000000000000000..cf0fc71cf4b9c0380f3dff34ad44aebb946e87bd --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.C @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "centredCPCCellToFaceStencilObject.H" + + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(centredCPCCellToFaceStencilObject, 0); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.H new file mode 100644 index 0000000000000000000000000000000000000000..68608f210bc9a5bea7e016ad8705d717b941201c --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredCPCCellToFaceStencilObject.H @@ -0,0 +1,95 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::centredCPCCellToFaceStencilObject + +Description + +SourceFiles + +\*---------------------------------------------------------------------------*/ + +#ifndef centredCPCCellToFaceStencilObject_H +#define centredCPCCellToFaceStencilObject_H + +#include "extendedCentredCellToFaceStencil.H" +#include "CPCCellToFaceStencil.H" +#include "MeshObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class centredCPCCellToFaceStencilObject Declaration +\*---------------------------------------------------------------------------*/ + +class centredCPCCellToFaceStencilObject +: + public MeshObject<fvMesh, centredCPCCellToFaceStencilObject>, + public extendedCentredCellToFaceStencil +{ + +public: + + TypeName("centredCFCCellToFaceStencil"); + + // Constructors + + //- Construct from uncompacted face stencil + explicit centredCPCCellToFaceStencilObject + ( + const fvMesh& mesh + ) + : + MeshObject<fvMesh, centredCPCCellToFaceStencilObject>(mesh), + extendedCentredCellToFaceStencil(CPCCellToFaceStencil(mesh)) + { + if (extendedCellToFaceStencil::debug) + { + Info<< "Generated centred stencil " << type() + << nl << endl; + writeStencilStats(Info, stencil(), map()); + } + } + + + // Destructor + + virtual ~centredCPCCellToFaceStencilObject() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.C new file mode 100644 index 0000000000000000000000000000000000000000..b66c40ce059dd15edd673e75f7aba716cd2af296 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.C @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "centredFECCellToFaceStencilObject.H" + + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(centredFECCellToFaceStencilObject, 0); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.H new file mode 100644 index 0000000000000000000000000000000000000000..3a802374f7af4de0b48af6c7d036f557e608bdcd --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/centredFECCellToFaceStencilObject.H @@ -0,0 +1,95 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::centredFECCellToFaceStencilObject + +Description + +SourceFiles + +\*---------------------------------------------------------------------------*/ + +#ifndef centredFECCellToFaceStencilObject_H +#define centredFECCellToFaceStencilObject_H + +#include "extendedCentredCellToFaceStencil.H" +#include "FECCellToFaceStencil.H" +#include "MeshObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class centredFECCellToFaceStencilObject Declaration +\*---------------------------------------------------------------------------*/ + +class centredFECCellToFaceStencilObject +: + public MeshObject<fvMesh, centredFECCellToFaceStencilObject>, + public extendedCentredCellToFaceStencil +{ + +public: + + TypeName("centredCFCCellToFaceStencil"); + + // Constructors + + //- Construct from uncompacted face stencil + explicit centredFECCellToFaceStencilObject + ( + const fvMesh& mesh + ) + : + MeshObject<fvMesh, centredFECCellToFaceStencilObject>(mesh), + extendedCentredCellToFaceStencil(FECCellToFaceStencil(mesh)) + { + if (extendedCellToFaceStencil::debug) + { + Info<< "Generated centred stencil " << type() + << nl << endl; + writeStencilStats(Info, stencil(), map()); + } + } + + + // Destructor + + virtual ~centredFECCellToFaceStencilObject() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/pureUpwindCFCCellToFaceStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/pureUpwindCFCCellToFaceStencilObject.C new file mode 100644 index 0000000000000000000000000000000000000000..541e7f40d0c32fd4112088232eabea1dc26da81c --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/pureUpwindCFCCellToFaceStencilObject.C @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "pureUpwindCFCCellToFaceStencilObject.H" + + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(pureUpwindCFCCellToFaceStencilObject, 0); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/pureUpwindCFCCellToFaceStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/pureUpwindCFCCellToFaceStencilObject.H new file mode 100644 index 0000000000000000000000000000000000000000..c3be0efe7e02c399500f46c7bfd2bdd8f9d7e442 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/pureUpwindCFCCellToFaceStencilObject.H @@ -0,0 +1,95 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::upwindCFCCellToFaceStencilObject + +Description + +SourceFiles + +\*---------------------------------------------------------------------------*/ + +#ifndef pureUpwindCFCCellToFaceStencilObject_H +#define pureUpwindCFCCellToFaceStencilObject_H + +#include "extendedUpwindCellToFaceStencil.H" +#include "CFCCellToFaceStencil.H" +#include "MeshObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class pureUpwindCFCCellToFaceStencilObject Declaration +\*---------------------------------------------------------------------------*/ + +class pureUpwindCFCCellToFaceStencilObject +: + public MeshObject<fvMesh, pureUpwindCFCCellToFaceStencilObject>, + public extendedUpwindCellToFaceStencil +{ + +public: + + TypeName("pureUpwindCFCCellToFaceStencil"); + + // Constructors + + //- Construct from uncompacted face stencil + explicit pureUpwindCFCCellToFaceStencilObject + ( + const fvMesh& mesh + ) + : + MeshObject<fvMesh, pureUpwindCFCCellToFaceStencilObject>(mesh), + extendedUpwindCellToFaceStencil(CFCCellToFaceStencil(mesh)) + { + if (extendedCellToFaceStencil::debug) + { + Info<< "Generated pure upwind stencil " << type() + << nl << endl; + writeStencilStats(Info, ownStencil(), ownMap()); + } + } + + + // Destructor + + virtual ~pureUpwindCFCCellToFaceStencilObject() + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCFCStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.C similarity index 92% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCFCStencilObject.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.C index e7ebaa389bdfea701f66d8ef8876ad38d97897cc..1c5271b13248118e0ebcfd093c303b086037977a 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCFCStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.C @@ -24,14 +24,14 @@ License \*---------------------------------------------------------------------------*/ -#include "centredCFCStencilObject.H" +#include "upwindCECCellToFaceStencilObject.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(centredCFCStencilObject, 0); + defineTypeNameAndDebug(upwindCECCellToFaceStencilObject, 0); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCFCStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.H similarity index 64% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCFCStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.H index de8972c112e647f78712371df86a289a85816a74..d23cdacfef173d7174c306445e6415e7f50c6c0a 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCFCStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCECCellToFaceStencilObject.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::upwindCFCStencilObject + Foam::upwindCECCellToFaceStencilObject Description @@ -31,11 +31,11 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef upwindCFCStencilObject_H -#define upwindCFCStencilObject_H +#ifndef upwindCECCellToFaceStencilObject_H +#define upwindCECCellToFaceStencilObject_H -#include "extendedUpwindStencil.H" -#include "cellFaceCellStencil.H" +#include "extendedUpwindCellToFaceStencil.H" +#include "CECCellToFaceStencil.H" #include "MeshObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,36 +44,49 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class upwindCFCStencilObject Declaration + Class upwindCECCellToFaceStencilObject Declaration \*---------------------------------------------------------------------------*/ -class upwindCFCStencilObject +class upwindCECCellToFaceStencilObject : - public MeshObject<fvMesh, upwindCFCStencilObject>, - public extendedUpwindStencil + public MeshObject<fvMesh, upwindCECCellToFaceStencilObject>, + public extendedUpwindCellToFaceStencil { public: - TypeName("upwindCFCStencil"); + TypeName("upwindCFCCellToFaceStencil"); // Constructors //- Construct from uncompacted face stencil - explicit upwindCFCStencilObject + explicit upwindCECCellToFaceStencilObject ( const fvMesh& mesh, + const bool pureUpwind, const scalar minOpposedness ) : - MeshObject<fvMesh, upwindCFCStencilObject>(mesh), - extendedUpwindStencil(cellFaceCellStencil(mesh), minOpposedness) - {} + MeshObject<fvMesh, upwindCECCellToFaceStencilObject>(mesh), + extendedUpwindCellToFaceStencil + ( + CECCellToFaceStencil(mesh), + pureUpwind, + minOpposedness + ) + { + if (extendedCellToFaceStencil::debug) + { + Info<< "Generated off-centred stencil " << type() + << nl << endl; + writeStencilStats(Info, ownStencil(), ownMap()); + } + } // Destructor - virtual ~upwindCFCStencilObject() + virtual ~upwindCECCellToFaceStencilObject() {} }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCECStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.C similarity index 92% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCECStencilObject.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.C index 6a1e250065db0ae32556e3c94172096078684183..18ea2137222c8baa5fe90fe3289b051c1913cbc6 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCECStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.C @@ -24,14 +24,14 @@ License \*---------------------------------------------------------------------------*/ -#include "centredCECStencilObject.H" +#include "upwindCFCCellToFaceStencilObject.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(centredCECStencilObject, 0); + defineTypeNameAndDebug(upwindCFCCellToFaceStencilObject, 0); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCPCStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.H similarity index 64% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCPCStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.H index b73d25820522007152aa50f32ea45028d6a93825..f543f6d8e63e426880bce2e4edda575ca3bb09dc 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCPCStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCFCCellToFaceStencilObject.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::upwindCPCStencilObject + Foam::upwindCFCCellToFaceStencilObject Description @@ -31,11 +31,11 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef upwindCPCStencilObject_H -#define upwindCPCStencilObject_H +#ifndef upwindCFCCellToFaceStencilObject_H +#define upwindCFCCellToFaceStencilObject_H -#include "extendedUpwindStencil.H" -#include "cellPointCellStencil.H" +#include "extendedUpwindCellToFaceStencil.H" +#include "CFCCellToFaceStencil.H" #include "MeshObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,36 +44,49 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class upwindCPCStencilObject Declaration + Class upwindCFCCellToFaceStencilObject Declaration \*---------------------------------------------------------------------------*/ -class upwindCPCStencilObject +class upwindCFCCellToFaceStencilObject : - public MeshObject<fvMesh, upwindCPCStencilObject>, - public extendedUpwindStencil + public MeshObject<fvMesh, upwindCFCCellToFaceStencilObject>, + public extendedUpwindCellToFaceStencil { public: - TypeName("upwindCFCStencil"); + TypeName("upwindCFCCellToFaceStencil"); // Constructors //- Construct from uncompacted face stencil - explicit upwindCPCStencilObject + explicit upwindCFCCellToFaceStencilObject ( const fvMesh& mesh, + const bool pureUpwind, const scalar minOpposedness ) : - MeshObject<fvMesh, upwindCPCStencilObject>(mesh), - extendedUpwindStencil(cellPointCellStencil(mesh), minOpposedness) - {} + MeshObject<fvMesh, upwindCFCCellToFaceStencilObject>(mesh), + extendedUpwindCellToFaceStencil + ( + CFCCellToFaceStencil(mesh), + pureUpwind, + minOpposedness + ) + { + if (extendedCellToFaceStencil::debug) + { + Info<< "Generated off-centred stencil " << type() + << nl << endl; + writeStencilStats(Info, ownStencil(), ownMap()); + } + } // Destructor - virtual ~upwindCPCStencilObject() + virtual ~upwindCFCCellToFaceStencilObject() {} }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredFECStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.C similarity index 92% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredFECStencilObject.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.C index ba7351994a998a531616c9903e52753d25a7ac65..1f1e3448cafd81d77913baf8a580db2b57c1a388 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredFECStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.C @@ -24,14 +24,14 @@ License \*---------------------------------------------------------------------------*/ -#include "centredFECStencilObject.H" +#include "upwindCPCCellToFaceStencilObject.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(centredFECStencilObject, 0); + defineTypeNameAndDebug(upwindCPCCellToFaceStencilObject, 0); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCECStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.H similarity index 64% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCECStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.H index dc4544e9b37e1f30da30435a1bda61ca54998007..b86e0b00b5bc724594945e535864a9a317a4a9ff 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCECStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindCPCCellToFaceStencilObject.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::upwindCECStencilObject + Foam::upwindCPCCellToFaceStencilObject Description @@ -31,11 +31,11 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef upwindCECStencilObject_H -#define upwindCECStencilObject_H +#ifndef upwindCPCCellToFaceStencilObject_H +#define upwindCPCCellToFaceStencilObject_H -#include "extendedUpwindStencil.H" -#include "cellEdgeCellStencil.H" +#include "extendedUpwindCellToFaceStencil.H" +#include "CPCCellToFaceStencil.H" #include "MeshObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,36 +44,49 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class upwindCECStencilObject Declaration + Class upwindCPCCellToFaceStencilObject Declaration \*---------------------------------------------------------------------------*/ -class upwindCECStencilObject +class upwindCPCCellToFaceStencilObject : - public MeshObject<fvMesh, upwindCECStencilObject>, - public extendedUpwindStencil + public MeshObject<fvMesh, upwindCPCCellToFaceStencilObject>, + public extendedUpwindCellToFaceStencil { public: - TypeName("upwindCFCStencil"); + TypeName("upwindCFCCellToFaceStencil"); // Constructors //- Construct from uncompacted face stencil - explicit upwindCECStencilObject + explicit upwindCPCCellToFaceStencilObject ( const fvMesh& mesh, + const bool pureUpwind, const scalar minOpposedness ) : - MeshObject<fvMesh, upwindCECStencilObject>(mesh), - extendedUpwindStencil(cellEdgeCellStencil(mesh), minOpposedness) - {} + MeshObject<fvMesh, upwindCPCCellToFaceStencilObject>(mesh), + extendedUpwindCellToFaceStencil + ( + CPCCellToFaceStencil(mesh), + pureUpwind, + minOpposedness + ) + { + if (extendedCellToFaceStencil::debug) + { + Info<< "Generated off-centred stencil " << type() + << nl << endl; + writeStencilStats(Info, ownStencil(), ownMap()); + } + } // Destructor - virtual ~upwindCECStencilObject() + virtual ~upwindCPCCellToFaceStencilObject() {} }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCPCStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.C similarity index 92% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCPCStencilObject.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.C index db5bf143ae170f945ff9c036233d0b59ab021c01..d397daf01f8ed2c676ce7d16b5334d47ad25e59d 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCPCStencilObject.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.C @@ -24,14 +24,14 @@ License \*---------------------------------------------------------------------------*/ -#include "centredCPCStencilObject.H" +#include "upwindFECCellToFaceStencilObject.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(centredCPCStencilObject, 0); + defineTypeNameAndDebug(upwindFECCellToFaceStencilObject, 0); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindFECStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.H similarity index 64% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindFECStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.H index 478774013a0edc76f9e21f066f51c98c669bab74..9bd07a1607357d52784d2dc9f949aef71efee8f2 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindFECStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/MeshObjects/upwindFECCellToFaceStencilObject.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::upwindFECStencilObject + Foam::upwindFECCellToFaceStencilObject Description @@ -31,11 +31,11 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef upwindFECStencilObject_H -#define upwindFECStencilObject_H +#ifndef upwindFECCellToFaceStencilObject_H +#define upwindFECCellToFaceStencilObject_H -#include "extendedUpwindStencil.H" -#include "faceEdgeCellStencil.H" +#include "extendedUpwindCellToFaceStencil.H" +#include "FECCellToFaceStencil.H" #include "MeshObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,36 +44,49 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class upwindFECStencilObject Declaration + Class upwindFECCellToFaceStencilObject Declaration \*---------------------------------------------------------------------------*/ -class upwindFECStencilObject +class upwindFECCellToFaceStencilObject : - public MeshObject<fvMesh, upwindFECStencilObject>, - public extendedUpwindStencil + public MeshObject<fvMesh, upwindFECCellToFaceStencilObject>, + public extendedUpwindCellToFaceStencil { public: - TypeName("upwindCFCStencil"); + TypeName("upwindCFCCellToFaceStencil"); // Constructors //- Construct from uncompacted face stencil - explicit upwindFECStencilObject + explicit upwindFECCellToFaceStencilObject ( const fvMesh& mesh, + const bool pureUpwind, const scalar minOpposedness ) : - MeshObject<fvMesh, upwindFECStencilObject>(mesh), - extendedUpwindStencil(faceEdgeCellStencil(mesh), minOpposedness) - {} + MeshObject<fvMesh, upwindFECCellToFaceStencilObject>(mesh), + extendedUpwindCellToFaceStencil + ( + FECCellToFaceStencil(mesh), + pureUpwind, + minOpposedness + ) + { + if (extendedCellToFaceStencil::debug) + { + Info<< "Generated off-centred stencil " << type() + << nl << endl; + writeStencilStats(Info, ownStencil(), ownMap()); + } + } // Destructor - virtual ~upwindFECStencilObject() + virtual ~upwindFECCellToFaceStencilObject() {} }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C similarity index 57% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C index 1ff00db7ba44c2350e44de2b2845f8b563d491e6..5b1cb12e342a15f38eaa1caa5f9b3da4787197c9 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.C @@ -24,184 +24,83 @@ License \*---------------------------------------------------------------------------*/ -#include "extendedStencil.H" +#include "extendedCellToFaceStencil.H" #include "globalIndex.H" #include "syncTools.H" #include "SortableList.H" +/* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */ + +defineTypeNameAndDebug(Foam::extendedCellToFaceStencil, 0); + + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Calculates per face a list of global cell/face indices. -void Foam::extendedStencil::calcFaceStencil +void Foam::extendedCellToFaceStencil::writeStencilStats ( - const labelListList& globalCellCells, - labelListList& faceStencil + Ostream& os, + const labelListList& stencil, + const mapDistribute& map ) { - const polyBoundaryMesh& patches = mesh_.boundaryMesh(); - const label nBnd = mesh_.nFaces()-mesh_.nInternalFaces(); - const labelList& own = mesh_.faceOwner(); - const labelList& nei = mesh_.faceNeighbour(); - + label sumSize = 0; + label nSum = 0; + label minSize = labelMax; + label maxSize = labelMin; - // Determine neighbouring global cell Cells - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - labelListList neiGlobalCellCells(nBnd); - forAll(patches, patchI) + forAll(stencil, i) { - const polyPatch& pp = patches[patchI]; + const labelList& sCells = stencil[i]; - if (pp.coupled()) + if (sCells.size() > 0) { - label faceI = pp.start(); - - forAll(pp, i) - { - neiGlobalCellCells[faceI-mesh_.nInternalFaces()] = - globalCellCells[own[faceI]]; - faceI++; - } + sumSize += sCells.size(); + nSum++; + minSize = min(minSize, sCells.size()); + maxSize = max(maxSize, sCells.size()); } } - syncTools::swapBoundaryFaceList(mesh_, neiGlobalCellCells, false); - - - - // Construct stencil in global numbering - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - faceStencil.setSize(mesh_.nFaces()); - - labelHashSet faceStencilSet; - - for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++) + reduce(sumSize, sumOp<label>()); + reduce(nSum, sumOp<label>()); + + reduce(minSize, minOp<label>()); + reduce(maxSize, maxOp<label>()); + + os << "Stencil size :" << nl + << " average : " << scalar(sumSize)/nSum << nl + << " min : " << minSize << nl + << " max : " << maxSize << nl + << endl; + + // Sum all sent data + label nSent = 0; + label nLocal = 0; + forAll(map.subMap(), procI) { - faceStencilSet.clear(); - - const labelList& ownCCells = globalCellCells[own[faceI]]; - label globalOwn = ownCCells[0]; - // Insert cellCells - forAll(ownCCells, i) - { - faceStencilSet.insert(ownCCells[i]); - } - - const labelList& neiCCells = globalCellCells[nei[faceI]]; - label globalNei = neiCCells[0]; - // Insert cellCells - forAll(neiCCells, i) + if (procI != Pstream::myProcNo()) { - faceStencilSet.insert(neiCCells[i]); + nSent += map.subMap()[procI].size(); } - - // Guarantee owner first, neighbour second. - faceStencil[faceI].setSize(faceStencilSet.size()); - label n = 0; - faceStencil[faceI][n++] = globalOwn; - faceStencil[faceI][n++] = globalNei; - forAllConstIter(labelHashSet, faceStencilSet, iter) + else { - if (iter.key() != globalOwn && iter.key() != globalNei) - { - faceStencil[faceI][n++] = iter.key(); - } + nLocal += map.subMap()[procI].size(); } - //Pout<< "internalface:" << faceI << " toc:" << faceStencilSet.toc() - // << " faceStencil:" << faceStencil[faceI] << endl; } - forAll(patches, patchI) - { - const polyPatch& pp = patches[patchI]; - label faceI = pp.start(); - - if (pp.coupled()) - { - forAll(pp, i) - { - faceStencilSet.clear(); - - const labelList& ownCCells = globalCellCells[own[faceI]]; - label globalOwn = ownCCells[0]; - forAll(ownCCells, i) - { - faceStencilSet.insert(ownCCells[i]); - } - - // And the neighbours of the coupled cell - const labelList& neiCCells = - neiGlobalCellCells[faceI-mesh_.nInternalFaces()]; - label globalNei = neiCCells[0]; - forAll(neiCCells, i) - { - faceStencilSet.insert(neiCCells[i]); - } - // Guarantee owner first, neighbour second. - faceStencil[faceI].setSize(faceStencilSet.size()); - label n = 0; - faceStencil[faceI][n++] = globalOwn; - faceStencil[faceI][n++] = globalNei; - forAllConstIter(labelHashSet, faceStencilSet, iter) - { - if (iter.key() != globalOwn && iter.key() != globalNei) - { - faceStencil[faceI][n++] = iter.key(); - } - } - - //Pout<< "coupledface:" << faceI - // << " toc:" << faceStencilSet.toc() - // << " faceStencil:" << faceStencil[faceI] << endl; - - faceI++; - } - } - else if (!isA<emptyPolyPatch>(pp)) - { - forAll(pp, i) - { - faceStencilSet.clear(); - - const labelList& ownCCells = globalCellCells[own[faceI]]; - label globalOwn = ownCCells[0]; - forAll(ownCCells, i) - { - faceStencilSet.insert(ownCCells[i]); - } - - // Guarantee owner first, neighbour second. - faceStencil[faceI].setSize(faceStencilSet.size()); - label n = 0; - faceStencil[faceI][n++] = globalOwn; - forAllConstIter(labelHashSet, faceStencilSet, iter) - { - if (iter.key() != globalOwn) - { - faceStencil[faceI][n++] = iter.key(); - } - } - - //Pout<< "boundaryface:" << faceI - // << " toc:" << faceStencilSet.toc() - // << " faceStencil:" << faceStencil[faceI] << endl; - - faceI++; - } - } - } + os << "Local data size : " << returnReduce(nLocal, sumOp<label>()) << nl + << "Sent data size : " << returnReduce(nSent, sumOp<label>()) << nl + << endl; } -Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap +Foam::autoPtr<Foam::mapDistribute> +Foam::extendedCellToFaceStencil::calcDistributeMap ( + const polyMesh& mesh, const globalIndex& globalNumbering, labelListList& faceStencil ) { - const label nBnd = mesh_.nFaces()-mesh_.nInternalFaces(); - - // Convert stencil to schedule // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -215,8 +114,8 @@ Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap // these are always all needed. List<Map<label> > globalToProc(Pstream::nProcs()); { - const labelList& procPatchMap = mesh_.globalData().procPatchMap(); - const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + const labelList& procPatchMap = mesh.globalData().procPatchMap(); + const polyBoundaryMesh& patches = mesh.boundaryMesh(); // Presize with (as estimate) size of patch to neighbour. forAll(procPatchMap, procI) @@ -280,12 +179,12 @@ Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap // 2. The overall compact addressing is - // - myProcNo first + // - myProcNo data first (uncompacted) // - all other processors consecutively labelList compactStart(Pstream::nProcs()); compactStart[Pstream::myProcNo()] = 0; - label nCompact = mesh_.nCells()+nBnd; + label nCompact = globalNumbering.localSize(); forAll(compactStart, procI) { if (procI != Pstream::myProcNo()) @@ -321,7 +220,7 @@ Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap { recvCompact[procI] = compactStart[procI] - + identity(mesh_.nCells()+nBnd); + + identity(globalNumbering.localSize()); } } labelListList sendCompact(Pstream::nProcs()); @@ -374,8 +273,9 @@ Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap } } + // Constuct map for distribution of compact data. - return autoPtr<mapDistribute> + autoPtr<mapDistribute> mapPtr ( new mapDistribute ( @@ -385,15 +285,40 @@ Foam::autoPtr<Foam::mapDistribute> Foam::extendedStencil::calcDistributeMap true // reuse send/recv maps. ) ); + + return mapPtr; } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::extendedStencil::extendedStencil(const polyMesh& mesh) +Foam::extendedCellToFaceStencil::extendedCellToFaceStencil(const polyMesh& mesh) : mesh_(mesh) -{} +{ + // Check for transformation - not supported. + const polyBoundaryMesh& patches = mesh.boundaryMesh(); + + forAll(patches, patchI) + { + if (isA<coupledPolyPatch>(patches[patchI])) + { + const coupledPolyPatch& cpp = + refCast<const coupledPolyPatch>(patches[patchI]); + + if (!cpp.parallel() || cpp.separated()) + { + FatalErrorIn + ( + "extendedCellToFaceStencil::extendedCellToFaceStencil" + "(const polyMesh&)" + ) << "Coupled patches with transformations not supported." + << endl + << "Problematic patch " << cpp.name() << exit(FatalError); + } + } + } +} // ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.H similarity index 78% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.H index 6faff8f3a6c7219a69b594250d78c58476136637..bb0e92d11fc8d2dc6aa4e55758f8ff0c0c9b08f9 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencil.H @@ -23,10 +23,10 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::extendedStencil + Foam::extendedCellToFaceStencil Description - Calculates/constains the extended face stencil. + Calculates/constains the extended cell-to-face stencil. The stencil is a list of indices into either cells or boundary faces in a compact way. (element 0 is owner, 1 is neighbour). The index numbering @@ -41,13 +41,13 @@ Description - sum the weights*field. SourceFiles - extendedStencil.C - extendedStencilTemplates.C + extendedCellToFaceStencil.C + extendedCellToFaceStencilTemplates.C \*---------------------------------------------------------------------------*/ -#ifndef extendedStencil_H -#define extendedStencil_H +#ifndef extendedCellToFaceStencil_H +#define extendedCellToFaceStencil_H #include "mapDistribute.H" #include "volFields.H" @@ -61,10 +61,10 @@ namespace Foam class globalIndex; /*---------------------------------------------------------------------------*\ - Class extendedStencil Declaration + Class extendedCellToFaceStencil Declaration \*---------------------------------------------------------------------------*/ -class extendedStencil +class extendedCellToFaceStencil { protected: @@ -75,19 +75,6 @@ protected: // Protected Member Functions - //- Collect cell neighbours into extended stencil - void calcFaceStencil - ( - const labelListList& globalCellCells, - labelListList& faceStencil - ); - - //- Calculate distribute map - autoPtr<mapDistribute> calcDistributeMap - ( - const globalIndex& globalNumbering, - labelListList& faceStencil - ); private: @@ -95,22 +82,44 @@ private: // Private Member Functions //- Disallow default bitwise copy construct - extendedStencil(const extendedStencil&); + extendedCellToFaceStencil(const extendedCellToFaceStencil&); //- Disallow default bitwise assignment - void operator=(const extendedStencil&); + void operator=(const extendedCellToFaceStencil&); +protected: + + //- Write some statistics about stencil + static void writeStencilStats + ( + Ostream& os, + const labelListList& stencil, + const mapDistribute& map + ); + public: + // Declare name of the class and its debug switch + ClassName("extendedCellToFaceStencil"); + + // Constructors //- Construct from mesh - explicit extendedStencil(const polyMesh&); + explicit extendedCellToFaceStencil(const polyMesh&); // Member Functions + //- Calculate distribute map + static autoPtr<mapDistribute> calcDistributeMap + ( + const polyMesh& mesh, + const globalIndex& globalNumbering, + labelListList& faceStencil + ); + //- Use map to get the data into stencil order template<class T> static void collectData @@ -141,7 +150,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "extendedStencilTemplates.C" +# include "extendedCellToFaceStencilTemplates.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilTemplates.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C similarity index 94% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilTemplates.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C index 537b7520d867e0b434edbcc91e05f04f8f90b787..9ee125de9b52497fdf8068a1ebd0e73fa90c64fc 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilTemplates.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCellToFaceStencilTemplates.C @@ -24,12 +24,12 @@ License \*---------------------------------------------------------------------------*/ -#include "extendedStencil.H" +#include "extendedCellToFaceStencil.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -void Foam::extendedStencil::collectData +void Foam::extendedCellToFaceStencil::collectData ( const mapDistribute& map, const labelListList& stencil, @@ -79,7 +79,7 @@ void Foam::extendedStencil::collectData template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > -Foam::extendedStencil::weightedSum +Foam::extendedCellToFaceStencil::weightedSum ( const mapDistribute& map, const labelListList& stencil, @@ -101,7 +101,10 @@ Foam::extendedStencil::weightedSum ( fld.name(), mesh.time().timeName(), - mesh + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false ), mesh, dimensioned<Type> diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedCentredStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.C similarity index 79% rename from src/finiteVolume/fvMesh/extendedStencil/extendedCentredStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.C index 252357a5f2e7680b718215a318b5119fb8b3cc35..acca48566fabffc3e0b4cbce3be39283fa83e786 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedCentredStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.C @@ -25,26 +25,34 @@ License \*---------------------------------------------------------------------------*/ #include "mapDistribute.H" -#include "extendedCentredStencil.H" -#include "faceStencil.H" +#include "extendedCentredCellToFaceStencil.H" +#include "cellToFaceStencil.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::extendedCentredStencil::extendedCentredStencil(const faceStencil& stencil) +Foam::extendedCentredCellToFaceStencil::extendedCentredCellToFaceStencil +( + const cellToFaceStencil& stencil +) : - extendedStencil(stencil.mesh()) + extendedCellToFaceStencil(stencil.mesh()) { stencil_ = stencil; - // Calculate distribute map (also renumbers stencil) - mapPtr_ = calcDistributeMap(stencil.globalNumbering(), stencil_); + // Calculate distribute map (also renumbers elements in stencil) + mapPtr_ = calcDistributeMap + ( + stencil.mesh(), + stencil.globalNumbering(), + stencil_ + ); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // Per face which elements of the stencil to keep. -void Foam::extendedCentredStencil::compact() +void Foam::extendedCentredCellToFaceStencil::compact() { boolList isInStencil(map().constructSize(), false); diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedCentredStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.H similarity index 79% rename from src/finiteVolume/fvMesh/extendedStencil/extendedCentredStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.H index edbf5ea48585e5739e9e5bc5436e582f1adcc378..c58e81db922cc3407bfcaaba91245977b2cf53ed 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedCentredStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedCentredCellToFaceStencil.H @@ -23,34 +23,34 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::extendedCentredStencil + Foam::extendedCentredCellToFaceStencil Description SourceFiles - extendedCentredStencil.C + extendedCentredCellToFaceStencil.C \*---------------------------------------------------------------------------*/ -#ifndef extendedCentredStencil_H -#define extendedCentredStencil_H +#ifndef extendedCentredCellToFaceStencil_H +#define extendedCentredCellToFaceStencil_H -#include "extendedStencil.H" +#include "extendedCellToFaceStencil.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -class faceStencil; +class cellToFaceStencil; /*---------------------------------------------------------------------------*\ - Class extendedCentredStencil Declaration + Class extendedCentredCellToFaceStencil Declaration \*---------------------------------------------------------------------------*/ -class extendedCentredStencil +class extendedCentredCellToFaceStencil : - public extendedStencil + public extendedCellToFaceStencil { // Private data @@ -64,10 +64,13 @@ class extendedCentredStencil // Private Member Functions //- Disallow default bitwise copy construct - extendedCentredStencil(const extendedCentredStencil&); + extendedCentredCellToFaceStencil + ( + const extendedCentredCellToFaceStencil& + ); //- Disallow default bitwise assignment - void operator=(const extendedCentredStencil&); + void operator=(const extendedCentredCellToFaceStencil&); public: @@ -75,7 +78,7 @@ public: // Constructors //- Construct from uncompacted face stencil - explicit extendedCentredStencil(const faceStencil&); + explicit extendedCentredCellToFaceStencil(const cellToFaceStencil&); // Member Functions @@ -103,7 +106,13 @@ public: List<List<T> >& stencilFld ) const { - extendedStencil::collectData(map(), stencil(), fld, stencilFld); + extendedCellToFaceStencil::collectData + ( + map(), + stencil(), + fld, + stencilFld + ); } //- Sum vol field contributions to create face values @@ -114,7 +123,7 @@ public: const List<List<scalar> >& stencilWeights ) const { - return extendedStencil::weightedSum + return extendedCellToFaceStencil::weightedSum ( map(), stencil(), diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.C similarity index 69% rename from src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.C index b7fa870cf741bcfdadc683be7956f3fc4496c4f3..80e47855a8c8cd4966a80389fe7ac1ff4720238f 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.C @@ -24,14 +24,14 @@ License \*---------------------------------------------------------------------------*/ -#include "extendedUpwindStencil.H" -#include "faceStencil.H" +#include "extendedUpwindCellToFaceStencil.H" +#include "cellToFaceStencil.H" #include "syncTools.H" #include "SortableList.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void Foam::extendedUpwindStencil::selectOppositeFaces +void Foam::extendedUpwindCellToFaceStencil::selectOppositeFaces ( const boolList& nonEmptyFace, const scalar minOpposedness, @@ -103,7 +103,7 @@ void Foam::extendedUpwindStencil::selectOppositeFaces } -void Foam::extendedUpwindStencil::transportStencil +void Foam::extendedUpwindCellToFaceStencil::transportStencil ( const boolList& nonEmptyFace, const labelListList& faceStencil, @@ -168,8 +168,10 @@ void Foam::extendedUpwindStencil::transportStencil } if (n != transportedStencil.size()) { - FatalErrorIn("extendedUpwindStencil::transportStencil(..)") - << "problem:" << faceStencilSet + FatalErrorIn + ( + "extendedUpwindCellToFaceStencil::transportStencil(..)" + ) << "problem:" << faceStencilSet << abort(FatalError); } } @@ -188,15 +190,17 @@ void Foam::extendedUpwindStencil::transportStencil } if (n != transportedStencil.size()) { - FatalErrorIn("extendedUpwindStencil::transportStencil(..)") - << "problem:" << faceStencilSet + FatalErrorIn + ( + "extendedUpwindCellToFaceStencil::transportStencil(..)" + ) << "problem:" << faceStencilSet << abort(FatalError); } } } -void Foam::extendedUpwindStencil::transportStencils +void Foam::extendedUpwindCellToFaceStencil::transportStencils ( const labelListList& faceStencil, const scalar minOpposedness, @@ -240,6 +244,7 @@ void Foam::extendedUpwindStencil::transportStencils // Internal faces for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++) { + // Get stencil as owner + neighbour + stencil from 'opposite' faces transportStencil ( nonEmptyFace, @@ -367,13 +372,15 @@ void Foam::extendedUpwindStencil::transportStencils // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::extendedUpwindStencil::extendedUpwindStencil +Foam::extendedUpwindCellToFaceStencil::extendedUpwindCellToFaceStencil ( - const faceStencil& stencil, + const cellToFaceStencil& stencil, + const bool pureUpwind, const scalar minOpposedness ) : - extendedStencil(stencil.mesh()) + extendedCellToFaceStencil(stencil.mesh()), + pureUpwind_(pureUpwind) { //forAll(stencil, faceI) //{ @@ -414,15 +421,145 @@ Foam::extendedUpwindStencil::extendedUpwindStencil ownMapPtr_ = calcDistributeMap ( + stencil.mesh(), stencil.globalNumbering(), ownStencil_ ); neiMapPtr_ = calcDistributeMap ( + stencil.mesh(), stencil.globalNumbering(), neiStencil_ ); + + // stencil now in compact form + if (pureUpwind_) + { + const fvMesh& mesh = dynamic_cast<const fvMesh&>(stencil.mesh()); + + List<List<point> > stencilPoints(ownStencil_.size()); + + // Owner stencil + // ~~~~~~~~~~~~~ + + collectData(ownMapPtr_(), ownStencil_, mesh.C(), stencilPoints); + + // Mask off all stencil points on wrong side of face + forAll(stencilPoints, faceI) + { + const point& fc = mesh.faceCentres()[faceI]; + const vector& fArea = mesh.faceAreas()[faceI]; + + const List<point>& points = stencilPoints[faceI]; + const labelList& stencil = ownStencil_[faceI]; + + DynamicList<label> newStencil(stencil.size()); + forAll(points, i) + { + if (((points[i]-fc) & fArea) < 0) + { + newStencil.append(stencil[i]); + } + } + if (newStencil.size() != stencil.size()) + { + ownStencil_[faceI].transfer(newStencil); + } + } + + + // Neighbour stencil + // ~~~~~~~~~~~~~~~~~ + + collectData(neiMapPtr_(), neiStencil_, mesh.C(), stencilPoints); + + // Mask off all stencil points on wrong side of face + forAll(stencilPoints, faceI) + { + const point& fc = mesh.faceCentres()[faceI]; + const vector& fArea = mesh.faceAreas()[faceI]; + + const List<point>& points = stencilPoints[faceI]; + const labelList& stencil = neiStencil_[faceI]; + + DynamicList<label> newStencil(stencil.size()); + forAll(points, i) + { + if (((points[i]-fc) & fArea) > 0) + { + newStencil.append(stencil[i]); + } + } + if (newStencil.size() != stencil.size()) + { + neiStencil_[faceI].transfer(newStencil); + } + } + + // Note: could compact schedule as well. for if cells are not needed + // across any boundary anymore. However relatively rare. + } +} + + +Foam::extendedUpwindCellToFaceStencil::extendedUpwindCellToFaceStencil +( + const cellToFaceStencil& stencil +) +: + extendedCellToFaceStencil(stencil.mesh()), + pureUpwind_(true) +{ + // Calculate stencil points with full stencil + + ownStencil_ = stencil; + + ownMapPtr_ = calcDistributeMap + ( + stencil.mesh(), + stencil.globalNumbering(), + ownStencil_ + ); + + const fvMesh& mesh = dynamic_cast<const fvMesh&>(stencil.mesh()); + + List<List<point> > stencilPoints(ownStencil_.size()); + collectData(ownMapPtr_(), ownStencil_, mesh.C(), stencilPoints); + + // Split stencil into owner and neighbour + neiStencil_.setSize(ownStencil_.size()); + + forAll(stencilPoints, faceI) + { + const point& fc = mesh.faceCentres()[faceI]; + const vector& fArea = mesh.faceAreas()[faceI]; + + const List<point>& points = stencilPoints[faceI]; + const labelList& stencil = ownStencil_[faceI]; + + DynamicList<label> newOwnStencil(stencil.size()); + DynamicList<label> newNeiStencil(stencil.size()); + forAll(points, i) + { + if (((points[i]-fc) & fArea) > 0) + { + newNeiStencil.append(stencil[i]); + } + else + { + newOwnStencil.append(stencil[i]); + } + } + if (newNeiStencil.size() > 0) + { + ownStencil_[faceI].transfer(newOwnStencil); + neiStencil_[faceI].transfer(newNeiStencil); + } + } + + // Should compact schedule. Or have both return the same schedule. + neiMapPtr_.reset(new mapDistribute(ownMapPtr_())); } diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.H similarity index 70% rename from src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.H index 174eb27a9d8d7b388a99bc085153ac9766eb210e..408d28ad8912d597814b58f4bcff273d48c0f226 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencil.H @@ -23,38 +23,50 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::extendedUpwindStencil + Foam::extendedUpwindCellToFaceStencil Description + Creates upwind stencil by shifting a centred stencil to upwind and downwind + faces and optionally removing all non-(up/down)wind faces ('pureUpwind'). + + Note: the minOpposedness parameter is to decide which upwind and + downwind faces to combine the stencils from. If myArea is the + local area and upwindArea + the area of the possible upwind candidate it will be included if + (upwindArea & myArea)/magSqr(myArea) > minOpposedness + so this includes both cosine and area. WIP. SourceFiles - extendedUpwindStencil.C - extendedUpwindStencilTemplates.C + extendedUpwindCellToFaceStencil.C + extendedUpwindCellToFaceStencilTemplates.C \*---------------------------------------------------------------------------*/ -#ifndef extendedUpwindStencil_H -#define extendedUpwindStencil_H +#ifndef extendedUpwindCellToFaceStencil_H +#define extendedUpwindCellToFaceStencil_H -#include "extendedStencil.H" +#include "extendedCellToFaceStencil.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -class faceStencil; +class cellToFaceStencil; /*---------------------------------------------------------------------------*\ - Class extendedUpwindStencil Declaration + Class extendedUpwindCellToFaceStencil Declaration \*---------------------------------------------------------------------------*/ -class extendedUpwindStencil +class extendedUpwindCellToFaceStencil : - public extendedStencil + public extendedCellToFaceStencil { // Private data + //- Does stencil contain upwind points only + const bool pureUpwind_; + //- Swap map for getting neigbouring data autoPtr<mapDistribute> ownMapPtr_; autoPtr<mapDistribute> neiMapPtr_; @@ -103,26 +115,41 @@ class extendedUpwindStencil //- Disallow default bitwise copy construct - extendedUpwindStencil(const extendedUpwindStencil&); + extendedUpwindCellToFaceStencil(const extendedUpwindCellToFaceStencil&); //- Disallow default bitwise assignment - void operator=(const extendedUpwindStencil&); + void operator=(const extendedUpwindCellToFaceStencil&); public: // Constructors - //- Construct from mesh and uncompacted face stencil - extendedUpwindStencil + //- Construct from mesh and uncompacted centred face stencil. + // Transports facestencil to create owner and neighbour versions. + // pureUpwind to remove any remaining downwind cells. + extendedUpwindCellToFaceStencil ( - const faceStencil&, + const cellToFaceStencil&, + const bool pureUpwind, const scalar minOpposedness ); + //- Construct from mesh and uncompacted centred face stencil. Splits + // stencil into owner and neighbour (so always pure upwind) + extendedUpwindCellToFaceStencil + ( + const cellToFaceStencil& + ); + // Member Functions + bool pureUpwind() const + { + return pureUpwind_; + } + //- Return reference to the parallel distribution map const mapDistribute& ownMap() const { @@ -167,7 +194,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "extendedUpwindStencilTemplates.C" +# include "extendedUpwindCellToFaceStencilTemplates.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencilTemplates.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C similarity index 95% rename from src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencilTemplates.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C index 5482261df8ba59e1455f3a13dcbcc567cfbbfd36..ee545754fa2fa02c1fdb923a516a1c4aad76668c 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedUpwindStencilTemplates.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/extendedUpwindCellToFaceStencilTemplates.C @@ -24,13 +24,13 @@ License \*---------------------------------------------------------------------------*/ -#include "extendedStencil.H" +#include "extendedCellToFaceStencil.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > -Foam::extendedUpwindStencil::weightedSum +Foam::extendedUpwindCellToFaceStencil::weightedSum ( const surfaceScalarField& phi, const GeometricField<Type, fvPatchField, volMesh>& fld, @@ -54,7 +54,10 @@ Foam::extendedUpwindStencil::weightedSum ( fld.name(), mesh.time().timeName(), - mesh + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false ), mesh, dimensioned<Type> diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.C new file mode 100644 index 0000000000000000000000000000000000000000..d7d7797da8b6d59cfbfcd47ae15b840e5d71bd6b --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.C @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "CECCellToFaceStencil.H" +#include "CECCellToCellStencil.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::CECCellToFaceStencil::CECCellToFaceStencil(const polyMesh& mesh) +: + cellToFaceStencil(mesh) +{ + // Calculate per cell the (edge) connected cells (in global numbering) + CECCellToCellStencil globalCellCells(mesh); + + // Add stencils of neighbouring cells to create faceStencil + labelListList faceStencil; + calcFaceStencil(globalCellCells, faceStencil); + + // Transfer to *this + transfer(faceStencil); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.H new file mode 100644 index 0000000000000000000000000000000000000000..640c2aa4f4746aa0a63e0805870b6d7b67b6f00a --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CECCellToFaceStencil.H @@ -0,0 +1,81 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::CECCellToFaceStencil + +Description + Combined corresponding cellToCellStencil of owner and neighbour. + +SourceFiles + CECCellToFaceStencil.C + +\*---------------------------------------------------------------------------*/ + +#ifndef CECCellToFaceStencil_H +#define CECCellToFaceStencil_H + +#include "cellToFaceStencil.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class CECCellToFaceStencil Declaration +\*---------------------------------------------------------------------------*/ + +class CECCellToFaceStencil +: + public cellToFaceStencil +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + CECCellToFaceStencil(const CECCellToFaceStencil&); + + //- Disallow default bitwise assignment + void operator=(const CECCellToFaceStencil&); + + +public: + + // Constructors + + //- Construct from all cells and boundary faces + explicit CECCellToFaceStencil(const polyMesh&); + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.C new file mode 100644 index 0000000000000000000000000000000000000000..9f19c90053568ae686d4b0cf15a80ebe092f6f40 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.C @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "CFCCellToFaceStencil.H" +#include "CFCCellToCellStencil.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::CFCCellToFaceStencil::CFCCellToFaceStencil(const polyMesh& mesh) +: + cellToFaceStencil(mesh) +{ + // Calculate per cell the (face) connected cells (in global numbering) + CFCCellToCellStencil globalCellCells(mesh); + + // Add stencils of neighbouring cells to create faceStencil + labelListList faceStencil; + calcFaceStencil(globalCellCells, faceStencil); + + // Transfer to *this + transfer(faceStencil); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredFECStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.H similarity index 70% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredFECStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.H index 8ce7efcacac1c0658d64907b9214dedb3ceecc10..a05b1b7aa6dfcaf2425d27c68bbfa57983239347 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredFECStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CFCCellToFaceStencil.H @@ -23,20 +23,20 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::centredFECStencilObject + Foam::CFCCellToFaceStencil Description + Combined corresponding cellToCellStencil of owner and neighbour. SourceFiles + CFCCellToFaceStencil.C \*---------------------------------------------------------------------------*/ -#ifndef centredFECStencilObject_H -#define centredFECStencilObject_H +#ifndef CFCCellToFaceStencil_H +#define CFCCellToFaceStencil_H -#include "extendedCentredStencil.H" -#include "faceEdgeCellStencil.H" -#include "MeshObject.H" +#include "cellToFaceStencil.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,36 +44,27 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class centredFECStencilObject Declaration + Class CFCCellToFaceStencil Declaration \*---------------------------------------------------------------------------*/ -class centredFECStencilObject +class CFCCellToFaceStencil : - public MeshObject<fvMesh, centredFECStencilObject>, - public extendedCentredStencil + public cellToFaceStencil { + // Private Member Functions -public: - - TypeName("centredCFCStencil"); - - // Constructors + //- Disallow default bitwise copy construct + CFCCellToFaceStencil(const CFCCellToFaceStencil&); - //- Construct from uncompacted face stencil - explicit centredFECStencilObject - ( - const fvMesh& mesh - ) - : - MeshObject<fvMesh, centredFECStencilObject>(mesh), - extendedCentredStencil(faceEdgeCellStencil(mesh)) - {} + //- Disallow default bitwise assignment + void operator=(const CFCCellToFaceStencil&); +public: - // Destructor + // Constructors - virtual ~centredFECStencilObject() - {} + //- Construct from mesh + explicit CFCCellToFaceStencil(const polyMesh& mesh); }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.C new file mode 100644 index 0000000000000000000000000000000000000000..3414af9932b2cdfc9577aa24c461839562535d00 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.C @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "CPCCellToFaceStencil.H" +#include "CPCCellToCellStencil.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::CPCCellToFaceStencil::CPCCellToFaceStencil(const polyMesh& mesh) +: + cellToFaceStencil(mesh) +{ + // Calculate per cell the (face) connected cells (in global numbering) + CPCCellToCellStencil globalCellCells(mesh); + + // Add stencils of neighbouring cells to create faceStencil + labelListList faceStencil; + calcFaceStencil(globalCellCells, faceStencil); + + // Transfer to *this + transfer(faceStencil); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.H new file mode 100644 index 0000000000000000000000000000000000000000..a82886e11145aca2883ac6846d822dca268eb0bd --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/CPCCellToFaceStencil.H @@ -0,0 +1,81 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::CPCCellToFaceStencil + +Description + Combined corresponding cellToCellStencil of owner and neighbour. + +SourceFiles + CPCCellToFaceStencil.C + +\*---------------------------------------------------------------------------*/ + +#ifndef CPCCellToFaceStencil_H +#define CPCCellToFaceStencil_H + +#include "cellToFaceStencil.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class CPCCellToFaceStencil Declaration +\*---------------------------------------------------------------------------*/ + +class CPCCellToFaceStencil +: + public cellToFaceStencil +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + CPCCellToFaceStencil(const CPCCellToFaceStencil&); + + //- Disallow default bitwise assignment + void operator=(const CPCCellToFaceStencil&); + + +public: + + // Constructors + + //- Construct from all cells and boundary faces + explicit CPCCellToFaceStencil(const polyMesh&); + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceEdgeCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.C similarity index 92% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceEdgeCellStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.C index 2d56b1b1942523b2c02acf5eb623f8f1084c6fec..2d79bd2048008b573200862d3bce53022c6f1b8d 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceEdgeCellStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "faceEdgeCellStencil.H" +#include "FECCellToFaceStencil.H" #include "syncTools.H" #include "emptyPolyPatch.H" //#include "meshTools.H" @@ -34,7 +34,7 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // Calculates per edge the neighbour data (= edgeCells) -void Foam::faceEdgeCellStencil::calcEdgeBoundaryData +void Foam::FECCellToFaceStencil::calcEdgeBoundaryData ( const boolList& isValidBFace, const labelList& boundaryEdges, @@ -73,7 +73,7 @@ void Foam::faceEdgeCellStencil::calcEdgeBoundaryData // Calculates per face the edge connected data (= cell or boundary in global // numbering). -void Foam::faceEdgeCellStencil::calcFaceStencil +void Foam::FECCellToFaceStencil::calcFaceStencil ( labelListList& faceStencil ) const @@ -220,7 +220,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil { if (iter.key() == globalOwn || iter.key() == globalNei) { - FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)") + FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)") << "problem:" << faceStencilSet << abort(FatalError); } @@ -281,8 +281,10 @@ void Foam::faceEdgeCellStencil::calcFaceStencil { if (iter.key() == globalOwn || iter.key() == globalNei) { - FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)") - << "problem:" << faceStencilSet + FatalErrorIn + ( + "FECCellToFaceStencil::calcFaceStencil(..)" + ) << "problem:" << faceStencilSet << abort(FatalError); } faceStencil[faceI][n++] = iter.key(); @@ -345,8 +347,10 @@ void Foam::faceEdgeCellStencil::calcFaceStencil { if (iter.key() == globalOwn) { - FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)") - << "problem:" << faceStencilSet + FatalErrorIn + ( + "FECCellToFaceStencil::calcFaceStencil(..)" + ) << "problem:" << faceStencilSet << abort(FatalError); } faceStencil[faceI][n++] = iter.key(); @@ -363,7 +367,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil label globalOwn = globalNumbering().toGlobal(own[faceI]); if (faceStencil[faceI][0] != globalOwn) { - FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)") + FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)") << "problem:" << faceStencil[faceI] << " globalOwn:" << globalOwn << abort(FatalError); @@ -371,7 +375,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil label globalNei = globalNumbering().toGlobal(nei[faceI]); if (faceStencil[faceI][1] != globalNei) { - FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)") + FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)") << "problem:" << faceStencil[faceI] << " globalNei:" << globalNei << abort(FatalError); @@ -392,7 +396,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil label globalOwn = globalNumbering().toGlobal(own[faceI]); if (faceStencil[faceI][0] != globalOwn) { - FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)") + FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)") << "problem:" << faceStencil[faceI] << " globalOwn:" << globalOwn << abort(FatalError); @@ -400,7 +404,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil label globalNei = neiGlobalCell[faceI-mesh().nInternalFaces()]; if (faceStencil[faceI][1] != globalNei) { - FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)") + FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)") << "problem:" << faceStencil[faceI] << " globalNei:" << globalNei << abort(FatalError); @@ -416,7 +420,7 @@ void Foam::faceEdgeCellStencil::calcFaceStencil label globalOwn = globalNumbering().toGlobal(own[faceI]); if (faceStencil[faceI][0] != globalOwn) { - FatalErrorIn("faceEdgeCellStencil::calcFaceStencil(..)") + FatalErrorIn("FECCellToFaceStencil::calcFaceStencil(..)") << "problem:" << faceStencil[faceI] << " globalOwn:" << globalOwn << abort(FatalError); @@ -429,9 +433,9 @@ void Foam::faceEdgeCellStencil::calcFaceStencil // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::faceEdgeCellStencil::faceEdgeCellStencil(const polyMesh& mesh) +Foam::FECCellToFaceStencil::FECCellToFaceStencil(const polyMesh& mesh) : - faceStencil(mesh) + cellToFaceStencil(mesh) { // Calculate per face the (edge) connected cells (in global numbering) labelListList faceStencil; diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceEdgeCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.H similarity index 83% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceEdgeCellStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.H index dfbb990fbce92858578e87db23071bebd1986758..6a00f702ea92cc9d19d655ad0ee19ff70e846510 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceEdgeCellStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/FECCellToFaceStencil.H @@ -23,23 +23,20 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::faceEdgeCellStencil + Foam::FECCellToFaceStencil Description All cells connected via edge to face. SourceFiles - faceEdgeCellStencil.C + FECCellToFaceStencil.C \*---------------------------------------------------------------------------*/ -#ifndef faceEdgeCellStencil_H -#define faceEdgeCellStencil_H +#ifndef FECCellToFaceStencil_H +#define FECCellToFaceStencil_H -#include "faceStencil.H" -#include "boolList.H" -#include "HashSet.H" -#include "Map.H" +#include "cellToFaceStencil.H" #include "EdgeMap.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -48,12 +45,12 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class faceEdgeCellStencil Declaration + Class FECCellToFaceStencil Declaration \*---------------------------------------------------------------------------*/ -class faceEdgeCellStencil +class FECCellToFaceStencil : - public faceStencil + public cellToFaceStencil { // Private Member Functions @@ -69,10 +66,10 @@ class faceEdgeCellStencil //- Disallow default bitwise copy construct - faceEdgeCellStencil(const faceEdgeCellStencil&); + FECCellToFaceStencil(const FECCellToFaceStencil&); //- Disallow default bitwise assignment - void operator=(const faceEdgeCellStencil&); + void operator=(const FECCellToFaceStencil&); public: @@ -80,7 +77,7 @@ public: // Constructors //- Construct from all cells and boundary faces - explicit faceEdgeCellStencil(const polyMesh&); + explicit FECCellToFaceStencil(const polyMesh&); }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceStencil.C b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.C similarity index 95% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceStencil.C rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.C index a0dac7b004f24c487911ac79cadf682b42269547..89a2cc5fecc389620dffce1f2030b53c6054cc1c 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceStencil.C +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ -#include "faceStencil.H" +#include "cellToFaceStencil.H" #include "syncTools.H" #include "SortableList.H" #include "emptyPolyPatch.H" @@ -32,7 +32,7 @@ License // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // Merge two list and guarantee global0,global1 are first. -void Foam::faceStencil::merge +void Foam::cellToFaceStencil::merge ( const label global0, const label global1, @@ -124,7 +124,7 @@ void Foam::faceStencil::merge if (resultI != result.size()) { - FatalErrorIn("faceStencil::merge(..)") + FatalErrorIn("cellToFaceStencil::merge(..)") << "problem" << abort(FatalError); } @@ -133,7 +133,7 @@ void Foam::faceStencil::merge // Merge two list and guarantee globalI is first. -void Foam::faceStencil::merge +void Foam::cellToFaceStencil::merge ( const label globalI, const labelList& pGlobals, @@ -168,7 +168,7 @@ void Foam::faceStencil::merge } -void Foam::faceStencil::validBoundaryFaces(boolList& isValidBFace) const +void Foam::cellToFaceStencil::validBoundaryFaces(boolList& isValidBFace) const { const polyBoundaryMesh& patches = mesh().boundaryMesh(); @@ -191,7 +191,7 @@ void Foam::faceStencil::validBoundaryFaces(boolList& isValidBFace) const Foam::autoPtr<Foam::indirectPrimitivePatch> -Foam::faceStencil::allCoupledFacesPatch() const +Foam::cellToFaceStencil::allCoupledFacesPatch() const { const polyBoundaryMesh& patches = mesh().boundaryMesh(); @@ -239,7 +239,7 @@ Foam::faceStencil::allCoupledFacesPatch() const } -void Foam::faceStencil::unionEqOp::operator() +void Foam::cellToFaceStencil::unionEqOp::operator() ( labelList& x, const labelList& y @@ -264,7 +264,7 @@ void Foam::faceStencil::unionEqOp::operator() } -void Foam::faceStencil::insertFaceCells +void Foam::cellToFaceStencil::insertFaceCells ( const label exclude0, const label exclude1, @@ -316,7 +316,7 @@ void Foam::faceStencil::insertFaceCells } -Foam::labelList Foam::faceStencil::calcFaceCells +Foam::labelList Foam::cellToFaceStencil::calcFaceCells ( const boolList& isValidBFace, const labelList& faceLabels, @@ -339,7 +339,7 @@ Foam::labelList Foam::faceStencil::calcFaceCells // Calculates per face a list of global cell/face indices. -void Foam::faceStencil::calcFaceStencil +void Foam::cellToFaceStencil::calcFaceStencil ( const labelListList& globalCellCells, labelListList& faceStencil @@ -502,7 +502,7 @@ void Foam::faceStencil::calcFaceStencil // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::faceStencil::faceStencil(const polyMesh& mesh) +Foam::cellToFaceStencil::cellToFaceStencil(const polyMesh& mesh) : mesh_(mesh), globalNumbering_(mesh_.nCells()+mesh_.nFaces()-mesh_.nInternalFaces()) diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceStencil.H b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.H similarity index 89% rename from src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceStencil.H rename to src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.H index a7e3105bc7d5177479d97f7f4adb5c7f4e05c92d..e577a857d51ee0371b6c86b8ff9fd6de3f1f41e7 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/faceStencil/faceStencil.H +++ b/src/finiteVolume/fvMesh/extendedStencil/cellToFace/fullStencils/cellToFaceStencil.H @@ -23,18 +23,19 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::faceStencil + Foam::cellToFaceStencil Description - baseclass for extended face-cell addressing. + baseclass for extended cell-to-facel stencils (face values from + neighbouring cells) SourceFiles faceStencil.C \*---------------------------------------------------------------------------*/ -#ifndef faceStencil_H -#define faceStencil_H +#ifndef cellToFaceStencil_H +#define cellToFaceStencil_H #include "globalIndex.H" #include "boolList.H" @@ -49,10 +50,10 @@ namespace Foam class polyMesh; /*---------------------------------------------------------------------------*\ - Class faceStencil Declaration + Class cellToFaceStencil Declaration \*---------------------------------------------------------------------------*/ -class faceStencil +class cellToFaceStencil : public labelListList { @@ -66,10 +67,12 @@ class faceStencil // Private Member Functions + //- Disallow default bitwise copy construct + cellToFaceStencil(const cellToFaceStencil&); + //- Disallow default bitwise assignment - void operator=(const faceStencil&); + void operator=(const cellToFaceStencil&); - protected: @@ -130,7 +133,7 @@ public: // Constructors //- Construct from mesh - explicit faceStencil(const polyMesh&); + explicit cellToFaceStencil(const polyMesh&); // Member Functions diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCECStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCECStencilObject.C deleted file mode 100644 index f27e24118f6928c4dc79332be76a88d839542df7..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCECStencilObject.C +++ /dev/null @@ -1,38 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "upwindCECStencilObject.H" - - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(upwindCECStencilObject, 0); -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCFCStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCFCStencilObject.C deleted file mode 100644 index 81292b002ece8bb5f58d8bf69642305f4152a30a..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCFCStencilObject.C +++ /dev/null @@ -1,38 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "upwindCFCStencilObject.H" - - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(upwindCFCStencilObject, 0); -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCPCStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCPCStencilObject.C deleted file mode 100644 index 36f0c19b34d715ca71e287ea4b094429524b346d..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindCPCStencilObject.C +++ /dev/null @@ -1,38 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "upwindCPCStencilObject.H" - - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(upwindCPCStencilObject, 0); -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindFECStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindFECStencilObject.C deleted file mode 100644 index d9202eaa6de0b967e424946aef97504ff2948f16..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/upwindFECStencilObject.C +++ /dev/null @@ -1,38 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "upwindFECStencilObject.H" - - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(upwindFECStencilObject, 0); -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.C new file mode 100644 index 0000000000000000000000000000000000000000..87d4a4a4889e1a94afb1d0c5267c822bdc9fdaa0 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.C @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "centredCFCFaceToCellStencilObject.H" + + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(centredCFCFaceToCellStencilObject, 0); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCFCStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.H similarity index 73% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCFCStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.H index 43b87a31f0587201ab3ea8460ea8c874a402e22f..4877d63a5ad64530e7f28e33a07d7957cd5af7fa 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCFCStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/MeshObjects/centredCFCFaceToCellStencilObject.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::centredCFCStencilObject + Foam::centredCFCFaceToCellStencilObject Description @@ -31,11 +31,11 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef centredCFCStencilObject_H -#define centredCFCStencilObject_H +#ifndef centredCFCFaceToCellStencilObject_H +#define centredCFCFaceToCellStencilObject_H -#include "extendedCentredStencil.H" -#include "cellFaceCellStencil.H" +#include "extendedCentredFaceToCellStencil.H" +#include "CFCFaceToCellStencil.H" #include "MeshObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,34 +44,34 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class centredCFCStencilObject Declaration + Class centredCFCFaceToCellStencilObject Declaration \*---------------------------------------------------------------------------*/ -class centredCFCStencilObject +class centredCFCFaceToCellStencilObject : - public MeshObject<fvMesh, centredCFCStencilObject>, - public extendedCentredStencil + public MeshObject<fvMesh, centredCFCFaceToCellStencilObject>, + public extendedCentredFaceToCellStencil { public: - TypeName("centredCFCStencil"); + TypeName("centredCFCFaceToCellStencil"); // Constructors //- Construct from uncompacted face stencil - explicit centredCFCStencilObject + explicit centredCFCFaceToCellStencilObject ( const fvMesh& mesh ) : - MeshObject<fvMesh, centredCFCStencilObject>(mesh), - extendedCentredStencil(cellFaceCellStencil(mesh)) + MeshObject<fvMesh, centredCFCFaceToCellStencilObject>(mesh), + extendedCentredFaceToCellStencil(CFCFaceToCellStencil(mesh)) {} //- Destructor - virtual ~centredCFCStencilObject() + virtual ~centredCFCFaceToCellStencilObject() {} }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.C new file mode 100644 index 0000000000000000000000000000000000000000..d7dcc2a093d15d4f28985292d670213b16de4f71 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.C @@ -0,0 +1,76 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "mapDistribute.H" +#include "extendedCentredFaceToCellStencil.H" +#include "faceToCellStencil.H" + +// Only for access to calcDistributeMap <- needs to be moved out +#include "extendedCellToFaceStencil.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::extendedCentredFaceToCellStencil::extendedCentredFaceToCellStencil +( + const faceToCellStencil& stencil +) +: + extendedFaceToCellStencil(stencil.mesh()) +{ + stencil_ = stencil; + + // Calculate distribute map (also renumbers elements in stencil) + mapPtr_ = extendedCellToFaceStencil::calcDistributeMap + ( + stencil.mesh(), + stencil.globalNumbering(), + stencil_ + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +// Per face which elements of the stencil to keep. +void Foam::extendedCentredFaceToCellStencil::compact() +{ + boolList isInStencil(map().constructSize(), false); + + forAll(stencil_, faceI) + { + const labelList& stencilCells = stencil_[faceI]; + + forAll(stencilCells, i) + { + isInStencil[stencilCells[i]] = true; + } + } + + mapPtr_().compact(isInStencil); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.H new file mode 100644 index 0000000000000000000000000000000000000000..137679f22665966346b07d624c233534066f10f4 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedCentredFaceToCellStencil.H @@ -0,0 +1,146 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::extendedCentredFaceToCellStencil + +Description + +SourceFiles + extendedCentredFaceToCellStencil.C + +\*---------------------------------------------------------------------------*/ + +#ifndef extendedCentredFaceToCellStencil_H +#define extendedCentredFaceToCellStencil_H + +#include "extendedFaceToCellStencil.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class faceToCellStencil; + +/*---------------------------------------------------------------------------*\ + Class extendedCentredFaceToCellStencil Declaration +\*---------------------------------------------------------------------------*/ + +class extendedCentredFaceToCellStencil +: + public extendedFaceToCellStencil +{ + // Private data + + //- Swap map for getting neigbouring data + autoPtr<mapDistribute> mapPtr_; + + //- Per face the stencil. + labelListList stencil_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + extendedCentredFaceToCellStencil + ( + const extendedCentredFaceToCellStencil& + ); + + //- Disallow default bitwise assignment + void operator=(const extendedCentredFaceToCellStencil&); + + +public: + + // Constructors + + //- Construct from uncompacted face stencil + explicit extendedCentredFaceToCellStencil(const faceToCellStencil&); + + + // Member Functions + + //- Return reference to the parallel distribution map + const mapDistribute& map() const + { + return mapPtr_(); + } + + //- Return reference to the stencil + const labelListList& stencil() const + { + return stencil_; + } + + //- After removing elements from the stencil adapt the schedule (map). + void compact(); + + //- Use map to get the data into stencil order + template<class T> + void collectData + ( + const GeometricField<T, fvsPatchField, surfaceMesh>& fld, + List<List<T> >& stencilFld + ) const + { + extendedFaceToCellStencil::collectData + ( + map(), + stencil(), + fld, + stencilFld + ); + } + + //- Sum surface field contributions to create cell values + template<class Type> + tmp<GeometricField<Type, fvPatchField, volMesh> > weightedSum + ( + const GeometricField<Type, fvsPatchField, surfaceMesh>& fld, + const List<List<scalar> >& stencilWeights + ) const + { + return extendedFaceToCellStencil::weightedSum + ( + map(), + stencil(), + fld, + stencilWeights + ); + } + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C new file mode 100644 index 0000000000000000000000000000000000000000..4f0f5c41ad581b672bc9cd77e4a6a335d71afb27 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.C @@ -0,0 +1,62 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "extendedFaceToCellStencil.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::extendedFaceToCellStencil::extendedFaceToCellStencil(const polyMesh& mesh) +: + mesh_(mesh) +{ + // Check for transformation - not supported. + const polyBoundaryMesh& patches = mesh.boundaryMesh(); + + forAll(patches, patchI) + { + if (isA<coupledPolyPatch>(patches[patchI])) + { + const coupledPolyPatch& cpp = + refCast<const coupledPolyPatch>(patches[patchI]); + + if (!cpp.parallel() || cpp.separated()) + { + FatalErrorIn + ( + "extendedFaceToCellStencil::extendedFaceToCellStencil" + "(const polyMesh&)" + ) << "Coupled patches with transformations not supported." + << endl + << "Problematic patch " << cpp.name() << exit(FatalError); + } + } + } +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.H new file mode 100644 index 0000000000000000000000000000000000000000..5c334786c6051427ac3927f4f13788890211dce7 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencil.H @@ -0,0 +1,121 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::extendedFaceToCellStencil + +Description + Note: transformations on coupled patches not supported. Problem is the + positions of cells reachable through these patches. + +SourceFiles + extendedFaceToCellStencil.C + extendedFaceToCellStencilTemplates.C + +\*---------------------------------------------------------------------------*/ + +#ifndef extendedFaceToCellStencil_H +#define extendedFaceToCellStencil_H + +#include "mapDistribute.H" +#include "volFields.H" +#include "surfaceFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class globalIndex; + +/*---------------------------------------------------------------------------*\ + Class extendedFaceToCellStencil Declaration +\*---------------------------------------------------------------------------*/ + +class extendedFaceToCellStencil +{ +protected: + + // Protected data + + const polyMesh& mesh_; + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + extendedFaceToCellStencil(const extendedFaceToCellStencil&); + + //- Disallow default bitwise assignment + void operator=(const extendedFaceToCellStencil&); + + +public: + + // Constructors + + //- Construct from mesh + explicit extendedFaceToCellStencil(const polyMesh&); + + + // Member Functions + + //- Use map to get the data into stencil order + template<class T> + static void collectData + ( + const mapDistribute& map, + const labelListList& stencil, + const GeometricField<T, fvsPatchField, surfaceMesh>& fld, + List<List<T> >& stencilFld + ); + + //- Sum surface field contributions to create cell values + template<class Type> + static tmp<GeometricField<Type, fvPatchField, volMesh> > weightedSum + ( + const mapDistribute& map, + const labelListList& stencil, + const GeometricField<Type, fvsPatchField, surfaceMesh>& fld, + const List<List<scalar> >& stencilWeights + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "extendedFaceToCellStencilTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencilTemplates.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencilTemplates.C new file mode 100644 index 0000000000000000000000000000000000000000..17210c360c8de0417611c4aacb9a4a4c1d69271c --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/extendedFaceToCellStencilTemplates.C @@ -0,0 +1,135 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "extendedFaceToCellStencil.H" + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +void Foam::extendedFaceToCellStencil::collectData +( + const mapDistribute& map, + const labelListList& stencil, + const GeometricField<Type, fvsPatchField, surfaceMesh>& fld, + List<List<Type> >& stencilFld +) +{ + // 1. Construct face data in compact addressing + List<Type> compactFld(map.constructSize(), pTraits<Type>::zero); + + // Insert my internal values + forAll(fld, cellI) + { + compactFld[cellI] = fld[cellI]; + } + // Insert my boundary values + label nCompact = fld.size(); + forAll(fld.boundaryField(), patchI) + { + const fvsPatchField<Type>& pfld = fld.boundaryField()[patchI]; + + forAll(pfld, i) + { + compactFld[nCompact++] = pfld[i]; + } + } + + // Do all swapping + map.distribute(compactFld); + + // 2. Pull to stencil + stencilFld.setSize(stencil.size()); + + forAll(stencil, faceI) + { + const labelList& compactCells = stencil[faceI]; + + stencilFld[faceI].setSize(compactCells.size()); + + forAll(compactCells, i) + { + stencilFld[faceI][i] = compactFld[compactCells[i]]; + } + } +} + + +template<class Type> +Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > +Foam::extendedFaceToCellStencil::weightedSum +( + const mapDistribute& map, + const labelListList& stencil, + const GeometricField<Type, fvsPatchField, surfaceMesh>& fld, + const List<List<scalar> >& stencilWeights +) +{ + const fvMesh& mesh = fld.mesh(); + + // Collect internal and boundary values + List<List<Type> > stencilFld; + collectData(map, stencil, fld, stencilFld); + + tmp<GeometricField<Type, fvPatchField, volMesh> > tsfCorr + ( + new GeometricField<Type, fvPatchField, volMesh> + ( + IOobject + ( + fld.name(), + mesh.time().timeName(), + mesh + ), + mesh, + dimensioned<Type> + ( + fld.name(), + fld.dimensions(), + pTraits<Type>::zero + ) + ) + ); + GeometricField<Type, fvPatchField, volMesh>& sf = tsfCorr(); + + // cells + forAll(sf, cellI) + { + const List<Type>& stField = stencilFld[cellI]; + const List<scalar>& stWeight = stencilWeights[cellI]; + + forAll(stField, i) + { + sf[cellI] += stField[i]*stWeight[i]; + } + } + + // Boundaries values? + + return tsfCorr; +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.C new file mode 100644 index 0000000000000000000000000000000000000000..c0d2302f0b3d97443b9a296724125fb6b87452c9 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.C @@ -0,0 +1,231 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "CFCFaceToCellStencil.H" +#include "syncTools.H" +#include "emptyPolyPatch.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +// Calculates per face the neighbour data (= faces of cell). Leaves out the +// face itself since this is already in stencil. +void Foam::CFCFaceToCellStencil::calcFaceBoundaryData +( + labelListList& neiGlobal +) const +{ + const polyBoundaryMesh& patches = mesh().boundaryMesh(); + const label nBnd = mesh().nFaces()-mesh().nInternalFaces(); + const labelList& own = mesh().faceOwner(); + + neiGlobal.setSize(nBnd); + + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + label faceI = pp.start(); + + if (pp.coupled()) + { + // For coupled faces get the faces of the cell on the other side + forAll(pp, i) + { + const labelList& cFaces = mesh().cells()[own[faceI]]; + + labelList& globFaces = neiGlobal[faceI-mesh().nInternalFaces()]; + globFaces.setSize(cFaces.size()-1); + label globI = 0; + + forAll(cFaces, j) + { + if (cFaces[j] != faceI) + { + globFaces[globI++] = globalNumbering().toGlobal + ( + cFaces[j] + ); + } + } + faceI++; + } + } + else if (isA<emptyPolyPatch>(pp)) + { + // Do nothing. + } + else + { + // Do nothing since face itself already in stencil + } + } + syncTools::swapBoundaryFaceList(mesh(), neiGlobal, false); +} + + +// Calculates per cell the neighbour data (= cell or boundary in global +// numbering). First element is always cell itself! +void Foam::CFCFaceToCellStencil::calcCellStencil(labelListList& globalCellFaces) + const +{ + const label nBnd = mesh().nFaces()-mesh().nInternalFaces(); + const labelList& own = mesh().faceOwner(); + const labelList& nei = mesh().faceNeighbour(); + + + // Calculate faces of coupled neighbour (in global numbering) + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + labelListList neiGlobal(nBnd); + calcFaceBoundaryData(neiGlobal); + + + + // Non-empty boundary faces + boolList validBFace(mesh().nFaces()-mesh().nInternalFaces(), true); + + const polyBoundaryMesh& patches = mesh().boundaryMesh(); + forAll(patches, patchI) + { + const polyPatch& pp = patches[patchI]; + + if (isA<emptyPolyPatch>(pp)) + { + label bFaceI = pp.start()-mesh().nInternalFaces(); + forAll(pp, i) + { + validBFace[bFaceI++] = false; + } + } + } + + + // Determine faces of cellCells in global numbering + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + DynamicList<label> allGlobalFaces(100); + + globalCellFaces.setSize(mesh().nCells()); + forAll(globalCellFaces, cellI) + { + const cell& cFaces = mesh().cells()[cellI]; + + allGlobalFaces.clear(); + + // My faces first + forAll(cFaces, i) + { + label faceI = cFaces[i]; + + if + ( + mesh().isInternalFace(faceI) + || validBFace[faceI-mesh().nInternalFaces()] + ) + { + allGlobalFaces.append(globalNumbering().toGlobal(faceI)); + } + } + + // faces of neighbouring cells second + forAll(cFaces, i) + { + label faceI = cFaces[i]; + + if (mesh().isInternalFace(faceI)) + { + label nbrCellI = own[faceI]; + if (nbrCellI == cellI) + { + nbrCellI = nei[faceI]; + } + const cell& nbrFaces = mesh().cells()[nbrCellI]; + + forAll(nbrFaces, j) + { + label nbrFaceI = nbrFaces[j]; + + if + ( + mesh().isInternalFace(nbrFaceI) + || validBFace[nbrFaceI-mesh().nInternalFaces()] + ) + { + label nbrGlobalI = globalNumbering().toGlobal(nbrFaceI); + + // Check if already there. Note:should use hashset? + if (findIndex(allGlobalFaces, nbrGlobalI) == -1) + { + allGlobalFaces.append(nbrGlobalI); + } + } + } + } + else + { + const labelList& nbrGlobalFaces = + neiGlobal[faceI-mesh().nInternalFaces()]; + + forAll(nbrGlobalFaces, j) + { + label nbrGlobalI = nbrGlobalFaces[j]; + + // Check if already there. Note:should use hashset? + if (findIndex(allGlobalFaces, nbrGlobalI) == -1) + { + allGlobalFaces.append(nbrGlobalI); + } + } + } + } + + globalCellFaces[cellI] = allGlobalFaces; + //Pout<< "** cell:" << cellI + // << " at:" << mesh().cellCentres()[cellI] + // << endl; + //const labelList& globalFaces = globalCellFaces[cellI]; + //forAll(globalFaces, i) + //{ + // label faceI = globalNumbering().toLocal(globalFaces[i]); + // Pout<< " face:" << faceI + // << " at:" << mesh().faceCentres()[faceI] + // << endl; + //} + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::CFCFaceToCellStencil::CFCFaceToCellStencil(const polyMesh& mesh) +: + faceToCellStencil(mesh) +{ + // Calculate per cell the (face) connected cells (in global numbering) + calcCellStencil(*this); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCECStencilObject.H b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.H similarity index 70% rename from src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCECStencilObject.H rename to src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.H index 29ece11951ce7d41458b6a43bdc67dd4f4bb7482..2bbf9376f438047e47ece65c6e1a9c6f5a091173 100644 --- a/src/finiteVolume/fvMesh/extendedStencil/extendedStencilMeshObjects/centredCECStencilObject.H +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/CFCFaceToCellStencil.H @@ -23,20 +23,19 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::centredCECStencilObject + Foam::CFCFaceToCellStencil Description SourceFiles + CFCFaceToCellStencil.C \*---------------------------------------------------------------------------*/ -#ifndef centredCECStencilObject_H -#define centredCECStencilObject_H +#ifndef CFCFaceToCellStencil_H +#define CFCFaceToCellStencil_H -#include "extendedCentredStencil.H" -#include "cellEdgeCellStencil.H" -#include "MeshObject.H" +#include "faceToCellStencil.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,36 +43,31 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class centredCECStencilObject Declaration + Class CFCFaceToCellStencil Declaration \*---------------------------------------------------------------------------*/ -class centredCECStencilObject +class CFCFaceToCellStencil : - public MeshObject<fvMesh, centredCECStencilObject>, - public extendedCentredStencil + public faceToCellStencil { + // Private Member Functions -public: + void calcFaceBoundaryData(labelListList& neiGlobal) const; - TypeName("centredCECStencil"); + void calcCellStencil(labelListList& globalCellFaces) const; - // Constructors + //- Disallow default bitwise copy construct + CFCFaceToCellStencil(const CFCFaceToCellStencil&); - //- Construct from uncompacted face stencil - explicit centredCECStencilObject - ( - const fvMesh& mesh - ) - : - MeshObject<fvMesh, centredCECStencilObject>(mesh), - extendedCentredStencil(cellEdgeCellStencil(mesh)) - {} + //- Disallow default bitwise assignment + void operator=(const CFCFaceToCellStencil&); +public: - // Destructor + // Constructors - virtual ~centredCECStencilObject() - {} + //- Construct from mesh + explicit CFCFaceToCellStencil(const polyMesh& mesh); }; diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.C b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.C new file mode 100644 index 0000000000000000000000000000000000000000..7e871cc7fa282e3e1af3a53bbd479d375488940e --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.C @@ -0,0 +1,41 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "faceToCellStencil.H" +#include "polyMesh.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::faceToCellStencil::faceToCellStencil(const polyMesh& mesh) +: + mesh_(mesh), + globalNumbering_(mesh_.nFaces()) +{} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.H b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.H new file mode 100644 index 0000000000000000000000000000000000000000..84df1ea789de5a6e54e47414d65fe4c0f588c5a0 --- /dev/null +++ b/src/finiteVolume/fvMesh/extendedStencil/faceToCell/fullStencils/faceToCellStencil.H @@ -0,0 +1,108 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::faceToCellStencil + +Description + baseclass for extended cell centred addressing. Contains per cell a + list of neighbouring faces in global addressing. + +SourceFiles + faceToCellStencil.C + +\*---------------------------------------------------------------------------*/ + +#ifndef faceToCellStencil_H +#define faceToCellStencil_H + +#include "globalIndex.H" +#include "boolList.H" +#include "HashSet.H" +#include "indirectPrimitivePatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class polyMesh; + +/*---------------------------------------------------------------------------*\ + Class faceToCellStencil Declaration +\*---------------------------------------------------------------------------*/ + +class faceToCellStencil +: + public labelListList +{ + // Private data + + const polyMesh& mesh_; + + //- Global numbering for faces + const globalIndex globalNumbering_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + faceToCellStencil(const faceToCellStencil&); + + //- Disallow default bitwise assignment + void operator=(const faceToCellStencil&); + +public: + + // Constructors + + //- Construct from mesh + explicit faceToCellStencil(const polyMesh&); + + + // Member Functions + + const polyMesh& mesh() const + { + return mesh_; + } + + //- Global numbering for faces + const globalIndex& globalNumbering() const + { + return globalNumbering_; + } + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C index aebecfefe9e22cf44914f8ff7b5a196a6b8f8207..5dd07f3a921b2732973b88d6993c543b61ff6863 100644 --- a/src/finiteVolume/fvMesh/fvMesh.C +++ b/src/finiteVolume/fvMesh/fvMesh.C @@ -44,17 +44,22 @@ License #include "leastSquaresVectors.H" #include "CentredFitData.H" #include "linearFitPolynomial.H" +#include "quadraticFitPolynomial.H" #include "quadraticLinearFitPolynomial.H" +//#include "quadraticFitSnGradData.H" #include "skewCorrectionVectors.H" -#include "centredCECStencilObject.H" -#include "centredCFCStencilObject.H" -#include "centredCPCStencilObject.H" -#include "centredFECStencilObject.H" -#include "upwindCECStencilObject.H" -#include "upwindCFCStencilObject.H" -#include "upwindCPCStencilObject.H" -#include "upwindFECStencilObject.H" + +#include "centredCECCellToFaceStencilObject.H" +#include "centredCFCCellToFaceStencilObject.H" +#include "centredCPCCellToFaceStencilObject.H" +#include "centredFECCellToFaceStencilObject.H" +#include "upwindCECCellToFaceStencilObject.H" +#include "upwindCFCCellToFaceStencilObject.H" +#include "upwindCPCCellToFaceStencilObject.H" +#include "upwindFECCellToFaceStencilObject.H" + +#include "centredCFCFaceToCellStencilObject.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -89,11 +94,12 @@ void Foam::fvMesh::clearGeom() // Things geometry dependent that are not updated. volPointInterpolation::Delete(*this); extendedLeastSquaresVectors::Delete(*this); - extendedLeastSquaresVectors::Delete(*this); leastSquaresVectors::Delete(*this); CentredFitData<linearFitPolynomial>::Delete(*this); + CentredFitData<quadraticFitPolynomial>::Delete(*this); CentredFitData<quadraticLinearFitPolynomial>::Delete(*this); skewCorrectionVectors::Delete(*this); + //quadraticFitSnGradData::Delete(*this); } @@ -105,20 +111,24 @@ void Foam::fvMesh::clearAddressing() volPointInterpolation::Delete(*this); extendedLeastSquaresVectors::Delete(*this); - extendedLeastSquaresVectors::Delete(*this); leastSquaresVectors::Delete(*this); CentredFitData<linearFitPolynomial>::Delete(*this); + CentredFitData<quadraticFitPolynomial>::Delete(*this); CentredFitData<quadraticLinearFitPolynomial>::Delete(*this); skewCorrectionVectors::Delete(*this); - - centredCECStencilObject::Delete(*this); - centredCFCStencilObject::Delete(*this); - centredCPCStencilObject::Delete(*this); - centredFECStencilObject::Delete(*this); - upwindCECStencilObject::Delete(*this); - upwindCFCStencilObject::Delete(*this); - upwindCPCStencilObject::Delete(*this); - upwindFECStencilObject::Delete(*this); + //quadraticFitSnGradData::Delete(*this); + + centredCECCellToFaceStencilObject::Delete(*this); + centredCFCCellToFaceStencilObject::Delete(*this); + centredCPCCellToFaceStencilObject::Delete(*this); + centredFECCellToFaceStencilObject::Delete(*this); + // Is this geometry related - cells distorting to upwind direction? + upwindCECCellToFaceStencilObject::Delete(*this); + upwindCFCCellToFaceStencilObject::Delete(*this); + upwindCPCCellToFaceStencilObject::Delete(*this); + upwindFECCellToFaceStencilObject::Delete(*this); + + centredCFCFaceToCellStencilObject::Delete(*this); } @@ -592,8 +602,10 @@ Foam::tmp<Foam::scalarField> Foam::fvMesh::movePoints(const pointField& p) MeshObjectMovePoints<extendedLeastSquaresVectors>(*this); MeshObjectMovePoints<leastSquaresVectors>(*this); MeshObjectMovePoints<CentredFitData<linearFitPolynomial> >(*this); + MeshObjectMovePoints<CentredFitData<quadraticFitPolynomial> >(*this); MeshObjectMovePoints<CentredFitData<quadraticLinearFitPolynomial> >(*this); MeshObjectMovePoints<skewCorrectionVectors>(*this); + //MeshObjectMovePoints<quadraticFitSnGradData>(*this); return tsweptVols; } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.C index 2b7bf7be3c567a0b1523a0f7c927885111205210..fb9611e9c8aa06f8f70c56ccd847232b34b72ef5 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.C @@ -29,7 +29,7 @@ License #include "volFields.H" #include "SVD.H" #include "syncTools.H" -#include "extendedCentredStencil.H" +#include "extendedCentredCellToFaceStencil.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -37,14 +37,19 @@ template<class Polynomial> Foam::CentredFitData<Polynomial>::CentredFitData ( const fvMesh& mesh, - const extendedCentredStencil& stencil, + const extendedCentredCellToFaceStencil& stencil, const scalar linearLimitFactor, const scalar centralWeight ) : - FitData<CentredFitData<Polynomial>, extendedCentredStencil, Polynomial> + FitData + < + CentredFitData<Polynomial>, + extendedCentredCellToFaceStencil, + Polynomial + > ( - mesh, stencil, linearLimitFactor, centralWeight + mesh, stencil, true, linearLimitFactor, centralWeight ), coeffs_(mesh.nFaces()) { @@ -83,8 +88,12 @@ void Foam::CentredFitData<Polynomial>::calcFit() for(label facei = 0; facei < mesh.nInternalFaces(); facei++) { - FitData<CentredFitData<Polynomial>, extendedCentredStencil, Polynomial>:: - calcFit(coeffs_[facei], stencilPoints[facei], w[facei], facei); + FitData + < + CentredFitData<Polynomial>, + extendedCentredCellToFaceStencil, + Polynomial + >::calcFit(coeffs_[facei], stencilPoints[facei], w[facei], facei); } const surfaceScalarField::GeometricBoundaryField& bw = w.boundaryField(); @@ -101,7 +110,9 @@ void Foam::CentredFitData<Polynomial>::calcFit() { FitData < - CentredFitData<Polynomial>, extendedCentredStencil, Polynomial + CentredFitData<Polynomial>, + extendedCentredCellToFaceStencil, + Polynomial >::calcFit(coeffs_[facei], stencilPoints[facei], pw[i], facei); facei++; } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.H index 3be61503c376ec25406836b73f9b611ab33cf42b..476d8aed1779fcfe23df729c122a83e216469c1d 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitData.H @@ -43,7 +43,7 @@ SourceFiles namespace Foam { -class extendedCentredStencil; +class extendedCentredCellToFaceStencil; /*---------------------------------------------------------------------------*\ Class CentredFitData Declaration @@ -52,7 +52,7 @@ class extendedCentredStencil; template<class Polynomial> class CentredFitData : - public FitData<CentredFitData<Polynomial>, extendedCentredStencil, Polynomial> + public FitData<CentredFitData<Polynomial>, extendedCentredCellToFaceStencil, Polynomial> { // Private data @@ -79,7 +79,7 @@ public: CentredFitData ( const fvMesh& mesh, - const extendedCentredStencil& stencil, + const extendedCentredCellToFaceStencil& stencil, const scalar linearLimitFactor, const scalar centralWeight ); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitScheme.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitScheme.H index 10cea46e3b37199c71dda657e95e396664c65081..7e981024c01013dd755d35c58dc165f6382ab463 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitScheme.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CentredFitScheme/CentredFitScheme.H @@ -119,7 +119,7 @@ public: { const fvMesh& mesh = this->mesh(); - const extendedCentredStencil& stencil = Stencil::New + const extendedCentredCellToFaceStencil& stencil = Stencil::New ( mesh ); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C index 18585bc645d1db5b13784960fd315f3e8165d824..dcea0902668d1444f3d93af5c37550f45a8245bf 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.C @@ -28,22 +28,22 @@ License #include "surfaceFields.H" #include "volFields.H" #include "SVD.H" -#include "syncTools.H" -#include "extendedStencil.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template<class Form, class extendedStencil, class Polynomial> -Foam::FitData<Form, extendedStencil, Polynomial>::FitData +template<class Form, class ExtendedStencil, class Polynomial> +Foam::FitData<Form, ExtendedStencil, Polynomial>::FitData ( const fvMesh& mesh, - const extendedStencil& stencil, + const ExtendedStencil& stencil, + const bool linearCorrection, const scalar linearLimitFactor, const scalar centralWeight ) : MeshObject<fvMesh, Form>(mesh), stencil_(stencil), + linearCorrection_(linearCorrection), linearLimitFactor_(linearLimitFactor), centralWeight_(centralWeight), # ifdef SPHERICAL_GEOMETRY @@ -145,7 +145,10 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit // Setup the point weights scalarList wts(C.size(), scalar(1)); wts[0] = centralWeight_; - wts[1] = centralWeight_; + if (linearCorrection_) + { + wts[1] = centralWeight_; + } // Reference point point p0 = this->mesh().faceCentres()[facei]; @@ -191,6 +194,13 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit ); } + // Additional weighting for constant and linear terms + for(label i = 0; i < B.n(); i++) + { + B[i][0] *= wts[0]; + B[i][1] *= wts[0]; + } + // Set the fit label stencilSize = C.size(); coeffsi.setSize(stencilSize); @@ -205,7 +215,7 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit for(label i=0; i<stencilSize; i++) { - coeffsi[i] = wts[i]*svd.VSinvUt()[0][i]; + coeffsi[i] = wts[0]*wts[i]*svd.VSinvUt()[0][i]; if (mag(coeffsi[i]) > maxCoeff) { maxCoeff = mag(coeffsi[i]); @@ -213,10 +223,20 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit } } - goodFit = - (mag(coeffsi[0] - wLin) < linearLimitFactor_*wLin) - && (mag(coeffsi[1] - (1 - wLin)) < linearLimitFactor_*(1 - wLin)) - && maxCoeffi <= 1; + if (linearCorrection_) + { + goodFit = + (mag(coeffsi[0] - wLin) < linearLimitFactor_*wLin) + && (mag(coeffsi[1] - (1 - wLin)) < linearLimitFactor_*(1 - wLin)) + && maxCoeffi <= 1; + } + else + { + // Upwind: weight on face is 1. + goodFit = + (mag(coeffsi[0] - 1.0) < linearLimitFactor_*1.0) + && maxCoeffi <= 1; + } // if (goodFit && iIt > 0) // { @@ -229,7 +249,8 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit // << " sing vals " << svd.S() << endl; // } - if (!goodFit) // (not good fit so increase weight in the centre) + if (!goodFit) // (not good fit so increase weight in the centre and weight + // for constant and linear terms) { // if (iIt == 7) // { @@ -237,26 +258,46 @@ void Foam::FitData<FitDataType, ExtendedStencil, Polynomial>::calcFit // ( // "FitData<Polynomial>::calcFit" // "(const List<point>& C, const label facei" - // ) << "Cannot fit face " << facei + // ) << "Cannot fit face " << facei << " iteration " << iIt + // << " with sum of weights " << sum(coeffsi) << nl + // << " Weights " << coeffsi << nl + // << " Linear weights " << wLin << " " << 1 - wLin << nl // << " sing vals " << svd.S() << endl; // } wts[0] *= 10; - wts[1] *= 10; + if (linearCorrection_) + { + wts[1] *= 10; + } for(label j = 0; j < B.m(); j++) { B[0][j] *= 10; B[1][j] *= 10; } + + for(label i = 0; i < B.n(); i++) + { + B[i][0] *= 10; + B[i][1] *= 10; + } } } if (goodFit) { - // Remove the uncorrected linear ocefficients - coeffsi[0] -= wLin; - coeffsi[1] -= 1 - wLin; + if (linearCorrection_) + { + // Remove the uncorrected linear coefficients + coeffsi[0] -= wLin; + coeffsi[1] -= 1 - wLin; + } + else + { + // Remove the uncorrected upwind coefficients + coeffsi[0] -= 1.0; + } } else { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.H index b151a7520414268d270a2ad46f48b32fcdfcc76e..cb7bd9ceae5197bfc15cf7cbf7b6c49d03701755 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/FitData/FitData.H @@ -26,7 +26,11 @@ Class Foam::FitData Description - Data for the upwinded and centred polynomial fit interpolation schemes + Data for the upwinded and centred polynomial fit interpolation schemes. + The linearCorrection_ determines whether the fit is for a corrected + linear scheme (first two coefficients are corrections for owner and + neighbour) or a pure upwind scheme (first coefficient is correction for + owner ; weight on face taken as 1). SourceFiles FitData.C @@ -58,7 +62,11 @@ class FitData //- The stencil the fit is based on const ExtendedStencil& stencil_; - //- Factor the fit is allowed to deviate from linear. + //- Is scheme correction on linear (true) or on upwind (false) + const bool linearCorrection_; + + //- Factor the fit is allowed to deviate from the base scheme + // (linear or pure upwind) // This limits the amount of high-order correction and increases // stability on bad meshes const scalar linearLimitFactor_; @@ -84,11 +92,6 @@ class FitData const label faci ); - //- Calculate the fit for the all the mesh faces - // and set the coefficients - // virtual void calcFit(); - - public: //TypeName("FitData"); @@ -101,6 +104,7 @@ public: ( const fvMesh& mesh, const ExtendedStencil& stencil, + const bool linearCorrection, const scalar linearLimitFactor, const scalar centralWeight ); @@ -119,12 +123,18 @@ public: return stencil_; } + bool linearCorrection() const + { + return linearCorrection_; + } + //- Calculate the fit for the specified face and set the coefficients void calcFit ( scalarList& coeffsi, // coefficients to be set const List<point>&, // Stencil points - const scalar wLin, // Linear weight + const scalar wLin, // Weight for linear approximation (weights + // nearest neighbours) const label faci // Current face index ); @@ -132,7 +142,7 @@ public: virtual void calcFit() = 0; - //- Delete the data when the mesh moves not implemented + //- Recalculate weights (but not stencil) when the mesh moves bool movePoints(); }; diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/PureUpwindFitScheme/PureUpwindFitScheme.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/PureUpwindFitScheme/PureUpwindFitScheme.H new file mode 100644 index 0000000000000000000000000000000000000000..6b0b792f9a2bd766d432b7bcbb8d788f2e073dfa --- /dev/null +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/PureUpwindFitScheme/PureUpwindFitScheme.H @@ -0,0 +1,186 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::PureUpwindFitScheme + +Description + Upwind biased fit surface interpolation scheme that applies an explicit + correction to upwind. + +\*---------------------------------------------------------------------------*/ + +#ifndef PureUpwindFitScheme_H +#define PureUpwindFitScheme_H + +#include "UpwindFitData.H" +#include "upwind.H" +#include "Switch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class PureUpwindFitScheme Declaration +\*---------------------------------------------------------------------------*/ + +template<class Type, class Polynomial, class Stencil> +class PureUpwindFitScheme +: + public upwind<Type> +{ + // Private Data + + //- Factor the fit is allowed to deviate from linear. + // This limits the amount of high-order correction and increases + // stability on bad meshes + const scalar linearLimitFactor_; + + //- Weights for central stencil + const scalar centralWeight_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + PureUpwindFitScheme(const PureUpwindFitScheme&); + + //- Disallow default bitwise assignment + void operator=(const PureUpwindFitScheme&); + + +public: + + //- Runtime type information + TypeName("PureUpwindFitScheme"); + + + // Constructors + + //- Construct from mesh and Istream + // The name of the flux field is read from the Istream and looked-up + // from the mesh objectRegistry + PureUpwindFitScheme(const fvMesh& mesh, Istream& is) + : + upwind<Type> + ( + mesh, + mesh.lookupObject<surfaceScalarField>(word(is)) + ), + linearLimitFactor_(readScalar(is)), + centralWeight_(1000) + {} + + + //- Construct from mesh, faceFlux and Istream + PureUpwindFitScheme + ( + const fvMesh& mesh, + const surfaceScalarField& faceFlux, + Istream& is + ) + : + upwind<Type>(mesh, faceFlux), + linearLimitFactor_(readScalar(is)), + centralWeight_(1000) + {} + + + // Member Functions + + //- Return true if this scheme uses an explicit correction + virtual bool corrected() const + { + return true; + } + + //- Return the explicit correction to the face-interpolate + virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > + correction + ( + const GeometricField<Type, fvPatchField, volMesh>& vf + ) const + { + const fvMesh& mesh = this->mesh(); + + // Use the owner/neighbour splitting constructor + const extendedUpwindCellToFaceStencil& stencil = Stencil::New(mesh); + + const UpwindFitData<Polynomial>& ufd = + UpwindFitData<Polynomial>::New + ( + mesh, + stencil, + false, //offset to upwind + linearLimitFactor_, + centralWeight_ + ); + + const List<scalarList>& fo = ufd.owncoeffs(); + const List<scalarList>& fn = ufd.neicoeffs(); + + return stencil.weightedSum(this->faceFlux_, vf, fo, fn); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Add the patch constructor functions to the hash tables + +#define makePureUpwindFitSurfaceInterpolationTypeScheme(SS, POLYNOMIAL, STENCIL, TYPE) \ + \ +typedef PureUpwindFitScheme<TYPE, POLYNOMIAL, STENCIL> \ + PureUpwindFitScheme##TYPE##POLYNOMIAL##STENCIL##_; \ +defineTemplateTypeNameAndDebugWithName \ + (PureUpwindFitScheme##TYPE##POLYNOMIAL##STENCIL##_, #SS, 0); \ + \ +surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \ +<PureUpwindFitScheme<TYPE, POLYNOMIAL, STENCIL> > \ + add##SS##STENCIL##TYPE##MeshConstructorToTable_; \ + \ +surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \ +<PureUpwindFitScheme<TYPE, POLYNOMIAL, STENCIL> > \ + add##SS##STENCIL##TYPE##MeshFluxConstructorToTable_; + +#define makePureUpwindFitSurfaceInterpolationScheme(SS, POLYNOMIAL, STENCIL) \ + \ +makePureUpwindFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,scalar) \ +makePureUpwindFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,vector) \ +makePureUpwindFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,sphericalTensor) \ +makePureUpwindFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,symmTensor) \ +makePureUpwindFitSurfaceInterpolationTypeScheme(SS,POLYNOMIAL,STENCIL,tensor) + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.C index 6f0ea20e1b1063e70ccaf04568ca6b4181d3e5cf..cd7a206ba50048779468aaf50a9b350e0c4a910a 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.C @@ -29,7 +29,7 @@ License #include "volFields.H" #include "SVD.H" #include "syncTools.H" -#include "extendedUpwindStencil.H" +#include "extendedUpwindCellToFaceStencil.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -37,14 +37,20 @@ template<class Polynomial> Foam::UpwindFitData<Polynomial>::UpwindFitData ( const fvMesh& mesh, - const extendedUpwindStencil& stencil, + const extendedUpwindCellToFaceStencil& stencil, + const bool linearCorrection, const scalar linearLimitFactor, const scalar centralWeight ) : - FitData<UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial> + FitData + < + UpwindFitData<Polynomial>, + extendedUpwindCellToFaceStencil, + Polynomial + > ( - mesh, stencil, linearLimitFactor, centralWeight + mesh, stencil, linearCorrection, linearLimitFactor, centralWeight ), owncoeffs_(mesh.nFaces()), neicoeffs_(mesh.nFaces()) @@ -72,40 +78,103 @@ void Foam::UpwindFitData<Polynomial>::calcFit() { const fvMesh& mesh = this->mesh(); + const surfaceScalarField& w = mesh.surfaceInterpolation::weights(); + const surfaceScalarField::GeometricBoundaryField& bw = w.boundaryField(); + + // Owner stencil weights + // ~~~~~~~~~~~~~~~~~~~~~ + // Get the cell/face centres in stencil order. - // Upwind face stencils no good for triangles or tets. - // Need bigger stencils - List<List<point> > ownStencilPoints(mesh.nFaces()); + List<List<point> > stencilPoints(mesh.nFaces()); this->stencil().collectData ( this->stencil().ownMap(), this->stencil().ownStencil(), mesh.C(), - ownStencilPoints + stencilPoints ); - List<List<point> > neiStencilPoints(mesh.nFaces()); + + // find the fit coefficients for every owner + + //Pout<< "-- Owner --" << endl; + for(label facei = 0; facei < mesh.nInternalFaces(); facei++) + { + FitData + < + UpwindFitData<Polynomial>, + extendedUpwindCellToFaceStencil, + Polynomial + >::calcFit(owncoeffs_[facei], stencilPoints[facei], w[facei], facei); + + //Pout<< " facei:" << facei + // << " at:" << mesh.faceCentres()[facei] << endl; + //forAll(owncoeffs_[facei], i) + //{ + // Pout<< " point:" << stencilPoints[facei][i] + // << "\tweight:" << owncoeffs_[facei][i] + // << endl; + //} + } + + forAll(bw, patchi) + { + const fvsPatchScalarField& pw = bw[patchi]; + + if (pw.coupled()) + { + label facei = pw.patch().patch().start(); + + forAll(pw, i) + { + FitData + < + UpwindFitData<Polynomial>, + extendedUpwindCellToFaceStencil, + Polynomial + >::calcFit + ( + owncoeffs_[facei], stencilPoints[facei], pw[i], facei + ); + facei++; + } + } + } + + + // Neighbour stencil weights + // ~~~~~~~~~~~~~~~~~~~~~~~~~ + + // Note:reuse stencilPoints since is major storage this->stencil().collectData ( this->stencil().neiMap(), this->stencil().neiStencil(), mesh.C(), - neiStencilPoints + stencilPoints ); - // find the fit coefficients for every owner and neighbour of ever face - - const surfaceScalarField& w = mesh.surfaceInterpolation::weights(); + // find the fit coefficients for every neighbour + //Pout<< "-- Neighbour --" << endl; for(label facei = 0; facei < mesh.nInternalFaces(); facei++) { - FitData<UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial>:: - calcFit(owncoeffs_[facei], ownStencilPoints[facei], w[facei], facei); - FitData<UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial>:: - calcFit(neicoeffs_[facei], neiStencilPoints[facei], w[facei], facei); + FitData + < + UpwindFitData<Polynomial>, + extendedUpwindCellToFaceStencil, + Polynomial + >::calcFit(neicoeffs_[facei], stencilPoints[facei], w[facei], facei); + + //Pout<< " facei:" << facei + // << " at:" << mesh.faceCentres()[facei] << endl; + //forAll(neicoeffs_[facei], i) + //{ + // Pout<< " point:" << stencilPoints[facei][i] + // << "\tweight:" << neicoeffs_[facei][i] + // << endl; + //} } - const surfaceScalarField::GeometricBoundaryField& bw = w.boundaryField(); - forAll(bw, patchi) { const fvsPatchScalarField& pw = bw[patchi]; @@ -118,17 +187,12 @@ void Foam::UpwindFitData<Polynomial>::calcFit() { FitData < - UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial - >::calcFit - ( - owncoeffs_[facei], ownStencilPoints[facei], pw[i], facei - ); - FitData - < - UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial + UpwindFitData<Polynomial>, + extendedUpwindCellToFaceStencil, + Polynomial >::calcFit ( - neicoeffs_[facei], neiStencilPoints[facei], pw[i], facei + neicoeffs_[facei], stencilPoints[facei], pw[i], facei ); facei++; } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.H index de0636c4d393a6f21e1bc3f39e18c890434bf951..a62a3002c3242d6d6bbccf67a61bf6caf89d71b8 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitData.H @@ -27,7 +27,9 @@ Class Description Data for the quadratic fit correction interpolation scheme to be used with - upwind biased stencil + upwind biased stencil. + - linearCorrection = true : fit calculated for corrected linear scheme + - linearCorrection = false : fit calculated for corrected upwind scheme SourceFiles UpwindFitData.C @@ -44,7 +46,7 @@ SourceFiles namespace Foam { -class extendedUpwindStencil; +class extendedUpwindCellToFaceStencil; /*---------------------------------------------------------------------------*\ Class UpwindFitData Declaration @@ -53,7 +55,12 @@ class extendedUpwindStencil; template<class Polynomial> class UpwindFitData : - public FitData<UpwindFitData<Polynomial>, extendedUpwindStencil, Polynomial> + public FitData + < + UpwindFitData<Polynomial>, + extendedUpwindCellToFaceStencil, + Polynomial + > { // Private data @@ -84,7 +91,8 @@ public: UpwindFitData ( const fvMesh& mesh, - const extendedUpwindStencil& stencil, + const extendedUpwindCellToFaceStencil& stencil, + const bool linearCorrection, const scalar linearLimitFactor, const scalar centralWeight ); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitScheme.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitScheme.H index 30444aafa4bb8e11ca10eb21e3911bab51457fb7..46fe3fe1ba08aa66c7fbd4c95ae2af94cbd9fe5c 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitScheme.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/UpwindFitScheme/UpwindFitScheme.H @@ -126,9 +126,10 @@ public: { const fvMesh& mesh = this->mesh(); - const extendedUpwindStencil& stencil = Stencil::New + const extendedUpwindCellToFaceStencil& stencil = Stencil::New ( mesh, + false, //pureUpwind scalar(0.5) ); @@ -137,6 +138,7 @@ public: ( mesh, stencil, + true, //calculate as offset to linear linearLimitFactor_, centralWeight_ ); diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/biLinearFit/biLinearFit.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/biLinearFit/biLinearFit.C index 0ff394ff82a14c68ebba0a74bb271c76ae1d6cbb..b80d70f065b92a17fc2d44ded85177ded497efef 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/biLinearFit/biLinearFit.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/biLinearFit/biLinearFit.C @@ -26,7 +26,7 @@ License #include "CentredFitScheme.H" #include "biLinearFitPolynomial.H" -#include "centredCFCStencilObject.H" +#include "centredCFCCellToFaceStencilObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -42,7 +42,7 @@ namespace Foam ( biLinearFit, biLinearFitPolynomial, - centredCFCStencilObject + centredCFCCellToFaceStencilObject ); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubicUpwindFit/cubicUpwindFit.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubicUpwindFit/cubicUpwindFit.C index 02b3a332f00659186a0172f2f326efb5e9f77832..7d588649ebaa8bef927ee3b86da860612ca4001c 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubicUpwindFit/cubicUpwindFit.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/cubicUpwindFit/cubicUpwindFit.C @@ -26,7 +26,7 @@ License #include "UpwindFitScheme.H" #include "cubicUpwindFitPolynomial.H" -#include "upwindCFCStencilObject.H" +#include "upwindCFCCellToFaceStencilObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -42,7 +42,7 @@ namespace Foam ( cubicUpwindFit, cubicUpwindFitPolynomial, - upwindCFCStencilObject + upwindCFCCellToFaceStencilObject ); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearFit/linearFit.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearFit/linearFit.C index 6362a7b7ae0b83de0c43640f37a21332bc298675..71a64fd14061b7dd21c4ffad31fc1af501b511e3 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearFit/linearFit.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearFit/linearFit.C @@ -26,7 +26,7 @@ License #include "CentredFitScheme.H" #include "linearFitPolynomial.H" -#include "centredCFCStencilObject.H" +#include "centredCFCCellToFaceStencilObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -42,7 +42,7 @@ namespace Foam ( linearFit, linearFitPolynomial, - centredCFCStencilObject + centredCFCCellToFaceStencilObject ); } diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelCompositionModels.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearPureUpwindFit/linearPureUpwindFit.C similarity index 79% rename from src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelCompositionModels.C rename to src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearPureUpwindFit/linearPureUpwindFit.C index 4dd31ffb585177c7b2655b86d44ec288c03e32af..28aa8e7434b919bb8089e6d56431ee35b948a167 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelCompositionModels.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/linearPureUpwindFit/linearPureUpwindFit.C @@ -24,28 +24,26 @@ License \*---------------------------------------------------------------------------*/ -#include "basicReactingMultiphaseParcel.H" -#include "ReactingCloud.H" - -#include "SingleMixtureFraction.H" +#include "PureUpwindFitScheme.H" +#include "linearFitPolynomial.H" +#include "pureUpwindCFCCellToFaceStencilObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeCompositionModel + defineTemplateTypeNameAndDebug ( - ReactingCloud<basicReactingMultiphaseParcel> + UpwindFitData<linearFitPolynomial>, + 0 ); - // Add instances of composition model to the table - makeCompositionModelType + makePureUpwindFitSurfaceInterpolationScheme ( - SingleMixtureFraction, - ReactingCloud, - basicReactingMultiphaseParcel + linearPureUpwindFit, + linearFitPolynomial, + pureUpwindCFCCellToFaceStencilObject ); -}; - +} // ************************************************************************* // diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticFit/quadraticFit.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticFit/quadraticFit.C index 7d84fd4887d9d5724767645a43c6eb9c6ddd3869..296de91b76375027aa638c9d5d3132d5fcb1980e 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticFit/quadraticFit.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticFit/quadraticFit.C @@ -26,7 +26,7 @@ License #include "CentredFitScheme.H" #include "quadraticFitPolynomial.H" -#include "centredCFCStencilObject.H" +#include "centredCFCCellToFaceStencilObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -42,7 +42,7 @@ namespace Foam ( quadraticFit, quadraticFitPolynomial, - centredCFCStencilObject + centredCFCCellToFaceStencilObject ); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearFit/quadraticLinearFit.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearFit/quadraticLinearFit.C index 8660cae93ad9df8dc05872a1f401d476b256a111..8c0911f4add5784b5991fcd9341794f6e8f842e5 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearFit/quadraticLinearFit.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearFit/quadraticLinearFit.C @@ -26,7 +26,7 @@ License #include "CentredFitScheme.H" #include "quadraticLinearFitPolynomial.H" -#include "centredCFCStencilObject.H" +#include "centredCFCCellToFaceStencilObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -42,7 +42,7 @@ namespace Foam ( quadraticLinearFit, quadraticLinearFitPolynomial, - centredCFCStencilObject + centredCFCCellToFaceStencilObject ); } diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelSurfaceReactionModels.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearPureUpwindFit/quadraticLinearPureUpwindFit.C similarity index 77% rename from src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelSurfaceReactionModels.C rename to src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearPureUpwindFit/quadraticLinearPureUpwindFit.C index d0478807400a41a0d301e19faaffcc0be0bfa3a0..513de347d75624f42be5b7ec6785d5e2246b4250 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelSurfaceReactionModels.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearPureUpwindFit/quadraticLinearPureUpwindFit.C @@ -24,28 +24,22 @@ License \*---------------------------------------------------------------------------*/ -#include "basicReactingMultiphaseParcel.H" -#include "ReactingMultiphaseCloud.H" - -#include "NoSurfaceReaction.H" +#include "PureUpwindFitScheme.H" +#include "quadraticLinearUpwindFitPolynomial.H" +#include "upwindCFCCellToFaceStencilObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeSurfaceReactionModel + // Use stencil with three upwind cells: + // upwindCFCCellToFaceStencilObject + pureUpwind + makePureUpwindFitSurfaceInterpolationScheme ( - ReactingMultiphaseCloud<basicReactingMultiphaseParcel> + quadraticLinearPureUpwindFit, + quadraticLinearUpwindFitPolynomial, + upwindCFCCellToFaceStencilObject ); - - // Add instances of surface reaction model to the table - makeSurfaceReactionModelType - ( - NoSurfaceReaction, - ReactingMultiphaseCloud, - basicReactingMultiphaseParcel - ); -}; - +} // ************************************************************************* // diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearUpwindFit/quadraticLinearUpwindFit.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearUpwindFit/quadraticLinearUpwindFit.C index ca0da7d9da0d322c13daec461006f8917e36c81d..d89107ab71e3fec4f73dbe8f0717cb4c65336e31 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearUpwindFit/quadraticLinearUpwindFit.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticLinearUpwindFit/quadraticLinearUpwindFit.C @@ -26,7 +26,7 @@ License #include "UpwindFitScheme.H" #include "quadraticLinearUpwindFitPolynomial.H" -#include "upwindCFCStencilObject.H" +#include "upwindFECCellToFaceStencilObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -42,7 +42,7 @@ namespace Foam ( quadraticLinearUpwindFit, quadraticLinearUpwindFitPolynomial, - upwindCFCStencilObject + upwindFECCellToFaceStencilObject ); } diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticUpwindFit/quadraticUpwindFit.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticUpwindFit/quadraticUpwindFit.C index e0e003906e603e2bc071679d5a68c0a1661a18a4..88ccc2971b887431b049c0261f95f8658a0a8a7b 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticUpwindFit/quadraticUpwindFit.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticUpwindFit/quadraticUpwindFit.C @@ -26,7 +26,7 @@ License #include "UpwindFitScheme.H" #include "quadraticUpwindFitPolynomial.H" -#include "upwindFECStencilObject.H" +#include "upwindFECCellToFaceStencilObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -42,7 +42,7 @@ namespace Foam ( quadraticUpwindFit, quadraticUpwindFitPolynomial, - upwindFECStencilObject + upwindFECCellToFaceStencilObject ); } diff --git a/src/lagrangian/basic/Particle/Particle.C b/src/lagrangian/basic/Particle/Particle.C index 6c8cbe4aa106f7181d0f93a84a8e6c5c5cd2996c..ea53ec3ee4d92165ee03861a86dfb96a4b65e4e7 100644 --- a/src/lagrangian/basic/Particle/Particle.C +++ b/src/lagrangian/basic/Particle/Particle.C @@ -45,7 +45,7 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces const labelList& faces = mesh.cells()[celli_]; const vector& C = mesh.cellCentres()[celli_]; - labelList faceList(0); + DynamicList<label> faceList(10); forAll(faces, i) { label facei = faces[i]; @@ -53,12 +53,12 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces if ((lam > 0) && (lam < 1.0)) { - label n = faceList.size(); - faceList.setSize(n+1); - faceList[n] = facei; + faceList.append(facei); } } + faceList.shrink(); + return faceList; } @@ -75,7 +75,7 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces const labelList& faces = mesh.cells()[celli]; const vector& C = mesh.cellCentres()[celli]; - labelList faceList(0); + DynamicList<label> faceList(10); forAll(faces, i) { label facei = faces[i]; @@ -83,12 +83,12 @@ Foam::labelList Foam::Particle<ParticleType>::findFaces if ((lam > 0) && (lam < 1.0)) { - label n = faceList.size(); - faceList.setSize(n+1); - faceList[n] = facei; + faceList.append(facei); } } + faceList.shrink(); + return faceList; } @@ -186,6 +186,17 @@ Foam::Particle<ParticleType>::Particle {} +template<class ParticleType> +Foam::Particle<ParticleType>::Particle(const Particle<ParticleType>& p) +: + cloud_(p.cloud_), + position_(p.position_), + celli_(p.celli_), + facei_(p.facei_), + stepFraction_(p.stepFraction_) +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class ParticleType> @@ -328,56 +339,47 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace label patchi = patch(facei_); const polyPatch& patch = mesh.boundaryMesh()[patchi]; - if (isA<wedgePolyPatch>(patch)) - { - p.hitWedgePatch - ( - static_cast<const wedgePolyPatch&>(patch), td - ); - } - else if (isA<symmetryPolyPatch>(patch)) - { - p.hitSymmetryPatch - ( - static_cast<const symmetryPolyPatch&>(patch), td - ); - } - else if (isA<cyclicPolyPatch>(patch)) + if (!p.hitPatch(patch, td, patchi)) { - p.hitCyclicPatch - ( - static_cast<const cyclicPolyPatch&>(patch), td - ); - } - else if (isA<processorPolyPatch>(patch)) - { - p.hitProcessorPatch - ( - static_cast<const processorPolyPatch&>(patch), td - ); - } - else if (isA<wallPolyPatch>(patch)) - { - p.hitWallPatch - ( - static_cast<const wallPolyPatch&>(patch), td - ); - } - else if (isA<polyPatch>(patch)) - { - p.hitPatch - ( - static_cast<const polyPatch&>(patch), td - ); - } - else - { - FatalErrorIn - ( - "Particle::trackToFace" - "(const vector& endPosition, scalar& trackFraction)" - )<< "patch type " << patch.type() << " not suported" << nl - << abort(FatalError); + if (isA<wedgePolyPatch>(patch)) + { + p.hitWedgePatch + ( + static_cast<const wedgePolyPatch&>(patch), td + ); + } + else if (isA<symmetryPolyPatch>(patch)) + { + p.hitSymmetryPatch + ( + static_cast<const symmetryPolyPatch&>(patch), td + ); + } + else if (isA<cyclicPolyPatch>(patch)) + { + p.hitCyclicPatch + ( + static_cast<const cyclicPolyPatch&>(patch), td + ); + } + else if (isA<processorPolyPatch>(patch)) + { + p.hitProcessorPatch + ( + static_cast<const processorPolyPatch&>(patch), td + ); + } + else if (isA<wallPolyPatch>(patch)) + { + p.hitWallPatch + ( + static_cast<const wallPolyPatch&>(patch), td + ); + } + else + { + p.hitPatch(patch, td); + } } } } @@ -423,6 +425,19 @@ void Foam::Particle<ParticleType>::transformProperties(const vector&) {} +template<class ParticleType> +template<class TrackData> +bool Foam::Particle<ParticleType>::hitPatch +( + const polyPatch&, + TrackData&, + const label +) +{ + return false; +} + + template<class ParticleType> template<class TrackData> void Foam::Particle<ParticleType>::hitWedgePatch diff --git a/src/lagrangian/basic/Particle/Particle.H b/src/lagrangian/basic/Particle/Particle.H index 75a0b041744af33b9de9b805a8c46cabb4031e29..4d1a8b9be839f7e92cd31ce2dc6ca7acf227b81a 100644 --- a/src/lagrangian/basic/Particle/Particle.H +++ b/src/lagrangian/basic/Particle/Particle.H @@ -98,10 +98,7 @@ public: // Constructors - inline trackData - ( - Cloud<ParticleType>& cloud - ); + inline trackData(Cloud<ParticleType>& cloud); // Member functions @@ -171,6 +168,16 @@ protected: // Patch interactions + //- Overridable function to handle the particle hitting a patch + // Executed before other patch-hitting functions + template<class TrackData> + bool hitPatch + ( + const polyPatch&, + TrackData& td, + const label patchI + ); + //- Overridable function to handle the particle hitting a wedgePatch template<class TrackData> void hitWedgePatch @@ -256,8 +263,13 @@ public: friend class Cloud<ParticleType>; - //- Runtime type information - TypeName("Particle"); + // Static data members + + //- String representation of properties + static string propHeader; + + //- Runtime type information + TypeName("Particle"); // Constructors @@ -278,14 +290,24 @@ public: bool readFields = true ); + //- Construct as a copy + Particle(const Particle& p); + + //- Construct a clone + autoPtr<ParticleType> clone() const + { + return autoPtr<Particle>(new Particle(*this)); + } + + //- Factory class to read-construct particles used for // parallel transfer class iNew { - // Private data - const Cloud<ParticleType>& cloud_; + //- Reference to the cloud + const Cloud<ParticleType>& cloud_; public: @@ -303,9 +325,8 @@ public: //- Destructor - - virtual ~Particle() - {} + virtual ~Particle() + {} // Member Functions @@ -344,6 +365,9 @@ public: //- Return the impact model to be used, soft or hard (default). inline bool softImpact() const; + //- Return the particle current time + inline scalar currentTime() const; + // Check @@ -414,10 +438,7 @@ public: // I-O //- Write the fields associated with the owner cloud - static void writeFields - ( - const Cloud<ParticleType>& c - ); + static void writeFields(const Cloud<ParticleType>& c); // Ostream Operator diff --git a/src/lagrangian/basic/Particle/ParticleI.H b/src/lagrangian/basic/Particle/ParticleI.H index 075d96705d876aee11d5156dc242313fe139022f..ce790d67c11258c29290dbaa14f31d8669a6a6e7 100644 --- a/src/lagrangian/basic/Particle/ParticleI.H +++ b/src/lagrangian/basic/Particle/ParticleI.H @@ -345,6 +345,15 @@ inline bool Particle<ParticleType>::softImpact() const } +template<class ParticleType> +inline scalar Particle<ParticleType>::currentTime() const +{ + return + cloud_.pMesh().time().value() + + stepFraction_*cloud_.pMesh().time().deltaT().value(); +} + + template<class ParticleType> inline label Particle<ParticleType>::patch(const label facei) const { diff --git a/src/lagrangian/basic/Particle/ParticleIO.C b/src/lagrangian/basic/Particle/ParticleIO.C index 7be84f9d1449e3721369caf4413e436f809992a4..70e635dc94765e8e3b321fbf98d45b3a8259b91c 100644 --- a/src/lagrangian/basic/Particle/ParticleIO.C +++ b/src/lagrangian/basic/Particle/ParticleIO.C @@ -28,6 +28,12 @@ License #include "IOstreams.H" #include "IOPosition.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template<class ParticleType> +Foam::string Foam::Particle<ParticleType>::propHeader = "(Px Py Pz) cellI"; + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // Construct from Istream diff --git a/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingData.C b/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingData.C new file mode 100644 index 0000000000000000000000000000000000000000..80f1dcaaf7063eb8b7899cd284c268f518a8bfe8 --- /dev/null +++ b/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingData.C @@ -0,0 +1,72 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "ParticleTrackingData.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template<class ParcelType> +Foam::label Foam::ParticleTrackingData<ParcelType>::PARTICLE_COUNT = 0; + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class ParcelType> +Foam::ParticleTrackingData<ParcelType>::ParticleTrackingData +( + const Cloud<ParcelType>& cloud +) +: + cloud_(cloud), + origProc_(Pstream::myProcNo()), + id_(PARTICLE_COUNT++) +{} + + +template<class ParcelType> +Foam::ParticleTrackingData<ParcelType>::ParticleTrackingData +( + const ParticleTrackingData& ptd +) +: + cloud_(ptd.cloud_), + origProc_(ptd.origProc_), + id_(ptd.id_) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class ParcelType> +Foam::ParticleTrackingData<ParcelType>::~ParticleTrackingData() +{} + + +// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // + +#include "ParticleTrackingDataIO.C" + +// ************************************************************************* // diff --git a/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingData.H b/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingData.H new file mode 100644 index 0000000000000000000000000000000000000000..c752c2ec366ab52dad64f49b6081f01d93e2c2e6 --- /dev/null +++ b/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingData.H @@ -0,0 +1,166 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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::ParticleTrackingData + +Description + Class to provide additional properties to allow construction of + particle tracks + +SourceFiles + ParticleTrackingData.C + ParticleTrackingDataIO.C + +\*---------------------------------------------------------------------------*/ + +#ifndef ParticleTrackingData_H +#define ParticleTrackingData_H + +#include "Cloud.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes and friend functions +template<class ParcelType> +class ParticleTrackingData; + + +template<class ParcelType> +Ostream& operator<< +( + Ostream&, + const ParticleTrackingData<ParcelType>& +); + + +/*---------------------------------------------------------------------------*\ + Class ParticleTrackingData Declaration +\*---------------------------------------------------------------------------*/ + +template<class ParcelType> +class ParticleTrackingData +{ + // Private data + + //- Reference to the cloud + const Cloud<ParcelType>& cloud_; + + //- Originating processor id + label origProc_; + + //- Local particle id + label id_; + + //- Cumulative particle count used for particle id + static label PARTICLE_COUNT; + + + // Private member functions + + //- Write properties - particle count + static void writeProperties(const Cloud<ParcelType>& cloud); + + //- Read properties - particle count + static void readProperties(const Cloud<ParcelType>& cloud); + + +public: + + // Constructors + + //- Construct from cloud + ParticleTrackingData(const Cloud<ParcelType>& cloud); + + //- Construct copy + ParticleTrackingData(const ParticleTrackingData& ptd); + + //- Construct from Istream and mesh + ParticleTrackingData + ( + const Cloud<ParcelType>& cloud, + Istream& is, + bool readFields + ); + + + //- Destructor + ~ParticleTrackingData(); + + + // Member functions + + // Access + + //- Return const access to the cloud + inline const Cloud<ParcelType>& cloud() const; + + //- Return const access to the originating processor id + inline label origProc() const; + + //- Return const access to the local particle id + inline label id() const; + + + // I-O + + //- Read fields + static void readFields(Cloud<ParcelType>& c); + + //- Write fields + static void writeFields(const Cloud<ParcelType>& c); + + + // Ostream Operator + + friend Ostream& operator<< <ParcelType> + ( + Ostream&, + const ParticleTrackingData<ParcelType>& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "ParticleTrackingDataI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "ParticleTrackingData.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingDataI.H b/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingDataI.H new file mode 100644 index 0000000000000000000000000000000000000000..da195d56274e4ac02cd87bd051539c1f1de517eb --- /dev/null +++ b/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingDataI.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 + +\*---------------------------------------------------------------------------*/ + +template<class ParcelType> +inline const Foam::Cloud<ParcelType>& +Foam::ParticleTrackingData<ParcelType>::cloud() const +{ + return cloud_; +} + + +template<class ParcelType> +inline Foam::label Foam::ParticleTrackingData<ParcelType>::origProc() const +{ + return origProc_; +} + + +template<class ParcelType> +inline Foam::label Foam::ParticleTrackingData<ParcelType>::id() const +{ + return id_; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingDataIO.C b/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingDataIO.C new file mode 100644 index 0000000000000000000000000000000000000000..e575426eea793be664dea0c84b216c8d5252e2e3 --- /dev/null +++ b/src/lagrangian/basic/ParticleTrackingData/ParticleTrackingDataIO.C @@ -0,0 +1,233 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "ParticleTrackingData.H" + +// * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * // + +template<class ParcelType> +void Foam::ParticleTrackingData<ParcelType>::readProperties +( + const Cloud<ParcelType>& cloud +) +{ + IOobject propsDictHeader + ( + "particleTrackingProperties", + cloud.db().time().timeName(), + "uniform/Lagrangian"/cloud.name(), + cloud.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ); + + if (propsDictHeader.headerOk()) + { + const IOdictionary propsDict(propsDictHeader); + + word procName("processor" + name(Pstream::myProcNo())); + if (propsDict.found(procName)) + { + propsDict.subDict(procName).lookup("particleCount") >> + PARTICLE_COUNT; + } + } +} + + +template<class ParcelType> +void Foam::ParticleTrackingData<ParcelType>::writeProperties +( + const Cloud<ParcelType>& cloud +) +{ + if (cloud.db().time().outputTime()) + { + IOdictionary propsDict + ( + IOobject + ( + "particleTrackingProperties", + cloud.db().time().timeName(), + "uniform/Lagrangian"/cloud.name(), + cloud.db(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ) + ); + + word procName("processor" + name(Pstream::myProcNo())); + propsDict.add(procName, dictionary()); + propsDict.subDict(procName).add("particleCount", PARTICLE_COUNT); + + propsDict.regIOobject::write(); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class ParcelType> +Foam::ParticleTrackingData<ParcelType>::ParticleTrackingData +( + const Cloud<ParcelType>& cloud, + Istream& is, + bool readFields +) +: + cloud_(cloud), + origProc_(-1), + id_(-1) +{ + if (readFields) + { + if (is.format() == IOstream::ASCII) + { + is >> origProc_ >> id_; + } + else + { + is.read + ( + reinterpret_cast<char*>(&origProc_), + sizeof(origProc_) + sizeof(id_) + ); + } + } + + // Check state of Istream + is.check + ( + "ParticleTrackingData<ParcelType>::ParticleTrackingData" + "(" + "Istream&, " + "bool" + ")" + ); +} + + +template<class ParcelType> +void Foam::ParticleTrackingData<ParcelType>::readFields +( + Cloud<ParcelType>& c +) +{ + if (!c.size()) + { + return; + } + + readProperties(c); + + IOField<label> origProc(c.fieldIOobject("origProc", IOobject::MUST_READ)); + c.checkFieldIOobject(c, origProc); + + IOField<label> id(c.fieldIOobject("id", IOobject::MUST_READ)); + c.checkFieldIOobject(c, id); + + label i = 0; + forAllIter(typename Cloud<ParcelType>, c, iter) + { + ParcelType& p = iter(); + p.origProc_ = origProc[i]; + p.id_ = id[i]; + i++; + } +} + + +template<class ParcelType> +void Foam::ParticleTrackingData<ParcelType>::writeFields +( + const Cloud<ParcelType>& c +) +{ + writeProperties(c); + + const label np = c.size(); + + IOField<label> origProc + ( + c.fieldIOobject("origProc", IOobject::NO_READ), + np + ); + IOField<label> id(c.fieldIOobject("id", IOobject::NO_READ), np); + + label i = 0; + forAllConstIter(typename Cloud<ParcelType>, c, iter) + { + const ParcelType& p = iter(); + + origProc[i] = p.origProc(); + id[i] = p.id(); + i++; + } + + origProc.write(); + id.write(); +} + + +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // + +template<class ParcelType> +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const ParticleTrackingData<ParcelType>& p +) +{ + if (os.format() == IOstream::ASCII) + { + os << p.origProc_ << token::SPACE << p.id_ << token::SPACE; + } + else + { + os.write + ( + reinterpret_cast<const char*>(&p.origProc_), + sizeof(p.origProc_) + sizeof(p.id_) + ); + } + + // Check state of Ostream + os.check + ( + "Ostream& operator<<" + "(" + "Ostream&, " + "const ParticleTrackingData<ParcelType>&" + ")" + ); + + return os; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/basic/indexedParticle/indexedParticle.H b/src/lagrangian/basic/indexedParticle/indexedParticle.H index 3774bb93d86cc23d0022e838fefe66cb0fed3a80..fd20681a32c4fc733259461ecafd4a98754a7a58 100644 --- a/src/lagrangian/basic/indexedParticle/indexedParticle.H +++ b/src/lagrangian/basic/indexedParticle/indexedParticle.H @@ -87,6 +87,12 @@ public: Particle<indexedParticle>(c, is) {} + //- Construct as a copy + indexedParticle(const indexedParticle& p) + : + Particle<indexedParticle>(p) + {} + //- Construct and return a clone autoPtr<indexedParticle> clone() const { diff --git a/src/lagrangian/basic/passiveParticle/passiveParticle.H b/src/lagrangian/basic/passiveParticle/passiveParticle.H index 4e81e077ac442b6fc899ad556bbddf29a975b1f3..ce4f7bfcadabca2e009eef09def797539dcf702f 100644 --- a/src/lagrangian/basic/passiveParticle/passiveParticle.H +++ b/src/lagrangian/basic/passiveParticle/passiveParticle.H @@ -47,7 +47,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class passiveParticle Declaration + Class passiveParticle Declaration \*---------------------------------------------------------------------------*/ class passiveParticle @@ -81,6 +81,12 @@ public: Particle<passiveParticle>(c, is) {} + //- Construct as copy + passiveParticle(const passiveParticle& p) + : + Particle<passiveParticle>(p) + {} + //- Construct and return a clone autoPtr<passiveParticle> clone() const { diff --git a/src/lagrangian/coalCombustion/coalCloud/coalCloud.C b/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.C similarity index 73% rename from src/lagrangian/coalCombustion/coalCloud/coalCloud.C rename to src/lagrangian/coalCombustion/CoalCloud/CoalCloud.C index a8d1dd867b4a881f6f0517583ff3034c383cde09..873b82d170ba37b1d33beb485a46533b3266a9f2 100644 --- a/src/lagrangian/coalCombustion/coalCloud/coalCloud.C +++ b/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,53 +24,46 @@ License \*---------------------------------------------------------------------------*/ -#include "coalCloud.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(coalCloud, 0); -}; - +#include "CoalCloud.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::coalCloud::coalCloud +template<class ThermoType> +Foam::CoalCloud<ThermoType>::CoalCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo, - PtrList<specieReactingProperties>& gases + hCombustionThermo& thermo ) : - ReactingMultiphaseCloud<coalParcel> + ReactingMultiphaseCloud<CoalParcel<ThermoType> > ( - cloudType, + cloudName, rho, U, g, - thermo, - gases + thermo ) { - coalParcel::readFields(*this); + CoalParcel<ThermoType>::readFields(*this); } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::coalCloud::~coalCloud() +template<class ThermoType> +Foam::CoalCloud<ThermoType>::~CoalCloud() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::coalCloud::writeFields() const +template<class ThermoType> +void Foam::CoalCloud<ThermoType>::writeFields() const { - coalParcel::writeFields(*this); + CoalParcel<ThermoType>::writeFields(*this); } diff --git a/src/lagrangian/coalCombustion/coalCloud/coalCloud.H b/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.H similarity index 77% rename from src/lagrangian/coalCombustion/coalCloud/coalCloud.H rename to src/lagrangian/coalCombustion/CoalCloud/CoalCloud.H index 72949ce14447e6280fd7e8c1597d97d989a33dd2..91a0289f0ffe3439d1f0900f7da70d073e2c96e1 100644 --- a/src/lagrangian/coalCombustion/coalCloud/coalCloud.H +++ b/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,20 +23,20 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - coalCloud + CoalCloud Description SourceFiles - coalCloud.C + CoalCloud.C \*---------------------------------------------------------------------------*/ -#ifndef coalCloud_H -#define coalCloud_H +#ifndef CoalCloud_H +#define CoalCloud_H #include "ReactingMultiphaseCloud.H" -#include "coalParcel.H" +#include "CoalParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,44 +44,44 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class coalCloud Declaration + Class CoalCloud Declaration \*---------------------------------------------------------------------------*/ -class coalCloud +template<class ThermoType> +class CoalCloud : - public ReactingMultiphaseCloud<coalParcel> + public ReactingMultiphaseCloud<CoalParcel<ThermoType> > { // Private Member Functions //- Disallow default bitwise copy construct - coalCloud(const coalCloud&); + CoalCloud(const CoalCloud&); //- Disallow default bitwise assignment - void operator=(const coalCloud&); + void operator=(const CoalCloud&); public: //-Runtime type information - TypeName("coalCloud"); + TypeName("CoalCloud"); // Constructors //- Construct given carrier gas fields - coalCloud + CoalCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo, - PtrList<specieReactingProperties>& gases + hCombustionThermo& thermo ); //- Destructor - ~coalCloud(); + ~CoalCloud(); // Member Functions @@ -97,6 +97,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "CoalCloud.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/CoalCloud/defineCoalCloud.C b/src/lagrangian/coalCombustion/CoalCloud/defineCoalCloud.C new file mode 100644 index 0000000000000000000000000000000000000000..cc0fa34f49fd096cc4b831c19fdaaec8fab3abde --- /dev/null +++ b/src/lagrangian/coalCombustion/CoalCloud/defineCoalCloud.C @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "createReactingCloudTypes.H" +#include "CoalCloud.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + createReactingCloudType(CoalCloud); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/coalParcel/coalParcel.C b/src/lagrangian/coalCombustion/CoalParcel/CoalParcel.C similarity index 66% rename from src/lagrangian/coalCombustion/coalParcel/coalParcel.C rename to src/lagrangian/coalCombustion/CoalParcel/CoalParcel.C index b1b6120906a9d9f1faa07a744d108e1cde66aa83..53a9f3ac63461372f31361e80c7c6a3bb0228c6a 100644 --- a/src/lagrangian/coalCombustion/coalParcel/coalParcel.C +++ b/src/lagrangian/coalCombustion/CoalParcel/CoalParcel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,25 +24,28 @@ License \*---------------------------------------------------------------------------*/ -#include "coalParcel.H" +#include "CoalParcel.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(coalParcel, 0); - defineParticleTypeNameAndDebug(coalParcel, 0); - defineParcelTypeNameAndDebug(coalParcel, 0); -}; +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +template<class ThermoType> +Foam::CoalParcel<ThermoType>::CoalParcel +( + ReactingMultiphaseCloud<CoalParcel<ThermoType> >& owner, + const vector& position, + const label cellI +) +: + ReactingMultiphaseParcel<CoalParcel<ThermoType> >(owner, position, cellI) +{} -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::coalParcel::coalParcel +template<class ThermoType> +Foam::CoalParcel<ThermoType>::CoalParcel ( - ReactingMultiphaseCloud<coalParcel>& owner, + ReactingMultiphaseCloud<CoalParcel<ThermoType> >& owner, const vector& position, - const label celli, + const label cellI, const label typeId, const scalar nParticle0, const scalar d0, @@ -51,14 +54,16 @@ Foam::coalParcel::coalParcel const scalarField& YGas0, const scalarField& YLiquid0, const scalarField& YSolid0, - const constantProperties& constProps + const typename + ReactingMultiphaseParcel<CoalParcel<ThermoType> >:: + constantProperties& constProps ) : - ReactingMultiphaseParcel<coalParcel> + ReactingMultiphaseParcel<CoalParcel<ThermoType> > ( owner, position, - celli, + cellI, typeId, nParticle0, d0, @@ -72,20 +77,22 @@ Foam::coalParcel::coalParcel {} -Foam::coalParcel::coalParcel +template<class ThermoType> +Foam::CoalParcel<ThermoType>::CoalParcel ( - const Cloud<coalParcel>& cloud, + const Cloud<CoalParcel<ThermoType> >& cloud, Istream& is, bool readFields ) : - ReactingMultiphaseParcel<coalParcel>(cloud, is, readFields) + ReactingMultiphaseParcel<CoalParcel<ThermoType> >(cloud, is, readFields) {} // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // -Foam::coalParcel::~coalParcel() +template<class ThermoType> +Foam::CoalParcel<ThermoType>::~CoalParcel() {} diff --git a/src/lagrangian/coalCombustion/coalParcel/coalParcel.H b/src/lagrangian/coalCombustion/CoalParcel/CoalParcel.H similarity index 63% rename from src/lagrangian/coalCombustion/coalParcel/coalParcel.H rename to src/lagrangian/coalCombustion/CoalParcel/CoalParcel.H index af3be65f84b4449984d6ebfe65053fc98b3ab773..a23e96bb852fcc7b85c38f49f054db309b001f87 100644 --- a/src/lagrangian/coalCombustion/coalParcel/coalParcel.H +++ b/src/lagrangian/coalCombustion/CoalParcel/CoalParcel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,19 +23,19 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - coalParcel + CoalParcel Description SourceFiles - coalParcel.C - coalParcelIO.C + CoalParcel.C + CoalParcelIO.C \*---------------------------------------------------------------------------*/ -#ifndef coalParcel_H -#define coalParcel_H +#ifndef CoalParcel_H +#define CoalParcel_H #include "ReactingMultiphaseParcel.H" @@ -44,27 +44,44 @@ SourceFiles namespace Foam { +// Forward declaration of classes +template<class ThermoType> +class CoalParcel; + /*---------------------------------------------------------------------------*\ - Class coalParcel Declaration + Class CoalParcel Declaration \*---------------------------------------------------------------------------*/ -class coalParcel +template<class ThermoType> +class CoalParcel : - public ReactingMultiphaseParcel<coalParcel> + public ReactingMultiphaseParcel<CoalParcel<ThermoType> > { public: + //- The type of thermodynamics this parcel was instantiated for + typedef ThermoType thermoType; + // Run-time type information - TypeName("coalParcel"); + TypeName("CoalParcel"); // Constructors + //- Construct from owner, position, and cloud owner + // Other properties initialised as null + CoalParcel + ( + ReactingMultiphaseCloud<CoalParcel>& owner, + const vector& position, + const label cellI + ); + //- Construct from components - coalParcel + CoalParcel ( - ReactingMultiphaseCloud<coalParcel>& owner, + ReactingMultiphaseCloud<CoalParcel>& owner, const vector& position, - const label celli, + const label cellI, const label typeId, const scalar nParticle0, const scalar d0, @@ -73,39 +90,40 @@ public: const scalarField& YGas0, const scalarField& YLiquid0, const scalarField& YSolid0, - const constantProperties& constProps + const typename + ReactingMultiphaseParcel<CoalParcel>:: + constantProperties& constProps ); //- Construct from Istream - coalParcel + CoalParcel ( - const Cloud<coalParcel>& c, + const Cloud<CoalParcel>& c, Istream& is, bool readFields = true ); //- Construct and return a clone - autoPtr<coalParcel> clone() const + autoPtr<CoalParcel> clone() const { - return autoPtr<coalParcel>(new coalParcel(*this)); + return autoPtr<CoalParcel>(new CoalParcel(*this)); } //- Destructor - virtual ~coalParcel(); + virtual ~CoalParcel(); }; -template<> -inline bool contiguous<coalParcel>() -{ - return false; // Now have scalar lists/fields (mass fractions) -} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam +#ifdef NoRepository + #include "CoalParcel.C" +#endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/coalCombustion/CoalParcel/defineCoalParcel.C b/src/lagrangian/coalCombustion/CoalParcel/defineCoalParcel.C new file mode 100644 index 0000000000000000000000000000000000000000..f5071d60305ef366ef1ceebebf789281fbf9eae9 --- /dev/null +++ b/src/lagrangian/coalCombustion/CoalParcel/defineCoalParcel.C @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2007 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 "createCoalParcelTypes.H" +#include "CoalParcel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + createCoalParcelType(CoalParcel); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/CoalParcel/makeCoalParcelSubmodels.C b/src/lagrangian/coalCombustion/CoalParcel/makeCoalParcelSubmodels.C new file mode 100644 index 0000000000000000000000000000000000000000..1f6787228821a18226b28111b721621691bc6bb6 --- /dev/null +++ b/src/lagrangian/coalCombustion/CoalParcel/makeCoalParcelSubmodels.C @@ -0,0 +1,71 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "CoalParcel.H" + +// Kinematic +#include "makeReactingParcelDispersionModels.H" +#include "makeReactingParcelDragModels.H" +#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant +#include "makeReactingParcelPatchInteractionModels.H" +#include "makeReactingParcelPostProcessingModels.H" + +// Thermodynamic +#include "makeReactingParcelHeatTransferModels.H" + +// Reacting +#include "makeReactingMultiphaseParcelCompositionModels.H" // MP variant +#include "makeReactingParcelPhaseChangeModels.H" + +// Reacting multiphase +#include "makeReactingMultiphaseParcelDevolatilisationModels.H" +#include "makeCoalParcelSurfaceReactionModels.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + // Kinematic sub-models + makeReactingDispersionModels(CoalParcel); + makeReactingDragModels(CoalParcel); + makeReactingMultiphaseInjectionModels(CoalParcel); + makeReactingPatchInteractionModels(CoalParcel); + makeReactingPostProcessingModels(CoalParcel); + + // Thermo sub-models + makeReactingHeatTransferModels(CoalParcel); + + // Reacting sub-models + makeReactingMultiphaseCompositionModels(CoalParcel); + makeReactingPhaseChangeModels(CoalParcel); + + // Reacting multiphase sub-models + makeReactingMultiphaseDevolatilisationModels(CoalParcel); + makeCoalSurfaceReactionModels(CoalParcel); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/Make/files b/src/lagrangian/coalCombustion/Make/files index c8fb192aea89081987d98a244d718aeb2b0d897e..2c7aac61ab97d66fe76fab863c8186c643d3beba 100755 --- a/src/lagrangian/coalCombustion/Make/files +++ b/src/lagrangian/coalCombustion/Make/files @@ -1,22 +1,8 @@ -/* coal cloud */ -coalCloud/coalCloud.C +/* Coal cloud */ +CoalCloud/defineCoalCloud.C -/* coal parcel and sub-models */ -coalParcel/coalParcel.C -coalParcel/defineCoalParcel.C -coalParcel/submodels/makeCoalParcelCompositionModels.C -coalParcel/submodels/makeCoalParcelDevolatilisationModels.C -coalParcel/submodels/makeCoalParcelDragModels.C -coalParcel/submodels/makeCoalParcelDispersionModels.C -coalParcel/submodels/makeCoalParcelInjectionModels.C -coalParcel/submodels/makeCoalParcelHeatTransferModels.C -coalParcel/submodels/makeCoalParcelPhaseChangeModels.C -coalParcel/submodels/makeCoalParcelSurfaceReactionModels.C -coalParcel/submodels/makeCoalParcelWallInteractionModels.C +/* Coal parcel and sub-models */ +CoalParcel/defineCoalParcel.C +CoalParcel/makeCoalParcelSubmodels.C -submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C -submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C -submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C - - -LIB = $(FOAM_USER_LIBBIN)/libcoalCombustion +LIB = $(FOAM_LIBBIN)/libcoalCombustion diff --git a/src/lagrangian/coalCombustion/coalParcel/defineCoalParcel.C b/src/lagrangian/coalCombustion/coalParcel/defineCoalParcel.C deleted file mode 100644 index 2c41d8289833f546ba8e834e87332d66dc9140cb..0000000000000000000000000000000000000000 --- a/src/lagrangian/coalCombustion/coalParcel/defineCoalParcel.C +++ /dev/null @@ -1,50 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 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 "coalParcel.H" -#include "ReactingMultiphaseCloud.H" - -namespace Foam -{ - defineTemplateTypeNameAndDebug(Cloud<coalParcel>, 0); - - defineParcelTypeNameAndDebug(KinematicParcel<coalParcel>, 0); -// defineTemplateTypeNameAndDebug(KinematicParcel<coalParcel>, 0); - defineParcelTypeNameAndDebug(ThermoParcel<coalParcel>, 0); - defineTemplateTypeNameAndDebug(ThermoParcel<coalParcel>, 0); - defineParcelTypeNameAndDebug(ReactingParcel<coalParcel>, 0); - defineTemplateTypeNameAndDebug(ReactingParcel<coalParcel>, 0); - defineParcelTypeNameAndDebug(ReactingMultiphaseParcel<coalParcel>, 0); - defineTemplateTypeNameAndDebug(ReactingMultiphaseParcel<coalParcel>, 0); - - defineParcelTypeNameAndDebug(KinematicCloud<coalParcel>, 0); - defineParcelTypeNameAndDebug(ThermoCloud<coalParcel>, 0); - defineParcelTypeNameAndDebug(ReactingCloud<coalParcel>, 0); - defineParcelTypeNameAndDebug(ReactingMultiphaseCloud<coalParcel>, 0); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelDevolatilisationModels.C b/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelDevolatilisationModels.C deleted file mode 100644 index 041a132d663ce94a05af8e8bb8a73f0d16d7e8bc..0000000000000000000000000000000000000000 --- a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelDevolatilisationModels.C +++ /dev/null @@ -1,65 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "coalParcel.H" -#include "ReactingMultiphaseCloud.H" - -#include "NoDevolatilisation.H" -#include "ConstantRateDevolatilisation.H" -#include "SingleKineticRateDevolatilisation.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeDevolatilisationModel - ( - ReactingMultiphaseCloud<coalParcel> - ); - - // Add instances of devolatilisation model to the table - makeDevolatilisationModelType - ( - NoDevolatilisation, - ReactingMultiphaseCloud, - coalParcel - ); - makeDevolatilisationModelType - ( - ConstantRateDevolatilisation, - ReactingMultiphaseCloud, - coalParcel - ); - makeDevolatilisationModelType - ( - SingleKineticRateDevolatilisation, - ReactingMultiphaseCloud, - coalParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelDispersionModels.C b/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelDispersionModels.C deleted file mode 100644 index d6f1cc823227fd1e137fb5901c60368b7165652d..0000000000000000000000000000000000000000 --- a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelDispersionModels.C +++ /dev/null @@ -1,68 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 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 "coalParcel.H" -#include "KinematicCloud.H" - -#include "NoDispersion.H" -#include "GradientDispersionRAS.H" -#include "StochasticDispersionRAS.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeDispersionModel(KinematicCloud<coalParcel>); - - defineNamedTemplateTypeNameAndDebug - ( - DispersionRASModel<KinematicCloud<coalParcel> >, - 0 - ); - - // Add instances of dispersion model to the table - makeDispersionModelType - ( - NoDispersion, - KinematicCloud, - coalParcel - ); - makeDispersionModelType - ( - GradientDispersionRAS, - KinematicCloud, - coalParcel - ); - makeDispersionModelType - ( - StochasticDispersionRAS, - KinematicCloud, - coalParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelDragModels.C b/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelDragModels.C deleted file mode 100644 index 162e1d56c2e4295aa5c953502c398ca41b82f516..0000000000000000000000000000000000000000 --- a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelDragModels.C +++ /dev/null @@ -1,45 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 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 "coalParcel.H" -#include "KinematicCloud.H" - -#include "NoDrag.H" -#include "SphereDrag.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeDragModel(KinematicCloud<coalParcel>); - - // Add instances of drag model to the table - makeDragModelType(NoDrag, KinematicCloud, coalParcel); - makeDragModelType(SphereDrag, KinematicCloud, coalParcel); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelInjectionModels.C b/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelInjectionModels.C deleted file mode 100644 index bf68b9947731c02b4b61917d647341f8df1b2896..0000000000000000000000000000000000000000 --- a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelInjectionModels.C +++ /dev/null @@ -1,49 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 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 "coalParcel.H" -#include "ReactingCloud.H" - -#include "ConeInjection.H" -#include "FieldActivatedInjection.H" -#include "ManualInjection.H" -#include "NoInjection.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeInjectionModel(KinematicCloud<coalParcel>); - - // Add instances of injection model to the table - makeInjectionModelType(ConeInjection, KinematicCloud, coalParcel); - makeInjectionModelType(FieldActivatedInjection, KinematicCloud, coalParcel); - makeInjectionModelType(ManualInjection, KinematicCloud, coalParcel); - makeInjectionModelType(NoInjection, KinematicCloud, coalParcel); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelPhaseChangeModels.C b/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelPhaseChangeModels.C deleted file mode 100644 index ebacd714bd6a43339ce28bc041cb9c88452ced46..0000000000000000000000000000000000000000 --- a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelPhaseChangeModels.C +++ /dev/null @@ -1,58 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "coalParcel.H" -#include "ReactingCloud.H" - -#include "NoPhaseChange.H" -#include "LiquidEvaporation.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makePhaseChangeModel - ( - ReactingCloud<coalParcel> - ); - - // Add instances of phase change model to the table - makePhaseChangeModelType - ( - NoPhaseChange, - ReactingCloud, - coalParcel - ); - makePhaseChangeModelType - ( - LiquidEvaporation, - ReactingCloud, - coalParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelSurfaceReactionModels.C b/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelSurfaceReactionModels.C deleted file mode 100644 index ee25d721f38212cebea8da261d3339df2c5cef8b..0000000000000000000000000000000000000000 --- a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelSurfaceReactionModels.C +++ /dev/null @@ -1,69 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 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 "coalParcel.H" -#include "ReactingMultiphaseCloud.H" - -#include "NoSurfaceReaction.H" -#include "COxidationDiffusionLimitedRate.H" -#include "COxidationKineticDiffusionLimitedRate.H" -#include "COxidationMurphyShaddix.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeSurfaceReactionModel(ReactingMultiphaseCloud<coalParcel>); - - // Add instances of surface reaction model to the table - makeSurfaceReactionModelType - ( - NoSurfaceReaction, - ReactingMultiphaseCloud, - coalParcel - ); - makeSurfaceReactionModelTypeInstance - ( - COxidationDiffusionLimitedRate, - ReactingMultiphaseCloud, - coalParcel - ); - makeSurfaceReactionModelTypeInstance - ( - COxidationKineticDiffusionLimitedRate, - ReactingMultiphaseCloud, - coalParcel - ); - makeSurfaceReactionModelTypeInstance - ( - COxidationMurphyShaddix, - ReactingMultiphaseCloud, - coalParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelWallInteractionModels.C b/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelWallInteractionModels.C deleted file mode 100644 index fedf097d4f0165875e5b0d10fb52aad0a010aae6..0000000000000000000000000000000000000000 --- a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelWallInteractionModels.C +++ /dev/null @@ -1,55 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 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 "coalParcel.H" -#include "ReactingCloud.H" - -#include "Rebound.H" -#include "StandardWallInteraction.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeWallInteractionModel(KinematicCloud<coalParcel>); - - // Add instances of wall interaction model to the table - makeWallInteractionModelType - ( - Rebound, - KinematicCloud, - coalParcel - ); - makeWallInteractionModelType - ( - StandardWallInteraction, - KinematicCloud, - coalParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/include/createCoalParcelTypes.H b/src/lagrangian/coalCombustion/include/createCoalParcelTypes.H new file mode 100644 index 0000000000000000000000000000000000000000..4c0668668379a0cbbf744e9dfa3867669d34b5f2 --- /dev/null +++ b/src/lagrangian/coalCombustion/include/createCoalParcelTypes.H @@ -0,0 +1,98 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef createCoalParcelTypes_H +#define createCoalParcelTypes_H + +#include "makeParcelIOList.H" +#include "reactingThermoTypes.H" +#include "CoalCloud.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define createCoalParcelType(ParcelType) \ + \ + createCoalParcelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + createCoalParcelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define createCoalParcelThermoType(ParcelType, ThermoType) \ + \ + typedef ParcelType<ThermoType> ParcelType##ThermoType; \ + \ + makeParcelIOList(ParcelType##ThermoType); \ + \ + defineTemplateTypeNameAndDebug(ParcelType##ThermoType, 0); \ + defineTemplateTypeNameAndDebug(Particle<ParcelType##ThermoType>, 0); \ + defineTemplateTypeNameAndDebug(Cloud<ParcelType##ThermoType>, 0); \ + \ + defineParcelTypeNameAndDebug(KinematicParcel<ParcelType##ThermoType>, 0); \ + defineTemplateTypeNameAndDebug \ + ( \ + KinematicParcel<ParcelType##ThermoType>, \ + 0 \ + ); \ + defineParcelTypeNameAndDebug(ThermoParcel<ParcelType##ThermoType>, 0); \ + defineTemplateTypeNameAndDebug(ThermoParcel<ParcelType##ThermoType>, 0); \ + defineParcelTypeNameAndDebug(ReactingParcel<ParcelType##ThermoType>, 0); \ + defineTemplateTypeNameAndDebug(ReactingParcel<ParcelType##ThermoType>, 0);\ + defineParcelTypeNameAndDebug \ + ( \ + ReactingMultiphaseParcel<ParcelType##ThermoType>, \ + 0 \ + ); \ + defineTemplateTypeNameAndDebug \ + ( \ + ReactingMultiphaseParcel<ParcelType##ThermoType>, \ + 0 \ + ); \ + defineParcelTypeNameAndDebug(CoalParcel<ParcelType##ThermoType>, 0); \ + defineTemplateTypeNameAndDebug(CoalParcel<ParcelType##ThermoType>, 0); \ + \ + defineParcelTypeNameAndDebug(KinematicCloud<ParcelType##ThermoType>, 0); \ + defineParcelTypeNameAndDebug(ThermoCloud<ParcelType##ThermoType>, 0); \ + defineParcelTypeNameAndDebug(ReactingCloud<ParcelType##ThermoType>, 0); \ + defineParcelTypeNameAndDebug \ + ( \ + ReactingMultiphaseCloud<ParcelType##ThermoType>, \ + 0 \ + ); \ + defineParcelTypeNameAndDebug(CoalCloud<ParcelType##ThermoType>, 0); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/include/makeCoalParcelSurfaceReactionModels.H b/src/lagrangian/coalCombustion/include/makeCoalParcelSurfaceReactionModels.H new file mode 100644 index 0000000000000000000000000000000000000000..1f60f47d9d5b48d0594eae236f89eb11bda0416a --- /dev/null +++ b/src/lagrangian/coalCombustion/include/makeCoalParcelSurfaceReactionModels.H @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeCoalParcelSurfaceReactionModels_H +#define makeCoalParcelSurfaceReactionModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "reactingThermoTypes.H" +#include "ReactingMultiphaseCloud.H" + +#include "NoSurfaceReaction.H" +#include "COxidationDiffusionLimitedRate.H" +#include "COxidationKineticDiffusionLimitedRate.H" +#include "COxidationMurphyShaddix.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeCoalSurfaceReactionModels(ParcelType) \ + \ + makeCoalSurfaceReactionModelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + makeCoalSurfaceReactionModelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define makeCoalSurfaceReactionModelThermoType(ParcelType, ThermoType) \ + \ + makeSurfaceReactionModel \ + ( \ + ReactingMultiphaseCloud<ParcelType<ThermoType> > \ + ); \ + \ + makeSurfaceReactionModelThermoType \ + ( \ + NoSurfaceReaction, \ + ReactingMultiphaseCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeSurfaceReactionModelThermoType \ + ( \ + COxidationDiffusionLimitedRate, \ + ReactingMultiphaseCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeSurfaceReactionModelThermoType \ + ( \ + COxidationKineticDiffusionLimitedRate, \ + ReactingMultiphaseCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeSurfaceReactionModelThermoType \ + ( \ + COxidationMurphyShaddix, \ + ReactingMultiphaseCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C index 7e8f2a0e2ba320f56e4ae5fbdbcec0ef9bd3a622..6c44dc9da86e5cbe7ad406dc5799cfa32b07e361 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,18 +28,14 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::COxidationDiffusionLimitedRate::COxidationDiffusionLimitedRate +template<class CloudType> +Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate ( const dictionary& dict, - ReactingMultiphaseCloud<coalParcel>& owner + CloudType& owner ) : - SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> > - ( - dict, - owner, - typeName - ), + SurfaceReactionModel<CloudType>(dict, owner, typeName), Sb_(dimensionedScalar(this->coeffDict().lookup("Sb")).value()), D_(dimensionedScalar(this->coeffDict().lookup("D")).value()), CsLocalId_(-1), @@ -63,10 +59,10 @@ Foam::COxidationDiffusionLimitedRate::COxidationDiffusionLimitedRate { FatalErrorIn ( - "COxidationDiffusionLimitedRate" + "COxidationDiffusionLimitedRate<CloudType>" "(" "const dictionary&, " - "ReactingMultiphaseCloud<coalParcel>&" + "CloudType&" ")" ) << "Stoichiometry of reaction, Sb, must be greater than zero" << nl << exit(FatalError); @@ -76,19 +72,23 @@ Foam::COxidationDiffusionLimitedRate::COxidationDiffusionLimitedRate // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::COxidationDiffusionLimitedRate::~COxidationDiffusionLimitedRate() +template<class CloudType> +Foam::COxidationDiffusionLimitedRate<CloudType>:: +~COxidationDiffusionLimitedRate() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::COxidationDiffusionLimitedRate::active() const +template<class CloudType> +bool Foam::COxidationDiffusionLimitedRate<CloudType>::active() const { return true; } -Foam::scalar Foam::COxidationDiffusionLimitedRate::calculate +template<class CloudType> +Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate ( const scalar dt, const label cellI, @@ -110,7 +110,8 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate::calculate ) const { // Fraction of remaining combustible material - const scalar fComb = YMixture[coalParcel::SLD]*YSolid[CsLocalId_]; + const label idSolid = CloudType::parcelType::SLD; + const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_]; // Surface combustion active combustible fraction is consumed if (fComb < SMALL) @@ -120,7 +121,7 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate::calculate // Local mass fraction of O2 in the carrier phase const scalar YO2 = - owner().carrierThermo().composition().Y(O2GlobalId_)[cellI]; + this->owner().carrierThermo().composition().Y(O2GlobalId_)[cellI]; // Change in C mass [kg] scalar dmC = diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.H b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.H index 4458a6e31e2ad4ee5e37827596322d119916d75a..9ab6a5c0f940450b350f8100b6217c387ecc5afe 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.H +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,19 +38,23 @@ Description #define COxidationDiffusionLimitedRate_H #include "SurfaceReactionModel.H" -#include "coalParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Forward class declarations +template<class CloudType> +class COxidationDiffusionLimitedRate; + namespace Foam { /*---------------------------------------------------------------------------*\ - Class COxidationDiffusionLimitedRate Declaration + Class COxidationDiffusionLimitedRate Declaration \*---------------------------------------------------------------------------*/ +template<class CloudType> class COxidationDiffusionLimitedRate : - public SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> > + public SurfaceReactionModel<CloudType> { // Private data @@ -99,7 +103,7 @@ public: COxidationDiffusionLimitedRate ( const dictionary& dict, - ReactingMultiphaseCloud<coalParcel>& owner + CloudType& owner ); @@ -142,6 +146,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "COxidationDiffusionLimitedRate.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C index 078cd100d73c6f66a7a859de8695fca4bf65b5d8..d21efd77e8b0b612b8a4c0d8bb22d3ce41a894f9 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,14 +28,15 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::COxidationKineticDiffusionLimitedRate:: +template<class CloudType> +Foam::COxidationKineticDiffusionLimitedRate<CloudType>:: COxidationKineticDiffusionLimitedRate ( const dictionary& dict, - ReactingMultiphaseCloud<coalParcel>& owner + CloudType& owner ) : - SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> > + SurfaceReactionModel<CloudType> ( dict, owner, @@ -69,7 +70,7 @@ COxidationKineticDiffusionLimitedRate "COxidationKineticDiffusionLimitedRate" "(" "const dictionary&, " - "ReactingMultiphaseCloud<coalParcel>&" + "CloudType&" ")" ) << "Stoichiometry of reaction, Sb, must be greater than zero" << nl << exit(FatalError); @@ -79,20 +80,23 @@ COxidationKineticDiffusionLimitedRate // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::COxidationKineticDiffusionLimitedRate:: +template<class CloudType> +Foam::COxidationKineticDiffusionLimitedRate<CloudType>:: ~COxidationKineticDiffusionLimitedRate() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::COxidationKineticDiffusionLimitedRate::active() const +template<class CloudType> +bool Foam::COxidationKineticDiffusionLimitedRate<CloudType>::active() const { return true; } -Foam::scalar Foam::COxidationKineticDiffusionLimitedRate::calculate +template<class CloudType> +Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate ( const scalar dt, const label cellI, @@ -114,7 +118,8 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate::calculate ) const { // Fraction of remaining combustible material - const scalar fComb = YMixture[coalParcel::SLD]*YSolid[CsLocalId_]; + const label idSolid = CloudType::parcelType::SLD; + const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_]; // Surface combustion active combustible fraction is consumed if (fComb < SMALL) @@ -124,7 +129,7 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate::calculate // Local mass fraction of O2 in the carrier phase const scalar YO2 = - owner().carrierThermo().composition().Y(O2GlobalId_)[cellI]; + this->owner().carrierThermo().composition().Y(O2GlobalId_)[cellI]; // Diffusion rate coefficient const scalar D0 = C1_/d*pow(0.5*(T + Tc), 0.75); diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.H b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.H index 1073cb637f8a69e62d45e41f74bd733b0ef4ac7b..6500b24c4ffd82f89501bbaf350e433ceb79ac1f 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.H +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,19 +39,24 @@ Description #define COxidationKineticDiffusionLimitedRate_H #include "SurfaceReactionModel.H" -#include "coalParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { + +// Forward class declarations +template<class CloudType> +class COxidationKineticDiffusionLimitedRate; + /*---------------------------------------------------------------------------*\ Class COxidationKineticDiffusionLimitedRate Declaration \*---------------------------------------------------------------------------*/ +template<class CloudType> class COxidationKineticDiffusionLimitedRate : - public SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> > + public SurfaceReactionModel<CloudType> { // Private data @@ -106,7 +111,7 @@ public: COxidationKineticDiffusionLimitedRate ( const dictionary& dict, - ReactingMultiphaseCloud<coalParcel>& owner + CloudType& owner ); @@ -149,6 +154,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "COxidationKineticDiffusionLimitedRate.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C index 265b4b66434f42f60731a8bbf6f80b80168f7dc9..c7c8dd795582d9ce079240f1b65bf2bc69740080 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,20 +28,23 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -Foam::label Foam::COxidationMurphyShaddix::maxIters_ = 1000; +template<class CloudType> +Foam::label Foam::COxidationMurphyShaddix<CloudType>::maxIters_ = 1000; -Foam::scalar Foam::COxidationMurphyShaddix::tolerance_ = 1e-06; +template<class CloudType> +Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::tolerance_ = 1e-06; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::COxidationMurphyShaddix::COxidationMurphyShaddix +template<class CloudType> +Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix ( const dictionary& dict, - ReactingMultiphaseCloud<coalParcel>& owner + CloudType& owner ) : - SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> > + SurfaceReactionModel<CloudType> ( dict, owner, @@ -59,36 +62,37 @@ Foam::COxidationMurphyShaddix::COxidationMurphyShaddix O2GlobalId_(owner.composition().globalCarrierId("O2")), CO2GlobalId_(owner.composition().globalCarrierId("CO2")), WC_(0.0), - WO2_(0.0), - HcCO2_(0.0) + WO2_(0.0) { // Determine Cs ids label idSolid = owner.composition().idSolid(); - CsLocalId_ = owner.composition().localId(idSolid, "Cs"); + CsLocalId_ = owner.composition().localId(idSolid, "C"); // Set local copies of thermo properties WO2_ = owner.composition().carrierSpecies()[O2GlobalId_].W(); scalar WCO2 = owner.composition().carrierSpecies()[CO2GlobalId_].W(); WC_ = WCO2 - WO2_; - HcCO2_ = owner.composition().carrierSpecies()[CO2GlobalId_].Hc(); } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::COxidationMurphyShaddix::~COxidationMurphyShaddix() +template<class CloudType> +Foam::COxidationMurphyShaddix<CloudType>::~COxidationMurphyShaddix() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::COxidationMurphyShaddix::active() const +template<class CloudType> +bool Foam::COxidationMurphyShaddix<CloudType>::active() const { return true; } -Foam::scalar Foam::COxidationMurphyShaddix::calculate +template<class CloudType> +Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate ( const scalar dt, const label cellI, @@ -110,7 +114,8 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate ) const { // Fraction of remaining combustible material - const scalar fComb = YMixture[coalParcel::SLD]*YSolid[CsLocalId_]; + const label idSolid = CloudType::parcelType::SLD; + const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_]; // Surface combustion until combustible fraction is consumed if (fComb < SMALL) @@ -120,7 +125,7 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate // Cell carrier phase O2 species density [kg/m^3] const scalar rhoO2 = - rhoc*owner().carrierThermo().composition().Y(O2GlobalId_)[cellI]; + rhoc*this->owner().carrierThermo().composition().Y(O2GlobalId_)[cellI]; if (rhoO2 < SMALL) { @@ -186,8 +191,10 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate if (iter > maxIters_) { - WarningIn("scalar Foam::COxidationMurphyShaddix::calculate(...)") - << "iter limit reached (" << maxIters_ << ")" << nl << endl; + WarningIn + ( + "scalar Foam::COxidationMurphyShaddix<CloudType>::calculate(...)" + ) << "iter limit reached (" << maxIters_ << ")" << nl << endl; } // Calculate the number of molar units reacted @@ -200,8 +207,16 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate // Add to particle mass transfer dMassSolid[CsLocalId_] += dOmega*WC_; + const scalar HC = + this->owner().composition().solids().properties()[CsLocalId_].Hf() + + this->owner().composition().solids().properties()[CsLocalId_].cp()*T; + const scalar HCO2 = + this->owner().composition().carrierSpecies()[CO2GlobalId_].H(T); + const scalar HO2 = + this->owner().composition().carrierSpecies()[O2GlobalId_].H(T); + // Heat of reaction - return -HcCO2_*dOmega*WC_; + return dOmega*(WC_*HC + WO2_*HO2 - (WC_ + WO2_)*HCO2); } diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.H b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.H index bc026db3646680cd1d9bac14d0f6f65d702c6544..7864fc63372bc1b34489e9bdedc49b6d402dd54a 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.H +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,19 +34,24 @@ Description #define COxidationMurphyShaddix_H #include "SurfaceReactionModel.H" -#include "coalParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { + +// Forward class declarations +template<class CloudType> +class COxidationMurphyShaddix; + /*---------------------------------------------------------------------------*\ Class COxidationMurphyShaddix Declaration \*---------------------------------------------------------------------------*/ +template<class CloudType> class COxidationMurphyShaddix : - public SurfaceReactionModel<ReactingMultiphaseCloud<coalParcel> > + public SurfaceReactionModel<CloudType> { // Private data @@ -106,9 +111,6 @@ class COxidationMurphyShaddix //- Molecular weight of O2 [kg/kmol] scalar WO2_; - //- Chemical enthalpy of CO2 [J/kg] - scalar HcCO2_; - public: @@ -122,7 +124,7 @@ public: COxidationMurphyShaddix ( const dictionary& dict, - ReactingMultiphaseCloud<coalParcel>& owner + CloudType& owner ); @@ -165,6 +167,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "COxidationMurphyShaddix.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C index 7f7b7a6119d6846393c77009dd7946afa2f97f29..2d9fa9bf7c0bae992d97bb7d131d43c9bd712f54 100644 --- a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C +++ b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C @@ -30,24 +30,22 @@ License #include "mathematicalConstants.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + namespace Foam { - -defineTypeNameAndDebug(swirlInjector, 0); - -addToRunTimeSelectionTable -( - injectorType, - swirlInjector, - dictionary -); + defineTypeNameAndDebug(swirlInjector, 0); + + addToRunTimeSelectionTable + ( + injectorType, + swirlInjector, + dictionary + ); } -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::swirlInjector::swirlInjector ( const Foam::Time& t, @@ -66,40 +64,56 @@ Foam::swirlInjector::swirlInjector X_(propsDict_.lookup("X")), massFlowRateProfile_(propsDict_.lookup("massFlowRateProfile")), injectionPressureProfile_(propsDict_.lookup("injectionPressureProfile")), - velocityProfile_(injectionPressureProfile_), - CdProfile_(injectionPressureProfile_), - TProfile_(injectionPressureProfile_), + velocityProfile_(massFlowRateProfile_), + CdProfile_(massFlowRateProfile_), + TProfile_(massFlowRateProfile_), averageParcelMass_(mass_/nParcels_), pressureIndependentVelocity_(false) { // convert CA to real time forAll(massFlowRateProfile_, i) { - massFlowRateProfile_[i][0] = t.userTimeToTime(massFlowRateProfile_[i][0]); + massFlowRateProfile_[i][0] = + t.userTimeToTime(massFlowRateProfile_[i][0]); } forAll(injectionPressureProfile_, i) { - injectionPressureProfile_[i][0] = t.userTimeToTime(injectionPressureProfile_[i][0]); + injectionPressureProfile_[i][0] = + t.userTimeToTime(injectionPressureProfile_[i][0]); } // check if time entries match if (mag(massFlowRateProfile_[0][0]-injectionPressureProfile_[0][0]) > SMALL) { - FatalError << "swirlInjector::swirlInjector(const time& t, const dictionary dict) " << endl - << " start-times do not match for injectionPressureProfile and massFlowRateProfile." + FatalErrorIn + ( + "swirlInjector::swirlInjector(const time& t, const dictionary dict)" + ) << "Start-times do not match for " + "injectionPressureProfile and massFlowRateProfile." << abort(FatalError); } // check if time entries match - if (mag(massFlowRateProfile_[massFlowRateProfile_.size()-1][0]-injectionPressureProfile_[injectionPressureProfile_.size()-1][0]) > SMALL) + if + ( + mag + ( + massFlowRateProfile_[massFlowRateProfile_.size() - 1][0] + - injectionPressureProfile_[injectionPressureProfile_.size() - 1][0] + ) > SMALL + ) { - FatalError << "swirlInjector::swirlInjector(const time& t, const dictionary dict) " << endl - << " end-times do not match for injectionPressureProfile and massFlowRateProfile." + FatalErrorIn + ( + "swirlInjector::swirlInjector(const time& t, const dictionary dict)" + ) << "End-times do not match for " + "injectionPressureProfile and massFlowRateProfile." << abort(FatalError); } scalar integratedMFR = integrateTable(massFlowRateProfile_); - scalar integratedPressure = integrateTable(injectionPressureProfile_)/(teoi()-tsoi()); + scalar integratedPressure = + integrateTable(injectionPressureProfile_)/(teoi()-tsoi()); forAll(massFlowRateProfile_, i) { @@ -118,12 +132,13 @@ Foam::swirlInjector::swirlInjector forAll(injectionPressureProfile_, i) { // correct the pressureProfile to match the injection pressure - injectionPressureProfile_[i][1] *= injectionPressure_/integratedPressure; + injectionPressureProfile_[i][1] *= + injectionPressure_/integratedPressure; } // Normalize the direction vector direction_ /= mag(direction_); - + setTangentialVectors(); // check molar fractions @@ -135,17 +150,19 @@ Foam::swirlInjector::swirlInjector if (mag(Xsum - 1.0) > SMALL) { - Info << "Warning!!!\n swirlInjector::swirlInjector(const time& t, Istream& is)" - << "X does not add up to 1.0, correcting molar fractions." - << endl; + WarningIn + ( + "swirlInjector::swirlInjector(const time& t, const dictionary dict)" + ) << "X does not add up to 1.0, correcting molar fractions." << endl; + forAll(X_, i) { X_[i] /= Xsum; } } - } + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::swirlInjector::~swirlInjector() @@ -170,10 +187,8 @@ void Foam::swirlInjector::setTangentialVectors() tangentialInjectionVector1_ = tangent/magV; tangentialInjectionVector2_ = direction_ ^ tangentialInjectionVector1_; - } - Foam::label Foam::swirlInjector::nParcelsToInject ( const scalar time0, @@ -183,7 +198,7 @@ Foam::label Foam::swirlInjector::nParcelsToInject scalar mInj = mass_*(fractionOfInjection(time1)-fractionOfInjection(time0)); label nParcels = label(mInj/averageParcelMass_ + 0.49); - + return nParcels; } @@ -223,7 +238,7 @@ Foam::vector Foam::swirlInjector::position scalar iAngle = 2.0*mathematicalConstant::pi*rndGen.scalar01(); return - ( + ( position_ + iRadius * ( @@ -231,7 +246,7 @@ Foam::vector Foam::swirlInjector::position + tangentialInjectionVector2_*sin(iAngle) ) ); - + } return position_; @@ -266,7 +281,7 @@ Foam::scalar Foam::swirlInjector::mass { scalar mInj = mass_*(fractionOfInjection(time1)-fractionOfInjection(time0)); - // correct mass if calculation is 2D + // correct mass if calculation is 2D if (twoD) { mInj *= 0.5*angleOfWedge/mathematicalConstant::pi; @@ -280,7 +295,8 @@ Foam::scalar Foam::swirlInjector::mass() const return mass_; } -Foam::List<Foam::swirlInjector::pair> Foam::swirlInjector::massFlowRateProfile() const +Foam::List<Foam::swirlInjector::pair> +Foam::swirlInjector::massFlowRateProfile() const { return massFlowRateProfile_; } @@ -290,7 +306,8 @@ Foam::scalar Foam::swirlInjector::massFlowRate(const scalar time) const return getTableValue(massFlowRateProfile_, time); } -Foam::List<Foam::swirlInjector::pair> Foam::swirlInjector::injectionPressureProfile() const +Foam::List<Foam::swirlInjector::pair> +Foam::swirlInjector::injectionPressureProfile() const { return injectionPressureProfile_; } @@ -300,7 +317,8 @@ Foam::scalar Foam::swirlInjector::injectionPressure(const scalar time) const return getTableValue(injectionPressureProfile_, time); } -Foam::List<Foam::swirlInjector::pair> Foam::swirlInjector::velocityProfile() const +Foam::List<Foam::swirlInjector::pair> +Foam::swirlInjector::velocityProfile() const { return velocityProfile_; } @@ -309,7 +327,7 @@ Foam::scalar Foam::swirlInjector::velocity(const scalar time) const { return getTableValue(velocityProfile_, time); } - + Foam::List<Foam::swirlInjector::pair> Foam::swirlInjector::CdProfile() const { return CdProfile_; @@ -350,7 +368,6 @@ Foam::scalar Foam::swirlInjector::fractionOfInjection(const scalar time) const return integrateTable(massFlowRateProfile_, time)/mass_; } - Foam::scalar Foam::swirlInjector::injectedMass ( const scalar t @@ -372,7 +389,11 @@ void Foam::swirlInjector::correctProfiles forAll(velocityProfile_, i) { - scalar Pinj = getTableValue(injectionPressureProfile_, massFlowRateProfile_[i][0]); + scalar Pinj = getTableValue + ( + injectionPressureProfile_, + massFlowRateProfile_[i][0] + ); scalar mfr = massFlowRateProfile_[i][1]/(rho*A); scalar v = sqrt(2.0*(Pinj - referencePressure)/rho); velocityProfile_[i][1] = v; @@ -390,4 +411,5 @@ Foam::vector Foam::swirlInjector::tan2(const label n) const return tangentialInjectionVector2_; } + // ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/parcel/parcel.C b/src/lagrangian/dieselSpray/parcel/parcel.C index 1af26992010a1e8d1cf4ab5a780eacddde5237a3..4d19f332fd3aa3901af43bedd62c8bc789a199ee 100644 --- a/src/lagrangian/dieselSpray/parcel/parcel.C +++ b/src/lagrangian/dieselSpray/parcel/parcel.C @@ -696,6 +696,4 @@ void Foam::parcel::transformProperties(const vector&) {} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - // ************************************************************************* // diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C index 1a89bcacb16c07fc3f836a02b5a01bbf21484b6e..10cec60dd27e5fc331d97c7c49428e6399bad2a9 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C @@ -524,20 +524,20 @@ void Foam::DsmcCloud<ParcelType>::addNewParcel template<class ParcelType> Foam::DsmcCloud<ParcelType>::DsmcCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& T, const volVectorField& U ) : - Cloud<ParcelType>(T.mesh(), cloudType, false), + Cloud<ParcelType>(T.mesh(), cloudName, false), DsmcBaseCloud(), - cloudType_(cloudType), + cloudName_(cloudName), mesh_(T.mesh()), particleProperties_ ( IOobject ( - cloudType + "Properties", + cloudName + "Properties", mesh_.time().constant(), mesh_, IOobject::MUST_READ, @@ -636,19 +636,19 @@ Foam::DsmcCloud<ParcelType>::DsmcCloud template<class ParcelType> Foam::DsmcCloud<ParcelType>::DsmcCloud ( - const word& cloudType, + const word& cloudName, const fvMesh& mesh ) : - Cloud<ParcelType>(mesh, cloudType, false), + Cloud<ParcelType>(mesh, cloudName, false), DsmcBaseCloud(), - cloudType_(cloudType), + cloudName_(cloudName), mesh_(mesh), particleProperties_ ( IOobject ( - cloudType + "Properties", + cloudName + "Properties", mesh_.time().constant(), mesh_, IOobject::MUST_READ, diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H index b6d01428c7b4ad75ba00bb2184f4c967b4e0d6a8..fc5cf53d683be6ed9ec879578887f59c70d53718 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.H @@ -76,7 +76,7 @@ class DsmcCloud //- Cloud type - used to set the name of the parcel properties // dictionary by appending "Properties" - const word cloudType_; + const word cloudName_; //- References to the mesh and time databases const fvMesh& mesh_; @@ -178,7 +178,7 @@ public: //- Construct given name and mesh, will read Parcels from file DsmcCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& T, const volVectorField& U ); @@ -186,7 +186,7 @@ public: //- Construct given name and mesh. Used to initialise. DsmcCloud ( - const word& cloudType, + const word& cloudName, const fvMesh& mesh ); @@ -202,7 +202,7 @@ public: // References to the mesh and databases //- Return the cloud type - inline const word& cloudType() const; + inline const word& cloudName() const; //- Return refernce to the mesh inline const fvMesh& mesh() const; diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H index aba0b846838ec09724d9ebe746f2e8379e126fe3..449650c0a8345d1fc3f14289eb39b4a27eb84521 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloudI.H @@ -27,9 +27,9 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class ParcelType> -inline const Foam::word& Foam::DsmcCloud<ParcelType>::cloudType() const +inline const Foam::word& Foam::DsmcCloud<ParcelType>::cloudName() const { - return cloudType_; + return cloudName_; } diff --git a/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.C b/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.C index 563c1dac57f703f711061e12c92a141ee2b6c502..425e47a70581d9c062d591209e8dc066ddd7b6ca 100644 --- a/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.C +++ b/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.C @@ -38,12 +38,12 @@ namespace Foam Foam::dsmcCloud::dsmcCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& T, const volVectorField& U ) : - DsmcCloud<dsmcParcel>(cloudType, T, U) + DsmcCloud<dsmcParcel>(cloudName, T, U) { dsmcParcel::readFields(*this); } @@ -51,11 +51,11 @@ Foam::dsmcCloud::dsmcCloud Foam::dsmcCloud::dsmcCloud ( - const word& cloudType, + const word& cloudName, const fvMesh& mesh ) : - DsmcCloud<dsmcParcel>(cloudType, mesh) + DsmcCloud<dsmcParcel>(cloudName, mesh) {} diff --git a/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.H b/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.H index 9296f12d0dd14376f0a400ec8489fe4155aee8a6..d5302056816419ee1deca073f94c13024bc52e8c 100644 --- a/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.H +++ b/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.H @@ -72,7 +72,7 @@ public: //- Construct from components dsmcCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& T, const volVectorField& U ); @@ -80,7 +80,7 @@ public: //- Construct from name and mesh, used to initialise. dsmcCloud ( - const word& cloudType, + const word& cloudName, const fvMesh& mesh ); diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C index 3a2eaab3928b9931ec5e0b8736b700e2449d96ed..fae05b0f2ffc2543046d449aef0dd2bcb7352de7 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C @@ -61,15 +61,9 @@ bool Foam::DsmcParcel<ParcelType>::move if (p.onBoundary() && td.keepParticle) { - if (p.face() > -1) + if (isType<processorPolyPatch>(pbMesh[p.patch(p.face())])) { - if - ( - isType<processorPolyPatch>(pbMesh[p.patch(p.face())]) - ) - { - td.switchProcessor = true; - } + td.switchProcessor = true; } } } @@ -78,6 +72,19 @@ bool Foam::DsmcParcel<ParcelType>::move } +template<class ParcelType> +template<class TrackData> +bool Foam::DsmcParcel<ParcelType>::hitPatch +( + const polyPatch&, + TrackData& td, + const label patchI +) +{ + return false; +} + + template<class ParcelType> template<class TrackData> void Foam::DsmcParcel<ParcelType>::hitProcessorPatch diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H index 03bb2bd5a186615cc88ab7b2a37e479a27ea4870..af8e350e7fd8ec756ba9957eb74c4f00b9152157 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.H @@ -239,6 +239,16 @@ public: // Patch interactions + //- Overridable function to handle the particle hitting a patch + // Executed before other patch-hitting functions + template<class TrackData> + bool hitPatch + ( + const polyPatch&, + TrackData& td, + const label patchI + ); + //- Overridable function to handle the particle hitting a // processorPatch template<class TrackData> diff --git a/src/lagrangian/intermediate/Make/files b/src/lagrangian/intermediate/Make/files index 4b371547f8678df5fcf81de218992fa93da50297..de8bcd332129c0d94f42c8f818b3d6aa0359ea02 100644 --- a/src/lagrangian/intermediate/Make/files +++ b/src/lagrangian/intermediate/Make/files @@ -1,70 +1,61 @@ PARCELS=parcels +BASEPARCELS=$(PARCELS)/baseClasses DERIVEDPARCELS=$(PARCELS)/derived +CLOUDS=clouds +BASECLOUDS=$(CLOUDS)/baseClasses +DERIVEDCLOUDS=$(CLOUDS)/derived + + /* Parcels */ -$(DERIVEDPARCELS)/basicKinematicParcel/basicKinematicParcel.C -$(DERIVEDPARCELS)/basicThermoParcel/basicThermoParcel.C -$(DERIVEDPARCELS)/basicReactingParcel/basicReactingParcel.C -$(DERIVEDPARCELS)/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C +$(BASEPARCELS)/reactingParcel/reactingParcel.C /* Cloud base classes */ -clouds/baseClasses/kinematicCloud/kinematicCloud.C -clouds/baseClasses/thermoCloud/thermoCloud.C -clouds/baseClasses/reactingCloud/reactingCloud.C -clouds/baseClasses/reactingMultiphaseCloud/reactingMultiphaseCloud.C +$(BASECLOUDS)/kinematicCloud/kinematicCloud.C +$(BASECLOUDS)/thermoCloud/thermoCloud.C +$(BASECLOUDS)/reactingCloud/reactingCloud.C +$(BASECLOUDS)/reactingMultiphaseCloud/reactingMultiphaseCloud.C /* Cloud container/injection mechanisms */ -clouds/derived/basicKinematicCloud/basicKinematicCloud.C -clouds/derived/basicThermoCloud/basicThermoCloud.C -clouds/derived/basicReactingCloud/basicReactingCloud.C -clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.C +$(DERIVEDCLOUDS)/basicKinematicCloud/basicKinematicCloud.C +$(DERIVEDCLOUDS)/basicThermoCloud/basicThermoCloud.C +$(DERIVEDCLOUDS)/BasicReactingCloud/defineBasicReactingCloud.C +$(DERIVEDCLOUDS)/BasicReactingMultiphaseCloud/defineBasicReactingMultiphaseCloud.C +$(DERIVEDCLOUDS)/BasicTrackedReactingCloud/defineBasicTrackedReactingCloud.C /* kinematic parcel sub-models */ KINEMATICPARCEL=$(DERIVEDPARCELS)/basicKinematicParcel +$(KINEMATICPARCEL)/basicKinematicParcel.C $(KINEMATICPARCEL)/defineBasicKinematicParcel.C -$(KINEMATICPARCEL)/submodels/makeBasicKinematicParcelDispersionModels.C -$(KINEMATICPARCEL)/submodels/makeBasicKinematicParcelDragModels.C -$(KINEMATICPARCEL)/submodels/makeBasicKinematicParcelInjectionModels.C -$(KINEMATICPARCEL)/submodels/makeBasicKinematicParcelWallInteractionModels.C +$(KINEMATICPARCEL)/makeBasicKinematicParcelSubmodels.C /* thermo parcel sub-models */ THERMOPARCEL=$(DERIVEDPARCELS)/basicThermoParcel +$(THERMOPARCEL)/basicThermoParcel.C $(THERMOPARCEL)/defineBasicThermoParcel.C -$(THERMOPARCEL)/submodels/makeBasicThermoParcelDispersionModels.C -$(THERMOPARCEL)/submodels/makeBasicThermoParcelDragModels.C -$(THERMOPARCEL)/submodels/makeBasicThermoParcelHeatTransferModels.C -$(THERMOPARCEL)/submodels/makeBasicThermoParcelInjectionModels.C -$(THERMOPARCEL)/submodels/makeBasicThermoParcelWallInteractionModels.C +$(THERMOPARCEL)/makeBasicThermoParcelSubmodels.C /* reacting parcel sub-models */ -REACTINGPARCEL=$(DERIVEDPARCELS)/basicReactingParcel +REACTINGPARCEL=$(DERIVEDPARCELS)/BasicReactingParcel $(REACTINGPARCEL)/defineBasicReactingParcel.C -$(REACTINGPARCEL)/submodels/makeBasicReactingParcelCompositionModels.C -$(REACTINGPARCEL)/submodels/makeBasicReactingParcelDispersionModels.C -$(REACTINGPARCEL)/submodels/makeBasicReactingParcelDragModels.C -$(REACTINGPARCEL)/submodels/makeBasicReactingParcelHeatTransferModels.C -$(REACTINGPARCEL)/submodels/makeBasicReactingParcelInjectionModels.C -$(REACTINGPARCEL)/submodels/makeBasicReactingParcelPhaseChangeModels.C -$(REACTINGPARCEL)/submodels/makeBasicReactingParcelWallInteractionModels.C +$(REACTINGPARCEL)/makeBasicReactingParcelSubmodels.C + + +/* tracked reacting parcel sub-models */ +TRACKEDREACTINGPARCEL=$(DERIVEDPARCELS)/BasicTrackedReactingParcel +$(TRACKEDREACTINGPARCEL)/defineTrackedReactingParcel.C +$(TRACKEDREACTINGPARCEL)/makeBasicTrackedReactingParcelSubmodels.C /* reacting multiphase parcel sub-models */ -REACTINGMPPARCEL=$(DERIVEDPARCELS)/basicReactingMultiphaseParcel +REACTINGMPPARCEL=$(DERIVEDPARCELS)/BasicReactingMultiphaseParcel $(REACTINGMPPARCEL)/defineBasicReactingMultiphaseParcel.C -$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelCompositionModels.C -$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelDevolatilisationModels.C -$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelDispersionModels.C -$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelDragModels.C -$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelHeatTransferModels.C -$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelInjectionModels.C -$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelPhaseChangeModels.C -$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelSurfaceReactionModels.C -$(REACTINGMPPARCEL)/submodels/makeBasicReactingMultiphaseParcelWallInteractionModels.C +$(REACTINGMPPARCEL)/makeBasicReactingMultiphaseParcelSubmodels.C /* bolt-on models */ @@ -72,6 +63,11 @@ submodels/addOns/radiation/absorptionEmission/cloudAbsorptionEmission/cloudAbsor submodels/addOns/radiation/scatter/cloudScatter/cloudScatter.C +/* data entries */ +submodels/IO/DataEntry/makeDataEntries.C +submodels/IO/DataEntry/polynomial/polynomial.C + + /* integration schemes */ IntegrationScheme/makeIntegrationSchemes.C @@ -86,9 +82,4 @@ phaseProperties/phaseProperties/phasePropertiesIO.C phaseProperties/phasePropertiesList/phasePropertiesList.C -/* data entries */ -submodels/IO/DataEntry/makeDataEntries.C -submodels/IO/DataEntry/polynomial/polynomial.C - - LIB = $(FOAM_LIBBIN)/liblagrangianIntermediate diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C index 2058dde5ea1a8ef18a6813b41a3c97f4c2bcf132..2f96ae1418ee6d1365a2a87e2380cadefc398b70 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C @@ -31,62 +31,29 @@ License #include "DispersionModel.H" #include "DragModel.H" #include "InjectionModel.H" -#include "WallInteractionModel.H" - - -// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // - -template<class ParcelType> -void Foam::KinematicCloud<ParcelType>::addNewParcel -( - const vector& position, - const label cellId, - const scalar d, - const vector& U, - const scalar nParticles, - const scalar lagrangianDt -) -{ - ParcelType* pPtr = new ParcelType - ( - *this, - position, - cellId, - parcelTypeId_, - nParticles, - d, - U, - constProps_ - ); - - scalar continuousDt = this->db().time().deltaT().value(); - pPtr->stepFraction() = (continuousDt - lagrangianDt)/continuousDt; - - addParticle(pPtr); -} - +#include "PatchInteractionModel.H" +#include "PostProcessingModel.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class ParcelType> Foam::KinematicCloud<ParcelType>::KinematicCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const volScalarField& mu, const dimensionedVector& g ) : - Cloud<ParcelType>(rho.mesh(), cloudType, false), + Cloud<ParcelType>(rho.mesh(), cloudName, false), kinematicCloud(), - cloudType_(cloudType), mesh_(rho.mesh()), particleProperties_ ( IOobject ( - cloudType + "Properties", + cloudName + "Properties", rho.mesh().time().constant(), rho.mesh(), IOobject::MUST_READ, @@ -131,14 +98,22 @@ Foam::KinematicCloud<ParcelType>::KinematicCloud *this ) ), - wallInteractionModel_ + patchInteractionModel_ ( - WallInteractionModel<KinematicCloud<ParcelType> >::New + PatchInteractionModel<KinematicCloud<ParcelType> >::New ( particleProperties_, *this ) ), + postProcessingModel_ + ( + PostProcessingModel<KinematicCloud<ParcelType> >::New + ( + this->particleProperties_, + *this + ) + ), UIntegrator_ ( vectorIntegrationScheme::New @@ -173,6 +148,24 @@ Foam::KinematicCloud<ParcelType>::~KinematicCloud() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class ParcelType> +void Foam::KinematicCloud<ParcelType>::checkParcelProperties +( + ParcelType* pPtr, + const scalar lagrangianDt, + const bool fullyDescribed +) +{ + if (!fullyDescribed) + { + pPtr->rho() = constProps_.rho0(); + } + + scalar carrierDt = this->db().time().deltaT().value(); + pPtr->stepFraction() = (carrierDt - lagrangianDt)/carrierDt; +} + + template<class ParcelType> void Foam::KinematicCloud<ParcelType>::resetSourceTerms() { @@ -227,6 +220,8 @@ void Foam::KinematicCloud<ParcelType>::evolve() } Cloud<ParcelType>::move(td); + + this->postProcessing().post(); } diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index 0a27aede96010b26dba378820285e3b6c7e746ff..2dcd277a1db0e9d4ed53b68e1968c929d17ca130 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -72,7 +72,10 @@ template<class CloudType> class InjectionModel; template<class CloudType> -class WallInteractionModel; +class PostProcessingModel; + +template<class CloudType> +class PatchInteractionModel; /*---------------------------------------------------------------------------*\ Class KinematicCloud Declaration @@ -84,11 +87,18 @@ class KinematicCloud public Cloud<ParcelType>, public kinematicCloud { - // Private data + // Private Member Functions + + //- Disallow default bitwise copy construct + KinematicCloud(const KinematicCloud&); + + //- Disallow default bitwise assignment + void operator=(const KinematicCloud&); - //- Cloud type - used to set the name of the parcel properties - // dictionary by appending "Properties" - const word cloudType_; + +protected: + + // Protected data //- References to the mesh and time databases const fvMesh& mesh_; @@ -153,9 +163,13 @@ class KinematicCloud autoPtr<InjectionModel<KinematicCloud<ParcelType> > > injectionModel_; - //- Wall interaction model - autoPtr<WallInteractionModel<KinematicCloud<ParcelType> > > - wallInteractionModel_; + //- Patch interaction model + autoPtr<PatchInteractionModel<KinematicCloud<ParcelType> > > + patchInteractionModel_; + + //- Post-processing model + autoPtr<PostProcessingModel<KinematicCloud<ParcelType> > > + postProcessingModel_; // Reference to the particle integration schemes @@ -170,15 +184,6 @@ class KinematicCloud DimensionedField<vector, volMesh> UTrans_; - // Private Member Functions - - //- Disallow default bitwise copy construct - KinematicCloud(const KinematicCloud&); - - //- Disallow default bitwise assignment - void operator=(const KinematicCloud&); - - public: // Constructors @@ -186,7 +191,7 @@ public: //- Construct given carrier gas fields KinematicCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const volScalarField& mu, @@ -208,9 +213,6 @@ public: // References to the mesh and databases - //- Return the cloud type - inline const word& cloudType() const; - //- Return the parcel type id inline label parcelTypeId() const; @@ -277,27 +279,33 @@ public: // Sub-models - //- Return reference to dispersion model + //- Return const-access to the dispersion model inline const DispersionModel<KinematicCloud<ParcelType> >& dispersion() const; + //- Return reference to the dispersion model inline DispersionModel<KinematicCloud<ParcelType> >& dispersion(); - //- Return reference to drag model + //- Return const-access to the drag model inline const DragModel<KinematicCloud<ParcelType> >& drag() const; - //- Return reference to injection model + //- Return const access to the injection model inline const InjectionModel<KinematicCloud<ParcelType> >& injection() const; + //- Return reference to the injection model inline InjectionModel<KinematicCloud<ParcelType> >& injection(); - //- Return reference to wall interaction model - inline const WallInteractionModel<KinematicCloud<ParcelType> >& - wallInteraction() const; + //- Return const-access to the patch interaction model + inline const PatchInteractionModel<KinematicCloud<ParcelType> >& + patchInteraction() const; + + //- Return reference to post-processing model + inline PostProcessingModel<KinematicCloud<ParcelType> >& + postProcessing(); // Integration schemes @@ -346,15 +354,12 @@ public: // Cloud evolution functions - //- Add new parcel - void addNewParcel + //- Check parcel properties + void checkParcelProperties ( - const vector& position, - const label cellId, - const scalar d, - const vector& U, - const scalar nParticles, - const scalar lagrangianDt + ParcelType* pPtr, + const scalar lagrangianDt, + const bool fullyDescribed ); //- Reset the spray source terms diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H index b02b0f0d8f4ac3d5f9d716186981385f388949cb..1f48632d152a1952201bcd5479dab0f36f4421cf 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H @@ -28,13 +28,6 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template<class ParcelType> -inline const Foam::word& Foam::KinematicCloud<ParcelType>::cloudType() const -{ - return cloudType_; -} - - template<class ParcelType> inline Foam::label Foam::KinematicCloud<ParcelType>::parcelTypeId() const { @@ -158,6 +151,14 @@ Foam::KinematicCloud<ParcelType>::injection() const } +template<class ParcelType> +inline const Foam::PatchInteractionModel<Foam::KinematicCloud<ParcelType> >& +Foam::KinematicCloud<ParcelType>::patchInteraction() const +{ + return patchInteractionModel_; +} + + template<class ParcelType> inline Foam::InjectionModel<Foam::KinematicCloud<ParcelType> >& Foam::KinematicCloud<ParcelType>::injection() @@ -167,10 +168,10 @@ Foam::KinematicCloud<ParcelType>::injection() template<class ParcelType> -inline const Foam::WallInteractionModel<Foam::KinematicCloud<ParcelType> >& -Foam::KinematicCloud<ParcelType>::wallInteraction() const +inline Foam::PostProcessingModel<Foam::KinematicCloud<ParcelType> >& +Foam::KinematicCloud<ParcelType>::postProcessing() { - return wallInteractionModel_; + return postProcessingModel_(); } diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C index bce296229cf9e4c53fc2ba8066841d02a82fa88e..88d5e8a877222a2f938217a77aca595255e8d5b4 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C @@ -28,37 +28,34 @@ License #include "CompositionModel.H" #include "PhaseChangeModel.H" +#include "multiComponentMixture.H" // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // template<class ParcelType> -void Foam::ReactingCloud<ParcelType>::addNewParcel +void Foam::ReactingCloud<ParcelType>::checkSuppliedComposition ( - const vector& position, - const label cellId, - const scalar d, - const vector& U, - const scalar nParticles, - const scalar lagrangianDt + const scalarField& YSupplied, + const scalarField& Y, + const word& YName ) { - ParcelType* pPtr = new ParcelType - ( - *this, - position, - cellId, - this->parcelTypeId(), - nParticles, - d, - U, - composition().YMixture0(), - constProps_ - ); - - scalar continuousDt = this->db().time().deltaT().value(); - pPtr->stepFraction() = (continuousDt - lagrangianDt)/continuousDt; - - addParticle(pPtr); + if (YSupplied.size() != Y.size()) + { + FatalErrorIn + ( + "ReactingCloud<ParcelType>::checkSuppliedComposition" + "(" + "const scalarField&, " + "const scalarField&, " + "const word&" + ")" + ) << YName << " supplied, but size is not compatible with " + << "parcel composition: " << nl << " " + << YName << "(" << YSupplied.size() << ") vs required composition " + << YName << "(" << Y.size() << ")" << nl + << abort(FatalError); + } } @@ -67,19 +64,18 @@ void Foam::ReactingCloud<ParcelType>::addNewParcel template<class ParcelType> Foam::ReactingCloud<ParcelType>::ReactingCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo, - PtrList<specieReactingProperties>& carrierSpecies + hCombustionThermo& thermo ) : - ThermoCloud<ParcelType>(cloudType, rho, U, g, thermo), + ThermoCloud<ParcelType>(cloudName, rho, U, g, thermo), reactingCloud(), constProps_(this->particleProperties()), carrierThermo_(thermo), - carrierSpecies_(carrierSpecies), + carrierSpecies_(thermo.composition().Y().size()), compositionModel_ ( CompositionModel<ReactingCloud<ParcelType> >::New @@ -99,6 +95,20 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud rhoTrans_(thermo.composition().Y().size()), dMassPhaseChange_(0.0) { + // Create the carrier species + forAll(carrierSpecies_, specieI) + { + carrierSpecies_.set + ( + specieI, + new thermoType + ( + dynamic_cast<const multiComponentMixture<thermoType>&> + (thermo).speciesData()[specieI] + ) + ); + } + // Set storage for mass source fields and initialise to zero forAll(rhoTrans_, i) { @@ -135,6 +145,40 @@ Foam::ReactingCloud<ParcelType>::~ReactingCloud() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class ParcelType> +void Foam::ReactingCloud<ParcelType>::checkParcelProperties +( + ParcelType* pPtr, + const scalar lagrangianDt, + const bool fullyDescribed +) +{ + ThermoCloud<ParcelType>::checkParcelProperties + ( + pPtr, + lagrangianDt, + fullyDescribed + ); + + if (!fullyDescribed) + { + pPtr->Y() = composition().YMixture0(); + } + else + { + checkSuppliedComposition + ( + pPtr->Y(), + composition().YMixture0(), + "YMixture" + ); + } + + // derived information - store initial mass + pPtr->mass0() = pPtr->mass(); +} + + template<class ParcelType> void Foam::ReactingCloud<ParcelType>::resetSourceTerms() { @@ -215,6 +259,8 @@ void Foam::ReactingCloud<ParcelType>::evolve() } Cloud<ParcelType>::move(td); + + this->postProcessing().post(); } diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H index 848da636042222f21ebf6cb0dfa8cf5787048539..beeee65e6e80fe9a6040a6d7277180be4ec185d5 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H @@ -27,6 +27,7 @@ Class Description Templated base class for reacting cloud + - Adds to thermodynamic cloud - Variable composition (single phase) - Phase change @@ -46,8 +47,6 @@ SourceFiles #include "ThermoCloud.H" #include "reactingCloud.H" -#include "ReactingCloudThermoTypes.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -71,7 +70,26 @@ class ReactingCloud public ThermoCloud<ParcelType>, public reactingCloud { - // Private data +public: + + //- Type of thermodynamics the cloud was instantiated for + typedef typename ParcelType::thermoType thermoType; + + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + ReactingCloud(const ReactingCloud&); + + //- Disallow default bitwise assignment + void operator=(const ReactingCloud&); + + +protected: + + // Protected data //- Parcel constant properties typename ParcelType::constantProperties constProps_; @@ -80,7 +98,7 @@ class ReactingCloud hCombustionThermo& carrierThermo_; //- Gas phase properties - PtrList<specieReactingProperties>& carrierSpecies_; + PtrList<thermoType> carrierSpecies_; // References to the cloud sub-models @@ -106,13 +124,17 @@ class ReactingCloud scalar dMassPhaseChange_; - // Private Member Functions + // Protected Member Functions - //- Disallow default bitwise copy construct - ReactingCloud(const ReactingCloud&); + // New parcel helper functions - //- Disallow default bitwise assignment - void operator=(const ReactingCloud&); + //- Check that size of a composition field is valid + void checkSuppliedComposition + ( + const scalarField& YSupplied, + const scalarField& Y, + const word& YName + ); public: @@ -122,12 +144,11 @@ public: //- Construct given carrier gas fields ReactingCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo, - PtrList<specieReactingProperties>& carrierSpecies + hCombustionThermo& thermo ); @@ -154,7 +175,7 @@ public: inline hCombustionThermo& carrierThermo(); //- Gas phase properties - inline const PtrList<specieReactingProperties>& carrierSpecies() const; + inline const PtrList<thermoType>& carrierSpecies() const; // Sub-models @@ -200,15 +221,12 @@ public: // Cloud evolution functions - //- Add new parcel - void addNewParcel + //- Check parcel properties + void checkParcelProperties ( - const vector& position, - const label cellId, - const scalar d, - const vector& U, - const scalar nParticles, - const scalar lagrangianDt + ParcelType* pPtr, + const scalar lagrangianDt, + const bool fullyDescribed ); //- Reset the spray source terms diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H index d21df2f89d49aae6819d396941d1e23fba7a5049..8dbaf52bbcf81675641d903cc1be6b8e171bde5a 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H @@ -51,7 +51,7 @@ Foam::ReactingCloud<ParcelType>::carrierThermo() template<class ParcelType> -inline const Foam::PtrList<Foam::specieReactingProperties>& +inline const Foam::PtrList<typename ParcelType::thermoType>& Foam::ReactingCloud<ParcelType>::carrierSpecies() const { return carrierSpecies_; diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C index 4ffc5306149f0f3b0294d67d475264b4e7ed49fe..379f12f341d49efc5109b2298c022b6ce1e0eca7 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,60 +29,19 @@ License #include "DevolatilisationModel.H" #include "SurfaceReactionModel.H" -// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // - -template<class ParcelType> -void Foam::ReactingMultiphaseCloud<ParcelType>::addNewParcel -( - const vector& position, - const label cellId, - const scalar d, - const vector& U, - const scalar nParticles, - const scalar lagrangianDt -) -{ - label idGas = this->composition().idGas(); - label idLiquid = this->composition().idLiquid(); - label idSolid = this->composition().idSolid(); - - ParcelType* pPtr = new ParcelType - ( - *this, - position, - cellId, - this->parcelTypeId(), - nParticles, - d, - U, - this->composition().YMixture0(), - this->composition().Y0(idGas), - this->composition().Y0(idLiquid), - this->composition().Y0(idSolid), - constProps_ - ); - - scalar continuousDt = this->db().time().deltaT().value(); - pPtr->stepFraction() = (continuousDt - lagrangianDt)/continuousDt; - - addParticle(pPtr); -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class ParcelType> Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo, - PtrList<specieReactingProperties>& carrierSpecies + hCombustionThermo& thermo ) : - ReactingCloud<ParcelType>(cloudType, rho, U, g, thermo, carrierSpecies), + ReactingCloud<ParcelType>(cloudName, rho, U, g, thermo), reactingMultiphaseCloud(), constProps_(this->particleProperties()), devolatilisationModel_ @@ -114,6 +73,55 @@ Foam::ReactingMultiphaseCloud<ParcelType>::~ReactingMultiphaseCloud() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class ParcelType> +void Foam::ReactingMultiphaseCloud<ParcelType>::checkParcelProperties +( + ParcelType* pPtr, + const scalar lagrangianDt, + const bool fullyDescribed +) +{ + ReactingCloud<ParcelType>::checkParcelProperties + ( + pPtr, + lagrangianDt, + fullyDescribed + ); + + label idGas = this->composition().idGas(); + label idLiquid = this->composition().idLiquid(); + label idSolid = this->composition().idSolid(); + + if (!fullyDescribed) + { + pPtr->YGas() = this->composition().Y0(idGas); + pPtr->YLiquid() = this->composition().Y0(idLiquid); + pPtr->YSolid() = this->composition().Y0(idSolid); + } + else + { + this->checkSuppliedComposition + ( + pPtr->YGas(), + this->composition().Y0(idGas), + "YGas" + ); + this->checkSuppliedComposition + ( + pPtr->YLiquid(), + this->composition().Y0(idLiquid), + "YLiquid" + ); + this->checkSuppliedComposition + ( + pPtr->YSolid(), + this->composition().Y0(idSolid), + "YSolid" + ); + } +} + + template<class ParcelType> void Foam::ReactingMultiphaseCloud<ParcelType>::resetSourceTerms() { @@ -190,6 +198,8 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::evolve() } Cloud<ParcelType>::move(td); + + this->postProcessing().post(); } diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H index d16577c03ae6612723e84bac0d1036c1d3296b38..8a90d25ef75f17f08cf359581066866d77ea7672 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,6 +27,7 @@ Class Description Templated base class for multiphase reacting cloud + - Adds to reacting cloud - multiphase composition - devolatilisatsion @@ -67,7 +68,18 @@ class ReactingMultiphaseCloud public ReactingCloud<ParcelType>, public reactingMultiphaseCloud { - // Private data + // Private Member Functions + + //- Disallow default bitwise copy construct + ReactingMultiphaseCloud(const ReactingMultiphaseCloud&); + + //- Disallow default bitwise assignment + void operator=(const ReactingMultiphaseCloud&); + + +protected: + + // Protected data //- Parcel constant properties typename ParcelType::constantProperties constProps_; @@ -100,15 +112,6 @@ class ReactingMultiphaseCloud scalar dMassSurfaceReaction_; - // Private Member Functions - - //- Disallow default bitwise copy construct - ReactingMultiphaseCloud(const ReactingMultiphaseCloud&); - - //- Disallow default bitwise assignment - void operator=(const ReactingMultiphaseCloud&); - - public: // Constructors @@ -116,12 +119,11 @@ public: //- Construct given carrier gas fields ReactingMultiphaseCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo, - PtrList<specieReactingProperties>& carrierSpecies + hCombustionThermo& thermo ); @@ -173,15 +175,12 @@ public: // Cloud evolution functions - //- Add new parcel - void addNewParcel + //- Check parcel properties + void checkParcelProperties ( - const vector& position, - const label cellId, - const scalar d, - const vector& U, - const scalar nParticles, - const scalar lagrangianDt + ParcelType* pPtr, + const scalar lagrangianDt, + const bool fullyDescribed ); //- Reset the spray source terms diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H index cbf042f688f801fd3110bcd0c39ae45403dd53d2..ac0b0291501e909bcb086e6a3c835b30dee3643f 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloudI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C index 91d7a2fb7f8423eb1dc6b5da92c499d1970fd6ba..bdde1bbdfe49458f4da209d2c138fa0ee55eeec8 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C @@ -30,44 +30,12 @@ License #include "HeatTransferModel.H" -// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // - -template<class ParcelType> -void Foam::ThermoCloud<ParcelType>::addNewParcel -( - const vector& position, - const label cellId, - const scalar d, - const vector& U, - const scalar nParticles, - const scalar lagrangianDt -) -{ - ParcelType* pPtr = new ParcelType - ( - *this, - position, - cellId, - this->parcelTypeId(), - nParticles, - d, - U, - constProps_ - ); - - scalar continuousDt = this->db().time().deltaT().value(); - pPtr->stepFraction() = (continuousDt - lagrangianDt)/continuousDt; - - addParticle(pPtr); -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class ParcelType> Foam::ThermoCloud<ParcelType>::ThermoCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, @@ -76,7 +44,7 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud : KinematicCloud<ParcelType> ( - cloudType, + cloudName, rho, U, thermo.mu(), @@ -142,6 +110,29 @@ Foam::ThermoCloud<ParcelType>::~ThermoCloud() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class ParcelType> +void Foam::ThermoCloud<ParcelType>::checkParcelProperties +( + ParcelType* pPtr, + const scalar lagrangianDt, + const bool fullyDescribed +) +{ + KinematicCloud<ParcelType>::checkParcelProperties + ( + pPtr, + lagrangianDt, + fullyDescribed + ); + + if (!fullyDescribed) + { + pPtr->T() = constProps_.T0(); + pPtr->cp() = constProps_.cp0(); + } +} + + template<class ParcelType> void Foam::ThermoCloud<ParcelType>::resetSourceTerms() { @@ -212,6 +203,8 @@ void Foam::ThermoCloud<ParcelType>::evolve() } Cloud<ParcelType>::move(td); + + this->postProcessing().post(); } diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H index 2e3aea4f23e808404d9749658780a23f5775d77c..2660060baf293834643a999008081ecbbd7bc0e3 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H @@ -27,6 +27,7 @@ Class Description Templated base class for thermodynamic cloud + - Adds to kinematic cloud - Heat transfer @@ -45,7 +46,6 @@ SourceFiles #include "KinematicCloud.H" #include "thermoCloud.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -66,7 +66,18 @@ class ThermoCloud public KinematicCloud<ParcelType>, public thermoCloud { - // Private data + // Private Member Functions + + //- Disallow default bitwise copy construct + ThermoCloud(const ThermoCloud&); + + //- Disallow default bitwise assignment + void operator=(const ThermoCloud&); + + +protected: + + // Protected data //- Thermo parcel constant properties typename ParcelType::constantProperties constProps_; @@ -109,15 +120,6 @@ class ThermoCloud DimensionedField<scalar, volMesh> hcTrans_; - // Private Member Functions - - //- Disallow default bitwise copy construct - ThermoCloud(const ThermoCloud&); - - //- Disallow default bitwise assignment - void operator=(const ThermoCloud&); - - public: // Constructors @@ -125,7 +127,7 @@ public: //- Construct given carrier gas fields ThermoCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, @@ -215,15 +217,12 @@ public: // Cloud evolution functions - //- Add new parcel - void addNewParcel + //- Check parcel properties + void checkParcelProperties ( - const vector& position, - const label cellId, - const scalar d, - const vector& U, - const scalar nParticles, - const scalar lagrangianDt + ParcelType* pPtr, + const scalar lagrangianDt, + const bool fullyDescribed ); //- Reset the spray source terms diff --git a/src/lagrangian/intermediate/clouds/baseClasses/kinematicCloud/kinematicCloud.H b/src/lagrangian/intermediate/clouds/baseClasses/kinematicCloud/kinematicCloud.H index 8c1e273f570a77a0b3bdf2099554d1cd180acfd6..37ab0548157a1178a8d427f2ebd035abb2c2ea0e 100644 --- a/src/lagrangian/intermediate/clouds/baseClasses/kinematicCloud/kinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/baseClasses/kinematicCloud/kinematicCloud.H @@ -29,13 +29,14 @@ Description Virtual abstract base class for templated KinematicCloud SourceFiles + kinematicCloud.H \*---------------------------------------------------------------------------*/ #ifndef kinematicCloud_H #define kinematicCloud_H -#include "volFields.H" +#include "typeInfo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/clouds/baseClasses/reactingCloud/reactingCloud.H b/src/lagrangian/intermediate/clouds/baseClasses/reactingCloud/reactingCloud.H index a27bf4edf18e8661a3cf506f717b5156832e5936..aef3eeba66c2eafebfbf2e76f6529f2586a79594 100644 --- a/src/lagrangian/intermediate/clouds/baseClasses/reactingCloud/reactingCloud.H +++ b/src/lagrangian/intermediate/clouds/baseClasses/reactingCloud/reactingCloud.H @@ -29,13 +29,14 @@ Description Virtual abstract base class for templated ReactingCloud SourceFiles + reactingCloud.C \*---------------------------------------------------------------------------*/ #ifndef reactingCloud_H #define reactingCloud_H -#include "volFields.H" +#include "typeInfo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/clouds/baseClasses/reactingMultiphaseCloud/reactingMultiphaseCloud.H b/src/lagrangian/intermediate/clouds/baseClasses/reactingMultiphaseCloud/reactingMultiphaseCloud.H index ea2ef0da89d14d2acf1d82c99298938fdba4b7ad..4cbe6f69177f1d826467a7629606e027d40b5db2 100644 --- a/src/lagrangian/intermediate/clouds/baseClasses/reactingMultiphaseCloud/reactingMultiphaseCloud.H +++ b/src/lagrangian/intermediate/clouds/baseClasses/reactingMultiphaseCloud/reactingMultiphaseCloud.H @@ -29,13 +29,14 @@ Description Virtual abstract base class for templated reactingMultiphaseCloud SourceFiles + reactingMultiphaseCloud.C \*---------------------------------------------------------------------------*/ #ifndef reactingMultiphaseCloud_H #define reactingMultiphaseCloud_H -#include "volFields.H" +#include "typeInfo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/clouds/baseClasses/thermoCloud/thermoCloud.H b/src/lagrangian/intermediate/clouds/baseClasses/thermoCloud/thermoCloud.H index 240c2d5ce39f42c4fef3c4b13ac69ccfd53641bf..9eff9c62ee4a3d3d45c57668ef50fb8400229e43 100644 --- a/src/lagrangian/intermediate/clouds/baseClasses/thermoCloud/thermoCloud.H +++ b/src/lagrangian/intermediate/clouds/baseClasses/thermoCloud/thermoCloud.H @@ -29,6 +29,7 @@ Description Virtual abstract base class for templated ThermoCloud SourceFiles + thermoCloud.C \*---------------------------------------------------------------------------*/ diff --git a/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.C b/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.C similarity index 73% rename from src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.C rename to src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.C index 405dc4a65859aeefe410b8d564330d4d69183f7c..1a639b5820b0d008932fe9454bc1df9e62bc0cee 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.C +++ b/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.C @@ -24,53 +24,46 @@ License \*---------------------------------------------------------------------------*/ -#include "basicReactingCloud.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(basicReactingCloud, 0); -}; - +#include "BasicReactingCloud.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::basicReactingCloud::basicReactingCloud +template<class ThermoType> +Foam::BasicReactingCloud<ThermoType>::BasicReactingCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo, - PtrList<specieReactingProperties>& carrierSpecies + hCombustionThermo& thermo ) : - ReactingCloud<basicReactingParcel> + ReactingCloud<BasicReactingParcel<ThermoType> > ( - cloudType, + cloudName, rho, U, g, - thermo, - carrierSpecies + thermo ) { - basicReactingParcel::readFields(*this); + BasicReactingParcel<ThermoType>::readFields(*this); } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::basicReactingCloud::~basicReactingCloud() +template<class ThermoType> +Foam::BasicReactingCloud<ThermoType>::~BasicReactingCloud() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::basicReactingCloud::writeFields() const +template<class ThermoType> +void Foam::BasicReactingCloud<ThermoType>::writeFields() const { - basicReactingParcel::writeFields(*this); + BasicReactingParcel<ThermoType>::writeFields(*this); } diff --git a/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.H b/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.H similarity index 72% rename from src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.H rename to src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.H index 7a56097614a5f90c62c87ce5eddb311f2466e25d..aa3048e6663f3db16cbad66a4392a13f397ac2a6 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.H @@ -23,66 +23,70 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::basicReactingCloud + Foam::BasicReactingCloud Description - Reacting cloud templated on the reacting parcel + Reacting cloud templated on the type of carrier phase thermodynamics SourceFiles - basicReactingCloud.C + BasicReactingCloud.C \*---------------------------------------------------------------------------*/ -#ifndef basicReactingCloud_H -#define basicReactingCloud_H +#ifndef BasicReactingCloud_H +#define BasicReactingCloud_H #include "ReactingCloud.H" -#include "basicReactingParcel.H" +#include "BasicReactingParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +// Forward declaration of classes +template<class ThermoType> +class BasicReactingCloud; + /*---------------------------------------------------------------------------*\ - Class basicReactingCloud Declaration + Class BasicReactingCloud Declaration \*---------------------------------------------------------------------------*/ -class basicReactingCloud +template<class ThermoType> +class BasicReactingCloud : - public ReactingCloud<basicReactingParcel> + public ReactingCloud<BasicReactingParcel<ThermoType> > { // Private Member Functions //- Disallow default bitwise copy construct - basicReactingCloud(const basicReactingCloud&); + BasicReactingCloud(const BasicReactingCloud&); //- Disallow default bitwise assignment - void operator=(const basicReactingCloud&); + void operator=(const BasicReactingCloud&); public: //- Runtime type information - TypeName("basicReactingCloud"); + TypeName("BasicReactingCloud"); // Constructors //- Construct given carrier gas fields - basicReactingCloud + BasicReactingCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - hCombustionThermo& thermo, - PtrList<specieReactingProperties>& carrierSpecies + hCombustionThermo& thermo ); //- Destructor - ~basicReactingCloud(); + ~BasicReactingCloud(); // Member Functions @@ -98,6 +102,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "BasicReactingCloud.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/defineBasicReactingCloud.C b/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/defineBasicReactingCloud.C new file mode 100644 index 0000000000000000000000000000000000000000..ca5b9e809062d6fac2137e44c146fe5c59beea21 --- /dev/null +++ b/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/defineBasicReactingCloud.C @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "createReactingCloudTypes.H" +#include "BasicReactingCloud.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + createReactingCloudType(BasicReactingCloud); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.C b/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.C similarity index 70% rename from src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.C rename to src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.C index d174e0ea0ac3511d26cab78da24a3a578bc34746..07cb83587ecd620b23e26fb2d874afdbf7a66ee2 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.C +++ b/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,31 +24,24 @@ License \*---------------------------------------------------------------------------*/ -#include "basicReactingMultiphaseCloud.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(basicReactingMultiphaseCloud, 0); -}; - +#include "BasicReactingMultiphaseCloud.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::basicReactingMultiphaseCloud::basicReactingMultiphaseCloud +template<class ThermoType> +Foam::BasicReactingMultiphaseCloud<ThermoType>::BasicReactingMultiphaseCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, hCombustionThermo& thermo, - PtrList<specieReactingProperties>& carrierSpecies + PtrList<ThermoType>& carrierSpecies ) : - ReactingMultiphaseCloud<basicReactingMultiphaseParcel> + ReactingMultiphaseCloud<BasicReactingMultiphaseParcel<ThermoType> > ( - cloudType, + cloudName, rho, U, g, @@ -56,21 +49,23 @@ Foam::basicReactingMultiphaseCloud::basicReactingMultiphaseCloud carrierSpecies ) { - basicReactingMultiphaseParcel::readFields(*this); + BasicReactingMultiphaseParcel<ThermoType>::readFields(*this); } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::basicReactingMultiphaseCloud::~basicReactingMultiphaseCloud() +template<class ThermoType> +Foam::BasicReactingMultiphaseCloud<ThermoType>::~BasicReactingMultiphaseCloud() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::basicReactingMultiphaseCloud::writeFields() const +template<class ThermoType> +void Foam::BasicReactingMultiphaseCloud<ThermoType>::writeFields() const { - basicReactingMultiphaseParcel::writeFields(*this); + BasicReactingMultiphaseParcel<ThermoType>::writeFields(*this); } diff --git a/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.H b/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H similarity index 67% rename from src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.H rename to src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H index e8a9485cb8ec6d183c0e37f82a61a25148101dab..7b093c529c03d7e2c9c8871b493cc93ae46f3293 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,66 +23,71 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::basicReactingMultiphaseCloud + Foam::BasicReactingMultiphaseCloud Description - Reacting cloud templated on the reacting multiphase parcel + Reacting multiphase cloud templated on the type of carrier phase thermodynamics SourceFiles - basicReactingMultiphaseCloud.C + BasicReactingMultiphaseCloud.C \*---------------------------------------------------------------------------*/ -#ifndef basicReactingMultiphaseCloud_H -#define basicReactingMultiphaseCloud_H +#ifndef BasicReactingMultiphaseCloud_H +#define BasicReactingMultiphaseCloud_H #include "ReactingMultiphaseCloud.H" -#include "basicReactingMultiphaseParcel.H" +#include "BasicReactingMultiphaseParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +// Forward declaration of classes +template<class ThermoType> +class BasicReactingMultiphaseCloud; + /*---------------------------------------------------------------------------*\ - Class basicReactingMultiphaseCloud Declaration + Class BasicReactingMultiphaseCloud Declaration \*---------------------------------------------------------------------------*/ -class basicReactingMultiphaseCloud +template<class ThermoType> +class BasicReactingMultiphaseCloud : - public ReactingMultiphaseCloud<basicReactingMultiphaseParcel> + public ReactingMultiphaseCloud<BasicReactingMultiphaseParcel<ThermoType> > { // Private Member Functions //- Disallow default bitwise copy construct - basicReactingMultiphaseCloud(const basicReactingMultiphaseCloud&); + BasicReactingMultiphaseCloud(const BasicReactingMultiphaseCloud&); //- Disallow default bitwise assignment - void operator=(const basicReactingMultiphaseCloud&); + void operator=(const BasicReactingMultiphaseCloud&); public: //- Runtime type information - TypeName("basicReactingMultiphaseCloud"); + TypeName("BasicReactingMultiphaseCloud"); // Constructors //- Construct given carrier gas fields - basicReactingMultiphaseCloud + BasicReactingMultiphaseCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, hCombustionThermo& thermo, - PtrList<specieReactingProperties>& carrierSpecies + PtrList<ThermoType>& carrierSpecies ); //- Destructor - ~basicReactingMultiphaseCloud(); + ~BasicReactingMultiphaseCloud(); // Member Functions @@ -98,6 +103,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "BasicReactingMultiphaseCloud.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/defineBasicReactingMultiphaseCloud.C b/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/defineBasicReactingMultiphaseCloud.C new file mode 100644 index 0000000000000000000000000000000000000000..d23115997d07bccb9ef83af7ff595635db9c634a --- /dev/null +++ b/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/defineBasicReactingMultiphaseCloud.C @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "createReactingCloudTypes.H" +#include "BasicReactingMultiphaseCloud.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + createReactingCloudType(BasicReactingMultiphaseCloud); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/BasicTrackedReactingCloud.C b/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/BasicTrackedReactingCloud.C new file mode 100644 index 0000000000000000000000000000000000000000..4b94788812116369124865291873fe467239e525 --- /dev/null +++ b/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/BasicTrackedReactingCloud.C @@ -0,0 +1,70 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "BasicTrackedReactingCloud.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class ThermoType> +Foam::BasicTrackedReactingCloud<ThermoType>::BasicTrackedReactingCloud +( + const word& cloudName, + const volScalarField& rho, + const volVectorField& U, + const dimensionedVector& g, + hCombustionThermo& thermo +) +: + ReactingCloud<BasicTrackedReactingParcel<ThermoType> > + ( + cloudName, + rho, + U, + g, + thermo + ) +{ + BasicTrackedReactingParcel<ThermoType>::readFields(*this); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class ThermoType> +Foam::BasicTrackedReactingCloud<ThermoType>::~BasicTrackedReactingCloud() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class ThermoType> +void Foam::BasicTrackedReactingCloud<ThermoType>::writeFields() const +{ + BasicTrackedReactingParcel<ThermoType>::writeFields(*this); +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/BasicTrackedReactingCloud.H b/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/BasicTrackedReactingCloud.H new file mode 100644 index 0000000000000000000000000000000000000000..5c3cd8148f2654b2588fb4cd3282768268cdb8a5 --- /dev/null +++ b/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/BasicTrackedReactingCloud.H @@ -0,0 +1,113 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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::BasicTrackedReactingCloud + +Description + Tracked racting cloud templated on the type of carrier phase thermodynamics + +SourceFiles + BasicTrackedReactingCloud.C + +\*---------------------------------------------------------------------------*/ + +#ifndef BasicTrackedReactingCloud_H +#define BasicTrackedReactingCloud_H + +#include "ReactingCloud.H" +#include "BasicTrackedReactingParcel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +template<class ThermoType> +class BasicTrackedReactingCloud; + +/*---------------------------------------------------------------------------*\ + Class BasicTrackedReactingCloud Declaration +\*---------------------------------------------------------------------------*/ + +template<class ThermoType> +class BasicTrackedReactingCloud +: + public ReactingCloud<BasicTrackedReactingParcel<ThermoType> > +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + BasicTrackedReactingCloud(const BasicTrackedReactingCloud&); + + //- Disallow default bitwise assignment + void operator=(const BasicTrackedReactingCloud&); + + +public: + + //- Runtime type information + TypeName("BasicTrackedReactingCloud"); + + + // Constructors + + //- Construct given carrier gas fields + BasicTrackedReactingCloud + ( + const word& cloudName, + const volScalarField& rho, + const volVectorField& U, + const dimensionedVector& g, + hCombustionThermo& thermo + ); + + + //- Destructor + ~BasicTrackedReactingCloud(); + + + // Member Functions + + //- Write fields + void writeFields() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "BasicTrackedReactingCloud.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/defineBasicTrackedReactingCloud.C b/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/defineBasicTrackedReactingCloud.C new file mode 100644 index 0000000000000000000000000000000000000000..5c946ca09cb63f6391327416104bc11f4cb3406b --- /dev/null +++ b/src/lagrangian/intermediate/clouds/derived/BasicTrackedReactingCloud/defineBasicTrackedReactingCloud.C @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "createReactingCloudTypes.H" +#include "BasicTrackedReactingCloud.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + createReactingCloudType(BasicTrackedReactingCloud); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.C b/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.C index 4e52274f8e029298574e7da9b1606a821743e754..15ab7afdfcdf1673493fab546a2e0787aa86ab3f 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.C +++ b/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.C @@ -38,14 +38,14 @@ namespace Foam Foam::basicKinematicCloud::basicKinematicCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const volScalarField& mu, const dimensionedVector& g ) : - KinematicCloud<basicKinematicParcel>(cloudType, rho, U, mu, g) + KinematicCloud<basicKinematicParcel>(cloudName, rho, U, mu, g) { basicKinematicParcel::readFields(*this); } @@ -64,4 +64,5 @@ void Foam::basicKinematicCloud::writeFields() const basicKinematicParcel::writeFields(*this); } + // ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H b/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H index 8a32780f351b4eeba5d86ef06dbfcf98ec9bc5f0..91a8ae2e5bd3134782f46fa7aa41101d48806bc5 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H @@ -72,7 +72,7 @@ public: //- Construct from components basicKinematicCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const volScalarField& mu, diff --git a/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.C b/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.C index 9d73a6533c91bc03c94cffec4dc767097feb565d..fc7ee7dc26eb80fbf66a701b839b8ef13a36fd25 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.C +++ b/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.C @@ -38,14 +38,14 @@ namespace Foam Foam::basicThermoCloud::basicThermoCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, basicThermo& thermo ) : - ThermoCloud<basicThermoParcel>(cloudType, rho, U, g, thermo) + ThermoCloud<basicThermoParcel>(cloudName, rho, U, g, thermo) { basicThermoParcel::readFields(*this); } diff --git a/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H b/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H index e8ba4c9a8c4813377837ad46dfbca670bed01da1..5254fed8ebb2dcb2e6160372e1ab6a1a2f5f74bb 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H @@ -26,6 +26,7 @@ Class Foam::basicThermoCloud Description + Cloud class to introduce thermodynamic parcels SourceFiles basicThermoCloud.C @@ -74,7 +75,7 @@ public: //- Construct given carrier gas fields basicThermoCloud ( - const word& cloudType, + const word& cloudName, const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, diff --git a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelHeatTransferModels.C b/src/lagrangian/intermediate/clouds/include/createReactingCloudTypes.H similarity index 62% rename from src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelHeatTransferModels.C rename to src/lagrangian/intermediate/clouds/include/createReactingCloudTypes.H index 92e1a6727006de9d3b56bea6f5752aec21d29425..cc73ce3ec3aca7987ef438cd3a0956fd41dbc77f 100644 --- a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelHeatTransferModels.C +++ b/src/lagrangian/intermediate/clouds/include/createReactingCloudTypes.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,22 +24,26 @@ License \*---------------------------------------------------------------------------*/ -#include "coalParcel.H" -#include "ThermoCloud.H" +#ifndef createReactingCloudTypes_H +#define createReactingCloudTypes_H -#include "NoHeatTransfer.H" -#include "RanzMarshall.H" +#include "reactingThermoTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - makeHeatTransferModel(ThermoCloud<coalParcel>); +#define createReactingCloudType(CloudType) \ + \ + createReactingCloudThermoType(CloudType, specieConstProperties); \ + createReactingCloudThermoType(CloudType, specieReactingProperties); - // Add instances of heat transfer model to the table - makeHeatTransferModelType(NoHeatTransfer, ThermoCloud, coalParcel); - makeHeatTransferModelType(RanzMarshall, ThermoCloud, coalParcel); -}; +#define createReactingCloudThermoType(CloudType, ThermoType) \ + \ + defineTemplateTypeNameAndDebug(CloudType<ThermoType>, 0); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C index cdc7e5e3b0d60a3f72c33f1d6ff0e1b03c6c8a37..d0962539e761760a9a693619c2bca2742288dbb8 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C @@ -103,6 +103,13 @@ void Foam::KinematicParcel<ParcelType>::calc const scalar mass0 = mass(); + // Explicit momentum source for particle + vector Su = vector::zero; + + // Momentum transfer from the particle to the carrier phase + vector dUTrans = vector::zero; + + // Motion // ~~~~~~ @@ -110,7 +117,7 @@ void Foam::KinematicParcel<ParcelType>::calc vector Fx = vector::zero; // Calculate new particle velocity - vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Fx); + vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans); // Accumulate carrier phase source terms @@ -118,7 +125,7 @@ void Foam::KinematicParcel<ParcelType>::calc if (td.cloud().coupled()) { // Update momentum transfer - td.cloud().UTrans()[cellI] += np0*mass0*(U0 - U1); + td.cloud().UTrans()[cellI] += np0*dUTrans; } @@ -139,34 +146,68 @@ const Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity const vector& U, const scalar rho, const scalar mass, - const vector& Fx + const vector& Su, + vector& dUTrans ) const { const polyMesh& mesh = this->cloud().pMesh(); - // Return linearised term from drag model - scalar Cud = td.cloud().drag().Cu(U - Uc_, d, rhoc_, rho, muc_); + // Momentum transfer coefficient + const scalar ptc = + td.cloud().drag().ptc(U - Uc_, d, rhoc_, muc_) + ROOTVSMALL; - // Calculate particle forces - vector Ftot = td.cloud().forces().calc(cellI, dt, rhoc_, rho, Uc_, U); + // Momentum source due to particle forces + const vector PFCoupled = + mass*td.cloud().forces().calcCoupled(cellI, dt, rhoc_, rho, Uc_, U); + const vector PFNonCoupled = + mass*td.cloud().forces().calcNonCoupled(cellI, dt, rhoc_, rho, Uc_, U); // New particle velocity //~~~~~~~~~~~~~~~~~~~~~~ // Update velocity - treat as 3-D - const vector ap = Uc_ + (Ftot + Fx)/(Cud + VSMALL); - const scalar bp = Cud; + const scalar As = this->areaS(d); + const vector ap = Uc_ + (PFCoupled + PFNonCoupled + Su)/(ptc*As); + const scalar bp = 6.0*ptc/(rho*d); + + IntegrationScheme<vector>::integrationResult Ures = + td.cloud().UIntegrator().integrate(U, dt, ap, bp); - vector Unew = td.cloud().UIntegrator().integrate(U, dt, ap, bp).value(); + vector Unew = Ures.value(); - // Apply correction to velocity for reduced-D cases + dUTrans += dt*(ptc*As*(Ures.average() - Uc_) - PFCoupled); + + // Apply correction to velocity and dUTrans for reduced-D cases meshTools::constrainDirection(mesh, mesh.solutionD(), Unew); + meshTools::constrainDirection(mesh, mesh.solutionD(), dUTrans); return Unew; } +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template <class ParcelType> +Foam::KinematicParcel<ParcelType>::KinematicParcel +( + const KinematicParcel<ParcelType>& p +) +: + Particle<ParcelType>(p), + typeId_(p.typeId_), + nParticle_(p.nParticle_), + d_(p.d_), + U_(p.U_), + rho_(p.rho_), + tTurb_(p.tTurb_), + UTurb_(p.UTurb_), + rhoc_(p.rhoc_), + Uc_(p.Uc_), + muc_(p.muc_) +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class ParcelType> @@ -218,12 +259,9 @@ bool Foam::KinematicParcel<ParcelType>::move(TrackData& td) if (p.onBoundary() && td.keepParticle) { - if (p.face() > -1) + if (isType<processorPolyPatch>(pbMesh[p.patch(p.face())])) { - if (isType<processorPolyPatch>(pbMesh[p.patch(p.face())])) - { - td.switchProcessor = true; - } + td.switchProcessor = true; } } } @@ -232,6 +270,34 @@ bool Foam::KinematicParcel<ParcelType>::move(TrackData& td) } +template<class ParcelType> +template<class TrackData> +bool Foam::KinematicParcel<ParcelType>::hitPatch +( + const polyPatch& pp, + TrackData& td, + const label patchI +) +{ + ParcelType& p = static_cast<ParcelType&>(*this); + td.cloud().postProcessing().postPatch(p, patchI); + + return td.cloud().patchInteraction().correct(pp, this->face(), U_); +} + + +template<class ParcelType> +bool Foam::KinematicParcel<ParcelType>::hitPatch +( + const polyPatch& pp, + int& td, + const label patchI +) +{ + return false; +} + + template<class ParcelType> template<class TrackData> void Foam::KinematicParcel<ParcelType>::hitProcessorPatch @@ -261,7 +327,7 @@ void Foam::KinematicParcel<ParcelType>::hitWallPatch TrackData& td ) { - td.cloud().wallInteraction().correct(wpp, this->face(), U_); + // Wall interactions handled by generic hitPatch function } diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H index 82d7c2ccd9e8293b10102214c419b686f9bb3266..049ab26bac5569c8f4bf98716ef9309ff10b5f9d 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H @@ -243,20 +243,36 @@ protected: const vector& U, // velocity const scalar rho, // density const scalar mass, // mass - const vector& Fx // additional forces + const vector& Su, // explicit particle momentum source + vector& dUTrans // momentum transfer to carrier ) const; public: - //- Runtime type information - TypeName("KinematicParcel"); + // Static data members + + //- String representation of properties + static string propHeader; + + //- Runtime type information + TypeName("KinematicParcel"); + friend class Cloud<ParcelType>; // Constructors + //- Construct from owner, position, and cloud owner + // Other properties initialised as null + inline KinematicParcel + ( + KinematicCloud<ParcelType>& owner, + const vector& position, + const label cellI + ); + //- Construct from components inline KinematicParcel ( @@ -278,10 +294,13 @@ public: bool readFields = true ); + //- Construct as a copy + KinematicParcel(const KinematicParcel& p); + //- Construct and return a clone - autoPtr<ParcelType> clone() const + autoPtr<KinematicParcel> clone() const { - return autoPtr<ParcelType>(new KinematicParcel<ParcelType>(*this)); + return autoPtr<KinematicParcel>(new KinematicParcel(*this)); } @@ -409,6 +428,27 @@ public: // Patch interactions + //- Overridable function to handle the particle hitting a patch + // Executed before other patch-hitting functions + template<class TrackData> + bool hitPatch + ( + const polyPatch& p, + TrackData& td, + const label patchI + ); + + + //- Overridable function to handle the particle hitting a patch + // Executed before other patch-hitting functions without trackData + bool hitPatch + ( + const polyPatch& p, + int& td, + const label patchI + ); + + //- Overridable function to handle the particle hitting a // processorPatch template<class TrackData> @@ -472,7 +512,7 @@ public: //- Read static void readFields(KinematicCloud<ParcelType>& c); - //- write + //- Write static void writeFields(const KinematicCloud<ParcelType>& c); diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H index 2adc0e944d0215c145e139a04c0a9a19e6544203..e0d927153780af56e42ac11af2db03636bd583b0 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H @@ -63,6 +63,28 @@ inline Foam::KinematicParcel<ParcelType>::trackData::trackData {} +template <class ParcelType> +inline Foam::KinematicParcel<ParcelType>::KinematicParcel +( + KinematicCloud<ParcelType>& owner, + const vector& position, + const label cellI +) +: + Particle<ParcelType>(owner, position, cellI), + typeId_(owner.parcelTypeId()), + nParticle_(0), + d_(0.0), + U_(vector::zero), + rho_(0.0), + tTurb_(0.0), + UTurb_(vector::zero), + rhoc_(0.0), + Uc_(vector::zero), + muc_(0.0) +{} + + template <class ParcelType> inline Foam::KinematicParcel<ParcelType>::KinematicParcel ( diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C index ae96d25a14ab212f2c14a03d86b9a6d0b61f3e8f..c69199cfb7ce7887bc0ae6212057b8ac6ed3974e 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C @@ -29,6 +29,20 @@ License #include "IOField.H" #include "Cloud.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template <class ParcelType> +Foam::string Foam::KinematicParcel<ParcelType>::propHeader = + Particle<ParcelType>::propHeader + + " typeId" + + " nParticle" + + " d" + + " (Ux Uy Uz)" + + " rho" + + " tTurb" + + " UTurb"; + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template <class ParcelType> @@ -102,16 +116,16 @@ void Foam::KinematicParcel<ParcelType>::readFields IOField<label> typeId(c.fieldIOobject("typeId", IOobject::MUST_READ)); c.checkFieldIOobject(c, typeId); + IOField<scalar> + nParticle(c.fieldIOobject("nParticle", IOobject::MUST_READ)); + c.checkFieldIOobject(c, nParticle); + IOField<scalar> d(c.fieldIOobject("d", IOobject::MUST_READ)); c.checkFieldIOobject(c, d); IOField<vector> U(c.fieldIOobject("U", IOobject::MUST_READ)); c.checkFieldIOobject(c, U); - IOField<scalar> - nParticle(c.fieldIOobject("nParticle", IOobject::MUST_READ)); - c.checkFieldIOobject(c, nParticle); - IOField<scalar> rho(c.fieldIOobject("rho", IOobject::MUST_READ)); c.checkFieldIOobject(c, rho); diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index e5d8e25d5f217bcb71c22d7620f5d4fe8f6f0e61..695ff95a8ef96e42020adfe63d7da93834d4ac93 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -174,14 +174,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::cellValueSourceCorrection const scalar cpc = td.cpInterp().psi()[cellI]; this->cpc_ = (massCell*cpc + addedMass*cpEff)/massCellNew; - const scalar fCarrier = - (1.0 - td.cloud().constProps().hRetentionCoeff()) - /td.cloud().constProps().hRetentionCoeff(); - - const scalar dh = - td.cloud().hsTrans()[cellI] - fCarrier*td.cloud().hcTrans()[cellI]; - - this->Tc_ += dh/(this->cpc_*massCellNew); + this->Tc_ += td.cloud().hsTrans()[cellI]/(this->cpc_*massCellNew); } @@ -211,34 +204,17 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc const label idL = td.cloud().composition().idLiquid(); const label idS = td.cloud().composition().idSolid(); - // Intial ethalpy state - scalar H0H = HEff(td, pc, T0, idG, idL, idS); - scalar H0L = LEff(td, pc, T0, idG, idL, idS); - scalar H0 = H0H - H0L; + // Explicit momentum source for particle + vector Su = vector::zero; + // Momentum transfer from the particle to the carrier phase + vector dUTrans = vector::zero; - // Phase change in liquid phase - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - // Mass transfer due to phase change - scalarField dMassPC(YLiquid_.size(), 0.0); + // Explicit enthalpy source for particle + scalar Sh = 0.0; - // Return enthalpy source and calc mass transfer due to phase change - scalar ShPC = - calcPhaseChange - ( - td, - dt, - cellI, - d0, - T0, - U0, - mass0, - idL, - YMix[LIQ], - YLiquid_, - dMassPC - ); + // Sensible enthalpy transfer from the particle to the carrier phase + scalar dhsTrans = 0.0; // Devolatilisation @@ -247,21 +223,22 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc // Mass transfer due to devolatilisation scalarField dMassDV(YGas_.size(), 0.0); - // Return enthalpy source and calc mass transfer due to devolatilisation - scalar ShDV = - calcDevolatilisation - ( - td, - dt, - T0, - mass0, - this->mass0_, - idG, - YMix[GAS], - YGas_, - canCombust_, - dMassDV - ); + // Calc mass and enthalpy transfer due to devolatilisation + calcDevolatilisation + ( + td, + dt, + T0, + mass0, + this->mass0_, + idG, + YMix[GAS], + YGas_, + canCombust_, + dMassDV, + Sh, + dhsTrans + ); // Surface reactions @@ -273,30 +250,53 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc scalarField dMassSRSolid(YSolid_.size(), 0.0); scalarField dMassSRCarrier(td.cloud().carrierSpecies().size(), 0.0); - // Return enthalpy source and calc mass transfer(s) due to surface reaction - scalar hReaction = - calcSurfaceReactions - ( - td, - dt, - cellI, - d0, - T0, - mass0, - canCombust_, - dMassDV, // assuming d(mass) due to phase change is non-volatile - YMix, - YGas_, - YLiquid_, - YSolid_, - dMassSRGas, - dMassSRLiquid, - dMassSRSolid, - dMassSRCarrier - ); - - // Heat of reaction retained by particle - const scalar ShSR = td.constProps().hRetentionCoeff()*hReaction; + // Clac mass and enthalpy transfer due to surface reactions + calcSurfaceReactions + ( + td, + dt, + cellI, + d0, + T0, + mass0, + canCombust_, + dMassDV, // assuming d(mass) due to phase change is non-volatile + YMix, + YGas_, + YLiquid_, + YSolid_, + dMassSRGas, + dMassSRLiquid, + dMassSRSolid, + dMassSRCarrier, + Sh, + dhsTrans + ); + + + // Phase change in liquid phase + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + // Mass transfer due to phase change + scalarField dMassPC(YLiquid_.size(), 0.0); + + // Calc mass and enthalpy transfer due to phase change + calcPhaseChange + ( + td, + dt, + cellI, + d0, + T0, + U0, + mass0, + idL, + YMix[LIQ], + YLiquid_, + dMassPC, + Sh, + dhsTrans + ); // Update component mass fractions @@ -313,27 +313,18 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc // Heat transfer // ~~~~~~~~~~~~~ - // Total enthalpy source - scalar Sh = ShPC + ShDV + ShSR; - // Calculate new particle temperature - scalar T1 = calcHeatTransfer(td, dt, cellI, d0, U0, rho0, T0, cp0, Sh); - - // Calculate new enthalpy state based on updated composition at new - // temperature - scalar H1H = HEff(td, pc, T1, idG, idL, idS); - scalar H1L = LEff(td, pc, T1, idG, idL, idS); - scalar H1 = H1H - H1L; + scalar T1 = + calcHeatTransfer(td, dt, cellI, d0, U0, rho0, T0, cp0, Sh, dhsTrans); // Motion // ~~~~~~ - // No additional forces - vector Fx = vector::zero; - // Calculate new particle velocity - vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Fx); + vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans); + + dUTrans += 0.5*(mass0 - mass1)*(U0 + U1); // Accumulate carrier phase source terms @@ -344,35 +335,48 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc // Transfer mass lost from particle to carrier mass source forAll(YGas_, i) { - label id = td.cloud().composition().localToGlobalCarrierId(GAS, i); - td.cloud().rhoTrans(id)[cellI] += np0*dMassGas[i]; + label gid = td.cloud().composition().localToGlobalCarrierId(GAS, i); + td.cloud().rhoTrans(gid)[cellI] += np0*dMassGas[i]; + td.cloud().hcTrans()[cellI] += + np0 + *dMassGas[i] + *td.cloud().composition().carrierSpecies()[gid].H(T0); } forAll(YLiquid_, i) { - label id = td.cloud().composition().localToGlobalCarrierId(LIQ, i); - td.cloud().rhoTrans(id)[cellI] += np0*dMassLiquid[i]; + label gid = td.cloud().composition().localToGlobalCarrierId(LIQ, i); + td.cloud().rhoTrans(gid)[cellI] += np0*dMassLiquid[i]; + td.cloud().hcTrans()[cellI] += + np0 + *dMassLiquid[i] + *td.cloud().composition().carrierSpecies()[gid].H(T0); } /* // No mapping between solid components and carrier phase forAll(YSolid_, i) { - label id = td.cloud().composition().localToGlobalCarrierId(SLD, i); - td.cloud().rhoTrans(id)[cellI] += np0*dMassSolid[i]; + label gid = td.cloud().composition().localToGlobalCarrierId(SLD, i); + td.cloud().rhoTrans(gid)[cellI] += np0*dMassSolid[i]; + td.cloud().hcTrans()[cellI] += + np0 + *dMassSolid[i] + *td.cloud().composition().carrierSpecies()[gid].H(T0); } */ forAll(dMassSRCarrier, i) { td.cloud().rhoTrans(i)[cellI] += np0*dMassSRCarrier[i]; + td.cloud().hcTrans()[cellI] += + np0 + *dMassSRCarrier[i] + *td.cloud().composition().carrierSpecies()[i].H(T0); } // Update momentum transfer - td.cloud().UTrans()[cellI] += np0*(mass0*U0 - mass1*U1); + td.cloud().UTrans()[cellI] += np0*dUTrans; // Update sensible enthalpy transfer - td.cloud().hsTrans()[cellI] += np0*(mass0*H0 - mass1*H1); - - // Update chemical enthalpy transfer - td.cloud().hcTrans()[cellI] -= np0*ShSR; + td.cloud().hsTrans()[cellI] += np0*dhsTrans; } @@ -388,29 +392,30 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc // Absorb parcel into carrier phase forAll(YGas_, i) { - label id = + label gid = td.cloud().composition().localToGlobalCarrierId(GAS, i); - td.cloud().rhoTrans(id)[cellI] += np0*mass1*YMix[GAS]*YGas_[i]; + td.cloud().rhoTrans(gid)[cellI] += np0*mass1*YMix[GAS]*YGas_[i]; } forAll(YLiquid_, i) { - label id = + label gid = td.cloud().composition().localToGlobalCarrierId(LIQ, i); - td.cloud().rhoTrans(id)[cellI] += + td.cloud().rhoTrans(gid)[cellI] += np0*mass1*YMix[LIQ]*YLiquid_[i]; } /* // No mapping between solid components and carrier phase forAll(YSolid_, i) { - label id = + label gid = td.cloud().composition().localToGlobalCarrierId(SLD, i); - td.cloud().rhoTrans(id)[cellI] += + td.cloud().rhoTrans(gid)[cellI] += np0*mass1*YMix[SLD]*YSolid_[i]; } */ td.cloud().UTrans()[cellI] += np0*mass1*U1; - td.cloud().hsTrans()[cellI] += np0*mass1*H1; + td.cloud().hsTrans()[cellI] += + np0*mass1*HEff(td, pc, T1, idG, idL, idS); } } @@ -420,9 +425,9 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc else { - this->U_ = U1; - this->T_ = T1; this->cp_ = cpEff(td, pc, T1, idG, idL, idS); + this->T_ = T1; + this->U_ = U1; // Update particle density or diameter if (td.constProps().constantVolume()) @@ -439,7 +444,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc template<class ParcelType> template<class TrackData> -Foam::scalar Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation +void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation ( TrackData& td, const scalar dt, @@ -450,7 +455,9 @@ Foam::scalar Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation const scalar YVolatileTot, const scalarField& YVolatile, bool& canCombust, - scalarField& dMassDV + scalarField& dMassDV, + scalar& Sh, + scalar& dhsTrans ) const { // Check that model is active, and that the parcel temperature is @@ -459,10 +466,9 @@ Foam::scalar Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation ( !td.cloud().devolatilisation().active() || T < td.constProps().Tvap() - || T < td.constProps().Tbp() ) { - return 0.0; + return; } // Total mass of volatiles evolved @@ -482,13 +488,13 @@ Foam::scalar Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation td.cloud().addToMassDevolatilisation(this->nParticle_*dMassTot); - return -dMassTot*td.constProps().LDevol(); + Sh -= dMassTot*td.constProps().LDevol()/dt; } template<class ParcelType> template<class TrackData> -Foam::scalar Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions +void Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions ( TrackData& td, const scalar dt, @@ -505,13 +511,15 @@ Foam::scalar Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions scalarField& dMassSRGas, scalarField& dMassSRLiquid, scalarField& dMassSRSolid, - scalarField& dMassSRCarrier + scalarField& dMassSRCarrier, + scalar& Sh, + scalar& dhsTrans ) const { // Check that model is active if (!td.cloud().surfaceReaction().active() || !canCombust) { - return 0.0; + return; } // Update surface reactions @@ -542,10 +550,31 @@ Foam::scalar Foam::ReactingMultiphaseParcel<ParcelType>::calcSurfaceReactions *(sum(dMassSRGas) + sum(dMassSRLiquid) + sum(dMassSRSolid)) ); - return hReaction; + const scalar xsi = min(T/5000.0, 1.0); + const scalar hRetentionCoeffMod = + (1.0 - xsi*xsi)*td.constProps().hRetentionCoeff(); + + Sh += hRetentionCoeffMod *hReaction/dt; + + dhsTrans += (1.0 - hRetentionCoeffMod)*hReaction; } +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template <class ParcelType> +Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel +( + const ReactingMultiphaseParcel<ParcelType>& p +) +: + ReactingParcel<ParcelType>(p), + YGas_(p.YGas_), + YLiquid_(p.YLiquid_), + YSolid_(p.YSolid_) +{} + + // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // #include "ReactingMultiphaseParcelIO.C" diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H index c3ce7e0073930614e434156f69d73fb1b3291339..e4e311ed90c37ac860a52be6c7a3332ef5c11913 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -223,7 +223,7 @@ protected: //- Calculate Devolatilisation template<class TrackData> - scalar calcDevolatilisation + void calcDevolatilisation ( TrackData& td, const scalar dt, // timestep @@ -234,12 +234,14 @@ protected: const scalar YVolatileTot, // total volatile mass fraction const scalarField& YVolatile, // volatile component mass fractions bool& canCombust, // 'can combust' flag - scalarField& dMassDV // mass transfer - local to particle + scalarField& dMassDV, // mass transfer - local to particle + scalar& Sh, // explicit particle enthalpy source + scalar& dhsTrans // sensible enthalpy transfer to carrier ) const; //- Calculate surface reactions template<class TrackData> - scalar calcSurfaceReactions + void calcSurfaceReactions ( TrackData& td, const scalar dt, // timestep @@ -256,20 +258,38 @@ protected: scalarField& dMassSRGas, // gas-phase mass transfer - local scalarField& dMassSRLiquid,// liquid-phase mass transfer - local scalarField& dMassSRSolid, // solid-phase mass transfer - local - scalarField& dMassSRCarrier// carrier phase mass transfer + scalarField& dMassSRCarrier, // carrier phase mass transfer + scalar& Sh, // explicit particle enthalpy source + scalar& dhsTrans // sensible enthalpy transfer to carrier ) const; public: - //- Runtime type information - TypeName("ReactingMultiphaseParcel"); + // Static data members + + //- String representation of properties + static string propHeader; + + //- Runtime type information + TypeName("ReactingMultiphaseParcel"); + friend class Cloud<ParcelType>; // Constructors + //- Construct from owner, position, and cloud owner + // Other properties initialised as null + inline ReactingMultiphaseParcel + ( + ReactingMultiphaseCloud<ParcelType>& owner, + const vector& position, + const label cellI + ); + + //- Construct from components inline ReactingMultiphaseParcel ( @@ -295,13 +315,17 @@ public: bool readFields = true ); + //- Construct as a copy + ReactingMultiphaseParcel(const ReactingMultiphaseParcel& p); + //- Construct and return a clone - autoPtr<ParcelType> clone() const + autoPtr<ReactingMultiphaseParcel> clone() const { - return autoPtr<ParcelType> - ( - new ReactingMultiphaseParcel<ParcelType>(*this) - ); + return + autoPtr<ReactingMultiphaseParcel> + ( + new ReactingMultiphaseParcel(*this) + ); } @@ -318,6 +342,9 @@ public: //- Return const access to mass fractions of solids inline const scalarField& YSolid() const; + //- Return const access to the canCombust flag + inline bool canCombust() const; + // Edit @@ -330,6 +357,9 @@ public: //- Return access to mass fractions of solids inline scalarField& YSolid(); + //- Return access to the canCombust flag + inline bool& canCombust(); + // Main calculation loop diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H index e70b922ae21621cbcb5ae6665e148697515a29d8..c512c5572847966c507b83edbf13a14d2502efb0 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,6 +85,22 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::trackData::trackData {} +template <class ParcelType> +inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel +( + ReactingMultiphaseCloud<ParcelType>& owner, + const vector& position, + const label cellI +) +: + ReactingParcel<ParcelType>(owner, position, cellI), + YGas_(0), + YLiquid_(0), + YSolid_(0), + canCombust_(false) +{} + + template<class ParcelType> inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel ( @@ -185,6 +201,13 @@ YSolid() const } +template<class ParcelType> +inline bool Foam::ReactingMultiphaseParcel<ParcelType>::canCombust() const +{ + return canCombust_; +} + + template<class ParcelType> inline Foam::scalarField& Foam::ReactingMultiphaseParcel<ParcelType>::YGas() { @@ -206,4 +229,10 @@ inline Foam::scalarField& Foam::ReactingMultiphaseParcel<ParcelType>::YSolid() } +template<class ParcelType> +inline bool& Foam::ReactingMultiphaseParcel<ParcelType>::canCombust() +{ + return canCombust_; +} + // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C index bbf58e49a04cfd0ccf3891ea318cf5824b6d2557..512f21e9530950563d4d71e0cfb89e1f54215000 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,6 +27,16 @@ License #include "ReactingMultiphaseParcel.H" #include "IOstreams.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template <class ParcelType> +Foam::string Foam::ReactingMultiphaseParcel<ParcelType>::propHeader = + ReactingParcel<ParcelType>::propHeader + + " nGas(Y1..YN)" + + " nLiquid(Y1..YN)" + + " nSolid(Y1..YN)"; + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class ParcelType> @@ -276,15 +286,15 @@ Foam::Ostream& Foam::operator<< scalarField YSolidLoc = p.YSolid()*p.Y()[2]; if (os.format() == IOstream::ASCII) { - os << static_cast<const ReactingMultiphaseParcel<ParcelType>&>(p) + os << static_cast<const ReactingParcel<ParcelType>&>(p) << token::SPACE << YGasLoc << token::SPACE << YLiquidLoc << token::SPACE << YSolidLoc; } else { - os << static_cast<const ReactingMultiphaseParcel<ParcelType>&>(p); - os << YGasLoc << YLiquidLoc << YSolidLoc; + os << static_cast<const ReactingParcel<ParcelType>&>(p); + os << YGasLoc << YLiquidLoc << YSolidLoc; } // Check state of Ostream diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 39658fcf2f8eccfd5b615f40405e515325aaef2f..b52bfeef29f4c81dc18d8f038fc42a6198b197c3 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -138,10 +138,17 @@ void Foam::ReactingParcel<ParcelType>::calc const scalar cp0 = this->cp_; const scalar mass0 = this->mass(); - // Intial ethalpy state - scalar H0H = td.cloud().composition().H(0, Y_, pc_, T0); - scalar H0L = td.cloud().composition().L(0, Y_, pc_, T0); - scalar H0 = H0H - H0L; + // Explicit momentum source for particle + vector Su = vector::zero; + + // Momentum transfer from the particle to the carrier phase + vector dUTrans = vector::zero; + + // Explicit enthalpy source for particle + scalar Sh = 0.0; + + // Sensible enthalpy transfer from the particle to the carrier phase + scalar dhsTrans = 0.0; // Phase change @@ -150,9 +157,23 @@ void Foam::ReactingParcel<ParcelType>::calc // Mass transfer due to phase change scalarField dMassPC(Y_.size(), 0.0); - // Return enthalpy source and calc mass transfer due to phase change - scalar ShPC = - calcPhaseChange(td, dt, cellI, d0, T0, U0, mass0, 0, 1.0, Y_, dMassPC); + // Calc mass and enthalpy transfer due to phase change + calcPhaseChange + ( + td, + dt, + cellI, + d0, + T0, + U0, + mass0, + 0, + 1.0, + Y_, + dMassPC, + Sh, + dhsTrans + ); // Update particle component mass and mass fractions scalar mass1 = updateMassFraction(mass0, dMassPC, Y_); @@ -162,12 +183,8 @@ void Foam::ReactingParcel<ParcelType>::calc // ~~~~~~~~~~~~~ // Calculate new particle temperature - scalar T1 = calcHeatTransfer(td, dt, cellI, d0, U0, rho0, T0, cp0, ShPC); - - // Calculate new enthalpy state - scalar H1H = td.cloud().composition().H(0, Y_, pc_, T1); - scalar H1L = td.cloud().composition().L(0, Y_, pc_, T1); - scalar H1 = H1H - H1L; + scalar T1 = + calcHeatTransfer(td, dt, cellI, d0, U0, rho0, T0, cp0, Sh, dhsTrans); // Motion @@ -177,8 +194,9 @@ void Foam::ReactingParcel<ParcelType>::calc vector Fx = vector::zero; // Calculate new particle velocity - vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Fx); + vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans); + dUTrans += 0.5*(mass0 - mass1)*(U0 + U1); // Accumulate carrier phase source terms // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -187,15 +205,19 @@ void Foam::ReactingParcel<ParcelType>::calc // Transfer mass lost from particle to carrier mass source forAll(dMassPC, i) { - label id = td.cloud().composition().localToGlobalCarrierId(0, i); - td.cloud().rhoTrans(id)[cellI] += np0*dMassPC[i]; + label gid = td.cloud().composition().localToGlobalCarrierId(0, i); + td.cloud().rhoTrans(gid)[cellI] += np0*dMassPC[i]; + td.cloud().hcTrans()[cellI] += + np0 + *dMassPC[i] + *td.cloud().composition().carrierSpecies()[gid].H(T0); } // Update momentum transfer - td.cloud().UTrans()[cellI] += np0*(mass0*U0 - mass1*U1); + td.cloud().UTrans()[cellI] += np0*dUTrans; // Update sensible enthalpy transfer - td.cloud().hsTrans()[cellI] += np0*(mass0*H0 - mass1*H1); + td.cloud().hsTrans()[cellI] += np0*dhsTrans; } @@ -210,12 +232,13 @@ void Foam::ReactingParcel<ParcelType>::calc // Absorb parcel into carrier phase forAll(Y_, i) { - label id = + label gid = td.cloud().composition().localToGlobalCarrierId(0, i); - td.cloud().rhoTrans(id)[cellI] += np0*mass1*Y_[i]; + td.cloud().rhoTrans(gid)[cellI] += np0*mass1*Y_[i]; } td.cloud().UTrans()[cellI] += np0*mass1*U1; - td.cloud().hsTrans()[cellI] += np0*mass1*H1; + td.cloud().hcTrans()[cellI] += + np0*mass1*td.cloud().composition().H(0, Y_, pc_, T1); } } @@ -225,9 +248,9 @@ void Foam::ReactingParcel<ParcelType>::calc else { - this->U_ = U1; - this->T_ = T1; this->cp_ = td.cloud().composition().cp(0, Y_, pc_, T1); + this->T_ = T1; + this->U_ = U1; // Update particle density or diameter if (td.constProps().constantVolume()) @@ -244,7 +267,7 @@ void Foam::ReactingParcel<ParcelType>::calc template<class ParcelType> template<class TrackData> -Foam::scalar Foam::ReactingParcel<ParcelType>::calcPhaseChange +void Foam::ReactingParcel<ParcelType>::calcPhaseChange ( TrackData& td, const scalar dt, @@ -256,7 +279,9 @@ Foam::scalar Foam::ReactingParcel<ParcelType>::calcPhaseChange const label idPhase, const scalar YPhase, const scalarField& YComponents, - scalarField& dMassPC + scalarField& dMassPC, + scalar& Sh, + scalar& dhsTrans ) { if @@ -266,7 +291,7 @@ Foam::scalar Foam::ReactingParcel<ParcelType>::calcPhaseChange || YPhase < SMALL ) { - return 0.0; + return; } // Calculate mass transfer due to phase change @@ -275,7 +300,7 @@ Foam::scalar Foam::ReactingParcel<ParcelType>::calcPhaseChange dt, cellI, d, - min(T, td.constProps().Tbp()), // Limit to boiling temperature + T, pc_, this->Tc_, this->muc_/(this->rhoc_ + ROOTVSMALL), @@ -291,13 +316,38 @@ Foam::scalar Foam::ReactingParcel<ParcelType>::calcPhaseChange // Add to cumulative phase change mass td.cloud().addToMassPhaseChange(this->nParticle_*dMassTot); - // Effective latent heat of vaporisation - scalar LEff = td.cloud().composition().L(idPhase, YComponents, pc_, T); + // Enthalphy transfer to carrier phase + forAll(YComponents, i) + { + label gid; + + gid = td.cloud().composition().localToGlobalCarrierId(idPhase, i); + const scalar hv = td.cloud().composition().carrierSpecies()[gid].H(T); - return -dMassTot*LEff; + gid = td.cloud().composition().globalIds(idPhase)[i]; + const scalar hl = + td.cloud().composition().liquids().properties()[gid].h(pc_, T); + + Sh += dMassPC[i]*(hl - hv)/dt; + } } +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template <class ParcelType> +Foam::ReactingParcel<ParcelType>::ReactingParcel +( + const ReactingParcel<ParcelType>& p +) +: + ThermoParcel<ParcelType>(p), + mass0_(p.mass0_), + Y_(p.Y_), + pc_(p.pc_) +{} + + // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // #include "ReactingParcelIO.C" diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H index 59e22d7d06867b1152ec2679aa056c0e0700bff4..8e351f96f098362f9532da369751e16ced11bcbe 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H @@ -46,6 +46,7 @@ SourceFiles #include "ThermoParcel.H" #include "ReactingCloud.H" +#include "reactingParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -69,6 +70,7 @@ Ostream& operator<< template<class ParcelType> class ReactingParcel : + public reactingParcel, public ThermoParcel<ParcelType> { public: @@ -86,10 +88,7 @@ public: //- Constant volume flag - e.g. during mass transfer Switch constantVolume_; - //- Boiling point [K] - const scalar Tbp_; - - //- Vapourisation temperature [K] + //- Vaporisation temperature [K] const scalar Tvap_; @@ -106,10 +105,7 @@ public: //- Return const access to the constant volume flag inline Switch constantVolume() const; - //- Return const access to the boiling point - inline scalar Tbp() const; - - //- Return const access to the vapourisation temperature + //- Return const access to the vaporisation temperature inline scalar Tvap() const; }; @@ -159,7 +155,7 @@ public: //- Return const access to the constant properties inline const constantProperties& constProps() const; - //- Return conat access to the interpolator for continuous + //- Return const access to the interpolator for continuous // phase pressure field inline const interpolation<scalar>& pInterp() const; }; @@ -188,7 +184,7 @@ protected: //- Calculate Phase change template<class TrackData> - scalar calcPhaseChange + void calcPhaseChange ( TrackData& td, const scalar dt, // timestep @@ -200,7 +196,9 @@ protected: const label idPhase, // id of phase involved in phase change const scalar YPhase, // total mass fraction const scalarField& YComponents, // component mass fractions - scalarField& dMassPC // mass transfer - local to particle + scalarField& dMassPC, // mass transfer - local to particle + scalar& Sh, // explicit particle enthalpy source + scalar& dhsTrans // sensible enthalpy transfer to carrier ); //- Update mass fraction @@ -214,14 +212,29 @@ protected: public: - //- Runtime type information - TypeName("ReactingParcel"); + // Static data members + + //- String representation of properties + static string propHeader; + + //- Runtime type information + TypeName("ReactingParcel"); + friend class Cloud<ParcelType>; // Constructors + //- Construct from owner, position, and cloud owner + // Other properties initialised as null + inline ReactingParcel + ( + ReactingCloud<ParcelType>& owner, + const vector& position, + const label cellI + ); + //- Construct from components inline ReactingParcel ( @@ -244,10 +257,13 @@ public: bool readFields = true ); + //- Construct as a copy + ReactingParcel(const ReactingParcel& p); + //- Construct and return a clone - autoPtr<ParcelType> clone() const + autoPtr<ReactingParcel> clone() const { - return autoPtr<ParcelType>(new ReactingParcel<ParcelType>(*this)); + return autoPtr<ReactingParcel>(new ReactingParcel(*this)); } diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H index 344eb09398a80d60cb3a117cf1da53eb7fc4fd6c..5c2b3c7b2d4b0fb885052120a4eec448831e01d7 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H @@ -35,7 +35,6 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties ThermoParcel<ParcelType>::constantProperties(parentDict), pMin_(dimensionedScalar(this->dict().lookup("pMin")).value()), constantVolume_(this->dict().lookup("constantVolume")), - Tbp_(dimensionedScalar(this->dict().lookup("Tbp")).value()), Tvap_(dimensionedScalar(this->dict().lookup("Tvap")).value()) {} @@ -71,6 +70,21 @@ inline Foam::ReactingParcel<ParcelType>::trackData::trackData {} +template<class ParcelType> +inline Foam::ReactingParcel<ParcelType>::ReactingParcel +( + ReactingCloud<ParcelType>& owner, + const vector& position, + const label cellI +) +: + ThermoParcel<ParcelType>(owner, position, cellI), + mass0_(0.0), + Y_(0), + pc_(0.0) +{} + + template<class ParcelType> inline Foam::ReactingParcel<ParcelType>::ReactingParcel ( @@ -123,14 +137,6 @@ Foam::ReactingParcel<ParcelType>::constantProperties::constantVolume() const } -template<class ParcelType> -inline Foam::scalar -Foam::ReactingParcel<ParcelType>::constantProperties::Tbp() const -{ - return Tbp_; -} - - template<class ParcelType> inline Foam::scalar Foam::ReactingParcel<ParcelType>::constantProperties::Tvap() const diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C index 968c608d7e2ed252332271828c33c1208a3c8334..b72d2af25a20f7525bd461f8aa1b24f07e4bf8b7 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C @@ -27,6 +27,15 @@ License #include "ReactingParcel.H" #include "IOstreams.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template <class ParcelType> +Foam::string Foam::ReactingParcel<ParcelType>::propHeader = + ThermoParcel<ParcelType>::propHeader + + " mass0" + + " nPhases(Y1..YN)"; + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class ParcelType> @@ -215,11 +224,10 @@ Foam::Ostream& Foam::operator<< os << static_cast<const ThermoParcel<ParcelType>&>(p); os.write ( - reinterpret_cast<const char*>(&p.mass0_), sizeof(p.mass0()) ); - os << p.Y(); + os << p.Y(); } // Check state of Ostream diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C index 5885512511ae853cf146ded11a2cf487cd477319..4596a471259111fbd0092bbbea56b88c676f3c55 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C @@ -96,31 +96,31 @@ void Foam::ThermoParcel<ParcelType>::calc const scalar cp0 = this->cp_; const scalar mass0 = this->mass(); - // Initial enthalpy state - scalar H0 = cp0*T0; + // Explicit momentum source for particle + vector Su = vector::zero; + // Momentum transfer from the particle to the carrier phase + vector dUTrans = vector::zero; + + // Explicit enthalpy source for particle + scalar Sh = 0.0; + + // Sensible enthalpy transfer from the particle to the carrier phase + scalar dhsTrans = 0.0; // Heat transfer // ~~~~~~~~~~~~~ - // No additional enthalpy sources - scalar Sh = 0.0; - // Calculate new particle velocity - scalar T1 = calcHeatTransfer(td, dt, cellI, d0, U0, rho0, T0, cp0, Sh); - - // Calculate new enthalpy state - scalar H1 = cp0*T1; + scalar T1 = + calcHeatTransfer(td, dt, cellI, d0, U0, rho0, T0, cp0, Sh, dhsTrans); // Motion // ~~~~~~ - // No additional forces - vector Fx = vector::zero; - // Calculate new particle velocity - vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Fx); + vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans); // Accumulate carrier phase source terms @@ -128,10 +128,10 @@ void Foam::ThermoParcel<ParcelType>::calc if (td.cloud().coupled()) { // Update momentum transfer - td.cloud().UTrans()[cellI] += np0*mass0*(U0 - U1); + td.cloud().UTrans()[cellI] += np0*dUTrans; // Update sensible enthalpy transfer - td.cloud().hsTrans()[cellI] += np0*mass0*(H0 - H1); + td.cloud().hsTrans()[cellI] += np0*dhsTrans; } // Set new particle properties @@ -153,7 +153,8 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer const scalar rho, const scalar T, const scalar cp, - const scalar Sh + const scalar Sh, + scalar& dhsTrans ) { if (!td.cloud().heatTransfer().active()) @@ -173,38 +174,64 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer this->muc_ ); + const scalar As = this->areaS(d); - // Determine new particle temperature - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - // Determine ap and bp coefficients - scalar ap = Tc_ + Sh/(htc*this->areaS(d) + ROOTVSMALL); - scalar bp = 6.0*htc/(rho*d*cp); - if (td.cloud().radiation()) + if (mag(htc) < ROOTVSMALL && !td.cloud().radiation()) { - // Carrier phase incident radiation field - // - The G field is not interpolated to the parcel position - // Instead, the cell centre value is applied directly - const scalarField& G = td.cloud().mesh().objectRegistry - ::lookupObject<volScalarField>("G"); + return T + dt*Sh/(this->mass()*cp); + } - // Helper variables + scalar ap; + scalar bp; + + if(td.cloud().radiation()) + { + const scalarField& G = + td.cloud().mesh().objectRegistry::lookupObject<volScalarField>("G"); const scalar sigma = radiation::sigmaSB.value(); const scalar epsilon = td.constProps().epsilon0(); - const scalar D = epsilon*sigma*pow3(T)/(htc + ROOTVSMALL) + 1.0; - ap += 0.25*epsilon*G[cellI]/(htc + ROOTVSMALL); - ap /= D; - bp *= D; + + ap = + (Sh/As + htc*Tc_ + epsilon*G[cellI]/4.0) + /(htc + epsilon*sigma*pow3(T)); + + bp = + 6.0 + *(Sh/As + htc*(Tc_ - T) + epsilon*(G[cellI]/4.0 - sigma*pow4(T))) + /(rho*d*cp*(ap - T)); + } + else + { + ap = Tc_ + Sh/As/htc; + bp = 6.0*(Sh/As + htc*(Tc_ - T))/(rho*d*cp*(ap - T)); } // Integrate to find the new parcel temperature IntegrationScheme<scalar>::integrationResult Tres = td.cloud().TIntegrator().integrate(T, dt, ap, bp); + dhsTrans += dt*htc*As*(Tres.average() - Tc_); + return Tres.value(); } +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template <class ParcelType> +Foam::ThermoParcel<ParcelType>::ThermoParcel +( + const ThermoParcel<ParcelType>& p +) +: + KinematicParcel<ParcelType>(p), + T_(p.T_), + cp_(p.cp_), + Tc_(p.Tc_), + cpc_(p.cpc_) +{} + + // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // #include "ThermoParcelIO.C" diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H index 1927ca3de692ab4b6fe01857e10b8211921d094d..c11fecd11dc9166cfe5f1753686cf6bcd6030132 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H @@ -146,7 +146,7 @@ public: //- Temperature field interpolator const interpolation<scalar>& TInterp_; - //- Scpecific heat capacity field interpolator + //- Specific heat capacity field interpolator const interpolation<scalar>& cpInterp_; @@ -176,11 +176,11 @@ public: //- Return const access to the owner cloud inline const constantProperties& constProps() const; - //- Return conat access to the interpolator for continuous + //- Return const access to the interpolator for continuous // phase temperature field inline const interpolation<scalar>& TInterp() const; - //- Return conat access to the interpolator for continuous + //- Return const access to the interpolator for continuous // phase specific heat capacity field inline const interpolation<scalar>& cpInterp() const; }; @@ -222,20 +222,36 @@ protected: const scalar rho, // density const scalar T, // temperature const scalar cp, // specific heat capacity - const scalar Sh // additional enthalpy sources + const scalar Sh, // explicit particle enthalpy source + scalar& dhsTrans // sensible enthalpy transfer to carrier ); public: - //- Runtime type information - TypeName("ThermoParcel"); + // Static data members + + //- String representation of properties + static string propHeader; + + //- Runtime type information + TypeName("ThermoParcel"); + friend class Cloud<ParcelType>; // Constructors + //- Construct from owner, position, and cloud owner + // Other properties initialised as null + inline ThermoParcel + ( + ThermoCloud<ParcelType>& owner, + const vector& position, + const label cellI + ); + //- Construct from components inline ThermoParcel ( @@ -257,10 +273,13 @@ public: bool readFields = true ); + //- Construct as a copy + ThermoParcel(const ThermoParcel& p); + //- Construct and return a clone - autoPtr<ParcelType> clone() const + autoPtr<ThermoParcel> clone() const { - return autoPtr<ParcelType>(new ThermoParcel<ParcelType>(*this)); + return autoPtr<ThermoParcel>(new ThermoParcel(*this)); } diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H index 6e929b6e691f2c913c122413a2c36df90c3171b7..8ce0cb56915196a30a7348af7582c64161d17523 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H @@ -70,6 +70,22 @@ inline Foam::ThermoParcel<ParcelType>::trackData::trackData {} +template<class ParcelType> +inline Foam::ThermoParcel<ParcelType>::ThermoParcel +( + ThermoCloud<ParcelType>& owner, + const vector& position, + const label cellI +) +: + KinematicParcel<ParcelType>(owner, position, cellI), + T_(0.0), + cp_(0.0), + Tc_(0.0), + cpc_(0.0) +{} + + template<class ParcelType> inline Foam::ThermoParcel<ParcelType>::ThermoParcel ( diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelIO.C index d4f30ce91734218f78c7108d4c937b11a76e058f..827b2f36f41ec7f94068c8f6a7213800d2fa26bb 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelIO.C @@ -27,6 +27,15 @@ License #include "ThermoParcel.H" #include "IOstreams.H" +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template <class ParcelType> +Foam::string Foam::ThermoParcel<ParcelType>::propHeader = + KinematicParcel<ParcelType>::propHeader + + " T" + + " cp"; + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class ParcelType> diff --git a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelCompositionModels.C b/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcel.C similarity index 71% rename from src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelCompositionModels.C rename to src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcel.C index f6dea63009cc329c15e0b4ed1183d7e2fed83c89..b41cb31df9454bcd2e03ccb799cf146b26fd5a32 100644 --- a/src/lagrangian/coalCombustion/coalParcel/submodels/makeCoalParcelCompositionModels.C +++ b/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,25 +24,24 @@ License \*---------------------------------------------------------------------------*/ -#include "coalParcel.H" -#include "ReactingCloud.H" +#include "TrackedReactingParcel.H" -#include "SingleMixtureFraction.H" +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +template <class ParcelType> +Foam::TrackedReactingParcel<ParcelType>::TrackedReactingParcel +( + const TrackedReactingParcel<ParcelType>& p +) +: + ReactingParcel<ParcelType>(p), + ParticleTrackingData<ParcelType>(p) +{} -namespace Foam -{ - makeCompositionModel(ReactingCloud<coalParcel>); - // Add instances of composition model to the table - makeCompositionModelType - ( - SingleMixtureFraction, - ReactingCloud, - coalParcel - ); -}; +// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // +#include "TrackedReactingParcelIO.C" // ************************************************************************* // + diff --git a/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcel.H b/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcel.H new file mode 100644 index 0000000000000000000000000000000000000000..8df58f8d2c8938473289a9c024877d0bad670d08 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcel.H @@ -0,0 +1,169 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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::TrackedReactingParcel + +Description + Adds tracking to ReactingParcel + +SourceFiles + TrackedReactingParcelI.H + TrackedReactingParcel.C + TrackedReactingParcelIO.C + +\*---------------------------------------------------------------------------*/ + +#ifndef TrackedReactingParcel_H +#define TrackedReactingParcel_H + +#include "ReactingParcel.H" +#include "ParticleTrackingData.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +template<class ParcelType> +class TrackedReactingParcel; + +// Forward declaration of friend functions + +template<class ParcelType> +Ostream& operator<< +( + Ostream&, + const TrackedReactingParcel<ParcelType>& +); + +/*---------------------------------------------------------------------------*\ + Class TrackedReactingParcel Declaration +\*---------------------------------------------------------------------------*/ + +template<class ParcelType> +class TrackedReactingParcel +: + public ReactingParcel<ParcelType>, + public ParticleTrackingData<ParcelType> +{ +public: + + typedef typename ReactingParcel<ParcelType>::constantProperties + constantProperties; + + // Static data + + //- Runtime type information + TypeName("TrackedReactingParcel"); + + + // Constructors + + //- Construct from owner, position, and cloud owner + // Other properties initialised as null + inline TrackedReactingParcel + ( + ReactingCloud<ParcelType>& owner, + const vector& position, + const label cellI + ); + + //- Construct from components + inline TrackedReactingParcel + ( + ReactingCloud<ParcelType>& owner, + const vector& position, + const label cellI, + const label typeId, + const scalar nParticle0, + const scalar d0, + const vector& U0, + const scalarField& Y0, + const constantProperties& constProps + ); + + //- Construct from Istream + TrackedReactingParcel + ( + const Cloud<ParcelType>& c, + Istream& is, + bool readFields = true + ); + + //- Construct as a copy + TrackedReactingParcel(const TrackedReactingParcel& p); + + //- Construct and return a clone + autoPtr<TrackedReactingParcel> clone() const + { + return + autoPtr<TrackedReactingParcel> + ( + new TrackedReactingParcel(*this) + ); + } + + + // Member Functions + + // I-O + + //- Read + static void readFields(ReactingCloud<ParcelType>& c); + + //- Write + static void writeFields(const ReactingCloud<ParcelType>& c); + + + // Ostream Operator + + friend Ostream& operator<< <ParcelType> + ( + Ostream&, + const TrackedReactingParcel<ParcelType>& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "TrackedReactingParcelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "TrackedReactingParcel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // + diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcelI.H similarity index 66% rename from src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.C rename to src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcelI.H index 72ac1f4842f72de5353f4b7d7f7263a55f9e4235..a3bf01eb35772d6f5fdd64feafc21de6449b8a61 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,23 +24,25 @@ License \*---------------------------------------------------------------------------*/ -#include "basicReactingParcel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(basicReactingParcel, 0); - defineParticleTypeNameAndDebug(basicReactingParcel, 0); - defineParcelTypeNameAndDebug(basicReactingParcel, 0); -}; +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +template <class ParcelType> +inline Foam::TrackedReactingParcel<ParcelType>::TrackedReactingParcel +( + ReactingCloud<ParcelType>& owner, + const vector& position, + const label cellI +) +: + ReactingParcel<ParcelType>(owner, position, cellI), + ParticleTrackingData<ParcelType>(owner) +{} -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::basicReactingParcel::basicReactingParcel +template <class ParcelType> +inline Foam::TrackedReactingParcel<ParcelType>::TrackedReactingParcel ( - ReactingCloud<basicReactingParcel>& owner, + ReactingCloud<ParcelType>& owner, const vector& position, const label cellI, const label typeId, @@ -51,7 +53,7 @@ Foam::basicReactingParcel::basicReactingParcel const constantProperties& constProps ) : - ReactingParcel<basicReactingParcel> + ReactingParcel<ParcelType> ( owner, position, @@ -62,24 +64,8 @@ Foam::basicReactingParcel::basicReactingParcel U0, Y0, constProps - ) -{} - - -Foam::basicReactingParcel::basicReactingParcel -( - const Cloud<basicReactingParcel>& cloud, - Istream& is, - bool readFields -) -: - ReactingParcel<basicReactingParcel>(cloud, is, readFields) -{} - - -// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // - -Foam::basicReactingParcel::~basicReactingParcel() + ), + ParticleTrackingData<ParcelType>(owner) {} diff --git a/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcelIO.C new file mode 100644 index 0000000000000000000000000000000000000000..8ce5d9b2f2f22a726598366796204702741a40b1 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/Templates/TrackedReactingParcel/TrackedReactingParcelIO.C @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "TrackedReactingParcel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template <class ParcelType> +Foam::TrackedReactingParcel<ParcelType>::TrackedReactingParcel +( + const Cloud<ParcelType>& cloud, + Istream& is, + bool readFields +) +: + ReactingParcel<ParcelType>(cloud, is, readFields), + ParticleTrackingData<ParcelType>(cloud, is, readFields) +{} + + +template<class ParcelType> +void Foam::TrackedReactingParcel<ParcelType>::readFields +( + ReactingCloud<ParcelType>& c +) +{ + if (!c.size()) + { + return; + } + + ReactingParcel<ParcelType>::readFields(c); + ParticleTrackingData<ParcelType>::readFields(c); +} + + +template<class ParcelType> +void Foam::TrackedReactingParcel<ParcelType>::writeFields +( + const ReactingCloud<ParcelType>& c +) +{ + ReactingParcel<ParcelType>::writeFields(c); + ParticleTrackingData<ParcelType>::writeFields(c); +} + + +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // + +template<class ParcelType> +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const TrackedReactingParcel<ParcelType>& p +) +{ + if (os.format() == IOstream::ASCII) + { + os << static_cast<const ReactingParcel<ParcelType>&>(p) + << static_cast<const ParticleTrackingData<ParcelType>&>(p); + } + else + { + os << static_cast<const ReactingParcel<ParcelType>&>(p) + << static_cast<const ParticleTrackingData<ParcelType>&>(p); + } + + // Check state of Ostream + os.check + ( + "Ostream& operator<<" + "(" + "Ostream&, " + "const TrackedReactingParcel<ParcelType>&" + ")" + ); + + return os; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/baseClasses/reactingParcel/reactingParcel.C b/src/lagrangian/intermediate/parcels/baseClasses/reactingParcel/reactingParcel.C new file mode 100644 index 0000000000000000000000000000000000000000..2974454658e5349c0ec4ddd1a354a85b30334db8 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/baseClasses/reactingParcel/reactingParcel.C @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "reactingParcel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(reactingParcel, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::reactingParcel::reactingParcel() +{} + + +// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // + +Foam::reactingParcel::~reactingParcel() +{} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/baseClasses/reactingParcel/reactingParcel.H b/src/lagrangian/intermediate/parcels/baseClasses/reactingParcel/reactingParcel.H new file mode 100644 index 0000000000000000000000000000000000000000..e78b15347d4483d63cba2e7ef0b24a6f4727a3cc --- /dev/null +++ b/src/lagrangian/intermediate/parcels/baseClasses/reactingParcel/reactingParcel.H @@ -0,0 +1,81 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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::basicReactingParcel + +Description + Base class for reacting parcel - simply used to set the contiguous flag + +SourceFiles + reactingParcel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef reactingParcel_H +#define reactingParcel_H + +#include "typeInfo.H" +#include "contiguous.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class reactingParcel Declaration +\*---------------------------------------------------------------------------*/ + +class reactingParcel +{ +public: + + //- Run-time type information + TypeName("reactingParcel"); + + //- Construct null + reactingParcel(); + + //- Destructor + virtual ~reactingParcel(); +}; + + +template<> +inline bool contiguous<reactingParcel>() +{ + return false; // Derived classes include scalar lists/fields +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/BasicReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/BasicReactingMultiphaseParcel.C new file mode 100644 index 0000000000000000000000000000000000000000..2189d8d8be909c0a6c852955b82a9af5839e9576 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/BasicReactingMultiphaseParcel.C @@ -0,0 +1,120 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "BasicReactingMultiphaseParcel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class ThermoType> +Foam::BasicReactingMultiphaseParcel<ThermoType>::BasicReactingMultiphaseParcel +( + ReactingMultiphaseCloud<BasicReactingMultiphaseParcel<ThermoType> >& owner, + const vector& position, + const label cellI +) +: + ReactingMultiphaseParcel<BasicReactingMultiphaseParcel<ThermoType> > + ( + owner, + position, + cellI + ) +{} + + +template<class ThermoType> +Foam::BasicReactingMultiphaseParcel<ThermoType>::BasicReactingMultiphaseParcel +( + ReactingMultiphaseCloud<BasicReactingMultiphaseParcel<ThermoType> >& owner, + const vector& position, + const label cellI, + const label typeId, + const scalar nParticle0, + const scalar d0, + const vector& U0, + const scalarField& YGas0, + const scalarField& YLiquid0, + const scalarField& YSolid0, + const scalarField& Y0, + const typename + ReactingMultiphaseParcel<BasicReactingMultiphaseParcel>:: + constantProperties& constProps +) +: + ReactingMultiphaseParcel<BasicReactingMultiphaseParcel<ThermoType> > + ( + owner, + position, + cellI, + typeId, + nParticle0, + d0, + U0, + YGas0, + YLiquid0, + YSolid0, + Y0, + constProps + ) +{} + + +template<class ThermoType> +Foam::BasicReactingMultiphaseParcel<ThermoType>::BasicReactingMultiphaseParcel +( + const Cloud<BasicReactingMultiphaseParcel<ThermoType> >& cloud, + Istream& is, + bool readFields +) +: + ReactingMultiphaseParcel<BasicReactingMultiphaseParcel<ThermoType> > + ( + cloud, + is, + readFields + ) +{} + + +template<class ThermoType> +Foam::BasicReactingMultiphaseParcel<ThermoType>::BasicReactingMultiphaseParcel +( + const BasicReactingMultiphaseParcel<ThermoType>& p +) +: + ReactingMultiphaseParcel<BasicReactingMultiphaseParcel<ThermoType> >(p) +{} + + +// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // + +template<class ThermoType> +Foam::BasicReactingMultiphaseParcel<ThermoType>:: +~BasicReactingMultiphaseParcel() +{} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.H b/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/BasicReactingMultiphaseParcel.H similarity index 56% rename from src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.H rename to src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/BasicReactingMultiphaseParcel.H index cc537e56380eb666dbefb6db4bca83efcd293d33..f216f8f54780b9b87ac2d928dd9ab4e2f9fbf4c9 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.H +++ b/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/BasicReactingMultiphaseParcel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,47 +23,65 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::basicReactingMultiphaseParcel + Foam::BasicReactingMultiphaseParcel Description SourceFiles - basicReactingMultiphaseParcel.C - basicReactingMultiphaseParcelIO.C + BasicReactingMultiphaseParcel.C + BasicReactingMultiphaseParcelIO.C \*---------------------------------------------------------------------------*/ -#ifndef basicReactingMultiphaseParcel_H -#define basicReactingMultiphaseParcel_H +#ifndef BasicReactingMultiphaseParcel_H +#define BasicReactingMultiphaseParcel_H #include "ReactingMultiphaseParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + namespace Foam { +// Forward declaration of classes +template<class ThermoType> +class BasicReactingMultiphaseParcel; + /*---------------------------------------------------------------------------*\ - Class basicReactingMultiphaseParcel Declaration + Class BasicReactingMultiphaseParcel Declaration \*---------------------------------------------------------------------------*/ -class basicReactingMultiphaseParcel +template<class ThermoType> +class BasicReactingMultiphaseParcel : - public ReactingMultiphaseParcel<basicReactingMultiphaseParcel> + public ReactingMultiphaseParcel<BasicReactingMultiphaseParcel<ThermoType> > { public: + //- The type of thermodynamics this parcel was instantiated for + typedef ThermoType thermoType; + //- Run-time type information - TypeName("basicReactingMultiphaseParcel"); + TypeName("BasicReactingMultiphaseParcel"); // Constructors + //- Construct from owner, position, and cloud owner + // Other properties initialised as null + BasicReactingMultiphaseParcel + ( + ReactingMultiphaseCloud<BasicReactingMultiphaseParcel>& owner, + const vector& position, + const label cellI + ); + //- Construct from components - basicReactingMultiphaseParcel + BasicReactingMultiphaseParcel ( - ReactingMultiphaseCloud<basicReactingMultiphaseParcel>& owner, + ReactingMultiphaseCloud<BasicReactingMultiphaseParcel>& owner, const vector& position, const label cellI, const label typeId, @@ -74,40 +92,47 @@ public: const scalarField& YLiquid0, const scalarField& YSolid0, const scalarField& Y0, - const constantProperties& constProps + const typename + ReactingMultiphaseParcel<BasicReactingMultiphaseParcel>:: + constantProperties& constProps ); //- Construct from Istream - basicReactingMultiphaseParcel + BasicReactingMultiphaseParcel ( - const Cloud<basicReactingMultiphaseParcel>& c, + const Cloud<BasicReactingMultiphaseParcel>& c, Istream& is, bool readFields = true ); + //- Construct as a copy + BasicReactingMultiphaseParcel(const BasicReactingMultiphaseParcel& p); + //- Construct and return a clone - autoPtr<basicReactingMultiphaseParcel> clone() const + autoPtr<BasicReactingMultiphaseParcel> clone() const { - return autoPtr<basicReactingMultiphaseParcel> - (new basicReactingMultiphaseParcel(*this)); + return + autoPtr<BasicReactingMultiphaseParcel> + ( + new BasicReactingMultiphaseParcel(*this) + ); } //- Destructor - virtual ~basicReactingMultiphaseParcel(); + virtual ~BasicReactingMultiphaseParcel(); }; -template<> -inline bool contiguous<basicReactingMultiphaseParcel>() -{ - return false; // Now have scalar lists/fields (mass fractions) -} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam +#ifdef NoRepository + #include "BasicReactingMultiphaseParcel.C" +#endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C new file mode 100644 index 0000000000000000000000000000000000000000..d73d63e9dd6d1a3dae186c26aa94faaf94767624 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "createReactingMultiphaseParcelTypes.H" +#include "BasicReactingMultiphaseParcel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + createReactingMultiphaseParcelType(BasicReactingMultiphaseParcel); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C new file mode 100644 index 0000000000000000000000000000000000000000..08c87530c37f60cfc1736f1894152080b6870a85 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C @@ -0,0 +1,77 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "BasicReactingMultiphaseParcel.H" + +// Kinematic +#include "makeReactingParcelDispersionModels.H" +#include "makeReactingParcelDragModels.H" +#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant +#include "makeReactingParcelPatchInteractionModels.H" +#include "makeReactingParcelPostProcessingModels.H" + +// Thermodynamic +#include "makeReactingParcelHeatTransferModels.H" + +// Reacting +#include "makeReactingMultiphaseParcelCompositionModels.H" // MP variant +#include "makeReactingParcelPhaseChangeModels.H" + +// Reacting multiphase +#include "makeReactingMultiphaseParcelDevolatilisationModels.H" +#include "makeReactingMultiphaseParcelSurfaceReactionModels.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + // Kinematic sub-models + makeReactingDispersionModels(BasicReactingMultiphaseParcel); + makeReactingDragModels(BasicReactingMultiphaseParcel); + makeReactingMultiphaseInjectionModels(BasicReactingMultiphaseParcel); + makeReactingPatchInteractionModels(BasicReactingMultiphaseParcel); + makeReactingPostProcessingModels(BasicReactingMultiphaseParcel); + + // Thermo sub-models + makeReactingHeatTransferModels(BasicReactingMultiphaseParcel); + + // Reacting sub-models + makeReactingMultiphaseCompositionModels(BasicReactingMultiphaseParcel); + makeReactingPhaseChangeModels(BasicReactingMultiphaseParcel); + + // Reacting multiphase sub-models + makeReactingMultiphaseDevolatilisationModels + ( + BasicReactingMultiphaseParcel + ); + makeReactingMultiphaseSurfaceReactionModels + ( + BasicReactingMultiphaseParcel + ); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/BasicReactingParcel.C similarity index 62% rename from src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C rename to src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/BasicReactingParcel.C index d200738319074ca40bbab59fb124b1b909bab94f..d2b00fdf73f3b6aef58d7d53fbe37a79f4f16f51 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/BasicReactingParcel.C @@ -24,37 +24,38 @@ License \*---------------------------------------------------------------------------*/ -#include "basicReactingMultiphaseParcel.H" +#include "BasicReactingParcel.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(basicReactingMultiphaseParcel, 0); - defineParticleTypeNameAndDebug(basicReactingMultiphaseParcel, 0); - defineParcelTypeNameAndDebug(basicReactingMultiphaseParcel, 0); -}; +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +template<class ThermoType> +Foam::BasicReactingParcel<ThermoType>::BasicReactingParcel +( + ReactingCloud<BasicReactingParcel<ThermoType> >& owner, + const vector& position, + const label cellI +) +: + ReactingParcel<BasicReactingParcel<ThermoType> >(owner, position, cellI) +{} -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel +template<class ThermoType> +Foam::BasicReactingParcel<ThermoType>::BasicReactingParcel ( - ReactingMultiphaseCloud<basicReactingMultiphaseParcel>& owner, + ReactingCloud<BasicReactingParcel<ThermoType> >& owner, const vector& position, const label cellI, const label typeId, const scalar nParticle0, const scalar d0, const vector& U0, - const scalarField& YGas0, - const scalarField& YLiquid0, - const scalarField& YSolid0, const scalarField& Y0, - const constantProperties& constProps + const typename ReactingParcel<BasicReactingParcel<ThermoType> >:: + constantProperties& constProps ) : - ReactingMultiphaseParcel<basicReactingMultiphaseParcel> + ReactingParcel<BasicReactingParcel<ThermoType> > ( owner, position, @@ -63,34 +64,38 @@ Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel nParticle0, d0, U0, - YGas0, - YLiquid0, - YSolid0, Y0, constProps ) {} -Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel +template<class ThermoType> +Foam::BasicReactingParcel<ThermoType>::BasicReactingParcel ( - const Cloud<basicReactingMultiphaseParcel>& cloud, + const Cloud<BasicReactingParcel<ThermoType> >& cloud, Istream& is, bool readFields ) : - ReactingMultiphaseParcel<basicReactingMultiphaseParcel> - ( - cloud, - is, - readFields - ) + ReactingParcel<BasicReactingParcel<ThermoType> >(cloud, is, readFields) +{} + + +template<class ThermoType> +Foam::BasicReactingParcel<ThermoType>::BasicReactingParcel +( + const BasicReactingParcel<ThermoType>& p +) +: + ReactingParcel<BasicReactingParcel>(p) {} // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // -Foam::basicReactingMultiphaseParcel::~basicReactingMultiphaseParcel() +template<class ThermoType> +Foam::BasicReactingParcel<ThermoType>::~BasicReactingParcel() {} diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.H b/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/BasicReactingParcel.H similarity index 60% rename from src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.H rename to src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/BasicReactingParcel.H index fae88a2da7bd8a26295b904ba8c5830c2082036f..b8b44eb237e4e2973a1abdbabab0fd943a61fbf7 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.H +++ b/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/BasicReactingParcel.H @@ -23,19 +23,19 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::basicReactingParcel + Foam::BasicReactingParcel Description SourceFiles - basicReactingParcel.C - basicReactingParcelIO.C + BasicReactingParcel.C + BasicReactingParcelIO.C \*---------------------------------------------------------------------------*/ -#ifndef basicReactingParcel_H -#define basicReactingParcel_H +#ifndef BasicReactingParcel_H +#define BasicReactingParcel_H #include "ReactingParcel.H" @@ -44,26 +44,43 @@ SourceFiles namespace Foam { +// Forward declaration of classes +template<class ThermoType> +class BasicReactingParcel; + /*---------------------------------------------------------------------------*\ - Class basicReactingParcel Declaration + Class BasicReactingParcel Declaration \*---------------------------------------------------------------------------*/ -class basicReactingParcel +template<class ThermoType> +class BasicReactingParcel : - public ReactingParcel<basicReactingParcel> + public ReactingParcel<BasicReactingParcel<ThermoType> > { public: + //- The type of thermodynamics this parcel was instantiated for + typedef ThermoType thermoType; + //- Run-time type information - TypeName("basicReactingParcel"); + TypeName("BasicReactingParcel"); // Constructors + //- Construct from owner, position, and cloud owner + // Other properties initialised as null + BasicReactingParcel + ( + ReactingCloud<BasicReactingParcel>& owner, + const vector& position, + const label cellI + ); + //- Construct from components - basicReactingParcel + BasicReactingParcel ( - ReactingCloud<basicReactingParcel>& owner, + ReactingCloud<BasicReactingParcel>& owner, const vector& position, const label cellI, const label typeId, @@ -71,39 +88,46 @@ public: const scalar d0, const vector& U0, const scalarField& Y0, - const constantProperties& constProps + const typename ReactingParcel<BasicReactingParcel>:: + constantProperties& constProps ); //- Construct from Istream - basicReactingParcel + BasicReactingParcel ( - const Cloud<basicReactingParcel>& c, + const Cloud<BasicReactingParcel>& c, Istream& is, bool readFields = true ); + //- Construct as a copy + BasicReactingParcel(const BasicReactingParcel& p); + //- Construct and return a clone - autoPtr<basicReactingParcel> clone() const + autoPtr<BasicReactingParcel> clone() const { - return autoPtr<basicReactingParcel>(new basicReactingParcel(*this)); + return + autoPtr<BasicReactingParcel> + ( + new BasicReactingParcel(*this) + ); } //- Destructor - virtual ~basicReactingParcel(); + virtual ~BasicReactingParcel(); }; -template<> -inline bool contiguous<basicReactingParcel>() -{ - return false; // Now have scalar lists/fields (mass fractions) -} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam +#ifdef NoRepository + #include "BasicReactingParcel.C" +#endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/defineBasicReactingParcel.C b/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/defineBasicReactingParcel.C new file mode 100644 index 0000000000000000000000000000000000000000..2c2e78630d691b2d398b09cbb32587da5e617e3d --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/defineBasicReactingParcel.C @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 "createReactingParcelTypes.H" +#include "BasicReactingParcel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + createReactingParcelType(BasicReactingParcel); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelDispersionModels.C b/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/makeBasicReactingParcelSubmodels.C similarity index 55% rename from src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelDispersionModels.C rename to src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/makeBasicReactingParcelSubmodels.C index 8e4a77d5e3038ad65a0bf05d3ead1451bf64a6f9..a05fd96a37ccedb7d6d77d03705ab66ec50fa611 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelDispersionModels.C +++ b/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/makeBasicReactingParcelSubmodels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,44 +24,39 @@ License \*---------------------------------------------------------------------------*/ -#include "basicReactingMultiphaseParcel.H" -#include "KinematicCloud.H" +#include "BasicReactingParcel.H" -#include "NoDispersion.H" -#include "GradientDispersionRAS.H" -#include "StochasticDispersionRAS.H" +// Kinematic +#include "makeReactingParcelDispersionModels.H" +#include "makeReactingParcelDragModels.H" +#include "makeReactingParcelInjectionModels.H" +#include "makeReactingParcelPatchInteractionModels.H" +#include "makeReactingParcelPostProcessingModels.H" + +// Thermodynamic +#include "makeReactingParcelHeatTransferModels.H" + +// Reacting +#include "makeReactingParcelCompositionModels.H" +#include "makeReactingParcelPhaseChangeModels.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeDispersionModel(KinematicCloud<basicReactingMultiphaseParcel>); - - defineNamedTemplateTypeNameAndDebug - ( - DispersionRASModel<KinematicCloud<basicReactingMultiphaseParcel> >, - 0 - ); - - // Add instances of dispersion model to the table - makeDispersionModelType - ( - NoDispersion, - KinematicCloud, - basicReactingMultiphaseParcel - ); - makeDispersionModelType - ( - GradientDispersionRAS, - KinematicCloud, - basicReactingMultiphaseParcel - ); - makeDispersionModelType - ( - StochasticDispersionRAS, - KinematicCloud, - basicReactingMultiphaseParcel - ); + // Kinematic sub-models + makeReactingDispersionModels(BasicReactingParcel); + makeReactingDragModels(BasicReactingParcel); + makeReactingInjectionModels(BasicReactingParcel); + makeReactingPatchInteractionModels(BasicReactingParcel); + makeReactingPostProcessingModels(BasicReactingParcel); + + // Thermo sub-models + makeReactingHeatTransferModels(BasicReactingParcel); + + // Reacting sub-models + makeReactingCompositionModels(BasicReactingParcel); + makeReactingPhaseChangeModels(BasicReactingParcel); }; diff --git a/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/BasicTrackedReactingParcel.C b/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/BasicTrackedReactingParcel.C new file mode 100644 index 0000000000000000000000000000000000000000..db48ba437f5a0a47f66ba8e14de956729063ed0e --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/BasicTrackedReactingParcel.C @@ -0,0 +1,113 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "BasicTrackedReactingParcel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class ThermoType> +Foam::BasicTrackedReactingParcel<ThermoType>::BasicTrackedReactingParcel +( + ReactingCloud<BasicTrackedReactingParcel<ThermoType> >& owner, + const vector& position, + const label cellI +) +: + TrackedReactingParcel<BasicTrackedReactingParcel<ThermoType> > + ( + owner, + position, + cellI + ) +{} + + +template<class ThermoType> +Foam::BasicTrackedReactingParcel<ThermoType>::BasicTrackedReactingParcel +( + ReactingCloud<BasicTrackedReactingParcel<ThermoType> >& owner, + const vector& position, + const label cellI, + const label typeId, + const scalar nParticle0, + const scalar d0, + const vector& U0, + const scalarField& Y0, + const typename + TrackedReactingParcel<BasicTrackedReactingParcel<ThermoType> >:: + constantProperties& constProps +) +: + TrackedReactingParcel<BasicTrackedReactingParcel<ThermoType> > + ( + owner, + position, + cellI, + typeId, + nParticle0, + d0, + U0, + Y0, + constProps + ) +{} + + +template<class ThermoType> +Foam::BasicTrackedReactingParcel<ThermoType>::BasicTrackedReactingParcel +( + const Cloud<BasicTrackedReactingParcel<ThermoType> >& cloud, + Istream& is, + bool readFields +) +: + TrackedReactingParcel<BasicTrackedReactingParcel<ThermoType> > + ( + cloud, + is, + readFields + ) +{} + + +template<class ThermoType> +Foam::BasicTrackedReactingParcel<ThermoType>::BasicTrackedReactingParcel +( + const BasicTrackedReactingParcel<ThermoType>& p +) +: + TrackedReactingParcel<BasicTrackedReactingParcel<ThermoType> >(p) +{} + + +// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // + +template<class ThermoType> +Foam::BasicTrackedReactingParcel<ThermoType>::~BasicTrackedReactingParcel() +{} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/BasicTrackedReactingParcel.H b/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/BasicTrackedReactingParcel.H new file mode 100644 index 0000000000000000000000000000000000000000..8c30301f9c2d5c88b3f0f105bc670b9bed161240 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/BasicTrackedReactingParcel.H @@ -0,0 +1,137 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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::BasicTrackedReactingParcel + +Description + + +SourceFiles + BasicTrackedReactingParcel.C + BasicTrackedReactingParcelIO.C + +\*---------------------------------------------------------------------------*/ + +#ifndef BasicTrackedReactingParcel_H +#define BasicTrackedReactingParcel_H + +#include "TrackedReactingParcel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +template<class ThermoType> +class BasicTrackedReactingParcel; + +/*---------------------------------------------------------------------------*\ + Class BasicTrackedReactingParcel Declaration +\*---------------------------------------------------------------------------*/ + +template<class ThermoType> +class BasicTrackedReactingParcel +: + public TrackedReactingParcel<BasicTrackedReactingParcel<ThermoType> > +{ + +public: + + //- The type of thermodynamics this parcel was instantiated for + typedef ThermoType thermoType; + + //- Run-time type information + TypeName("BasicTrackedReactingParcel"); + + // Constructors + + //- Construct from owner, position, and cloud owner + // Other properties initialised as null + BasicTrackedReactingParcel + ( + ReactingCloud<BasicTrackedReactingParcel>& owner, + const vector& position, + const label cellI + ); + + //- Construct from components + BasicTrackedReactingParcel + ( + ReactingCloud<BasicTrackedReactingParcel>& owner, + const vector& position, + const label cellI, + const label typeId, + const scalar nParticle0, + const scalar d0, + const vector& U0, + const scalarField& Y0, + const typename + TrackedReactingParcel<BasicTrackedReactingParcel>:: + constantProperties& constProps + ); + + //- Construct from Istream + BasicTrackedReactingParcel + ( + const Cloud<BasicTrackedReactingParcel>& c, + Istream& is, + bool readFields = true + ); + + //- Construct as a copy + BasicTrackedReactingParcel(const BasicTrackedReactingParcel& p); + + //- Construct and return a clone + autoPtr<BasicTrackedReactingParcel> clone() const + { + return + autoPtr<BasicTrackedReactingParcel> + ( + new BasicTrackedReactingParcel(*this) + ); + } + + + //- Destructor + virtual ~BasicTrackedReactingParcel(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "BasicTrackedReactingParcel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/defineTrackedReactingParcel.C b/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/defineTrackedReactingParcel.C new file mode 100644 index 0000000000000000000000000000000000000000..239ebccb3b451a6178984693820f21a66687fac1 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/defineTrackedReactingParcel.C @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "createTrackedReactingParcelTypes.H" +#include "BasicTrackedReactingParcel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + createTrackedReactingParcelType(BasicTrackedReactingParcel); +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelDragModels.C b/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/makeBasicTrackedReactingParcelSubmodels.C similarity index 54% rename from src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelDragModels.C rename to src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/makeBasicTrackedReactingParcelSubmodels.C index 0c43e221b1a42eeb12dd8f5afc8505dcb6626ff0..7d94a79bea88df99a17c5c945bacc614518895b4 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelDragModels.C +++ b/src/lagrangian/intermediate/parcels/derived/BasicTrackedReactingParcel/makeBasicTrackedReactingParcelSubmodels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,21 +24,39 @@ License \*---------------------------------------------------------------------------*/ -#include "basicReactingParcel.H" -#include "KinematicCloud.H" +#include "BasicTrackedReactingParcel.H" -#include "NoDrag.H" -#include "SphereDrag.H" +// Kinematic +#include "makeReactingParcelDispersionModels.H" +#include "makeReactingParcelDragModels.H" +#include "makeReactingParcelInjectionModels.H" +#include "makeReactingParcelPatchInteractionModels.H" +#include "makeReactingParcelPostProcessingModels.H" + +// Thermo +#include "makeReactingParcelHeatTransferModels.H" + +// Reacting +#include "makeReactingParcelCompositionModels.H" +#include "makeReactingParcelPhaseChangeModels.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeDragModel(KinematicCloud<basicReactingParcel>); - - // Add instances of drag model to the table - makeDragModelType(NoDrag, KinematicCloud, basicReactingParcel); - makeDragModelType(SphereDrag, KinematicCloud, basicReactingParcel); + // Kinematic sub-models + makeReactingDispersionModels(BasicTrackedReactingParcel); + makeReactingDragModels(BasicTrackedReactingParcel); + makeReactingInjectionModels(BasicTrackedReactingParcel); + makeReactingPatchInteractionModels(BasicTrackedReactingParcel); + makeReactingPostProcessingModels(BasicTrackedReactingParcel); + + // Thermo sub-models + makeReactingHeatTransferModels(BasicTrackedReactingParcel); + + // Reacting sub-models + makeReactingCompositionModels(BasicTrackedReactingParcel); + makeReactingPhaseChangeModels(BasicTrackedReactingParcel); }; diff --git a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/basicKinematicParcel.C b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/basicKinematicParcel.C index d207887826320ef12c6d724f9d52b150be3451dd..e7f883dcfdacd0c275f2bb7b7f8c942c1957e980 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/basicKinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/basicKinematicParcel.C @@ -38,6 +38,17 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +Foam::basicKinematicParcel::basicKinematicParcel +( + KinematicCloud<basicKinematicParcel>& owner, + const vector& position, + const label cellI +) +: + KinematicParcel<basicKinematicParcel>(owner, position, cellI) +{} + + Foam::basicKinematicParcel::basicKinematicParcel ( KinematicCloud<basicKinematicParcel>& owner, @@ -75,6 +86,15 @@ Foam::basicKinematicParcel::basicKinematicParcel {} +Foam::basicKinematicParcel::basicKinematicParcel +( + const basicKinematicParcel& p +) +: + KinematicParcel<basicKinematicParcel>(p) +{} + + // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // Foam::basicKinematicParcel::~basicKinematicParcel() diff --git a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/basicKinematicParcel.H b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/basicKinematicParcel.H index 0e5733870f2afc8ec47a9174c83c285ea69e5beb..18b43cbbadc5baa621870b145d8c22b32b8f050e 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/basicKinematicParcel.H +++ b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/basicKinematicParcel.H @@ -60,6 +60,15 @@ public: // Constructors + //- Construct from owner, position, and cloud owner + // Other properties initialised as null + basicKinematicParcel + ( + KinematicCloud<basicKinematicParcel>& owner, + const vector& position, + const label cellI + ); + //- Construct from components basicKinematicParcel ( @@ -81,11 +90,17 @@ public: bool readFields = true ); + //- Construct as a copy + basicKinematicParcel(const basicKinematicParcel& p); + //- Construct and return a clone autoPtr<basicKinematicParcel> clone() const { - return autoPtr<basicKinematicParcel> - (new basicKinematicParcel(*this)); + return + autoPtr<basicKinematicParcel> + ( + new basicKinematicParcel(*this) + ); } diff --git a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C index 82698ce0dfd1682ec94fecd6ef5447c1adcb6891..e7c1b578da4973a572b62987e48346ca2427152c 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C @@ -26,15 +26,17 @@ License #include "basicKinematicParcel.H" #include "KinematicCloud.H" +#include "makeParcelIOList.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -// defineTemplateTypeNameAndDebug(IOPosition<basicKinematicParcel>, 0); - defineTemplateTypeNameAndDebug(Cloud<basicKinematicParcel>, 0); defineParcelTypeNameAndDebug(KinematicCloud<basicKinematicParcel>, 0); -// defineTemplateTypeNameAndDebug(KinematicCloud<basicKinematicParcel>, 0); + + makeParcelIOList(basicKinematicParcel); }; diff --git a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/submodels/makeBasicKinematicParcelDragModels.C b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C similarity index 70% rename from src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/submodels/makeBasicKinematicParcelDragModels.C rename to src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C index 6b10e4efb0356ff4e8e1d200e26f760efcbbf95e..6aaa63f9c0614e9b462fba14bb5a96923051ce39 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/submodels/makeBasicKinematicParcelDragModels.C +++ b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,20 +25,24 @@ License \*---------------------------------------------------------------------------*/ #include "basicKinematicParcel.H" -#include "KinematicCloud.H" -#include "NoDrag.H" -#include "SphereDrag.H" +// Kinematic +#include "makeParcelDispersionModels.H" +#include "makeParcelDragModels.H" +#include "makeParcelInjectionModels.H" +#include "makeParcelPatchInteractionModels.H" +#include "makeParcelPostProcessingModels.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeDragModel(KinematicCloud<basicKinematicParcel>); - - // Add instances of drag model to the table - makeDragModelType(NoDrag, KinematicCloud, basicKinematicParcel); - makeDragModelType(SphereDrag, KinematicCloud, basicKinematicParcel); + // Kinematic sub-models + makeParcelDispersionModels(basicKinematicParcel); + makeParcelDragModels(basicKinematicParcel); + makeParcelInjectionModels(basicKinematicParcel); + makeParcelPatchInteractionModels(basicKinematicParcel); + makeParcelPostProcessingModels(basicKinematicParcel); }; diff --git a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/submodels/makeBasicKinematicParcelDispersionModels.C b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/submodels/makeBasicKinematicParcelDispersionModels.C deleted file mode 100644 index f6444b1252fe479922e8b867a0ef06bf6629de33..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/submodels/makeBasicKinematicParcelDispersionModels.C +++ /dev/null @@ -1,68 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicKinematicParcel.H" -#include "KinematicCloud.H" - -#include "NoDispersion.H" -#include "GradientDispersionRAS.H" -#include "StochasticDispersionRAS.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeDispersionModel(KinematicCloud<basicKinematicParcel>); - - defineNamedTemplateTypeNameAndDebug - ( - DispersionRASModel<KinematicCloud<basicKinematicParcel> >, - 0 - ); - - // Add instances of dispersion model to the table - makeDispersionModelType - ( - NoDispersion, - KinematicCloud, - basicKinematicParcel - ); - makeDispersionModelType - ( - GradientDispersionRAS, - KinematicCloud, - basicKinematicParcel - ); - makeDispersionModelType - ( - StochasticDispersionRAS, - KinematicCloud, - basicKinematicParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/submodels/makeBasicKinematicParcelInjectionModels.C b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/submodels/makeBasicKinematicParcelInjectionModels.C deleted file mode 100644 index 272ea3e06d261bf58e7246074e0b262caf98fb8f..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/submodels/makeBasicKinematicParcelInjectionModels.C +++ /dev/null @@ -1,69 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicKinematicParcel.H" -#include "KinematicCloud.H" - -#include "ConeInjection.H" -#include "FieldActivatedInjection.H" -#include "ManualInjection.H" -#include "NoInjection.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeInjectionModel(KinematicCloud<basicKinematicParcel>); - - // Add instances of injection model to the table - makeInjectionModelType - ( - ConeInjection, - KinematicCloud, - basicKinematicParcel - ); - makeInjectionModelType - ( - FieldActivatedInjection, - KinematicCloud, - basicKinematicParcel - ); - makeInjectionModelType - ( - ManualInjection, - KinematicCloud, - basicKinematicParcel - ); - makeInjectionModelType - ( - NoInjection, - KinematicCloud, - basicKinematicParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/submodels/makeBasicKinematicParcelWallInteractionModels.C b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/submodels/makeBasicKinematicParcelWallInteractionModels.C deleted file mode 100644 index 544cddaf2ad164fd975e392223ba9eda0a0ff541..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/submodels/makeBasicKinematicParcelWallInteractionModels.C +++ /dev/null @@ -1,55 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicKinematicParcel.H" -#include "KinematicCloud.H" - -#include "Rebound.H" -#include "StandardWallInteraction.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeWallInteractionModel(KinematicCloud<basicKinematicParcel>); - - // Add instances of wall interaction model to the table - makeWallInteractionModelType - ( - Rebound, - KinematicCloud, - basicKinematicParcel - ); - makeWallInteractionModelType - ( - StandardWallInteraction, - KinematicCloud, - basicKinematicParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C deleted file mode 100644 index 5278c5e0f5a27a944b69207ea4c543473016b80e..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C +++ /dev/null @@ -1,99 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicReactingMultiphaseParcel.H" -#include "ReactingMultiphaseCloud.H" - -namespace Foam -{ - defineTemplateTypeNameAndDebug(Cloud<basicReactingMultiphaseParcel>, 0); - - defineParcelTypeNameAndDebug - ( - KinematicParcel<basicReactingMultiphaseParcel>, - 0 - ); -// defineTemplateTypeNameAndDebug -// ( -// KinematicParcel<basicReactingMultiphaseParcel>, -// 0 -// ); - defineParcelTypeNameAndDebug - ( - ThermoParcel<basicReactingMultiphaseParcel>, - 0 - ); - defineTemplateTypeNameAndDebug - ( - ThermoParcel<basicReactingMultiphaseParcel>, - 0 - ); - defineParcelTypeNameAndDebug - ( - ReactingParcel<basicReactingMultiphaseParcel>, - 0 - ); - defineTemplateTypeNameAndDebug - ( - ReactingParcel<basicReactingMultiphaseParcel>, - 0 - ); - defineParcelTypeNameAndDebug - ( - ReactingMultiphaseParcel<basicReactingMultiphaseParcel>, - 0 - ); - defineTemplateTypeNameAndDebug - ( - ReactingMultiphaseParcel<basicReactingMultiphaseParcel>, - 0 - ); - - defineParcelTypeNameAndDebug - ( - KinematicCloud<basicReactingMultiphaseParcel>, - 0 - ); - defineParcelTypeNameAndDebug - ( - ThermoCloud<basicReactingMultiphaseParcel>, - 0 - ); - defineParcelTypeNameAndDebug - ( - ReactingCloud<basicReactingMultiphaseParcel>, - 0 - ); - defineParcelTypeNameAndDebug - ( - ReactingMultiphaseCloud<basicReactingMultiphaseParcel>, - 0 - ); - -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelDevolatilisationModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelDevolatilisationModels.C deleted file mode 100644 index 8704e48d801561ce3c543afc7e09d47090e50323..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelDevolatilisationModels.C +++ /dev/null @@ -1,65 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicReactingMultiphaseParcel.H" -#include "ReactingMultiphaseCloud.H" - -#include "NoDevolatilisation.H" -#include "ConstantRateDevolatilisation.H" -#include "SingleKineticRateDevolatilisation.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeDevolatilisationModel - ( - ReactingMultiphaseCloud<basicReactingMultiphaseParcel> - ); - - // Add instances of devolatilisation model to the table - makeDevolatilisationModelType - ( - NoDevolatilisation, - ReactingMultiphaseCloud, - basicReactingMultiphaseParcel - ); - makeDevolatilisationModelType - ( - ConstantRateDevolatilisation, - ReactingMultiphaseCloud, - basicReactingMultiphaseParcel - ); - makeDevolatilisationModelType - ( - SingleKineticRateDevolatilisation, - ReactingMultiphaseCloud, - basicReactingMultiphaseParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelHeatTransferModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelHeatTransferModels.C deleted file mode 100644 index f501421d8bb869808909eb53cad995167a36543f..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelHeatTransferModels.C +++ /dev/null @@ -1,55 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicReactingMultiphaseParcel.H" -#include "ThermoCloud.H" - -#include "NoHeatTransfer.H" -#include "RanzMarshall.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeHeatTransferModel(ThermoCloud<basicReactingMultiphaseParcel>); - - // Add instances of heat transfer model to the table - makeHeatTransferModelType - ( - NoHeatTransfer, - ThermoCloud, - basicReactingMultiphaseParcel - ); - makeHeatTransferModelType - ( - RanzMarshall, - ThermoCloud, - basicReactingMultiphaseParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelInjectionModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelInjectionModels.C deleted file mode 100644 index 6b427ae7c2427bd5edb50d76734d3b0124c25a95..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelInjectionModels.C +++ /dev/null @@ -1,69 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicReactingMultiphaseParcel.H" -#include "ReactingCloud.H" - -#include "ConeInjection.H" -#include "FieldActivatedInjection.H" -#include "ManualInjection.H" -#include "NoInjection.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeInjectionModel(KinematicCloud<basicReactingMultiphaseParcel>); - - // Add instances of injection model to the table - makeInjectionModelType - ( - ConeInjection, - KinematicCloud, - basicReactingMultiphaseParcel - ); - makeInjectionModelType - ( - FieldActivatedInjection, - KinematicCloud, - basicReactingMultiphaseParcel - ); - makeInjectionModelType - ( - ManualInjection, - KinematicCloud, - basicReactingMultiphaseParcel - ); - makeInjectionModelType - ( - NoInjection, - KinematicCloud, - basicReactingMultiphaseParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelPhaseChangeModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelPhaseChangeModels.C deleted file mode 100644 index 99e9dfb89ba8eec740fd62e73fc72616fd62305b..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelPhaseChangeModels.C +++ /dev/null @@ -1,58 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicReactingMultiphaseParcel.H" -#include "ReactingCloud.H" - -#include "NoPhaseChange.H" -#include "LiquidEvaporation.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makePhaseChangeModel - ( - ReactingCloud<basicReactingMultiphaseParcel> - ); - - // Add instances of phase change model to the table - makePhaseChangeModelType - ( - NoPhaseChange, - ReactingCloud, - basicReactingMultiphaseParcel - ); - makePhaseChangeModelType - ( - LiquidEvaporation, - ReactingCloud, - basicReactingMultiphaseParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelWallInteractionModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelWallInteractionModels.C deleted file mode 100644 index 3e7d911f8f3fd5c1fe20c18dc94554967736fdb0..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelWallInteractionModels.C +++ /dev/null @@ -1,55 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicReactingMultiphaseParcel.H" -#include "KinematicCloud.H" - -#include "Rebound.H" -#include "StandardWallInteraction.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeWallInteractionModel(KinematicCloud<basicReactingMultiphaseParcel>); - - // Add instances of wall interaction model to the table - makeWallInteractionModelType - ( - Rebound, - KinematicCloud, - basicReactingMultiphaseParcel - ); - makeWallInteractionModelType - ( - StandardWallInteraction, - KinematicCloud, - basicReactingMultiphaseParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C deleted file mode 100644 index 5c45881ccf773ea0a287385acc024160d90dcacf..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C +++ /dev/null @@ -1,53 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicReactingParcel.H" -#include "ReactingCloud.H" - -namespace Foam -{ - defineTemplateTypeNameAndDebug(Cloud<basicReactingParcel>, 0); - - defineParcelTypeNameAndDebug(KinematicParcel<basicReactingParcel>, 0); -// defineTemplateTypeNameAndDebug(KinematicParcel<basicReactingParcel>, 0); - defineParcelTypeNameAndDebug(ThermoParcel<basicReactingParcel>, 0); - defineTemplateTypeNameAndDebug(ThermoParcel<basicReactingParcel>, 0); - defineParcelTypeNameAndDebug(ReactingParcel<basicReactingParcel>, 0); - defineTemplateTypeNameAndDebug(ReactingParcel<basicReactingParcel>, 0); - - defineParcelTypeNameAndDebug(KinematicCloud<basicReactingParcel>, 0); -// defineTemplateTypeNameAndDebug(KinematicCloud<basicReactingParcel>, 0); - - defineParcelTypeNameAndDebug(ThermoCloud<basicReactingParcel>, 0); -// defineTemplateTypeNameAndDebug(ThermoCloud<basicReactingParcel>, 0); - - defineParcelTypeNameAndDebug(ReactingCloud<basicReactingParcel>, 0); -// defineTemplateTypeNameAndDebug(ReactingCloud<basicReactingParcel>, 0); - -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelDispersionModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelDispersionModels.C deleted file mode 100644 index d2b6132bcaa1d945630db56ed4d49c2c952433ae..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelDispersionModels.C +++ /dev/null @@ -1,68 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicReactingParcel.H" -#include "KinematicCloud.H" - -#include "NoDispersion.H" -#include "GradientDispersionRAS.H" -#include "StochasticDispersionRAS.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeDispersionModel(KinematicCloud<basicReactingParcel>); - - defineNamedTemplateTypeNameAndDebug - ( - DispersionRASModel<KinematicCloud<basicReactingParcel> >, - 0 - ); - - // Add instances of dispersion model to the table - makeDispersionModelType - ( - NoDispersion, - KinematicCloud, - basicReactingParcel - ); - makeDispersionModelType - ( - GradientDispersionRAS, - KinematicCloud, - basicReactingParcel - ); - makeDispersionModelType - ( - StochasticDispersionRAS, - KinematicCloud, - basicReactingParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelHeatTransferModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelHeatTransferModels.C deleted file mode 100644 index 5bc2ea33a89138eae638d916392690bb8ba1b1b3..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelHeatTransferModels.C +++ /dev/null @@ -1,55 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicReactingParcel.H" -#include "ThermoCloud.H" - -#include "NoHeatTransfer.H" -#include "RanzMarshall.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeHeatTransferModel(ThermoCloud<basicReactingParcel>); - - // Add instances of heat transfer model to the table - makeHeatTransferModelType - ( - NoHeatTransfer, - ThermoCloud, - basicReactingParcel - ); - makeHeatTransferModelType - ( - RanzMarshall, - ThermoCloud, - basicReactingParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelInjectionModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelInjectionModels.C deleted file mode 100644 index 4ed4e7894ae31e63d9ba040af2a6130ed18f528b..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelInjectionModels.C +++ /dev/null @@ -1,69 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicReactingParcel.H" -#include "ReactingCloud.H" - -#include "ConeInjection.H" -#include "FieldActivatedInjection.H" -#include "ManualInjection.H" -#include "NoInjection.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeInjectionModel(KinematicCloud<basicReactingParcel>); - - // Add instances of injection model to the table - makeInjectionModelType - ( - ConeInjection, - KinematicCloud, - basicReactingParcel - ); - makeInjectionModelType - ( - FieldActivatedInjection, - KinematicCloud, - basicReactingParcel - ); - makeInjectionModelType - ( - ManualInjection, - KinematicCloud, - basicReactingParcel - ); - makeInjectionModelType - ( - NoInjection, - KinematicCloud, - basicReactingParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelPhaseChangeModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelPhaseChangeModels.C deleted file mode 100644 index f8ce035ada1133bee9bed0f3517eeb6b6b9202a1..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelPhaseChangeModels.C +++ /dev/null @@ -1,55 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicReactingParcel.H" -#include "ReactingCloud.H" - -#include "NoPhaseChange.H" -#include "LiquidEvaporation.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makePhaseChangeModel(ReactingCloud<basicReactingParcel>); - - // Add instances of phase change model to the table - makePhaseChangeModelType - ( - NoPhaseChange, - ReactingCloud, - basicReactingParcel - ); - makePhaseChangeModelType - ( - LiquidEvaporation, - ReactingCloud, - basicReactingParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelWallInteractionModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelWallInteractionModels.C deleted file mode 100644 index 637fd92aaede265680644ad8224f85f9d4528286..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/submodels/makeBasicReactingParcelWallInteractionModels.C +++ /dev/null @@ -1,55 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicReactingParcel.H" -#include "KinematicCloud.H" - -#include "Rebound.H" -#include "StandardWallInteraction.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeWallInteractionModel(KinematicCloud<basicReactingParcel>); - - // Add instances of wall interaction model to the table - makeWallInteractionModelType - ( - Rebound, - KinematicCloud, - basicReactingParcel - ); - makeWallInteractionModelType - ( - StandardWallInteraction, - KinematicCloud, - basicReactingParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/basicThermoParcel.C b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/basicThermoParcel.C index 095b217aca799ecb700f0f6e2538e0d9c7a52976..7f2524cbd282cfb8d9543c069d22b07db8add93b 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/basicThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/basicThermoParcel.C @@ -38,6 +38,17 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +Foam::basicThermoParcel::basicThermoParcel +( + ThermoCloud<basicThermoParcel>& owner, + const vector position, + const label cellI +) +: + ThermoParcel<basicThermoParcel>(owner, position, cellI) +{} + + Foam::basicThermoParcel::basicThermoParcel ( ThermoCloud<basicThermoParcel>& owner, @@ -75,6 +86,15 @@ Foam::basicThermoParcel::basicThermoParcel {} +Foam::basicThermoParcel::basicThermoParcel +( + const basicThermoParcel& p +) +: + ThermoParcel<basicThermoParcel>(p) +{} + + // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // Foam::basicThermoParcel::~basicThermoParcel() diff --git a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/basicThermoParcel.H b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/basicThermoParcel.H index ec74d2add8ae675110efcafd9a84a8f8acff7044..974c36e23a96f51bb57d3009fea0a1951fbf331e 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/basicThermoParcel.H +++ b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/basicThermoParcel.H @@ -59,6 +59,15 @@ public: // Constructors + //- Construct from owner, position, and cloud owner + // Other properties initialised as null + basicThermoParcel + ( + ThermoCloud<basicThermoParcel>& owner, + const vector position, + const label cellI + ); + //- Construct from components basicThermoParcel ( @@ -80,10 +89,17 @@ public: bool readFields = true ); + //- Construct as a copy + basicThermoParcel(const basicThermoParcel& p); + //- Construct and return a clone autoPtr<basicThermoParcel> clone() const { - return autoPtr<basicThermoParcel>(new basicThermoParcel(*this)); + return + autoPtr<basicThermoParcel> + ( + new basicThermoParcel(*this) + ); } diff --git a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C index ba76c4675628d835618cb695e419defbe6103cf8..2e67f54e815ab2e3e296126edae8ccd005471e2c 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,21 +26,23 @@ License #include "basicThermoParcel.H" #include "ThermoCloud.H" +#include "makeParcelIOList.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { defineTemplateTypeNameAndDebug(Cloud<basicThermoParcel>, 0); defineParcelTypeNameAndDebug(KinematicParcel<basicThermoParcel>, 0); -// defineTemplateTypeNameAndDebug(KinematicParcel<basicThermoParcel>, 0); defineParcelTypeNameAndDebug(ThermoParcel<basicThermoParcel>, 0); defineTemplateTypeNameAndDebug(ThermoParcel<basicThermoParcel>, 0); defineParcelTypeNameAndDebug(KinematicCloud<basicThermoParcel>, 0); -// defineTemplateTypeNameAndDebug(KinematicCloud<basicThermoParcel>, 0); defineParcelTypeNameAndDebug(ThermoCloud<basicThermoParcel>, 0); -// defineTemplateTypeNameAndDebug(ThermoCloud<basicThermoParcel>, 0); + + makeParcelIOList(basicThermoParcel); }; diff --git a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/submodels/makeBasicThermoParcelWallInteractionModels.C b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/makeBasicThermoParcelSubmodels.C similarity index 66% rename from src/lagrangian/intermediate/parcels/derived/basicThermoParcel/submodels/makeBasicThermoParcelWallInteractionModels.C rename to src/lagrangian/intermediate/parcels/derived/basicThermoParcel/makeBasicThermoParcelSubmodels.C index 361ffffdb10e8f21a636c54ca694e65054debe6e..044d8db68ed797c97f9b181bdec78326a1ee9656 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/submodels/makeBasicThermoParcelWallInteractionModels.C +++ b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/makeBasicThermoParcelSubmodels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,29 +25,30 @@ License \*---------------------------------------------------------------------------*/ #include "basicThermoParcel.H" -#include "KinematicCloud.H" -#include "Rebound.H" -#include "StandardWallInteraction.H" + +// Kinematic +#include "makeParcelDispersionModels.H" +#include "makeParcelDragModels.H" +#include "makeParcelInjectionModels.H" +#include "makeParcelPatchInteractionModels.H" +#include "makeParcelPostProcessingModels.H" + +// Thermodynamic +#include "makeParcelHeatTransferModels.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - makeWallInteractionModel(KinematicCloud<basicThermoParcel>); - - // Add instances of wall interaction model to the table - makeWallInteractionModelType - ( - Rebound, - KinematicCloud, - basicThermoParcel - ); - makeWallInteractionModelType - ( - StandardWallInteraction, - KinematicCloud, - basicThermoParcel - ); + // Kinematic sub-models + makeParcelDispersionModels(basicThermoParcel); + makeParcelDragModels(basicThermoParcel); + makeParcelInjectionModels(basicThermoParcel); + makeParcelPatchInteractionModels(basicThermoParcel); + makeParcelPostProcessingModels(basicThermoParcel); + + // Thermo sub-models + makeParcelHeatTransferModels(basicThermoParcel); }; diff --git a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/submodels/makeBasicThermoParcelDispersionModels.C b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/submodels/makeBasicThermoParcelDispersionModels.C deleted file mode 100644 index 86bc63c72a7626294862f46bf281dd0848d37225..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/submodels/makeBasicThermoParcelDispersionModels.C +++ /dev/null @@ -1,67 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicThermoParcel.H" -#include "KinematicCloud.H" -#include "NoDispersion.H" -#include "GradientDispersionRAS.H" -#include "StochasticDispersionRAS.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeDispersionModel(KinematicCloud<basicThermoParcel>); - - defineNamedTemplateTypeNameAndDebug - ( - DispersionRASModel<KinematicCloud<basicThermoParcel> >, - 0 - ); - - // Add instances of dispersion model to the table - makeDispersionModelType - ( - NoDispersion, - KinematicCloud, - basicThermoParcel - ); - makeDispersionModelType - ( - GradientDispersionRAS, - KinematicCloud, - basicThermoParcel - ); - makeDispersionModelType - ( - StochasticDispersionRAS, - KinematicCloud, - basicThermoParcel - ); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/submodels/makeBasicThermoParcelHeatTransferModels.C b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/submodels/makeBasicThermoParcelHeatTransferModels.C deleted file mode 100644 index afb3ae0833ba89d779c0ee14ba7c0d4544545f99..0000000000000000000000000000000000000000 --- a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/submodels/makeBasicThermoParcelHeatTransferModels.C +++ /dev/null @@ -1,44 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-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 "basicThermoParcel.H" -#include "ThermoCloud.H" -#include "NoHeatTransfer.H" -#include "RanzMarshall.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makeHeatTransferModel(ThermoCloud<basicThermoParcel>); - - // Add instances of heat transfer model to the table - makeHeatTransferModelType(NoHeatTransfer, ThermoCloud, basicThermoParcel); - makeHeatTransferModelType(RanzMarshall, ThermoCloud, basicThermoParcel); -}; - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/createReactingMultiphaseParcelTypes.H b/src/lagrangian/intermediate/parcels/include/createReactingMultiphaseParcelTypes.H new file mode 100644 index 0000000000000000000000000000000000000000..9c1a6baf61e35a2e757f1f321c4dbd2551863788 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/createReactingMultiphaseParcelTypes.H @@ -0,0 +1,94 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef createReactingMultiphaseParcelTypes_H +#define createReactingMultiphaseParcelTypes_H + +#include "makeParcelIOList.H" +#include "reactingThermoTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define createReactingMultiphaseParcelType(ParcelType) \ + \ + createReactingMultiphaseParcelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + createReactingMultiphaseParcelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define createReactingMultiphaseParcelThermoType(ParcelType, ThermoType) \ + \ + typedef ParcelType<ThermoType> ParcelType##ThermoType; \ + \ + makeParcelIOList(ParcelType##ThermoType); \ + \ + defineTemplateTypeNameAndDebug(ParcelType##ThermoType, 0); \ + defineTemplateTypeNameAndDebug(Particle<ParcelType##ThermoType>, 0); \ + defineTemplateTypeNameAndDebug(Cloud<ParcelType##ThermoType>, 0); \ + \ + defineParcelTypeNameAndDebug(KinematicParcel<ParcelType##ThermoType>, 0); \ + defineTemplateTypeNameAndDebug \ + ( \ + KinematicParcel<ParcelType##ThermoType>, \ + 0 \ + ); \ + defineParcelTypeNameAndDebug(ThermoParcel<ParcelType##ThermoType>, 0); \ + defineTemplateTypeNameAndDebug(ThermoParcel<ParcelType##ThermoType>, 0); \ + defineParcelTypeNameAndDebug(ReactingParcel<ParcelType##ThermoType>, 0); \ + defineTemplateTypeNameAndDebug(ReactingParcel<ParcelType##ThermoType>, 0);\ + defineParcelTypeNameAndDebug \ + ( \ + ReactingMultiphaseParcel<ParcelType##ThermoType>, \ + 0 \ + ); \ + defineTemplateTypeNameAndDebug \ + ( \ + ReactingMultiphaseParcel<ParcelType##ThermoType>, \ + 0 \ + ); \ + \ + defineParcelTypeNameAndDebug(KinematicCloud<ParcelType##ThermoType>, 0); \ + defineParcelTypeNameAndDebug(ThermoCloud<ParcelType##ThermoType>, 0); \ + defineParcelTypeNameAndDebug(ReactingCloud<ParcelType##ThermoType>, 0); \ + defineParcelTypeNameAndDebug \ + ( \ + ReactingMultiphaseCloud<ParcelType##ThermoType>, \ + 0 \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/createReactingParcelTypes.H b/src/lagrangian/intermediate/parcels/include/createReactingParcelTypes.H new file mode 100644 index 0000000000000000000000000000000000000000..78bdf1aae4de76d7ef1ce00acbae73a5548ba78b --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/createReactingParcelTypes.H @@ -0,0 +1,71 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef createReactingParcelTypes_H +#define createReactingParcelTypes_H + +#include "makeParcelIOList.H" +#include "reactingThermoTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define createReactingParcelType(ParcelType) \ + \ + createReactingParcelThermoType(ParcelType, specieConstProperties); \ + createReactingParcelThermoType(ParcelType, specieReactingProperties); + + +#define createReactingParcelThermoType(ParcelType, ThermoType) \ + \ + typedef ParcelType<ThermoType> ParcelType##ThermoType; \ + \ + makeParcelIOList(ParcelType##ThermoType); \ + \ + defineTemplateTypeNameAndDebug(ParcelType##ThermoType, 0); \ + defineTemplateTypeNameAndDebug(Particle<ParcelType##ThermoType>, 0); \ + defineTemplateTypeNameAndDebug(Cloud<ParcelType##ThermoType>, 0); \ + \ + defineParcelTypeNameAndDebug(KinematicParcel<ParcelType##ThermoType>, 0); \ + defineTemplateTypeNameAndDebug \ + ( \ + KinematicParcel<ParcelType##ThermoType>, \ + 0 \ + ); \ + defineParcelTypeNameAndDebug(ThermoParcel<ParcelType##ThermoType>, 0); \ + defineTemplateTypeNameAndDebug(ThermoParcel<ParcelType##ThermoType>, 0); \ + defineParcelTypeNameAndDebug(ReactingParcel<ParcelType##ThermoType>, 0); \ + defineTemplateTypeNameAndDebug(ReactingParcel<ParcelType##ThermoType>, 0);\ + \ + defineParcelTypeNameAndDebug(KinematicCloud<ParcelType##ThermoType>, 0); \ + defineParcelTypeNameAndDebug(ThermoCloud<ParcelType##ThermoType>, 0); \ + defineParcelTypeNameAndDebug(ReactingCloud<ParcelType##ThermoType>, 0); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/createTrackedReactingParcelTypes.H b/src/lagrangian/intermediate/parcels/include/createTrackedReactingParcelTypes.H new file mode 100644 index 0000000000000000000000000000000000000000..fb357cb7c8b61a678e08141edc3e8d02084b2868 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/createTrackedReactingParcelTypes.H @@ -0,0 +1,70 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef createTrackedReactingParcelTypes_H +#define createTrackedReactingParcelTypes_H + +#include "createReactingParcelTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define createTrackedReactingParcelType(ParcelType) \ + \ + createTrackedReactingParcelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + createTrackedReactingParcelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define createTrackedReactingParcelThermoType(ParcelType, ThermoType) \ + \ + createReactingParcelThermoType(ParcelType, ThermoType); \ + \ + typedef ParcelType<ThermoType> ParcelType##ThermoType; \ + \ + defineParcelTypeNameAndDebug \ + ( \ + TrackedReactingParcel<ParcelType##ThermoType>, \ + 0 \ + ); \ + defineTemplateTypeNameAndDebug \ + ( \ + TrackedReactingParcel<ParcelType##ThermoType>, \ + 0 \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelDispersionModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelDispersionModels.H new file mode 100644 index 0000000000000000000000000000000000000000..4763688f5205dd39241b779c1ad47738c12318c8 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeParcelDispersionModels.H @@ -0,0 +1,74 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeParcelDispersionModels_h +#define makeParcelDispersionModels_h + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "KinematicCloud.H" + +#include "NoDispersion.H" +#include "GradientDispersionRAS.H" +#include "StochasticDispersionRAS.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeParcelDispersionModels(ParcelType) \ + \ + makeDispersionModel(KinematicCloud<ParcelType>); \ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + DispersionRASModel<KinematicCloud<ParcelType> >, \ + 0 \ + ); \ + \ + makeDispersionModelType \ + ( \ + NoDispersion, \ + KinematicCloud, \ + ParcelType \ + ); \ + makeDispersionModelType \ + ( \ + GradientDispersionRAS, \ + KinematicCloud, \ + ParcelType \ + ); \ + makeDispersionModelType \ + ( \ + StochasticDispersionRAS, \ + KinematicCloud, \ + ParcelType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelDragModels.C b/src/lagrangian/intermediate/parcels/include/makeParcelDragModels.H similarity index 64% rename from src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelDragModels.C rename to src/lagrangian/intermediate/parcels/include/makeParcelDragModels.H index 5e56985952fa0a004e1b4d7d38a1cebe9445ec76..0d47aaf2393bd880b63e3cdbeafb4fdfa12e952a 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/submodels/makeBasicReactingMultiphaseParcelDragModels.C +++ b/src/lagrangian/intermediate/parcels/include/makeParcelDragModels.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,11 @@ License \*---------------------------------------------------------------------------*/ -#include "basicReactingMultiphaseParcel.H" +#ifndef makeParcelDragModels_H +#define makeParcelDragModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #include "KinematicCloud.H" #include "NoDrag.H" @@ -32,19 +36,16 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - makeDragModel(KinematicCloud<basicReactingMultiphaseParcel>); +#define makeParcelDragModels(ParcelType) \ + \ + makeDragModel(KinematicCloud<ParcelType>); \ + \ + makeDragModelType(NoDrag, KinematicCloud, ParcelType); \ + makeDragModelType(SphereDrag, KinematicCloud, ParcelType); - // Add instances of drag model to the table - makeDragModelType(NoDrag, KinematicCloud, basicReactingMultiphaseParcel); - makeDragModelType - ( - SphereDrag, - KinematicCloud, - basicReactingMultiphaseParcel - ); -}; +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelHeatTransferModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelHeatTransferModels.H new file mode 100644 index 0000000000000000000000000000000000000000..a2ce1942020b529d3ec1c651296ae8bc53ebeead --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeParcelHeatTransferModels.H @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeParcelHeatTransferModels_H +#define makeParcelHeatTransferModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "ThermoCloud.H" + +#include "NoHeatTransfer.H" +#include "RanzMarshall.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeParcelHeatTransferModels(ParcelType) \ + \ + makeHeatTransferModel(ThermoCloud<ParcelType>); \ + \ + makeHeatTransferModelType \ + ( \ + NoHeatTransfer, \ + ThermoCloud, \ + ParcelType \ + ); \ + makeHeatTransferModelType \ + ( \ + RanzMarshall, \ + ThermoCloud, \ + ParcelType \ + ); \ + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelInjectionModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelInjectionModels.H new file mode 100644 index 0000000000000000000000000000000000000000..5483f56f6191e586f9284bb7aa0c10cd99630a44 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeParcelInjectionModels.H @@ -0,0 +1,89 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeParcelInjectionModels_H +#define makeParcelInjectionModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "KinematicCloud.H" + +#include "ConeInjection.H" +#include "ConeInjectionMP.H" +#include "FieldActivatedInjection.H" +#include "KinematicLookupTableInjection.H" +#include "ManualInjection.H" +#include "NoInjection.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeParcelInjectionModels(ParcelType) \ + \ + makeInjectionModel(KinematicCloud<ParcelType>); \ + \ + makeInjectionModelType \ + ( \ + ConeInjection, \ + KinematicCloud, \ + ParcelType \ + ); \ + makeInjectionModelType \ + ( \ + ConeInjectionMP, \ + KinematicCloud, \ + ParcelType \ + ); \ + makeInjectionModelType \ + ( \ + FieldActivatedInjection, \ + KinematicCloud, \ + ParcelType \ + ); \ + makeInjectionModelType \ + ( \ + KinematicLookupTableInjection, \ + KinematicCloud, \ + ParcelType \ + ); \ + makeInjectionModelType \ + ( \ + ManualInjection, \ + KinematicCloud, \ + ParcelType \ + ); \ + makeInjectionModelType \ + ( \ + NoInjection, \ + KinematicCloud, \ + ParcelType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelPatchInteractionModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelPatchInteractionModels.H new file mode 100644 index 0000000000000000000000000000000000000000..f3141b67d3eb99584852a8830c2fb3968ae7c51b --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeParcelPatchInteractionModels.H @@ -0,0 +1,68 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeParcelPatchInteractionModels_H +#define makeParcelPatchInteractionModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "KinematicCloud.H" + +#include "LocalInteraction.H" +#include "Rebound.H" +#include "StandardWallInteraction.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeParcelPatchInteractionModels(ParcelType) \ + \ + makePatchInteractionModel(KinematicCloud<ParcelType>); \ + \ + makePatchInteractionModelType \ + ( \ + LocalInteraction, \ + KinematicCloud, \ + ParcelType \ + ); \ + makePatchInteractionModelType \ + ( \ + Rebound, \ + KinematicCloud, \ + ParcelType \ + ); \ + makePatchInteractionModelType \ + ( \ + StandardWallInteraction, \ + KinematicCloud, \ + ParcelType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelPostProcessingModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelPostProcessingModels.H new file mode 100644 index 0000000000000000000000000000000000000000..51aa8e2a53c07127d0b6ba4e902ca29cda84eae4 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeParcelPostProcessingModels.H @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeParcelPostProcessingModels_H +#define makeParcelPostProcessingModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "KinematicCloud.H" + +#include "NoPostProcessing.H" +#include "PatchPostProcessing.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeParcelPostProcessingModels(ParcelType) \ + \ + makePostProcessingModel(KinematicCloud<ParcelType>); \ + \ + makePostProcessingModelType \ + ( \ + NoPostProcessing, \ + KinematicCloud, \ + ParcelType \ + ); \ + makePostProcessingModelType \ + ( \ + PatchPostProcessing, \ + KinematicCloud, \ + ParcelType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelCompositionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelCompositionModels.H new file mode 100644 index 0000000000000000000000000000000000000000..654582e3c1d256a7f9bbb31e3dd8e2f024fad1de --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelCompositionModels.H @@ -0,0 +1,70 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactingMultiphaseParcelCompositionModels_H +#define makeReactingMultiphaseParcelCompositionModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "reactingThermoTypes.H" +#include "ReactingCloud.H" + +#include "SingleMixtureFraction.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReactingMultiphaseCompositionModels(ParcelType) \ + \ + makeReactingMultiphaseCompositionModelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + makeReactingMultiphaseCompositionModelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define makeReactingMultiphaseCompositionModelThermoType(ParcelType, ThermoType)\ + \ + makeCompositionModel(ReactingCloud<ParcelType<ThermoType> >); \ + \ + makeCompositionModelThermoType \ + ( \ + SingleMixtureFraction, \ + ReactingCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelDevolatilisationModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelDevolatilisationModels.H new file mode 100644 index 0000000000000000000000000000000000000000..85e9192a59ca84bcf14cea726c01566b60aa2d05 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelDevolatilisationModels.H @@ -0,0 +1,89 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactingMultiphaseParcelDevolatilisationModels_H +#define makeReactingMultiphaseParcelDevolatilisationModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "reactingThermoTypes.H" +#include "ReactingMultiphaseCloud.H" + +#include "ConstantRateDevolatilisation.H" +#include "NoDevolatilisation.H" +#include "SingleKineticRateDevolatilisation.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReactingMultiphaseDevolatilisationModels(ParcelType) \ + \ + makeReactingMultiphaseDevolatilisationModelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + makeReactingMultiphaseDevolatilisationModelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define makeReactingMultiphaseDevolatilisationModelThermoType(ParcelType, ThermoType)\ + \ + makeDevolatilisationModel \ + ( \ + ReactingMultiphaseCloud<ParcelType<ThermoType> > \ + ); \ + \ + makeDevolatilisationModelThermoType \ + ( \ + ConstantRateDevolatilisation, \ + ReactingMultiphaseCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeDevolatilisationModelThermoType \ + ( \ + NoDevolatilisation, \ + ReactingMultiphaseCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeDevolatilisationModelThermoType \ + ( \ + SingleKineticRateDevolatilisation, \ + ReactingMultiphaseCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H new file mode 100644 index 0000000000000000000000000000000000000000..fe7a669d7e9f3303dc8098e102c987b66739add1 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H @@ -0,0 +1,103 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactingMultiphaseParcelInjectionModels_H +#define makeReactingMultiphaseParcelInjectionModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "reactingThermoTypes.H" +#include "KinematicCloud.H" + +#include "ConeInjection.H" +#include "ConeInjectionMP.H" +#include "FieldActivatedInjection.H" +#include "ManualInjection.H" +#include "NoInjection.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReactingMultiphaseInjectionModels(ParcelType) \ + \ + makeReactingMultiphaseInjectionModelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + \ + makeReactingMultiphaseInjectionModelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define makeReactingMultiphaseInjectionModelThermoType(ParcelType, ThermoType)\ + \ + makeInjectionModel(KinematicCloud<ParcelType<ThermoType> >); \ + \ + makeInjectionModelThermoType \ + ( \ + ConeInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + ConeInjectionMP, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + FieldActivatedInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + ManualInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + NoInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceReactionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceReactionModels.H new file mode 100644 index 0000000000000000000000000000000000000000..d85a073dde6f0c1a53098952abca716addef4ffa --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceReactionModels.H @@ -0,0 +1,73 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactingMultiphaseParcelSurfaceReactionModels_H +#define makeReactingMultiphaseParcelSurfaceReactionModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "reactingThermoTypes.H" +#include "ReactingMultiphaseCloud.H" + +#include "NoSurfaceReaction.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReactingMultiphaseSurfaceReactionModels(ParcelType) \ + \ + makeReactingMultiphaseSurfaceReactionModelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + makeReactingMultiphaseSurfaceReactionModelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define makeReactingMultiphaseSurfaceReactionModelThermoType(ParcelType, ThermoType)\ + \ + makeSurfaceReactionModel \ + ( \ + ReactingMultiphaseCloud<ParcelType<ThermoType> > \ + ); \ + \ + makeSurfaceReactionModelThermoType \ + ( \ + NoSurfaceReaction, \ + ReactingMultiphaseCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelCompositionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelCompositionModels.H new file mode 100644 index 0000000000000000000000000000000000000000..475095871f85befcfef55dfe451bcba5626e31ab --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelCompositionModels.H @@ -0,0 +1,70 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactingParcelCompositionModels_H +#define makeReactingParcelCompositionModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "reactingThermoTypes.H" +#include "ReactingCloud.H" + +#include "SinglePhaseMixture.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReactingCompositionModels(ParcelType) \ + \ + makeReactingCompositionModelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + makeReactingCompositionModelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define makeReactingCompositionModelThermoType(ParcelType, ThermoType) \ + \ + makeCompositionModel(ReactingCloud<ParcelType<ThermoType> >); \ + \ + makeCompositionModelThermoType \ + ( \ + SinglePhaseMixture, \ + ReactingCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelDispersionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelDispersionModels.H new file mode 100644 index 0000000000000000000000000000000000000000..534e85e190dfded6671c5736663f5373ced5dbdb --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelDispersionModels.H @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactingParcelDispersionModels_H +#define makeReactingParcelDispersionModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "reactingThermoTypes.H" +#include "KinematicCloud.H" + +#include "NoDispersion.H" +#include "GradientDispersionRAS.H" +#include "StochasticDispersionRAS.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReactingDispersionModels(ParcelType) \ + \ + makeReactingDispersionModelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + \ + makeReactingDispersionModelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define makeReactingDispersionModelThermoType(ParcelType, ThermoType) \ + \ + makeDispersionModel(KinematicCloud<ParcelType<ThermoType> >); \ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + DispersionRASModel<KinematicCloud<ParcelType<ThermoType> > >, \ + 0 \ + ); \ + \ + makeDispersionModelThermoType \ + ( \ + NoDispersion, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeDispersionModelThermoType \ + ( \ + GradientDispersionRAS, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeDispersionModelThermoType \ + ( \ + StochasticDispersionRAS, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelDragModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelDragModels.H new file mode 100644 index 0000000000000000000000000000000000000000..545995ec4d86849b73c951f6273750d9b92b9179 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelDragModels.H @@ -0,0 +1,78 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactingParcelDragModels_H +#define makeReactingParcelDragModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "reactingThermoTypes.H" +#include "KinematicCloud.H" + +#include "NoDrag.H" +#include "SphereDrag.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReactingDragModels(ParcelType) \ + \ + makeReactingDragModelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + makeReactingDragModelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define makeReactingDragModelThermoType(ParcelType, ThermoType) \ + \ + makeDragModel(KinematicCloud<ParcelType<ThermoType> >); \ + \ + makeDragModelThermoType \ + ( \ + NoDrag, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeDragModelThermoType \ + ( \ + SphereDrag, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H new file mode 100644 index 0000000000000000000000000000000000000000..02290b68c260f9796f67f58dc13a0e7c0dce0510 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H @@ -0,0 +1,78 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactingParcelHeatTransferModels_H +#define makeReactingParcelHeatTransferModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "reactingThermoTypes.H" +#include "ThermoCloud.H" + +#include "NoHeatTransfer.H" +#include "RanzMarshall.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReactingHeatTransferModels(ParcelType) \ + \ + makeReactingHeatTransferModelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + makeReactingHeatTransferModelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define makeReactingHeatTransferModelThermoType(ParcelType, ThermoType) \ + \ + makeHeatTransferModel(ThermoCloud<ParcelType<ThermoType> >); \ + \ + makeHeatTransferModelThermoType \ + ( \ + NoHeatTransfer, \ + ThermoCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeHeatTransferModelThermoType \ + ( \ + RanzMarshall, \ + ThermoCloud, \ + ParcelType, \ + ThermoType \ + ); \ + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H new file mode 100644 index 0000000000000000000000000000000000000000..c691fee62c8d12374ba38c341d360213d15bff49 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H @@ -0,0 +1,111 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactingParcelInjectionModels_H +#define makeReactingParcelInjectionModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "reactingThermoTypes.H" +#include "KinematicCloud.H" + +#include "ConeInjection.H" +#include "ConeInjectionMP.H" +#include "FieldActivatedInjection.H" +#include "ManualInjection.H" +#include "NoInjection.H" +#include "ReactingLookupTableInjection.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReactingInjectionModels(ParcelType) \ + \ + makeReactingInjectionModelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + \ + makeReactingInjectionModelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define makeReactingInjectionModelThermoType(ParcelType, ThermoType) \ + \ + makeInjectionModel(KinematicCloud<ParcelType<ThermoType> >); \ + \ + makeInjectionModelThermoType \ + ( \ + ConeInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + ConeInjectionMP, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + FieldActivatedInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + ManualInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + NoInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + ReactingLookupTableInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPatchInteractionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPatchInteractionModels.H new file mode 100644 index 0000000000000000000000000000000000000000..6c64d7d50e2b6e43ab19fd66119622b16ef45032 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPatchInteractionModels.H @@ -0,0 +1,87 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactingParcelPatchInteractionModels_H +#define makeReactingParcelPatchInteractionModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "reactingThermoTypes.H" +#include "KinematicCloud.H" + +#include "LocalInteraction.H" +#include "Rebound.H" +#include "StandardWallInteraction.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReactingPatchInteractionModels(ParcelType) \ + \ + makeReactingPatchInteractionModelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + \ + makeReactingPatchInteractionModelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define makeReactingPatchInteractionModelThermoType(ParcelType, ThermoType) \ + \ + makePatchInteractionModel(KinematicCloud<ParcelType<ThermoType> >); \ + \ + makePatchInteractionModelThermoType \ + ( \ + LocalInteraction, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makePatchInteractionModelThermoType \ + ( \ + Rebound, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makePatchInteractionModelThermoType \ + ( \ + StandardWallInteraction, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H new file mode 100644 index 0000000000000000000000000000000000000000..cd2fab217054d63a2dbbecd11a10762d64afcc5c --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H @@ -0,0 +1,79 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactingParcelPhaseChangeModels_H +#define makeReactingParcelPhaseChangeModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "reactingThermoTypes.H" +#include "ReactingCloud.H" + +#include "NoPhaseChange.H" +#include "LiquidEvaporation.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReactingPhaseChangeModels(ParcelType) \ + \ + makeReactingPhaseChangeModelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + \ + makeReactingPhaseChangeModelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define makeReactingPhaseChangeModelThermoType(ParcelType, ThermoType) \ + \ + makePhaseChangeModel(ReactingCloud<ParcelType<ThermoType> >); \ + \ + makePhaseChangeModelThermoType \ + ( \ + NoPhaseChange, \ + ReactingCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makePhaseChangeModelThermoType \ + ( \ + LiquidEvaporation, \ + ReactingCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPostProcessingModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPostProcessingModels.H new file mode 100644 index 0000000000000000000000000000000000000000..f316b1c460d5435454e593c6d43ab0675e9c05e0 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPostProcessingModels.H @@ -0,0 +1,79 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +#ifndef makeReactingParcelPostProcessingModels_H +#define makeReactingParcelPostProcessingModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "reactingThermoTypes.H" +#include "KinematicCloud.H" + +#include "NoPostProcessing.H" +#include "PatchPostProcessing.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeReactingPostProcessingModels(ParcelType) \ + \ + makeReactingPostProcessingModelThermoType \ + ( \ + ParcelType, \ + specieConstProperties \ + ); \ + \ + makeReactingPostProcessingModelThermoType \ + ( \ + ParcelType, \ + specieReactingProperties \ + ); + + +#define makeReactingPostProcessingModelThermoType(ParcelType, ThermoType) \ + \ + makePostProcessingModel(KinematicCloud<ParcelType<ThermoType> >); \ + \ + makePostProcessingModelThermoType \ + ( \ + NoPostProcessing, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makePostProcessingModelThermoType \ + ( \ + PatchPostProcessing, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudThermoTypes.H b/src/lagrangian/intermediate/parcels/include/reactingThermoTypes.H similarity index 78% rename from src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudThermoTypes.H rename to src/lagrangian/intermediate/parcels/include/reactingThermoTypes.H index 2341e65aa027a792bc4c51e1a4063b0b39417398..9f176ade30950836f3971d65998686b82dab5234 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudThermoTypes.H +++ b/src/lagrangian/intermediate/parcels/include/reactingThermoTypes.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,34 +23,27 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Typedefs - Foam::cloudThermoTypes + Foam::ReactingCloudThermoTypes Description + Type definitions for available thermo pacakges \*---------------------------------------------------------------------------*/ -#ifndef ReactingCloudThermoTypes_H -#define ReactingCloudThermoTypes_H +#ifndef reactingThermoTypes_H +#define reactingThermoTypes_H -#include "sutherlandTransport.H" -#include "multiComponentMixture.H" -#include "specie.H" -#include "constTransport.H" -#include "specieThermo.H" +#include "perfectGas.H" #include "hConstThermo.H" #include "janafThermo.H" -#include "perfectGas.H" +#include "specieThermo.H" +#include "sutherlandTransport.H" +#include "constTransport.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -// typedef multiComponentMixture<constTransport<specieThermo<hConstThermo<perfectGas> > > > specieProperties; -// typedef hConstThermo<perfectGas> specieProperties; - -// typedef sutherlandTransport<specieThermo<janafThermo<perfectGas> > > -// specieProperties; - typedef sutherlandTransport<specieThermo<janafThermo<perfectGas> > > specieReactingProperties; diff --git a/src/lagrangian/intermediate/particleForces/particleForces.C b/src/lagrangian/intermediate/particleForces/particleForces.C index 44d758351fbdf684ece31993acd6b5e23796bbfa..d81ebadefcbdc5cf8cf0b4285540e7038baa6dd7 100644 --- a/src/lagrangian/intermediate/particleForces/particleForces.C +++ b/src/lagrangian/intermediate/particleForces/particleForces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -115,7 +115,7 @@ const Foam::word& Foam::particleForces::gradUName() const } -Foam::vector Foam::particleForces::calc +Foam::vector Foam::particleForces::calcCoupled ( const label cellI, const scalar dt, @@ -127,12 +127,6 @@ Foam::vector Foam::particleForces::calc { vector Ftot = vector::zero; - // Gravity force - if (gravity_) - { - Ftot += g_*(1.0 - rhoc/rho); - } - // Virtual mass force if (virtualMass_) { @@ -152,5 +146,27 @@ Foam::vector Foam::particleForces::calc } +Foam::vector Foam::particleForces::calcNonCoupled +( + const label cellI, + const scalar dt, + const scalar rhoc, + const scalar rho, + const vector& Uc, + const vector& U +) const +{ + vector Ftot = vector::zero; + + // Gravity force + if (gravity_) + { + Ftot += g_*(1.0 - rhoc/rho); + } + + return Ftot; +} + + // ************************************************************************* // diff --git a/src/lagrangian/intermediate/particleForces/particleForces.H b/src/lagrangian/intermediate/particleForces/particleForces.H index 8258e35be2f753136e5a7e2e38debf6dc947d095..aab27da4653faa4fa950f2c4463f69e6896271b8 100644 --- a/src/lagrangian/intermediate/particleForces/particleForces.H +++ b/src/lagrangian/intermediate/particleForces/particleForces.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -132,8 +132,19 @@ public: // Evaluation - //- Calculate the net particle force - vector calc + //- Calculate action/reaction forces between carrier and particles + vector calcCoupled + ( + const label cellI, + const scalar dt, + const scalar rhoc, + const scalar rho, + const vector& Uc, + const vector& U + ) const; + + //- Calculate external forces applied to the particles + vector calcNonCoupled ( const label cellI, const scalar dt, diff --git a/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C b/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C index eb451ba36f07fe864ae3f33cac1c15b0c0858d85..5f04d57d30689b22b5ea80684aed369fc1c1d12b 100644 --- a/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C +++ b/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,47 +44,6 @@ const Foam::NamedEnum<Foam::phaseProperties::phaseType, 4> // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -void Foam::phaseProperties::setGlobalIds -( - const PtrList<volScalarField>& YGas -) -{ - forAll(names_, i) - { - forAll (YGas, j) - { - word specieName = YGas[j].name(); - - if (specieName == names_[i]) - { - globalIds_[i] = j; - break; - } - } - if (globalIds_[i] == -1) - { - wordList globalCarrierNames(YGas.size()); - - forAll (YGas, k) - { - globalCarrierNames[k] = YGas[k].name(); - } - - FatalErrorIn - ( - "void phaseProperties::setGlobalIds" - "(" - "const PtrList<volScalarField>&" - ")" - ) << "Could not find carrier species " << names_[i] - << " in species list" << nl - << "Available species are: " << nl << globalCarrierNames << nl - << exit(FatalError); - } - } -} - - void Foam::phaseProperties::setGlobalIds(const wordList& globalNames) { forAll(names_, i) @@ -113,18 +72,16 @@ void Foam::phaseProperties::setGlobalIds(const wordList& globalNames) void Foam::phaseProperties::setGlobalCarrierIds ( - const PtrList<volScalarField>& YGas + const wordList& carrierNames ) { globalCarrierIds_ = -1; forAll(names_, i) { - forAll (YGas, j) + forAll (carrierNames, j) { - word specieName = YGas[j].name(); - - if (specieName == names_[i]) + if (carrierNames[j] == names_[i]) { globalCarrierIds_[i] = j; break; @@ -132,21 +89,15 @@ void Foam::phaseProperties::setGlobalCarrierIds } if (globalCarrierIds_[i] == -1) { - wordList gasNames(YGas.size()); - forAll(YGas, gasI) - { - gasNames[gasI] = YGas[gasI].name(); - } - FatalErrorIn ( "void Foam::phaseProperties::setGlobalCarrierIds" "(" - "const PtrList<volScalarField>&" + "const wordList&" ")" - ) << "Could not find gas specie " << names_[i] + ) << "Could not find carrier specie " << names_[i] << " in species list" << nl - << "Available species are: " << nl << gasNames << nl + << "Available species are: " << nl << carrierNames << nl << exit(FatalError); } } @@ -242,7 +193,7 @@ Foam::phaseProperties::~phaseProperties() void Foam::phaseProperties::initialiseGlobalIds ( - const PtrList<volScalarField>& YGas, + const wordList& gasNames, const wordList& liquidNames, const wordList& solidNames ) @@ -253,7 +204,7 @@ void Foam::phaseProperties::initialiseGlobalIds { case GAS: { - setGlobalIds(YGas); + setGlobalIds(gasNames); forAll(globalCarrierIds_, i) { globalCarrierIds_[i] = globalIds_[i]; @@ -263,7 +214,7 @@ void Foam::phaseProperties::initialiseGlobalIds case LIQUID: { setGlobalIds(liquidNames); - setGlobalCarrierIds(YGas); + setGlobalCarrierIds(gasNames); break; } case SOLID: @@ -274,7 +225,7 @@ void Foam::phaseProperties::initialiseGlobalIds "phaseProperties::initialiseGlobalIds(...)" ) << "Assuming no mapping between solid and carrier species" << endl; -// setGlobalCarrierIds(YGas); +// setGlobalCarrierIds(gasNames); break; } default: diff --git a/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.H b/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.H index c87f51b7a05dd255b41c05bbed89ce4a4732472b..eaa44b6afb59d4c0b90d2fd84c62738f739d1b16 100644 --- a/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.H +++ b/src/lagrangian/intermediate/phaseProperties/phaseProperties/phaseProperties.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,6 +30,7 @@ Description SourceFiles phaseProperties.C + phasePropertiesIO.C \*---------------------------------------------------------------------------*/ @@ -94,15 +95,12 @@ private: // Private member functions - //- Set global ids - specialisation for carrier phases - void setGlobalIds(const PtrList<volScalarField>& YGas); - - //- Set global ids - liquid and solid phases + //- Set global ids void setGlobalIds(const wordList& globalNames); //- Set global carrier ids - attempts to map component names to global // carrier species - void setGlobalCarrierIds(const PtrList<volScalarField>& YGas); + void setGlobalCarrierIds(const wordList& carrierNames); //- Check the total mass fraction void checkTotalMassFraction() const; @@ -134,7 +132,7 @@ public: //- Initialise the global ids void initialiseGlobalIds ( - const PtrList<volScalarField>& YGas, + const wordList& gasNames, const wordList& liquidNames, const wordList& solidNames ); @@ -163,10 +161,10 @@ public: //- Return non-const access to a component mass fraction scalar& Y(const label cmptI); - //- Return const acccess to the global ids + //- Return const access to the global ids const labelList& globalIds() const; - //- Return const acccess to the map to the carrier global ids + //- Return const access to the map to the carrier global ids const labelList& globalCarrierIds() const; //- Return the global id of a component in the local list by name diff --git a/src/lagrangian/intermediate/phaseProperties/phaseProperties/phasePropertiesIO.C b/src/lagrangian/intermediate/phaseProperties/phaseProperties/phasePropertiesIO.C index 2fbb79039b7366ffc5a47a28eb7ba288fc481354..f738cf2683683f5a8aaded5500f7b511772db846 100644 --- a/src/lagrangian/intermediate/phaseProperties/phaseProperties/phasePropertiesIO.C +++ b/src/lagrangian/intermediate/phaseProperties/phaseProperties/phasePropertiesIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/intermediate/phaseProperties/phasePropertiesList/phasePropertiesList.C b/src/lagrangian/intermediate/phaseProperties/phasePropertiesList/phasePropertiesList.C index f1146e0245cc4339ecc5196a3c0c72c77665db50..2d3f7ce7add1aec039013e7006d4b2618e2bd82c 100644 --- a/src/lagrangian/intermediate/phaseProperties/phasePropertiesList/phasePropertiesList.C +++ b/src/lagrangian/intermediate/phaseProperties/phasePropertiesList/phasePropertiesList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,7 +31,7 @@ License Foam::phasePropertiesList::phasePropertiesList ( Istream& is, - const PtrList<volScalarField>& YGas, + const wordList& gasNames, const wordList& liquidNames, const wordList& solidNames ) @@ -42,7 +42,7 @@ Foam::phasePropertiesList::phasePropertiesList { forAll(props_, i) { - props_[i].initialiseGlobalIds(YGas, liquidNames, solidNames); + props_[i].initialiseGlobalIds(gasNames, liquidNames, solidNames); } phaseTypeNames_.setSize(props_.size()); diff --git a/src/lagrangian/intermediate/phaseProperties/phasePropertiesList/phasePropertiesList.H b/src/lagrangian/intermediate/phaseProperties/phasePropertiesList/phasePropertiesList.H index 4247f2c4badb946f8afc8f05a37ce2123a14f503..50f6c62ebd65cc2a3d99b6b8333aec61da49f1ac 100644 --- a/src/lagrangian/intermediate/phaseProperties/phasePropertiesList/phasePropertiesList.H +++ b/src/lagrangian/intermediate/phaseProperties/phasePropertiesList/phasePropertiesList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,7 +70,7 @@ public: phasePropertiesList ( Istream& is, - const PtrList<volScalarField>& YGas, + const wordList& gasNames, const wordList& liquidNames, const wordList& solidNames ); diff --git a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/submodels/makeBasicThermoParcelInjectionModels.C b/src/lagrangian/intermediate/submodels/IO/IOList/makeParcelIOList.H similarity index 59% rename from src/lagrangian/intermediate/parcels/derived/basicThermoParcel/submodels/makeBasicThermoParcelInjectionModels.C rename to src/lagrangian/intermediate/submodels/IO/IOList/makeParcelIOList.H index 2bf6f2e1b3dfda80d65e35abc203087b5d70d867..fb463a8289e69b43508b45e5c9e4d9a35e9d3729 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/submodels/makeBasicThermoParcelInjectionModels.C +++ b/src/lagrangian/intermediate/submodels/IO/IOList/makeParcelIOList.H @@ -22,50 +22,32 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Description + Macros for defining parcel IOLists + \*---------------------------------------------------------------------------*/ -#include "basicThermoParcel.H" -#include "ThermoCloud.H" +#ifndef makeParcelIOList_H +#define makeParcelIOList_H -#include "ConeInjection.H" -#include "FieldActivatedInjection.H" -#include "ManualInjection.H" -#include "NoInjection.H" +#include "IOPtrList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - makeInjectionModel(KinematicCloud<basicThermoParcel>); - - // Add instances of injection model to the table - - makeInjectionModelType - ( - ConeInjection, - KinematicCloud, - basicThermoParcel - ); - makeInjectionModelType - ( - FieldActivatedInjection, - KinematicCloud, - basicThermoParcel - ); - makeInjectionModelType - ( - ManualInjection, - KinematicCloud, - basicThermoParcel - ); - makeInjectionModelType - ( - NoInjection, - KinematicCloud, - basicThermoParcel +#define makeParcelIOList(ParcelType) \ + \ + typedef IOPtrList<ParcelType> IOPtrList##ParcelType; \ + \ + defineTemplateTypeNameAndDebugWithName \ + ( \ + IOPtrList##ParcelType, \ + "IOPtrList<"#ParcelType">", \ + 0 \ ); -}; +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#endif // ************************************************************************* // + diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.C index fa37b022edb490dd171ad715ac4b43ca7c7f7fb3..dc89a44b9d7752fc1eff83570c90185e40b2e995 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.C @@ -22,8 +22,6 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - \*---------------------------------------------------------------------------*/ #include "DispersionModel.H" diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.H index 085ff97b8adc42655f7993c64c60adeeebf0cf81..74131b6fff2592735c594ac5d6fdd2cd83245fca 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.H @@ -42,7 +42,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class DispersionModel Declaration + Class DispersionModel Declaration \*---------------------------------------------------------------------------*/ template<class CloudType> @@ -54,7 +54,7 @@ class DispersionModel //- Cloud dictionary const dictionary& dict_; - // Reference to the owner cloud class + //- Reference to the owner cloud class CloudType& owner_; @@ -160,6 +160,20 @@ public: add##SS##CloudType##ParcelType##ConstructorToTable_; +#define makeDispersionModelThermoType(SS, CloudType, ParcelType, ThermoType) \ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + SS<CloudType<ParcelType<ThermoType> > >, \ + 0 \ + ); \ + \ + DispersionModel<CloudType<ParcelType<ThermoType> > >:: \ + adddictionaryConstructorToTable \ + <SS<CloudType<ParcelType<ThermoType> > > > \ + add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C index 4e834244453dd2403aae07d6793562107d1b1ab1..6c028d0205602a984a591810be5a2b14d8886e8a 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionRASModel/DispersionRASModel.C @@ -22,8 +22,6 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - \*---------------------------------------------------------------------------*/ #include "DispersionRASModel.H" diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/GradientDispersionRAS/GradientDispersionRAS.C b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/GradientDispersionRAS/GradientDispersionRAS.C index daac8b5af3f126394fc5a00bfc5ff0c217616868..a8fdac2b472b917042f950a4bac52155bde8b8ad 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/GradientDispersionRAS/GradientDispersionRAS.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/GradientDispersionRAS/GradientDispersionRAS.C @@ -22,8 +22,6 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - \*---------------------------------------------------------------------------*/ #include "GradientDispersionRAS.H" diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/NoDispersion/NoDispersion.C b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/NoDispersion/NoDispersion.C index 221eb2b229cb920742b4d2df4255804f50a5a4bd..56745ef686818ab433e3b3e11c0df6320ea4c0bd 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/NoDispersion/NoDispersion.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/NoDispersion/NoDispersion.C @@ -22,8 +22,6 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - \*---------------------------------------------------------------------------*/ #include "NoDispersion.H" diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/StochasticDispersionRAS/StochasticDispersionRAS.C b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/StochasticDispersionRAS/StochasticDispersionRAS.C index f9a51f050eb89d153039a8e2c9b5f969d4844595..fb03ca581c716d493b88b0611867745787e4924c 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/StochasticDispersionRAS/StochasticDispersionRAS.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/StochasticDispersionRAS/StochasticDispersionRAS.C @@ -22,8 +22,6 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - \*---------------------------------------------------------------------------*/ #include "StochasticDispersionRAS.H" diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.C b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.C index f1b98e609c2e0b0ae27a533a2a57e09c2d0735e6..1eb7f86b48effaee07d38f4ec60cacafd0e0ce09 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.C @@ -64,12 +64,11 @@ const Foam::dictionary& Foam::DragModel<CloudType>::dict() const template<class CloudType> -Foam::scalar Foam::DragModel<CloudType>::Cu +Foam::scalar Foam::DragModel<CloudType>::ptc ( const vector& Ur, const scalar d, const scalar rhoc, - const scalar rhop, const scalar mu ) const { @@ -79,7 +78,7 @@ Foam::scalar Foam::DragModel<CloudType>::Cu const scalar Cd = this->Cd(Re); - return 3.0*Cd*rhoc*magUr/(4.0*d*rhop); + return Cd*rhoc*magUr/8.0; } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H index 5623c7f30e4984b1b1774af8059d12ce5eb0b11e..69130b168ca54d846a1c5d2d1b671183335f1361 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H @@ -58,7 +58,7 @@ class DragModel //- The cloud dictionary const dictionary& dict_; - // reference to the owner cloud class + //- Reference to the owner cloud class CloudType& owner_; @@ -120,14 +120,13 @@ public: //- Return drag coefficient virtual scalar Cd(const scalar Re) const = 0; - //- Return linearised coefficient for velocity equation - // Drag force per unit particle mass = Cu(U - Up) - scalar Cu + //- Return momentum transfer coefficient + // Drag force per unit particle surface area = ptc(U - Up) + scalar ptc ( const vector& Ur, const scalar d, const scalar rhoc, - const scalar rhop, const scalar mu ) const; }; @@ -155,6 +154,20 @@ public: add##SS##CloudType##ParcelType##ConstructorToTable_; +#define makeDragModelThermoType(SS, CloudType, ParcelType, ThermoType) \ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + SS<CloudType<ParcelType<ThermoType> > >, \ + 0 \ + ); \ + \ + DragModel<CloudType<ParcelType<ThermoType> > >:: \ + adddictionaryConstructorToTable \ + <SS<CloudType<ParcelType<ThermoType> > > > \ + add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C index a812eb918979e90930138f617cb493600d5f5781..b7dd300b45857b920c986b79e63726db8020f478 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C @@ -77,6 +77,7 @@ Foam::ConeInjection<CloudType>::ConeInjection InjectionModel<CloudType>(dict, owner, typeName), duration_(readScalar(this->coeffDict().lookup("duration"))), position_(this->coeffDict().lookup("position")), + injectorCell_(-1), direction_(this->coeffDict().lookup("direction")), parcelsPerSecond_ ( @@ -145,6 +146,9 @@ Foam::ConeInjection<CloudType>::ConeInjection // Set total volume to inject this->volumeTotal_ = volumeFlowRate_().integrate(0.0, duration_); + + // Set/cache the injector cell + this->findCellAtPosition(injectorCell_, position_); } @@ -174,6 +178,7 @@ Foam::scalar Foam::ConeInjection<CloudType>::timeEnd() const template<class CloudType> void Foam::ConeInjection<CloudType>::setPositionAndCell ( + const label, const label, const scalar, vector& position, @@ -181,17 +186,20 @@ void Foam::ConeInjection<CloudType>::setPositionAndCell ) { position = position_; - this->findCellAtPosition(cellOwner, position); + cellOwner = injectorCell_; } template<class CloudType> -Foam::vector Foam::ConeInjection<CloudType>::velocity +void Foam::ConeInjection<CloudType>::setProperties ( + const label parcelI, const label, - const scalar time + const scalar time, + typename CloudType::parcelType& parcel ) { + // set particle velocity const scalar deg2Rad = mathematicalConstant::pi/180.0; scalar t = time - this->SOI_; @@ -210,23 +218,22 @@ Foam::vector Foam::ConeInjection<CloudType>::velocity dirVec += normal; dirVec /= mag(dirVec); - return Umag_().value(t)*dirVec; + parcel.U() = Umag_().value(t)*dirVec; + + // set particle diameter + parcel.d() = parcelPDF_().sample(); } template<class CloudType> -Foam::scalar Foam::ConeInjection<CloudType>::d0 -( - const label, - const scalar -) const +bool Foam::ConeInjection<CloudType>::fullyDescribed() const { - return parcelPDF_().sample(); + return false; } template<class CloudType> -bool Foam::ConeInjection<CloudType>::validInjection(const label parcelI) +bool Foam::ConeInjection<CloudType>::validInjection(const label) { return true; } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H index 0c07e4622a63f1bd31ace06f01fecb39099257ac..4e43f9b37459e0ba7996e01fd392e12af39e64ba 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.H @@ -53,6 +53,8 @@ SourceFiles namespace Foam { +// Forward declaration of classes + template<class Type> class DataEntry; @@ -67,14 +69,14 @@ class ConeInjection { // Private data - //- Coefficients dictionary - dictionary coeffDict_; - //- Injection duration [s] const scalar duration_; //- Injector position [m] - const vector position_; + vector position_; + + //- Cell containing injector position [] + label injectorCell_; //- Injector direction [] vector direction_; @@ -111,14 +113,14 @@ protected: // Protected member functions - //- Number of parcels to introduce over the time step + //- Number of parcels to introduce over the time step relative to SOI label parcelsToInject ( const scalar time0, const scalar time1 ) const; - //- Number of parcels to introduce over the time step + //- Number of parcels to introduce over the time step relative to SOI scalar volumeToInject ( const scalar time0, @@ -158,31 +160,30 @@ public: // Injection geometry //- Set the injection position and owner cell - void setPositionAndCell + virtual void setPositionAndCell ( const label parcelI, + const label nParcels, const scalar time, vector& position, label& cellOwner ); - //- Return the velocity of the parcel to introduce at a time - vector velocity + //- Set the parcel properties + virtual void setProperties ( const label parcelI, - const scalar time + const label nParcels, + const scalar time, + typename CloudType::parcelType& parcel ); - //- Return the diameter of the parcel to introduce at a time - scalar d0 - ( - const label parcelI, - const scalar time - ) const; + //- Flag to identify whether model fully describes the parcel + virtual bool fullyDescribed() const; //- Return flag to identify whether or not injection in cellI is // permitted - bool validInjection(const label parcelI); + virtual bool validInjection(const label parcelI); }; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C new file mode 100644 index 0000000000000000000000000000000000000000..17af3bb8702d60c269eba2491345b88fa6a0fbf5 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C @@ -0,0 +1,289 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "ConeInjectionMP.H" +#include "DataEntry.H" + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template<class CloudType> +Foam::label Foam::ConeInjectionMP<CloudType>::parcelsToInject +( + const scalar time0, + const scalar time1 +) const +{ + if ((time0 >= 0.0) && (time0 < duration_)) + { + const scalar targetVolume = volumeFlowRate_().integrate(0, time1); + + const label targetParcels = + parcelsPerInjector_*targetVolume/this->volumeTotal_; + + const label nToInject = targetParcels - nInjected_; + + nInjected_ += nToInject; + + return positions_.size()*nToInject; + } + else + { + return 0; + } +} + + +template<class CloudType> +Foam::scalar Foam::ConeInjectionMP<CloudType>::volumeToInject +( + const scalar time0, + const scalar time1 +) const +{ + if ((time0 >= 0.0) && (time0 < duration_)) + { + return volumeFlowRate_().integrate(time0, time1); + } + else + { + return 0.0; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::ConeInjectionMP<CloudType>::ConeInjectionMP +( + const dictionary& dict, + CloudType& owner +) +: + InjectionModel<CloudType>(dict, owner, typeName), + positionsFile_(this->coeffDict().lookup("positionsFile")), + positions_ + ( + IOobject + ( + positionsFile_, + owner.db().time().constant(), + owner.mesh(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ), + injectorCells_(positions_.size()), + axesFile_(this->coeffDict().lookup("axesFile")), + axes_ + ( + IOobject + ( + axesFile_, + owner.db().time().constant(), + owner.mesh(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ), + duration_(readScalar(this->coeffDict().lookup("duration"))), + parcelsPerInjector_ + ( + readScalar(this->coeffDict().lookup("parcelsPerInjector")) + ), + volumeFlowRate_ + ( + DataEntry<scalar>::New + ( + "volumeFlowRate", + this->coeffDict() + ) + ), + Umag_ + ( + DataEntry<scalar>::New + ( + "Umag", + this->coeffDict() + ) + ), + thetaInner_ + ( + DataEntry<scalar>::New + ( + "thetaInner", + this->coeffDict() + ) + ), + thetaOuter_ + ( + DataEntry<scalar>::New + ( + "thetaOuter", + this->coeffDict() + ) + ), + parcelPDF_ + ( + pdf::New + ( + this->coeffDict().subDict("parcelPDF"), + owner.rndGen() + ) + ), + nInjected_(this->parcelsAddedTotal()), + tanVec1_(positions_.size()), + tanVec2_(positions_.size()) +{ + // Normalise direction vector and determine direction vectors + // tangential to direction + forAll(axes_, i) + { + axes_[i] /= mag(axes_[i]); + + vector tangent = vector::zero; + scalar magTangent = 0.0; + + while (magTangent < SMALL) + { + vector v = this->owner().rndGen().vector01(); + + tangent = v - (v & axes_[i])*axes_[i]; + magTangent = mag(tangent); + } + + tanVec1_[i] = tangent/magTangent; + tanVec2_[i] = axes_[i]^tanVec1_[i]; + } + + // Set total volume to inject + this->volumeTotal_ = volumeFlowRate_().integrate(0.0, duration_); + + // Set/cache the injector cells + forAll(positions_, i) + { + this->findCellAtPosition + ( + injectorCells_[i], + positions_[i] + ); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::ConeInjectionMP<CloudType>::~ConeInjectionMP() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class CloudType> +bool Foam::ConeInjectionMP<CloudType>::active() const +{ + return true; +} + + +template<class CloudType> +Foam::scalar Foam::ConeInjectionMP<CloudType>::timeEnd() const +{ + return this->SOI_ + duration_; +} + + +template<class CloudType> +void Foam::ConeInjectionMP<CloudType>::setPositionAndCell +( + const label parcelI, + const label, + const scalar, + vector& position, + label& cellOwner +) +{ + const label i = parcelI%positions_.size(); + + position = positions_[i]; + cellOwner = injectorCells_[i]; +} + + +template<class CloudType> +void Foam::ConeInjectionMP<CloudType>::setProperties +( + const label parcelI, + const label, + const scalar time, + typename CloudType::parcelType& parcel +) +{ + // set particle velocity + const label i = parcelI%positions_.size(); + + const scalar deg2Rad = mathematicalConstant::pi/180.0; + + scalar t = time - this->SOI_; + scalar ti = thetaInner_().value(t); + scalar to = thetaOuter_().value(t); + scalar coneAngle = this->owner().rndGen().scalar01()*(to - ti) + ti; + + coneAngle *= deg2Rad; + scalar alpha = sin(coneAngle); + scalar dcorr = cos(coneAngle); + scalar beta = + 2.0*mathematicalConstant::pi*this->owner().rndGen().scalar01(); + + vector normal = alpha*(tanVec1_[i]*cos(beta) + tanVec2_[i]*sin(beta)); + vector dirVec = dcorr*axes_[i]; + dirVec += normal; + + dirVec /= mag(dirVec); + + parcel.U() = Umag_().value(t)*dirVec; + + // set particle diameter + parcel.d() = parcelPDF_().sample(); +} + + +template<class CloudType> +bool Foam::ConeInjectionMP<CloudType>::fullyDescribed() const +{ + return false; +} + + +template<class CloudType> +bool Foam::ConeInjectionMP<CloudType>::validInjection(const label parcelI) +{ + return true; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.H new file mode 100644 index 0000000000000000000000000000000000000000..cb10e93cec5ab6b98606567210128171b33e6c26 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.H @@ -0,0 +1,214 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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::ConeInjectionMP + +Description + Cone injection multi-point + + - User specifies + - time of start of injection + - injector positions + - directions (along injection axes) + - parcel flow rate + - parcel velocities + - inner and outer cone angles + - Parcel diameters obtained by PDF model + +SourceFiles + ConeInjectionMP.C + +\*---------------------------------------------------------------------------*/ + +#ifndef ConeInjectionMP_H +#define ConeInjectionMP_H + +#include "InjectionModel.H" +#include "pdf.H" +#include "vectorList.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes + +template<class Type> +class DataEntry; + +/*---------------------------------------------------------------------------*\ + Class ConeInjectionMP Declaration +\*---------------------------------------------------------------------------*/ + +template<class CloudType> +class ConeInjectionMP +: + public InjectionModel<CloudType> +{ + // Private data + + //- Name of file containing positions data + const word positionsFile_; + + //- Field of injector positions + vectorIOField positions_; + + //- Field of cell labels corresoponding to injector positions + labelList injectorCells_; + + //- Name of file containing axes data + const word axesFile_; + + //- Field of injector positions + vectorIOField axes_; + + //- Injection duration [s] + const scalar duration_; + + //- Number of parcels to introduce per injector + const label parcelsPerInjector_; + + //- Volume flow rate of parcels to introduce relative to SOI [m^3] + const autoPtr<DataEntry<scalar> > volumeFlowRate_; + + //- Parcel velocity magnitude relative to SOI [m/s] + const autoPtr<DataEntry<scalar> > Umag_; + + //- Inner cone angle relative to SOI [deg] + const autoPtr<DataEntry<scalar> > thetaInner_; + + //- Outer cone angle relative to SOI [deg] + const autoPtr<DataEntry<scalar> > thetaOuter_; + + //- Parcel size PDF model + const autoPtr<pdf> parcelPDF_; + + //- Number of parcels per injector already injected + mutable label nInjected_; + + + // Tangential vectors to the direction vector + + //- First tangential vector + vectorList tanVec1_; + + //- Second tangential vector + vectorList tanVec2_; + + +protected: + + // Protected member functions + + //- Number of parcels to introduce over the time step + label parcelsToInject + ( + const scalar time0, + const scalar time1 + ) const; + + //- Number of parcels to introduce over the time step + scalar volumeToInject + ( + const scalar time0, + const scalar time1 + ) const; + + +public: + + //- Runtime type information + TypeName("ConeInjectionMP"); + + + // Constructors + + //- Construct from dictionary + ConeInjectionMP + ( + const dictionary& dict, + CloudType& owner + ); + + + //- Destructor + virtual ~ConeInjectionMP(); + + + // 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 + ); + + //- Set the parcel properties + 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 in cellI is + // permitted + virtual bool validInjection(const label parcelI); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "ConeInjectionMP.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C index fb241b2f450555b34cbbd9e613a1b3b5434798b7..8429ca7ca6543c88b80066ec1bfde05d61063e82 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -131,7 +131,7 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection *sum(pow3(diameters_)) *mathematicalConstant::pi/6.0; - // Set/cahce the injector cells + // Set/cache the injector cells forAll(positions_, i) { this->findCellAtPosition @@ -170,6 +170,7 @@ template<class CloudType> void Foam::FieldActivatedInjection<CloudType>::setPositionAndCell ( const label parcelI, + const label, const scalar, vector& position, label& cellOwner @@ -181,24 +182,26 @@ void Foam::FieldActivatedInjection<CloudType>::setPositionAndCell template<class CloudType> -Foam::vector Foam::FieldActivatedInjection<CloudType>::velocity +void Foam::FieldActivatedInjection<CloudType>::setProperties ( + const label parcelI, const label, - const scalar + const scalar, + typename CloudType::parcelType& parcel ) { - return U0_; + // set particle velocity + parcel.U() = U0_; + + // set particle diameter + parcel.d() = diameters_[parcelI]; } template<class CloudType> -Foam::scalar Foam::FieldActivatedInjection<CloudType>::d0 -( - const label parcelI, - const scalar -) const +bool Foam::FieldActivatedInjection<CloudType>::fullyDescribed() const { - return diameters_[parcelI]; + return false; } @@ -212,8 +215,8 @@ bool Foam::FieldActivatedInjection<CloudType>::validInjection if ( - nParcelsInjected_[parcelI] < nParcelsPerInjector_ - && factor_*referenceField_[cellI] > thresholdField_[cellI] + nParcelsInjected_[parcelI] < nParcelsPerInjector_ + && factor_*referenceField_[cellI] > thresholdField_[cellI] ) { nParcelsInjected_[parcelI]++; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H index 194add8ca95f74b464f18ebdebc3c134875c2399..aa7c6e16f631cbcfd7fdf38b5ba5c7ec90da0872 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,14 +87,14 @@ class FieldActivatedInjection //- Field of injector (x,y,z) positions vectorIOField positions_; - //- Field of cell labels corresoponding to injector positions - labelField injectorCells_; + //- Field of cell labels corresponding to injector positions + labelList injectorCells_; //- Number of parcels per injector const label nParcelsPerInjector_; //- Field of number of parcels injected for each injector - labelField nParcelsInjected_; + labelList nParcelsInjected_; // Parcel properties @@ -103,7 +103,7 @@ class FieldActivatedInjection const vector U0_; //- Field of parcel diameters - scalarField diameters_; + scalarList diameters_; //- Parcel size PDF model const autoPtr<pdf> parcelPDF_; @@ -113,14 +113,14 @@ protected: // Protected member functions - //- Number of parcels to introduce over the time step + //- 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 + //- Volume of parcels to introduce over the time step relative to SOI scalar volumeToInject ( const scalar time0, @@ -160,31 +160,30 @@ public: // Injection geometry //- Set the injection position and owner cell - void setPositionAndCell + virtual void setPositionAndCell ( const label parcelI, + const label nParcels, const scalar time, vector& position, label& cellOwner ); - //- Return the velocity of the parcel to introduce at a time - vector velocity + //- Set the parcel properties + virtual void setProperties ( const label parcelI, - const scalar time + const label nParcels, + const scalar time, + typename CloudType::parcelType& parcel ); - //- Return the diameter of the parcel to introduce at a time - scalar d0 - ( - const label parcelI, - const scalar time - ) const; + //- Flag to identify whether model fully describes the parcel + virtual bool fullyDescribed() const; //- Return flag to identify whether or not injection in cellI is // permitted - bool validInjection(const label parcelI); + virtual bool validInjection(const label parcelI); }; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C index 6a0ba9544bc4a61eb47055786de2c448fe5b3417..abbba2698d004ea46afbc4b8048ce1abe52fa34a 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C @@ -88,8 +88,7 @@ void Foam::InjectionModel<CloudType>::writeProps() template<class CloudType> void Foam::InjectionModel<CloudType>::prepareForNextTimeStep ( - const scalar time0, - const scalar time1, + const scalar time, label& newParcels, scalar& newVolume ) @@ -99,15 +98,15 @@ void Foam::InjectionModel<CloudType>::prepareForNextTimeStep newVolume = 0.0; // Return if not started injection event - if (time1 < SOI_) + if (time < SOI_) { - timeStep0_ = time1; + timeStep0_ = time; return; } // Make times relative to SOI scalar t0 = timeStep0_ - SOI_; - scalar t1 = time1 - SOI_; + scalar t1 = time - SOI_; // Number of parcels to inject newParcels = parcelsToInject(t0, t1); @@ -123,7 +122,7 @@ void Foam::InjectionModel<CloudType>::prepareForNextTimeStep else { // advance value of timeStep0_ - timeStep0_ = time1; + timeStep0_ = time; } } @@ -348,13 +347,13 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td) } const scalar time = owner_.db().time().value(); - const scalar continuousDt = owner_.db().time().deltaT().value(); + const scalar carrierDt = owner_.db().time().deltaT().value(); const polyMesh& mesh = owner_.mesh(); // Prepare for next time step label newParcels = 0; scalar newVolume = 0.0; - prepareForNextTimeStep(time0_, time, newParcels, newVolume); + prepareForNextTimeStep(time, newParcels, newVolume); // Return if no parcels are required if (newParcels == 0) @@ -363,18 +362,12 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td) return; } - // Particle density given by constant properties - const scalar rho = td.constProps().rho0(); - // Volume fraction to introduce during this timestep const scalar volFraction = volumeFraction(newVolume); // Duration of injection period during this timestep - const scalar deltaT = min - ( - continuousDt, - min(time - SOI_, timeEnd() - time0_) - ); + const scalar deltaT = + max(0.0, min(carrierDt, min(time - SOI_, timeEnd() - time0_))); // Pad injection time if injection starts during this timestep const scalar padTime = max(0.0, SOI_ - time0_); @@ -383,44 +376,56 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td) label parcelsAdded = 0; for (label parcelI=0; parcelI<newParcels; parcelI++) { - // Calculate the pseudo time of injection for parcel 'parcelI' - scalar timeInj = time0_ + padTime + deltaT*parcelI/newParcels; - - // Determine the injection position and owner cell - label cellI = -1; - vector pos = vector::zero; - setPositionAndCell(parcelI, timeInj, pos, cellI); - - if (cellI > -1) + if (validInjection(parcelI)) { - if (validInjection(parcelI)) - { - // Diameter of parcels - scalar d = d0(parcelI, timeInj); - - // Number of particles per parcel - scalar nP = setNumberOfParticles - ( - newParcels, - newVolume, - volFraction, - d, - rho - ); + // Calculate the pseudo time of injection for parcel 'parcelI' + scalar timeInj = time0_ + padTime + deltaT*parcelI/newParcels; - // Velocity of parcels - vector U = velocity(parcelI, timeInj); + // Determine the injection position and owner cell + label cellI = -1; + vector pos = vector::zero; + setPositionAndCell(parcelI, newParcels, timeInj, pos, cellI); + if (cellI > -1) + { // Lagrangian timestep scalar dt = time - timeInj; - // Apply corrections for 2-D cases + // Apply corrections to position for 2-D cases meshTools::constrainToMeshCentre(mesh, pos); - meshTools::constrainDirection(mesh, mesh.solutionD(), U); + + // Create a new parcel + parcelType* pPtr = new parcelType(td.cloud(), pos, cellI); + + // Assign new parcel properties in injection model + setProperties(parcelI, newParcels, timeInj, *pPtr); + + // Check new parcel properties + td.cloud().checkParcelProperties(pPtr, dt, fullyDescribed()); + + // Apply correction to velocity for 2-D cases + meshTools::constrainDirection + ( + mesh, + mesh.solutionD(), + pPtr->U() + ); + + // Number of particles per parcel + pPtr->nParticle() = + setNumberOfParticles + ( + newParcels, + newVolume, + volFraction, + pPtr->d(), + pPtr->rho() + ); // Add the new parcel - td.cloud().addNewParcel(pos, cellI, d, U, nP, dt); - massInjected_ += nP*rho*mathematicalConstant::pi*pow3(d)/6.0; + td.cloud().addParticle(pPtr); + + massInjected_ += pPtr->nParticle()*pPtr->mass(); parcelsAdded++; } } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H index 36820ac3184d9e324c1dde78a34f1dc63bed83c8..d90624ebcd3715a1bcfdd74c6b4029b2b6af09ef 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H @@ -26,7 +26,19 @@ Class Foam::InjectionModel Description - Templated injection model class + Templated injection model class. + + The injection model nominally describes the parcel: + - position + - diameter + - velocity + In this case, the fullyDescribed() flag should be set to 0 (false). When + the parcel is then added to the cloud, the remaining properties are + populated using values supplied in the constant properties. + + If, however, all of a parcel's properties are described in the model, the + fullDescribed() flag should be set to 1 (true). + SourceFiles InjectionModel.C @@ -73,7 +85,7 @@ private: //- The cloud dictionary const dictionary& dict_; - // Reference to the owner cloud class + //- Reference to the owner cloud class CloudType& owner_; //- The coefficients dictionary @@ -93,6 +105,9 @@ protected: // Protected data + //- Convenience typedef for parcel type + typedef typename CloudType::parcelType parcelType; + // Global injection properties //- Start of injection [s] @@ -132,14 +147,14 @@ protected: // Protected member functions - //- Number of parcels to introduce over the time step + //- Number of parcels to introduce over the time step relative to SOI virtual label parcelsToInject ( const scalar time0, const scalar time1 ) const = 0; - //- Volume of parcels to introduce over the time step + //- Volume of parcels to introduce over the time step relative to SOI virtual scalar volumeToInject ( const scalar time0, @@ -153,8 +168,7 @@ protected: //- Determine properties for next time step/injection interval virtual void prepareForNextTimeStep ( - const scalar time0, - const scalar time1, + const scalar time, label& newParcels, scalar& newVolume ); @@ -255,7 +269,7 @@ public: //- Return mass of particles to introduce inline scalar massTotal() const; - //- Return mass of particles injected (cummulative) + //- Return mass of particles injected (cumulative) inline scalar massInjected() const; //- Return the end-of-injection time @@ -286,31 +300,26 @@ public: virtual void setPositionAndCell ( const label parcelI, + const label nParcels, const scalar time, vector& position, label& cellOwner ) = 0; - //- Return the velocity of the parcel to introduce at a time - virtual vector velocity + //- Set the parcel properties + virtual void setProperties ( const label parcelI, - const scalar time + const label nParcels, + const scalar time, + typename CloudType::parcelType& parcel ) = 0; - //- Return the diameter of the parcel to introduce at a time - virtual scalar d0 - ( - const label parcelI, - const scalar time - ) const = 0; + //- Flag to identify whether model fully describes the parcel + virtual bool fullyDescribed() const = 0; }; -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "InjectionModelI.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam @@ -333,6 +342,25 @@ public: add##SS##CloudType##ParcelType##ConstructorToTable_; +#define makeInjectionModelThermoType(SS, CloudType, ParcelType, ThermoType) \ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + SS<CloudType<ParcelType<ThermoType> > >, \ + 0 \ + ); \ + \ + InjectionModel<CloudType<ParcelType<ThermoType> > >:: \ + adddictionaryConstructorToTable \ + <SS<CloudType<ParcelType<ThermoType> > > > \ + add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "InjectionModelI.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.C new file mode 100644 index 0000000000000000000000000000000000000000..5fd976e0160d5ba25a548b86730e38b007085d3b --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.C @@ -0,0 +1,241 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "KinematicLookupTableInjection.H" +#include "scalarIOList.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template<class CloudType> +Foam::label Foam::KinematicLookupTableInjection<CloudType>::INPUT_FILE_COLS = 9; + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template<class CloudType> +Foam::label Foam::KinematicLookupTableInjection<CloudType>::parcelsToInject +( + const scalar time0, + const scalar time1 +) const +{ + if ((time0 >= 0.0) && (time0 < duration_)) + { + return round(injectorCells_.size()*(time1 - time0)*nParcelsPerSecond_); + } + else + { + return 0; + } +} + + +template<class CloudType> +Foam::scalar Foam::KinematicLookupTableInjection<CloudType>::volumeToInject +( + const scalar time0, + const scalar time1 +) const +{ + scalar volume = 0.0; + if ((time0 >= 0.0) && (time0 < duration_)) + { + forAll(mDot_, injectorI) + { + volume += mDot_[injectorI]/rho_[injectorI]*(time1 - time0); + } + } + + return volume; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::KinematicLookupTableInjection<CloudType>::KinematicLookupTableInjection +( + const dictionary& dict, + CloudType& owner +) +: + InjectionModel<CloudType>(dict, owner, typeName), + inputFileName_(this->coeffDict().lookup("inputFile")), + duration_(readScalar(this->coeffDict().lookup("duration"))), + nParcelsPerSecond_ + ( + readScalar(this->coeffDict().lookup("parcelsPerSecond")) + ), + x_(0), + U_(0), + d_(0), + rho_(0), + mDot_(0), + injectorCells_(0) +{ + scalarListIOList injectorData + ( + IOobject + ( + inputFileName_, + owner.db().time().constant(), + owner.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + x_.setSize(injectorData.size()); + U_.setSize(injectorData.size()); + d_.setSize(injectorData.size()); + rho_.setSize(injectorData.size()); + mDot_.setSize(injectorData.size()); + + // Populate lists + forAll(injectorData, injectorI) + { + if (injectorData[injectorI].size() != INPUT_FILE_COLS) + { + FatalErrorIn + ( + "KinematicLookupTableInjection" + "(" + "const dictionary&," + "CloudType& owner" + ")" + ) << "Incorrect number of entries in injector specification " + << "- found " << injectorData[injectorI].size() + << ", expected " << INPUT_FILE_COLS << ":" << nl + << " x0 x1 x2 u0 u1 u2 d rho mDot " << nl + << exit(FatalError); + } + x_[injectorI].component(0) = injectorData[injectorI][0]; + x_[injectorI].component(1) = injectorData[injectorI][1]; + x_[injectorI].component(2) = injectorData[injectorI][2]; + U_[injectorI].component(0) = injectorData[injectorI][3]; + U_[injectorI].component(1) = injectorData[injectorI][4]; + U_[injectorI].component(2) = injectorData[injectorI][5]; + d_[injectorI] = injectorData[injectorI][6]; + rho_[injectorI] = injectorData[injectorI][7]; + mDot_[injectorI] = injectorData[injectorI][8]; + } + + // Set/cache the injector cells + injectorCells_.setSize(injectorData.size()); + forAll(x_, injectorI) + { + this->findCellAtPosition(injectorCells_[injectorI], x_[injectorI]); + } + + // Determine volume of particles to inject + this->volumeTotal_ = 0.0; + forAll(mDot_, injectorI) + { + this->volumeTotal_ += mDot_[injectorI]/rho_[injectorI]; + } + this->volumeTotal_ *= duration_; +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::KinematicLookupTableInjection<CloudType>::~KinematicLookupTableInjection() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class CloudType> +bool Foam::KinematicLookupTableInjection<CloudType>::active() const +{ + return true; +} + + +template<class CloudType> +Foam::scalar Foam::KinematicLookupTableInjection<CloudType>::timeEnd() const +{ + return this->SOI_ + duration_; +} + + +template<class CloudType> +void Foam::KinematicLookupTableInjection<CloudType>::setPositionAndCell +( + const label parcelI, + const label nParcels, + const scalar time, + vector& position, + label& cellOwner +) +{ + label injectorI = parcelI*injectorCells_.size()/nParcels; + + position = x_[injectorI]; + cellOwner = injectorCells_[injectorI]; +} + + +template<class CloudType> +void Foam::KinematicLookupTableInjection<CloudType>::setProperties +( + const label parcelI, + const label nParcels, + const scalar, + typename CloudType::parcelType& parcel +) +{ + label injectorI = parcelI*injectorCells_.size()/nParcels; + + // set particle velocity + parcel.U() = U_[injectorI]; + + // set particle diameter + parcel.d() = d_[injectorI]; + + // set particle density + parcel.rho() = rho_[injectorI]; +} + + +template<class CloudType> +bool Foam::KinematicLookupTableInjection<CloudType>::fullyDescribed() const +{ + return true; +} + + +template<class CloudType> +bool Foam::KinematicLookupTableInjection<CloudType>::validInjection +( + const label +) +{ + return true; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.H new file mode 100644 index 0000000000000000000000000000000000000000..b3dd74099ccc89ef90f6305c4da8f0ec638ee5cb --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/KinematicLookupTableInjection/KinematicLookupTableInjection.H @@ -0,0 +1,193 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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::KinematicLookupTableInjection + +Description + Particle injection sources read from look-up table. Each row corresponds to + an injection site. + + ( + (x y z u v w d rho mDot) + ); + + where: + x, y, z = global cartesian co-ordinates [m] + u, v, w = global cartesian velocity components [m/s] + d = diameter [m] + rho = density [kg/m3] + mDot = mass flow rate [kg/m3] + +SourceFiles + KinematicLookupTableInjection.C + +\*---------------------------------------------------------------------------*/ + +#ifndef KinematicLookupTableInjection_H +#define KinematicLookupTableInjection_H + +#include "InjectionModel.H" +#include "pdf.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class KinematicLookupTableInjection Declaration +\*---------------------------------------------------------------------------*/ + +template<class CloudType> +class KinematicLookupTableInjection +: + public InjectionModel<CloudType> +{ + // Private data + + //- Name of file containing injector/parcel data + const word inputFileName_; + + //- Injection duration - common to all injection sources + const scalar duration_; + + //- Number of parcels per injector - common to all injection sources + const label nParcelsPerSecond_; + + //- List of parcel position per injector / [m] + List<point> x_; + + //- List of parcel velocity per injector / [m] + List<vector> U_; + + //- List of parcel diameter per injector / [m] + List<scalar> d_; + + //- List of parcel fluid density pre injector / [kg/m3] + List<scalar> rho_; + + //- List of parcel injection mass flow per injector / [kg/s] + List<scalar> mDot_; + + //- List of injector cells per injector + List<label> injectorCells_; + + //- Number of columns expected in input file + static label INPUT_FILE_COLS; + + +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("KinematicLookupTableInjection"); + + + // Constructors + + //- Construct from dictionary + KinematicLookupTableInjection + ( + const dictionary& dict, + CloudType& owner + ); + + + //- Destructor + virtual ~KinematicLookupTableInjection(); + + + // 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 + ); + + //- Set the parcel properties + 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 in cellI is + // permitted + virtual bool validInjection(const label parcelI); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "KinematicLookupTableInjection.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C index 6d71828c237ca36ed0bc29e3b22e1db97a47adb7..afcd15f30308226ed2f1d48d3a2f11b78639fc39 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C @@ -130,7 +130,7 @@ template<class CloudType> Foam::scalar Foam::ManualInjection<CloudType>::timeEnd() const { // Not used - return 0.0; + return this->SOI_; } @@ -138,6 +138,7 @@ template<class CloudType> void Foam::ManualInjection<CloudType>::setPositionAndCell ( const label parcelI, + const label, const scalar time, vector& position, label& cellOwner @@ -149,24 +150,26 @@ void Foam::ManualInjection<CloudType>::setPositionAndCell template<class CloudType> -Foam::vector Foam::ManualInjection<CloudType>::velocity +void Foam::ManualInjection<CloudType>::setProperties ( + const label parcelI, const label, - const scalar + const scalar, + typename CloudType::parcelType& parcel ) { - return U0_; + // set particle velocity + parcel.U() = U0_; + + // set particle diameter + parcel.d() = diameters_[parcelI]; } template<class CloudType> -Foam::scalar Foam::ManualInjection<CloudType>::d0 -( - const label parcelI, - const scalar -) const +bool Foam::ManualInjection<CloudType>::fullyDescribed() const { - return diameters_[parcelI]; + return false; } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H index a9b4ae0f5c241a979f78271c2776279a32b957f4..e3ab4853c57948ff88d12775b48086260fc5c287 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.H @@ -40,8 +40,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef manualInjection_H -#define manualInjection_H +#ifndef ManualInjection_H +#define ManualInjection_H #include "InjectionModel.H" #include "pdf.H" @@ -62,9 +62,6 @@ class ManualInjection { // Private data - //- Coefficients dictionary - dictionary coeffDict_; - //- Name of file containing positions data const word positionsFile_; @@ -72,7 +69,7 @@ class ManualInjection vectorIOField positions_; //- Field of parcel diameters - scalarField diameters_; + scalarList diameters_; //- Initial parcel velocity const vector U0_; @@ -88,14 +85,14 @@ protected: // Protected member functions - //- Number of parcels to introduce over the time step + //- 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 + //- Volume of parcels to introduce over the time step relative to SOI scalar volumeToInject ( const scalar time0, @@ -135,31 +132,30 @@ public: // Injection geometry //- Set the injection position and owner cell - void setPositionAndCell + virtual void setPositionAndCell ( const label parcelI, + const label nParcels, const scalar time, vector& position, label& cellOwner ); - //- Return the velocity of the parcel to introduce at a time - vector velocity + //- Set the parcel properties + virtual void setProperties ( const label parcelI, - const scalar time + const label nParcels, + const scalar time, + typename CloudType::parcelType& parcel ); - //- Return the diameter of the parcel to introduce at a time - scalar d0 - ( - const label parcelI, - const scalar time - ) const; + //- Flag to identify whether model fully describes the parcel + virtual bool fullyDescribed() const; //- Return flag to identify whether or not injection in cellI is // permitted - bool validInjection(const label parcelI); + virtual bool validInjection(const label parcelI); }; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/NoInjection/NoInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/NoInjection/NoInjection.C index 5e51bc26a9ee1c3a8c392dc9248df4287d90fb06..9e8019e5373a21f031105bb8a98b598a8df80cbe 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/NoInjection/NoInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/NoInjection/NoInjection.C @@ -90,6 +90,7 @@ Foam::scalar Foam::NoInjection<CloudType>::timeEnd() const template<class CloudType> void Foam::NoInjection<CloudType>::setPositionAndCell ( + const label, const label, const scalar, vector&, @@ -99,24 +100,26 @@ void Foam::NoInjection<CloudType>::setPositionAndCell template<class CloudType> -Foam::vector Foam::NoInjection<CloudType>::velocity +void Foam::NoInjection<CloudType>::setProperties ( const label, - const scalar + const label, + const scalar, + typename CloudType::parcelType& parcel ) { - return vector::zero; + // set particle velocity + parcel.U() = vector::zero; + + // set particle diameter + parcel.d() = 0.0; } template<class CloudType> -Foam::scalar Foam::NoInjection<CloudType>::d0 -( - const label, - const scalar -) const +bool Foam::NoInjection<CloudType>::fullyDescribed() const { - return 0.0; + return false; } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/NoInjection/NoInjection.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/NoInjection/NoInjection.H index e05790a64e928e90e3d00e8d7c3326cf97e5f3e9..6f2950b17cdf16df1090e8f1ba136543f1b5f981 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/NoInjection/NoInjection.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/NoInjection/NoInjection.H @@ -33,8 +33,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef noInjection_H -#define noInjection_H +#ifndef NoInjection_H +#define NoInjection_H #include "InjectionModel.H" @@ -56,14 +56,14 @@ protected: // Protected member functions - //- Number of parcels to introduce over the time step + //- Number of parcels to introduce over the time step relative to SOI label parcelsToInject ( const scalar, const scalar ) const; - //- Volume of parcels to introduce over the time step + //- Volume of parcels to introduce over the time step relative to SOI scalar volumeToInject ( const scalar, @@ -103,31 +103,29 @@ public: // Injection geometry //- Set the injection position and owner cell - void setPositionAndCell + virtual void setPositionAndCell ( const label parcelI, + const label nParcels, const scalar time, vector& position, label& cellOwner ); - //- Return the velocity of the parcel to introduce at a time - vector velocity + virtual void setProperties ( const label parcelI, - const scalar time + const label nParcels, + const scalar time, + typename CloudType::parcelType& parcel ); - //- Return the diameter of the parcel to introduce at a time - scalar d0 - ( - const label parcelI, - const scalar time - ) const; + //- Flag to identify whether model fully describes the parcel + virtual bool fullyDescribed() const; //- Return flag to identify whether or not injection in cellI is // permitted - bool validInjection(const label cellI); + virtual bool validInjection(const label cellI); }; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C new file mode 100644 index 0000000000000000000000000000000000000000..257f2af21a9d9632fdc561fc9f25cdb7f1a46cf0 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C @@ -0,0 +1,140 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "LocalInteraction.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template <class CloudType> +bool Foam::LocalInteraction<CloudType>::applyToPatch(const polyPatch& pp) const +{ + forAll(patchIds_, patchI) + { + if (patchIds_[patchI] == pp.index()) + { + return true; + } + } + + return false; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template <class CloudType> +Foam::LocalInteraction<CloudType>::LocalInteraction +( + const dictionary& dict, + CloudType& cloud +) +: + PatchInteractionModel<CloudType>(dict, cloud, typeName), + patchData_(this->coeffDict().lookup("patches")), + patchIds_(patchData_.size()) +{ + const polyMesh& mesh = cloud.mesh(); + const polyBoundaryMesh& bMesh = mesh.boundaryMesh(); + + forAll(patchData_, patchI) + { + const word& patchName = patchData_[patchI].patchName(); + patchIds_[patchI] = bMesh.findPatchID(patchName); + if (patchIds_[patchI] < 0) + { + FatalErrorIn("LocalInteraction(const dictionary&, CloudType&)") + << "Patch " << patchName << " not found. Available patches " + << "are: " << bMesh.names() << exit(FatalError); + } + } + + // check that all walls are specified + DynamicList<word> badWalls; + forAll(bMesh, patchI) + { + if (isA<wallPolyPatch>(bMesh[patchI]) && !applyToPatch(bMesh[patchI])) + { + badWalls.append(bMesh[patchI].name()); + } + } + + if (badWalls.size() > 0) + { + FatalErrorIn("LocalInteraction(const dictionary&, CloudType&)") + << "All wall patches must be specified when employing local patch " + << "interaction. Please specify data for patches:" << nl + << badWalls << nl << exit(FatalError); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template <class CloudType> +Foam::LocalInteraction<CloudType>::~LocalInteraction() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class CloudType> +bool Foam::LocalInteraction<CloudType>::active() const +{ + return true; +} + + +template <class CloudType> +bool Foam::LocalInteraction<CloudType>::correct +( + const polyPatch& pp, + const label faceId, + vector& U +) const +{ + if (applyToPatch(pp)) + { + vector nw = pp.faceAreas()[pp.whichFace(faceId)]; + nw /= mag(nw); + + scalar Un = U & nw; + vector Ut = U - Un*nw; + + if (Un > 0) + { + U -= (1.0 + patchData_[pp.index()].e())*Un*nw; + } + + U -= patchData_[pp.index()].mu()*Ut; + + return true; + } + + return false; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H new file mode 100644 index 0000000000000000000000000000000000000000..a53d6398efb22b488f37cd34c98736061d1a39b9 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.H @@ -0,0 +1,186 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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::LocalInteraction + +Description + Patch interaction specified on a patch-by-patch basis + +\*---------------------------------------------------------------------------*/ + +#ifndef LocalInteraction_H +#define LocalInteraction_H + +#include "PatchInteractionModel.H" +#include "dictionaryEntry.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class LocalInteraction Declaration +\*---------------------------------------------------------------------------*/ + +template<class CloudType> +class LocalInteraction +: + public PatchInteractionModel<CloudType> +{ + class patchInteractionData + { + // Private data + + //- Patch name + word patchName_; + + //- Elasticity coefficient + scalar e_; + + //- Restitution coefficient + scalar mu_; + + + public: + + //- Construct null + patchInteractionData() + : + patchName_("unknownPatch"), + e_(0.0), + mu_(0.0) + {} + + //- Construct from dictionary + patchInteractionData(const dictionary& dict); + + // Member functions + + // Access + + //- Return const access to the patch name + const word& patchName() const + { + return patchName_; + } + + //- Return const access to the elasticity coefficient + scalar e() const + { + return e_; + } + + //- Return const access to the restitution coefficient + scalar mu() const + { + return mu_; + } + + + // I-O + + //- Istream operator + friend Istream& operator>>(Istream& is, patchInteractionData& pid) + { + is.check + ( + "Istream& operator>>" + "(Istream&, patchInteractionData&)" + ); + + const dictionaryEntry entry(dictionary::null, is); + + pid.patchName_ = entry.keyword(); + entry.lookup("e") >> pid.e_; + entry.lookup("mu") >> pid.mu_; + + return is; + } + }; + + + // Private data + + //- List of participating patches + const List<patchInteractionData> patchData_; + + //- List of participating patch ids + List<label> patchIds_; + + + // Private member functions + + //- Returns true if patch is in patchIds_ list + bool applyToPatch(const polyPatch& pp) const; + + + +public: + + //- Runtime type information + TypeName("LocalInteraction"); + + + // Constructors + + //- Construct from dictionary + LocalInteraction(const dictionary& dict, CloudType& cloud); + + + //- Destructor + virtual ~LocalInteraction(); + + + // Member Functions + + //- Flag to indicate whether model activates patch interaction model + virtual bool active() const; + + //- Apply velocity correction + // Returns true if particle remains in same cell + virtual bool correct + ( + const polyPatch& pp, + const label faceId, + vector& U + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "LocalInteraction.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/WallInteractionModel/NewWallInteractionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/NewPatchInteractionModel.C similarity index 71% rename from src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/WallInteractionModel/NewWallInteractionModel.C rename to src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/NewPatchInteractionModel.C index 522432191af717485be937013e972ea969ac5c06..83740bb684d1e0dea8fdf4a8acc637fc5854170a 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/WallInteractionModel/NewWallInteractionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/NewPatchInteractionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,43 +24,43 @@ License \*---------------------------------------------------------------------------*/ -#include "WallInteractionModel.H" +#include "PatchInteractionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template<class CloudType> -Foam::autoPtr<Foam::WallInteractionModel<CloudType> > -Foam::WallInteractionModel<CloudType>::New +Foam::autoPtr<Foam::PatchInteractionModel<CloudType> > +Foam::PatchInteractionModel<CloudType>::New ( const dictionary& dict, CloudType& owner ) { - word WallInteractionModelType(dict.lookup("WallInteractionModel")); + word PatchInteractionModelType(dict.lookup("PatchInteractionModel")); - Info<< "Selecting WallInteractionModel " << WallInteractionModelType + Info<< "Selecting PatchInteractionModel " << PatchInteractionModelType << endl; typename dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(WallInteractionModelType); + dictionaryConstructorTablePtr_->find(PatchInteractionModelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorIn ( - "WallInteractionModel<CloudType>::New" + "PatchInteractionModel<CloudType>::New" "(" "const dictionary&, " "CloudType&" ")" - ) << "Unknown WallInteractionModelType type " - << WallInteractionModelType + ) << "Unknown PatchInteractionModelType type " + << PatchInteractionModelType << ", constructor not in hash table" << nl << nl - << " Valid WallInteractionModel types are:" << nl + << " Valid PatchInteractionModel types are:" << nl << dictionaryConstructorTablePtr_->toc() << exit(FatalError); } - return autoPtr<WallInteractionModel<CloudType> >(cstrIter()(dict, owner)); + return autoPtr<PatchInteractionModel<CloudType> >(cstrIter()(dict, owner)); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/WallInteractionModel/WallInteractionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C similarity index 81% rename from src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/WallInteractionModel/WallInteractionModel.C rename to src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C index 5ee04a0a1cd82ae0cef3c81dab963269801b7d4b..117e6005c8c98cd61f275cd512c8e8ac281070a4 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/WallInteractionModel/WallInteractionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,12 +24,12 @@ License \*---------------------------------------------------------------------------*/ -#include "WallInteractionModel.H" +#include "PatchInteractionModel.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class CloudType> -Foam::WallInteractionModel<CloudType>::WallInteractionModel +Foam::PatchInteractionModel<CloudType>::PatchInteractionModel ( const dictionary& dict, CloudType& owner, @@ -45,7 +45,7 @@ Foam::WallInteractionModel<CloudType>::WallInteractionModel // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template<class CloudType> -Foam::WallInteractionModel<CloudType>::~WallInteractionModel() +Foam::PatchInteractionModel<CloudType>::~PatchInteractionModel() {} @@ -53,14 +53,14 @@ Foam::WallInteractionModel<CloudType>::~WallInteractionModel() template<class CloudType> const CloudType& -Foam::WallInteractionModel<CloudType>::owner() const +Foam::PatchInteractionModel<CloudType>::owner() const { return owner_; } template<class CloudType> -const Foam::dictionary& Foam::WallInteractionModel<CloudType>::dict() const +const Foam::dictionary& Foam::PatchInteractionModel<CloudType>::dict() const { return dict_; } @@ -68,7 +68,7 @@ const Foam::dictionary& Foam::WallInteractionModel<CloudType>::dict() const template<class CloudType> const Foam::dictionary& -Foam::WallInteractionModel<CloudType>::coeffDict() const +Foam::PatchInteractionModel<CloudType>::coeffDict() const { return coeffDict_; } @@ -76,7 +76,7 @@ Foam::WallInteractionModel<CloudType>::coeffDict() const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "NewWallInteractionModel.C" +#include "NewPatchInteractionModel.C" // ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/WallInteractionModel/WallInteractionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H similarity index 65% rename from src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/WallInteractionModel/WallInteractionModel.H rename to src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H index 6f9648231feb6b3c746e0e9c7ee061306752fb82..986d30d3a1c20d513a170fe4d03096351f8fa790 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/WallInteractionModel/WallInteractionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,20 +23,19 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::WallInteractionModel - + Foam::PatchInteractionModel Description - Templated wall interaction model class + Templated patch interaction model class SourceFiles - WallInteractionModel.C - NewWallInteractionModel.C + PatchInteractionModel.C + NewPatchInteractionModel.C \*---------------------------------------------------------------------------*/ -#ifndef WallInteractionModel_H -#define WallInteractionModel_H +#ifndef PatchInteractionModel_H +#define PatchInteractionModel_H #include "IOdictionary.H" #include "autoPtr.H" @@ -48,18 +47,18 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class WallInteractionModel Declaration + Class PatchInteractionModel Declaration \*---------------------------------------------------------------------------*/ template<class CloudType> -class WallInteractionModel +class PatchInteractionModel { // Private data //- The cloud dictionary const dictionary& dict_; - // reference to the owner cloud class + //- Reference to the owner cloud class CloudType& owner_; //- The coefficients dictionary @@ -69,13 +68,13 @@ class WallInteractionModel public: //- Runtime type information - TypeName("WallInteractionModel"); + TypeName("PatchInteractionModel"); //- Declare runtime constructor selection table declareRunTimeSelectionTable ( autoPtr, - WallInteractionModel, + PatchInteractionModel, dictionary, ( const dictionary& dict, @@ -88,7 +87,7 @@ public: // Constructors //- Construct from components - WallInteractionModel + PatchInteractionModel ( const dictionary& dict, CloudType& owner, @@ -97,11 +96,11 @@ public: //- Destructor - virtual ~WallInteractionModel(); + virtual ~PatchInteractionModel(); //- Selector - static autoPtr<WallInteractionModel<CloudType> > New + static autoPtr<PatchInteractionModel<CloudType> > New ( const dictionary& dict, CloudType& owner @@ -122,13 +121,14 @@ public: // Member Functions - //- Flag to indicate whether model activates heat transfer model + //- Flag to indicate whether model activates patch interaction model virtual bool active() const = 0; - //- Apply wall correction - virtual void correct + //- Apply velocity correction + // Returns true if particle remains in same cell + virtual bool correct ( - const wallPolyPatch& wpp, + const polyPatch& pp, const label faceId, vector& U ) const = 0; @@ -141,30 +141,44 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeWallInteractionModel(CloudType) \ +#define makePatchInteractionModel(CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(WallInteractionModel<CloudType>, 0); \ + defineNamedTemplateTypeNameAndDebug(PatchInteractionModel<CloudType>, 0); \ \ defineTemplateRunTimeSelectionTable \ ( \ - WallInteractionModel<CloudType>, \ + PatchInteractionModel<CloudType>, \ dictionary \ ); -#define makeWallInteractionModelType(SS, CloudType, ParcelType) \ +#define makePatchInteractionModelType(SS, CloudType, ParcelType) \ \ defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ \ - WallInteractionModel<CloudType<ParcelType> >:: \ + PatchInteractionModel<CloudType<ParcelType> >:: \ adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ add##SS##CloudType##ParcelType##ConstructorToTable_; +#define makePatchInteractionModelThermoType(SS, CloudType, ParcelType, ThermoType)\ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + SS<CloudType<ParcelType<ThermoType> > >, \ + 0 \ + ); \ + \ + PatchInteractionModel<CloudType<ParcelType<ThermoType> > >:: \ + adddictionaryConstructorToTable \ + <SS<CloudType<ParcelType<ThermoType> > > > \ + add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "WallInteractionModel.C" +# include "PatchInteractionModel.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/Rebound/Rebound.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.C similarity index 88% rename from src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/Rebound/Rebound.C rename to src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.C index a437c67edbdc18a44bc3b96710de2ab02f3afd6b..e5cfdd3540105e38d9f32f211a131923642faadb 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/Rebound/Rebound.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,7 +35,7 @@ Foam::Rebound<CloudType>::Rebound CloudType& cloud ) : - WallInteractionModel<CloudType>(dict, cloud, typeName), + PatchInteractionModel<CloudType>(dict, cloud, typeName), UFactor_(readScalar(this->coeffDict().lookup("UFactor"))) {} @@ -57,14 +57,14 @@ bool Foam::Rebound<CloudType>::active() const template<class CloudType> -void Foam::Rebound<CloudType>::correct +bool Foam::Rebound<CloudType>::correct ( - const wallPolyPatch& wpp, + const polyPatch& pp, const label faceId, vector& U ) const { - vector nw = wpp.faceAreas()[wpp.whichFace(faceId)]; + vector nw = pp.faceAreas()[pp.whichFace(faceId)]; nw /= mag(nw); scalar Un = U & nw; @@ -76,6 +76,8 @@ void Foam::Rebound<CloudType>::correct } U -= Ut; + + return true; } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/Rebound/Rebound.H b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.H similarity index 82% rename from src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/Rebound/Rebound.H rename to src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.H index da99ceec6722e38a94247ecb5956bcb94fbdd434..7e3126996f92760256966da6945c608d127832bf 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/Rebound/Rebound.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,14 +26,14 @@ Class Foam::Rebound Description - Simple rebound wall interaction model + Simple rebound patch interaction model \*---------------------------------------------------------------------------*/ #ifndef Rebound_H #define Rebound_H -#include "WallInteractionModel.H" +#include "PatchInteractionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -46,7 +46,7 @@ namespace Foam template<class CloudType> class Rebound : - public WallInteractionModel<CloudType> + public PatchInteractionModel<CloudType> { // Private data @@ -64,11 +64,7 @@ public: // Constructors //- Construct from dictionary - Rebound - ( - const dictionary& dict, - CloudType& cloud - ); + Rebound(const dictionary& dict, CloudType& cloud); //- Destructor @@ -77,13 +73,14 @@ public: // Member Functions - //- Flag to indicate whether model activates heat transfer model - bool active() const; + //- Flag to indicate whether model activates patch interaction model + virtual bool active() const; - //- Apply wall correction - virtual void correct + //- Apply velocity correction + // Returns true if particle remains in same cell + virtual bool correct ( - const wallPolyPatch& wpp, + const polyPatch& pp, const label faceId, vector& U ) const; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/StandardWallInteraction/StandardWallInteraction.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.C similarity index 80% rename from src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/StandardWallInteraction/StandardWallInteraction.C rename to src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.C index 0c09c4be378e9f5de7ce012c112489ef162d038b..f87c0dd08b927c739ee6b9ca9592f98a8df8dbda 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/StandardWallInteraction/StandardWallInteraction.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,8 +24,6 @@ License \*---------------------------------------------------------------------------*/ -#include "error.H" - #include "StandardWallInteraction.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -37,7 +35,7 @@ Foam::StandardWallInteraction<CloudType>::StandardWallInteraction CloudType& cloud ) : - WallInteractionModel<CloudType>(dict, cloud, typeName), + PatchInteractionModel<CloudType>(dict, cloud, typeName), e_(dimensionedScalar(this->coeffDict().lookup("e")).value()), mu_(dimensionedScalar(this->coeffDict().lookup("mu")).value()) {} @@ -60,25 +58,32 @@ bool Foam::StandardWallInteraction<CloudType>::active() const template <class CloudType> -void Foam::StandardWallInteraction<CloudType>::correct +bool Foam::StandardWallInteraction<CloudType>::correct ( - const wallPolyPatch& wpp, + const polyPatch& pp, const label faceId, vector& U ) const { - vector nw = wpp.faceAreas()[wpp.whichFace(faceId)]; - nw /= mag(nw); + if (isA<wallPolyPatch>(pp)) + { + vector nw = pp.faceAreas()[pp.whichFace(faceId)]; + nw /= mag(nw); - scalar Un = U & nw; - vector Ut = U - Un*nw; + scalar Un = U & nw; + vector Ut = U - Un*nw; - if (Un > 0) - { - U -= (1.0 + e_)*Un*nw; + if (Un > 0) + { + U -= (1.0 + e_)*Un*nw; + } + + U -= mu_*Ut; + + return true; } - U -= mu_*Ut; + return false; } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/StandardWallInteraction/StandardWallInteraction.H b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.H similarity index 83% rename from src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/StandardWallInteraction/StandardWallInteraction.H rename to src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.H index afdc572103145295cbe9767ea7e17ca31214f4af..3e2175e4698cbbf05c5a9a7175469ae12403a4ee 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/WallInteractionModel/StandardWallInteraction/StandardWallInteraction.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,7 +33,7 @@ Description #ifndef StandardWallInteraction_H #define StandardWallInteraction_H -#include "WallInteractionModel.H" +#include "PatchInteractionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -46,14 +46,14 @@ namespace Foam template<class CloudType> class StandardWallInteraction : - public WallInteractionModel<CloudType> + public PatchInteractionModel<CloudType> { // Private data //- Elasticity const scalar e_; - //-Restitution coefficient + //- Restitution coefficient const scalar mu_; @@ -66,11 +66,7 @@ public: // Constructors //- Construct from dictionary - StandardWallInteraction - ( - const dictionary& dict, - CloudType& cloud - ); + StandardWallInteraction(const dictionary& dict, CloudType& cloud); //- Destructor @@ -79,13 +75,14 @@ public: // Member Functions - //- Flag to indicate whether model activates heat transfer model - bool active() const; + //- Flag to indicate whether model activates patch interaction model + virtual bool active() const; - //- Apply wall correction - virtual void correct + //- Apply velocity correction + // Returns true if particle remains in same cell + virtual bool correct ( - const wallPolyPatch& wpp, + const polyPatch& pp, const label faceId, vector& U ) const; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/NoPostProcessing/NoPostProcessing.C b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/NoPostProcessing/NoPostProcessing.C new file mode 100644 index 0000000000000000000000000000000000000000..b1842b858a17fbd1122ef59e12e7c0400aacfda7 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/NoPostProcessing/NoPostProcessing.C @@ -0,0 +1,78 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "NoPostProcessing.H" + +// * * * * * * * * * * * * * protected Member Functions * * * * * * * * * * // + +template<class CloudType> +void Foam::NoPostProcessing<CloudType>::write() +{ +// do nothing +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::NoPostProcessing<CloudType>::NoPostProcessing +( + const dictionary&, + CloudType& owner +) +: + PostProcessingModel<CloudType>(owner) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::NoPostProcessing<CloudType>::~NoPostProcessing() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class CloudType> +bool Foam::NoPostProcessing<CloudType>::active() const +{ + return false; +} + + +template<class CloudType> +void Foam::NoPostProcessing<CloudType>::postPatch +( + const typename CloudType::parcelType&, + const label +) +{ +// do nothing +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/NoPostProcessing/NoPostProcessing.H b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/NoPostProcessing/NoPostProcessing.H new file mode 100644 index 0000000000000000000000000000000000000000..6328cc67212de074cc002511bc41612c3f820554 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/NoPostProcessing/NoPostProcessing.H @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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::NoPostProcessing + +Description + Place holder for 'none' option + +SourceFiles + NoPostProcessing.C + +\*---------------------------------------------------------------------------*/ + +#ifndef NoPostProcessing_H +#define NoPostProcessing_H + +#include "PostProcessingModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class NoPostProcessing Declaration +\*---------------------------------------------------------------------------*/ + +template<class CloudType> +class NoPostProcessing +: + public PostProcessingModel<CloudType> +{ +protected: + + // Protected member functions + + //- Write post-processing info + void write(); + + +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from components + NoPostProcessing(const dictionary&, CloudType&); + + + //- Destructor + virtual ~NoPostProcessing(); + + + // Member Functions + + // Evaluation + + //- Flag to indicate whether model activates post-processing model + virtual bool active() const; + + //- Gather post-processing info on patch + virtual void postPatch + ( + const typename CloudType::parcelType& p, + const label patchI + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "NoPostProcessing.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PatchPostProcessing/PatchPostProcessing.C b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PatchPostProcessing/PatchPostProcessing.C new file mode 100644 index 0000000000000000000000000000000000000000..8bd67c31daf6211257ef6bdc90440139f8c14e20 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PatchPostProcessing/PatchPostProcessing.C @@ -0,0 +1,143 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "PatchPostProcessing.H" +#include "IOPtrList.H" + +// * * * * * * * * * * * * * protected Member Functions * * * * * * * * * * // + +template<class CloudType> +void Foam::PatchPostProcessing<CloudType>::write() +{ + forAll(patchData_, patchI) + { + IOPtrList<parcelType> postObject + ( + IOobject + ( + patchNames_[patchI] + ".post", + this->owner().time().timeName(), + "postProcessing", + this->owner(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + patchData_[patchI].size() + ); + + forAll(postObject, ptrI) + { + postObject.set(ptrI, patchData_[patchI][ptrI].ptr()); + } + + postObject.note() = parcelType::propHeader; + + postObject.writeObject + ( + IOstream::ASCII, + IOstream::currentVersion, + mesh_.time().writeCompression() + ); + + patchData_[patchI].clearStorage(); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::PatchPostProcessing<CloudType>::PatchPostProcessing +( + const dictionary& dict, + CloudType& owner +) +: + PostProcessingModel<CloudType>(dict, owner, typeName), + mesh_(owner.mesh()), + patchNames_(this->coeffDict().lookup("patches")), + patchData_(patchNames_.size()), + globalToLocalPatchIds_(patchNames_.size()) +{ + labelList localToGlobal(patchNames_.size()); + forAll(patchNames_, patchI) + { + label id = mesh_.boundaryMesh().findPatchID(patchNames_[patchI]); + if (id < 0) + { + FatalErrorIn + ( + "PatchPostProcessing<CloudType>::PatchPostProcessing" + "(" + "const dictionary&, " + "CloudType& owner" + ")" + )<< "Requested patch " << patchNames_[patchI] << " not found" << nl + << "Available patches are: " << mesh_.boundaryMesh().names() << nl + << exit(FatalError); + } + localToGlobal[patchI] = id; + } + + forAll(localToGlobal, patchI) + { + globalToLocalPatchIds_[localToGlobal[patchI]] = patchI; + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::PatchPostProcessing<CloudType>::~PatchPostProcessing() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class CloudType> +bool Foam::PatchPostProcessing<CloudType>::active() const +{ + return true; +} + + +template<class CloudType> +void Foam::PatchPostProcessing<CloudType>::postPatch +( + const parcelType& p, + const label patchI +) +{ + label localPatchI = globalToLocalPatchIds_[patchI]; + if (patchData_[localPatchI].size() < maxStoredParcels_) + { + patchData_[localPatchI].append(p.clone()); + } +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PatchPostProcessing/PatchPostProcessing.H b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PatchPostProcessing/PatchPostProcessing.H new file mode 100644 index 0000000000000000000000000000000000000000..78c5e205082338ba9cb5166f93904eaa5ab08bcf --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PatchPostProcessing/PatchPostProcessing.H @@ -0,0 +1,148 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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::PatchPostProcessing + +Description + Standard post-processing + +SourceFiles + PatchPostProcessing.C + +\*---------------------------------------------------------------------------*/ + +#ifndef PatchPostProcessing_H +#define PatchPostProcessing_H + +#include "PostProcessingModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class PatchPostProcessing Declaration +\*---------------------------------------------------------------------------*/ + +template<class CloudType> +class PatchPostProcessing +: + public PostProcessingModel<CloudType> +{ + // Private data + + typedef typename CloudType::parcelType parcelType; + + //- Reference to the mesh + const polyMesh& mesh_; + + //- Maximum number of parcels to store per patch + label maxStoredParcels_; + + //- List of patch names + wordList patchNames_; + + //- List of parcel data per patch + List<DynamicList<autoPtr<parcelType> > > patchData_; + + //- Mapping from global to local patch ids + labelList globalToLocalPatchIds_; + + +protected: + + // Protected member functions + + //- Write post-processing info + void write(); + + +public: + + //- Runtime type information + TypeName("PatchPostProcessing"); + + + // Constructors + + //- Construct from dictionary + PatchPostProcessing(const dictionary& dict, CloudType& owner); + + + //- Destructor + virtual ~PatchPostProcessing(); + + + // Member Functions + + // Access + + //- Return const access to the mesh + inline const polyMesh& mesh() const; + + //- Return maximum number of parcels to store per patch + inline label maxStoredParcels() const; + + //- 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; + + + // Evaluation + + //- Flag to indicate whether model activates post-processing model + virtual bool active() const; + + //- Gather post-processing info on patch + virtual void postPatch + ( + const parcelType& p, + const label patchI + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "PatchPostProcessingI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "PatchPostProcessing.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PatchPostProcessing/PatchPostProcessingI.H b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PatchPostProcessing/PatchPostProcessingI.H new file mode 100644 index 0000000000000000000000000000000000000000..3ecdf058e82da9e18a7c1c7b2221b4e7da5ea459 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PatchPostProcessing/PatchPostProcessingI.H @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +template<class CloudType> +const Foam::polyMesh& Foam::PatchPostProcessing<CloudType>::mesh() const +{ + return mesh_; +} + + +template<class CloudType> +Foam::label Foam::PatchPostProcessing<CloudType>::maxStoredParcels() const +{ + return maxStoredParcels_; +} + + +template<class CloudType> +const Foam::wordList& Foam::PatchPostProcessing<CloudType>::patchNames() const +{ + return patchNames_; +} + + +template<class CloudType> +const Foam::labelList& +Foam::PatchPostProcessing<CloudType>::globalToLocalPatchIds() const +{ + return globalToLocalPatchIds_; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/NewPostProcessingModel.C b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/NewPostProcessingModel.C new file mode 100644 index 0000000000000000000000000000000000000000..29c096b67769cefbb1626097d6f6c16b38f6ff22 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/NewPostProcessingModel.C @@ -0,0 +1,66 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "PostProcessingModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::autoPtr<Foam::PostProcessingModel<CloudType> > +Foam::PostProcessingModel<CloudType>::New +( + const dictionary& dict, + CloudType& owner +) +{ + word PostProcessingModelType(dict.lookup("PostProcessingModel")); + + Info<< "Selecting PostProcessingModel " << PostProcessingModelType << endl; + + typename dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(PostProcessingModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "PostProcessingModel<CloudType>::New" + "(" + "const dictionary&, " + "CloudType&" + ")" + ) << "Unknown PostProcessingModelType type " + << PostProcessingModelType + << ", constructor not in hash table" << nl << nl + << " Valid PostProcessingModel types are:" << nl + << dictionaryConstructorTablePtr_->toc() << exit(FatalError); + } + + return autoPtr<PostProcessingModel<CloudType> >(cstrIter()(dict, owner)); +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModel.C b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModel.C new file mode 100644 index 0000000000000000000000000000000000000000..15d429493fee8c1be0678948a7502a8216f340ea --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModel.C @@ -0,0 +1,77 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "PostProcessingModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::PostProcessingModel<CloudType>::PostProcessingModel(CloudType& owner) +: + dict_(dictionary::null), + owner_(owner), + coeffDict_(dictionary::null) +{} + + +template<class CloudType> +Foam::PostProcessingModel<CloudType>::PostProcessingModel +( + const dictionary& dict, + CloudType& owner, + const word& type +) +: + dict_(dict), + owner_(owner), + coeffDict_(dict.subDict(type + "Coeffs")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::PostProcessingModel<CloudType>::~PostProcessingModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class CloudType> +void Foam::PostProcessingModel<CloudType>::post() +{ + if (owner_.time().outputTime()) + { + this->write(); + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "NewPostProcessingModel.C" + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModel.H b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModel.H new file mode 100644 index 0000000000000000000000000000000000000000..311169aa3aa472f0659b86c1e4ed7ab9cc80e433 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModel.H @@ -0,0 +1,209 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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::PostProcessingModel + +Description + Templated post-processing model class + +SourceFiles + PostProcessingModel.C + NewPostProcessingModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef PostProcessingModel_H +#define PostProcessingModel_H + +#include "IOdictionary.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class PostProcessingModel Declaration +\*---------------------------------------------------------------------------*/ + +template<class CloudType> +class PostProcessingModel +{ + // Private data + + //- The cloud dictionary + const dictionary& dict_; + + //- Reference to the owner cloud class + CloudType& owner_; + + //- The coefficients dictionary + const dictionary coeffDict_; + + +protected: + + // Protected member functions + + //- Write post-processing info + virtual void write() = 0; + + +public: + + //- Runtime type information + TypeName("PostProcessingModel"); + + //- Declare runtime constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + PostProcessingModel, + dictionary, + ( + const dictionary& dict, + CloudType& owner + ), + (dict, owner) + ); + + + // Constructors + + //- Construct null from owner + PostProcessingModel(CloudType& owner); + + //- Construct from dictionary + PostProcessingModel + ( + const dictionary& dict, + CloudType& owner, + const word& type + ); + + + //- Destructor + virtual ~PostProcessingModel(); + + + //- Selector + static autoPtr<PostProcessingModel<CloudType> > New + ( + const dictionary& dict, + CloudType& owner + ); + + + // Member Functions + + // Access + + //- Return the owner cloud dictionary + inline const dictionary& dict() const; + + //- Return const access the owner cloud object + inline const CloudType& owner() const; + + //- Return non-const access the owner cloud object for manipulation + inline CloudType& owner(); + + //- Return the coefficients dictionary + inline const dictionary& coeffDict() const; + + + // Evaluation + + //- Main post-processing function + virtual void post(); + + //- Flag to indicate whether model activates post-processing model + virtual bool active() const = 0; + + //- Gather post-processing info on patch + virtual void postPatch + ( + const typename CloudType::parcelType& p, + const label patchI + ) = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makePostProcessingModel(CloudType) \ + \ + defineNamedTemplateTypeNameAndDebug(PostProcessingModel<CloudType>, 0); \ + \ + defineTemplateRunTimeSelectionTable \ + ( \ + PostProcessingModel<CloudType>, \ + dictionary \ + ); + + +#define makePostProcessingModelType(SS, CloudType, ParcelType) \ + \ + defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + \ + PostProcessingModel<CloudType<ParcelType> >:: \ + adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ + add##SS##CloudType##ParcelType##ConstructorToTable_; + + +#define makePostProcessingModelThermoType(SS, CloudType, ParcelType, ThermoType)\ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + SS<CloudType<ParcelType<ThermoType> > >, \ + 0 \ + ); \ + \ + PostProcessingModel<CloudType<ParcelType<ThermoType> > >:: \ + adddictionaryConstructorToTable \ + <SS<CloudType<ParcelType<ThermoType> > > > \ + add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "PostProcessingModelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "PostProcessingModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModelI.H b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModelI.H new file mode 100644 index 0000000000000000000000000000000000000000..0a95224da503f494be1c5de411eb787381a4da92 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModelI.H @@ -0,0 +1,55 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +template<class CloudType> +const Foam::dictionary& Foam::PostProcessingModel<CloudType>::dict() const +{ + return dict_; +} + + +template<class CloudType> +const CloudType& Foam::PostProcessingModel<CloudType>::owner() const +{ + return owner_; +} + + +template<class CloudType> +CloudType& Foam::PostProcessingModel<CloudType>::owner() +{ + return owner_; +} + + +template<class CloudType> +const Foam::dictionary& Foam::PostProcessingModel<CloudType>::coeffDict() const +{ + return coeffDict_; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C index 4336b72baa3b282e33914f0533e0b9f3fb4f2ab0..4154dcf06c40b0eca5212abaa797a095f776b559 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -64,7 +64,7 @@ Foam::CompositionModel<CloudType>::CompositionModel phaseProps_ ( coeffDict_.lookup("phases"), - carrierThermo_.composition().Y(), + carrierThermo_.composition().species(), liquids_().components(), solids_().components() ) @@ -110,7 +110,7 @@ Foam::CompositionModel<CloudType>::carrierThermo() const template<class CloudType> -const Foam::PtrList<Foam::specieReactingProperties>& +const Foam::PtrList<typename CloudType::thermoType>& Foam::CompositionModel<CloudType>::carrierSpecies() const { return carrierSpecies_; @@ -184,9 +184,9 @@ Foam::label Foam::CompositionModel<CloudType>::globalCarrierId const word& cmptName ) const { - forAll(carrierThermo_.composition().Y(), i) + forAll(carrierThermo_.composition().species(), i) { - word carrierSpecieName = carrierThermo_.composition().Y()[i].name(); + word carrierSpecieName = carrierThermo_.composition().species()[i]; if (cmptName == carrierSpecieName) { return i; diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H index 8fb8762cf02c970feb4db9dceb8ca9e6b8050af9..1e0b800b45709680d18fc421aba7f9b5805e02df 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,7 +78,7 @@ class CompositionModel hCombustionThermo& carrierThermo_; //- Reference to the carrier phase species - const PtrList<specieReactingProperties>& carrierSpecies_; + const PtrList<typename CloudType::thermoType>& carrierSpecies_; //- Global (additional) liquid properties data autoPtr<liquidMixture> liquids_; @@ -152,7 +152,8 @@ public: // Composition lists //- Return the carrier species - const PtrList<specieReactingProperties>& carrierSpecies() const; + const PtrList<typename CloudType::thermoType>& + carrierSpecies() const; //- Return the global (additional) liquids const liquidMixture& liquids() const; @@ -281,13 +282,18 @@ public: ); -#define makeCompositionModelType(SS, CloudType, ParcelType) \ +#define makeCompositionModelThermoType(SS, CloudType, ParcelType, ThermoType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + SS<CloudType<ParcelType<ThermoType> > >, \ + 0 \ + ); \ \ - CompositionModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + CompositionModel<CloudType<ParcelType<ThermoType> > >:: \ + adddictionaryConstructorToTable \ + <SS<CloudType<ParcelType<ThermoType> > > > \ + add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/NewCompositionModel.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/NewCompositionModel.C index 4a9f8d7b745db2ab56a30ee3d5f38b2d424134c6..81d338176c1566f32a42aa47b41d78a4ea4b317c 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/NewCompositionModel.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/NewCompositionModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SingleMixtureFraction/SingleMixtureFraction.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SingleMixtureFraction/SingleMixtureFraction.C index fb00ddc76330fe00b7d730ef300052111120e7f1..64240eab73ef0ec1e2fb75fd1126eed020d7cdba 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SingleMixtureFraction/SingleMixtureFraction.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SingleMixtureFraction/SingleMixtureFraction.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SingleMixtureFraction/SingleMixtureFraction.H b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SingleMixtureFraction/SingleMixtureFraction.H index c2b7198a2581da1483d2e7a3c3ea408866b1c0fb..3555f616f7433c90b261d0403f3f2656ff1582c4 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SingleMixtureFraction/SingleMixtureFraction.H +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SingleMixtureFraction/SingleMixtureFraction.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SinglePhaseMixture/SinglePhaseMixture.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SinglePhaseMixture/SinglePhaseMixture.C index a2ae2053d1ff055d17a41f8e996f9af4007020ae..5be1ce0a495cb03f09176330c3f3ae4b03ef0466 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SinglePhaseMixture/SinglePhaseMixture.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SinglePhaseMixture/SinglePhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SinglePhaseMixture/SinglePhaseMixture.H b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SinglePhaseMixture/SinglePhaseMixture.H index 91a727587dc7fe57fa1f4de3ff8852ea42a70f62..f7fda36a90829efd6e821d9b5638f28c7add25b4 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SinglePhaseMixture/SinglePhaseMixture.H +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SinglePhaseMixture/SinglePhaseMixture.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -141,13 +141,13 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef NoRepository -# include "SinglePhaseMixture.C" -#endif +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam +#ifdef NoRepository +# include "SinglePhaseMixture.C" +#endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.C b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.C new file mode 100644 index 0000000000000000000000000000000000000000..2de0366b31230928c3cec60622aee9f8cf1b6699 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.C @@ -0,0 +1,270 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "ReactingLookupTableInjection.H" +#include "scalarIOList.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template<class CloudType> +Foam::label Foam::ReactingLookupTableInjection<CloudType>::INPUT_FILE_COLS = 12; + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template<class CloudType> +Foam::label Foam::ReactingLookupTableInjection<CloudType>::parcelsToInject +( + const scalar time0, + const scalar time1 +) const +{ + if ((time0 >= 0.0) && (time0 < duration_)) + { + return round(injectorCells_.size()*(time1 - time0)*nParcelsPerSecond_); + } + else + { + return 0; + } +} + + +template<class CloudType> +Foam::scalar Foam::ReactingLookupTableInjection<CloudType>::volumeToInject +( + const scalar time0, + const scalar time1 +) const +{ + scalar volume = 0.0; + if ((time0 >= 0.0) && (time0 < duration_)) + { + forAll(mDot_, injectorI) + { + volume += mDot_[injectorI]/rho_[injectorI]*(time1 - time0); + } + } + + return volume; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::ReactingLookupTableInjection<CloudType>::ReactingLookupTableInjection +( + const dictionary& dict, + CloudType& owner +) +: + InjectionModel<CloudType>(dict, owner, typeName), + inputFileName_(this->coeffDict().lookup("inputFile")), + duration_(readScalar(this->coeffDict().lookup("duration"))), + nParcelsPerSecond_ + ( + readScalar(this->coeffDict().lookup("parcelsPerSecond")) + ), + x_(0), + U_(0), + d_(0), + rho_(0), + mDot_(0), + T_(0), + cp_(0), + Y_(0), + injectorCells_(0) +{ + scalarListIOList injectorData + ( + IOobject + ( + inputFileName_, + owner.db().time().constant(), + owner.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + x_.setSize(injectorData.size()); + U_.setSize(injectorData.size()); + d_.setSize(injectorData.size()); + rho_.setSize(injectorData.size()); + mDot_.setSize(injectorData.size()); + T_.setSize(injectorData.size()); + cp_.setSize(injectorData.size()); + Y_.setSize(injectorData.size()); + + // Populate lists + forAll(injectorData, injectorI) + { + if (injectorData[injectorI].size() != INPUT_FILE_COLS) + { + FatalErrorIn + ( + "ReactingLookupTableInjection" + "(" + "const dictionary&," + "CloudType& owner" + ")" + ) << "Incorrect number of entries in injector specification " + << "- found " << injectorData[injectorI].size() + << ", expected a minimum of " << INPUT_FILE_COLS << ":" << nl + << " x0 x1 x2 u0 u1 u2 d rho mDot T cp Y0..YN" + << nl << exit(FatalError); + } + x_[injectorI].component(0) = injectorData[injectorI][0]; + x_[injectorI].component(1) = injectorData[injectorI][1]; + x_[injectorI].component(2) = injectorData[injectorI][2]; + U_[injectorI].component(0) = injectorData[injectorI][3]; + U_[injectorI].component(1) = injectorData[injectorI][4]; + U_[injectorI].component(2) = injectorData[injectorI][5]; + d_[injectorI] = injectorData[injectorI][6]; + rho_[injectorI] = injectorData[injectorI][7]; + mDot_[injectorI] = injectorData[injectorI][8]; + T_[injectorI] = injectorData[injectorI][9]; + cp_[injectorI] = injectorData[injectorI][10]; + + Y_[injectorI].setSize + ( + injectorData[injectorI].size() - INPUT_FILE_COLS + 1 + ); + label Yi = 0; + for + ( + label i = INPUT_FILE_COLS-1; + i < injectorData[injectorI].size(); + i++ + ) + { + Y_[injectorI][Yi++] = injectorData[injectorI][i]; + } + } + + // Set/cache the injector cells + injectorCells_.setSize(injectorData.size()); + forAll(x_, injectorI) + { + this->findCellAtPosition(injectorCells_[injectorI], x_[injectorI]); + } + + // Determine volume of particles to inject + this->volumeTotal_ = 0.0; + forAll(mDot_, injectorI) + { + this->volumeTotal_ += mDot_[injectorI]/rho_[injectorI]; + } + this->volumeTotal_ *= duration_; +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::ReactingLookupTableInjection<CloudType>::~ReactingLookupTableInjection() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class CloudType> +bool Foam::ReactingLookupTableInjection<CloudType>::active() const +{ + return true; +} + + +template<class CloudType> +Foam::scalar Foam::ReactingLookupTableInjection<CloudType>::timeEnd() const +{ + return this->SOI_ + duration_; +} + + +template<class CloudType> +void Foam::ReactingLookupTableInjection<CloudType>::setPositionAndCell +( + const label parcelI, + const label nParcels, + const scalar time, + vector& position, + label& cellOwner +) +{ + label injectorI = parcelI*injectorCells_.size()/nParcels; + + position = x_[injectorI]; + cellOwner = injectorCells_[injectorI]; +} + + +template<class CloudType> +void Foam::ReactingLookupTableInjection<CloudType>::setProperties +( + const label parcelI, + const label nParcels, + const scalar, + typename CloudType::parcelType& parcel +) +{ + label injectorI = parcelI*injectorCells_.size()/nParcels; + + // set particle velocity + parcel.U() = U_[injectorI]; + + // set particle diameter + parcel.d() = d_[injectorI]; + + // set particle density + parcel.rho() = rho_[injectorI]; + + // set particle temperature + parcel.T() = T_[injectorI]; + + // set particle specific heat capacity + parcel.cp() = cp_[injectorI]; + + // set particle component mass fractions + parcel.Y() = Y_[injectorI]; +} + + +template<class CloudType> +bool Foam::ReactingLookupTableInjection<CloudType>::fullyDescribed() const +{ + return true; +} + + +template<class CloudType> +bool Foam::ReactingLookupTableInjection<CloudType>::validInjection(const label) +{ + return true; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.H b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.H new file mode 100644 index 0000000000000000000000000000000000000000..3ca571ee1e626957a6ce2d4895c381522c7d0e7c --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Reacting/InjectionModel/ReactingLookupTableInjection/ReactingLookupTableInjection.H @@ -0,0 +1,204 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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::ReactingLookupTableInjection + +Description + Particle injection sources read from look-up table. Each row corresponds to + an injection site. + + ( + (x y z u v w d rho mDot T cp Y0..YN) + ); + + where: + x, y, z = global cartesian co-ordinates [m] + u, v, w = global cartesian velocity components [m/s] + d = diameter [m] + rho = density [kg/m3] + mDot = mass flow rate [kg/m3] + T = temperature [K] + cp = specific heat capacity [J/kg/K] + +SourceFiles + ReactingLookupTableInjection.C + +\*---------------------------------------------------------------------------*/ + +#ifndef ReactingLookupTableInjection_H +#define ReactingLookupTableInjection_H + +#include "InjectionModel.H" +#include "pdf.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class ReactingLookupTableInjection Declaration +\*---------------------------------------------------------------------------*/ + +template<class CloudType> +class ReactingLookupTableInjection +: + public InjectionModel<CloudType> +{ + // Private data + + //- Name of file containing injector/parcel data + const word inputFileName_; + + //- Injection duration - common to all injection sources + const scalar duration_; + + //- Number of parcels per injector - common to all injection sources + const label nParcelsPerSecond_; + + //- List of parcel position per injector / [m] + List<point> x_; + + //- List of parcel velocity per injector / [m] + List<vector> U_; + + //- List of parcel diameter per injector / [m] + List<scalar> d_; + + //- List of parcel fluid density pre injector / [kg/m3] + List<scalar> rho_; + + //- List of parcel injection mass flow per injector / [kg/s] + List<scalar> mDot_; + + //- List of parcel temperature flow per injector / [K] + List<scalar> T_; + + //- List of parcel specific heat capacity per injector / [J/kg/K] + List<scalar> cp_; + + //- List of parcel specie mass fractions per injector / [] + List<scalarList> Y_; + + //- List of injector cells per injector + List<label> injectorCells_; + + //- Number of columns expected in input file + static label INPUT_FILE_COLS; + + +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("ReactingLookupTableInjection"); + + + // Constructors + + //- Construct from dictionary + ReactingLookupTableInjection + ( + const dictionary& dict, + CloudType& owner + ); + + + //- Destructor + virtual ~ReactingLookupTableInjection(); + + + // 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 + ); + + //- Set the parcel properties + 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 in cellI is + // permitted + virtual bool validInjection(const label parcelI); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "ReactingLookupTableInjection.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C index d0afb84cb0f2ce89ea90b266cd2eb7872e739a95..b7caef3652d1f71f8b2406c6f4100adb5bd1f905 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C @@ -153,8 +153,8 @@ void Foam::LiquidEvaporation<CloudType>::calculate // Reynolds number scalar Re = mag(Ur)*d/(nuc + ROOTVSMALL); - // film temperature evaluated using the 1/3 rule - scalar Tf = (2.0*T + Tc)/3.0; + // film temperature evaluated using the particle temperature + scalar Tf = T; // calculate mass transfer of each specie in liquid forAll(activeLiquids_, i) @@ -168,7 +168,7 @@ void Foam::LiquidEvaporation<CloudType>::calculate // saturation pressure for species i [pa] // - carrier phase pressure assumed equal to the liquid vapour pressure // close to the surface - scalar pSat = liquids_->properties()[lid].pv(pc, Tf); + scalar pSat = min(liquids_->properties()[lid].pv(pc, Tf), pc); // Schmidt number scalar Sc = nuc/(Dab + ROOTVSMALL); @@ -179,13 +179,13 @@ void Foam::LiquidEvaporation<CloudType>::calculate // mass transfer coefficient [m/s] scalar kc = Sh*Dab/(d + ROOTVSMALL); - // vapour concentration at droplet surface [kgmol/m3] + // vapour concentration at droplet surface [kmol/m3] scalar Cs = pSat/(specie::RR*Tf); - // vapour concentration in bulk gas [kgmol/m3] + // vapour concentration in bulk gas [kmol/m3] scalar Cinf = Xc[gid]*pc/(specie::RR*Tc); - // molar flux of vapour [kgmol/m2/s] + // molar flux of vapour [kmol/m2/s] scalar Ni = max(kc*(Cs - Cinf), 0.0); // mass transfer [kg] diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H index 9c650f1c2efa4ac1b2e3c60dc8ab47b907b43a57..7e569736cab10d9dbb4dac3f464f9a5abbf2a22d 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H @@ -72,7 +72,7 @@ protected: //- Sherwood number as a function of Reynolds and Schmidt numbers scalar Sh(const scalar Re, const scalar Sc) const; - //- Calculate the carrier phase comonent volume fractions at cellI + //- Calculate the carrier phase component volume fractions at cellI scalarField calcXc(const label cellI) const; @@ -99,10 +99,10 @@ public: // Member Functions //- Flag to indicate whether model activates phase change model - bool active() const; + virtual bool active() const; //- Update model - void calculate + virtual void calculate ( const scalar dt, const label cellI, diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/NoPhaseChange/NoPhaseChange.H b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/NoPhaseChange/NoPhaseChange.H index 6419f127ff71a29851b8d33286f493c0eb8448a2..007fa73344ff48732e4dd396c97b8bb131c8e53c 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/NoPhaseChange/NoPhaseChange.H +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/NoPhaseChange/NoPhaseChange.H @@ -67,10 +67,10 @@ public: // Member Functions //- Flag to indicate whether model activates phase change model - bool active() const; + virtual bool active() const; //- Update model - void calculate + virtual void calculate ( const scalar dt, const label cellI, diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H index b8ebc644b01a88e5cb447417d2bb6fcf6f2189e7..2e0f03a3f52510fb46a661246636c0cad340bbc8 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H @@ -168,13 +168,18 @@ public: ); -#define makePhaseChangeModelType(SS, CloudType, ParcelType) \ +#define makePhaseChangeModelThermoType(SS, CloudType, ParcelType, ThermoType) \ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + SS<CloudType<ParcelType<ThermoType> > >, \ + 0 \ + ); \ \ - PhaseChangeModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + PhaseChangeModel<CloudType<ParcelType<ThermoType> > >:: \ + adddictionaryConstructorToTable \ + <SS<CloudType<ParcelType<ThermoType> > > > \ + add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C index 77cea7e00b0e5d5ec678057c12702f647a6e0225..d8d522ff90b4909cbab192757e19ae553637d187 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H index a026bae9a9461e4ebb116efc57f11d6c2369cf3e..b787a9b28254a4c8c09972040a276ace88e47975 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,10 +85,10 @@ public: // Member Functions //- Flag to indicate whether model activates devolatilisation model - bool active() const; + virtual bool active() const; //- Update model - scalar calculate + virtual scalar calculate ( const scalar dt, const scalar mass0, diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.C index 6a3d3efeb2363fc23743977e7e42ebfa7bd13e0d..4239eb19958f8c70326f6aba9a7eea4fe23181ae 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H index bb4e7ddc637f9212e466f011136e66667c73e55e..b7edc60275d7b403049c66a4a1157c3c01f71167 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -160,13 +160,18 @@ public: ); -#define makeDevolatilisationModelType(SS, CloudType, ParcelType) \ +#define makeDevolatilisationModelThermoType(SS, CloudType, ParcelType, ThermoType)\ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + SS<CloudType<ParcelType<ThermoType> > >, \ + 0 \ + ); \ \ - DevolatilisationModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + DevolatilisationModel<CloudType<ParcelType<ThermoType> > >:: \ + adddictionaryConstructorToTable \ + <SS<CloudType<ParcelType<ThermoType> > > > \ + add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/NewDevolatilisationModel.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/NewDevolatilisationModel.C index 838bdf75e21f5e95fae32cb211cb56745da842d1..cac0375b2816f94748edd2a0f12944a38483a51e 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/NewDevolatilisationModel.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/NewDevolatilisationModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.C index c0431a61f3b2faf4f9f66dbb70ae4c029d2e3760..0961826a23c089aea4dd03fe2d22f652f851cf35 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.H index 4dbea82607a2a9fcbacc7fa84f515789cafb79dd..687978a0a2a20af61a28e4b94fce803d669ad6f6 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/NoDevolatilisation/NoDevolatilisation.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -68,10 +68,10 @@ public: // Member Functions //- Flag to indicate whether model activates devolatilisation model - bool active() const; + virtual bool active() const; //- Update model - scalar calculate + virtual scalar calculate ( const scalar, const scalar, diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.C index 2d09c134a974fe160a4c342cb18f8d0cfd5e2658..6f95dd54f9482924d3d355771a0ab00172f55c9c 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.H index 91bd5f06122208d02b266798f4c262eb9a101cf4..48fec17b833019497d909c42bfebdc0e2e7f5838 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,10 +87,10 @@ public: // Member Functions //- Flag to indicate whether model activates devolatilisation model - bool active() const; + virtual bool active() const; //- Update model - scalar calculate + virtual scalar calculate ( const scalar dt, const scalar mass0, diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H index 2deacb3465f3bb6cfe985aa0a516523c82a42b59..f876563fec613eadc020828d1ab89e9cea0bcaf9 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H @@ -60,7 +60,7 @@ class SurfaceReactionModel //- The cloud dictionary const dictionary& dict_; - // reference to the owner cloud class + //- Reference to the owner cloud class CloudType& owner_; //- The coefficients dictionary @@ -172,22 +172,18 @@ public: ); -#define makeSurfaceReactionModelType(SS, CloudType, ParcelType) \ +#define makeSurfaceReactionModelThermoType(SS, CloudType, ParcelType, ThermoType)\ \ - defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \ - \ - SurfaceReactionModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \ - add##SS##CloudType##ParcelType##ConstructorToTable_; - - -#define makeSurfaceReactionModelTypeInstance(SS, CloudType, ParcelType) \ - \ - defineNamedTemplateTypeNameAndDebug(SS, 0); \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + SS<CloudType<ParcelType<ThermoType> > >, \ + 0 \ + ); \ \ - SurfaceReactionModel<CloudType<ParcelType> >:: \ - adddictionaryConstructorToTable<SS> \ - add##SS##CloudType##ParcelType##ConstructorToTable_; + SurfaceReactionModel<CloudType<ParcelType<ThermoType> > >:: \ + adddictionaryConstructorToTable \ + <SS<CloudType<ParcelType<ThermoType> > > > \ + add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H index 1924be16c9bef032cbdd6b9d30eed5d894752ab1..baf61f2395e973377c975c5f21b4c8f5c6b313fd 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H @@ -61,7 +61,7 @@ class HeatTransferModel //- Reference to the owner cloud class CloudType& owner_; - //- The coefficents dictionary + //- The coefficients dictionary const dictionary coeffDict_; @@ -138,7 +138,7 @@ public: virtual scalar Pr() const = 0; //- Return heat transfer coefficient - scalar h + virtual scalar h ( const scalar dp, const vector& Ur, @@ -150,7 +150,7 @@ public: ) const; //- Return linearised coefficient for temperature equation - scalar Cu + virtual scalar Cu ( const scalar dp, const vector& Ur, @@ -189,6 +189,20 @@ public: add##SS##CloudType##ParcelType##ConstructorToTable_; +#define makeHeatTransferModelThermoType(SS, CloudType, ParcelType, ThermoType)\ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + SS<CloudType<ParcelType<ThermoType> > >, \ + 0 \ + ); \ + \ + HeatTransferModel<CloudType<ParcelType<ThermoType> > >:: \ + adddictionaryConstructorToTable \ + <SS<CloudType<ParcelType<ThermoType> > > > \ + add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/NoHeatTransfer/NoHeatTransfer.H b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/NoHeatTransfer/NoHeatTransfer.H index f03b4b3dc5fb1fc5ea169d1ef1f354e5156c0256..2941b4c2b7b9f6eb08515dff5e39c669fcc333a7 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/NoHeatTransfer/NoHeatTransfer.H +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/NoHeatTransfer/NoHeatTransfer.H @@ -67,17 +67,17 @@ public: // Member Functions //- Flag to indicate whether model activates heat transfer model - bool active() const; + virtual bool active() const; //- Nusselt number - scalar Nu + virtual scalar Nu ( const scalar, const scalar ) const; //- Prandtl number - scalar Pr() const; + virtual scalar Pr() const; }; diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.C b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.C index b728282001a0dc7a3f9a8b454fe052fae6d9336f..8e9b6e9379e1dacf996c00baed606fcf1f092bc2 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.C @@ -24,8 +24,6 @@ License \*---------------------------------------------------------------------------*/ -#include "error.H" - #include "RanzMarshall.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.H b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.H index 38d5e040aed7c47013bbcdc5a5d2615fcf12b481..f010160c1feb51aef1ec100b5fd4ae04692dc95c 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.H +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.H @@ -77,17 +77,17 @@ public: // Member Functions //- Flag to indicate whether model activates heat transfer model - bool active() const; + virtual bool active() const; //- Nusselt number - scalar Nu + virtual scalar Nu ( const scalar Re, const scalar Pr ) const; //- Prandtl number - scalar Pr() const; + virtual scalar Pr() const; }; diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.C b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.C new file mode 100644 index 0000000000000000000000000000000000000000..ad7e13b6d20417d9364345d3da04628588241777 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.C @@ -0,0 +1,250 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "ThermoLookupTableInjection.H" +#include "scalarIOList.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template<class CloudType> +Foam::label Foam::ThermoLookupTableInjection<CloudType>::INPUT_FILE_COLS = 11; + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template<class CloudType> +Foam::label Foam::ThermoLookupTableInjection<CloudType>::parcelsToInject +( + const scalar time0, + const scalar time1 +) const +{ + if ((time0 >= 0.0) && (time0 < duration_)) + { + return round(injectorCells_.size()*(time1 - time0)*nParcelsPerSecond_); + } + else + { + return 0; + } +} + + +template<class CloudType> +Foam::scalar Foam::ThermoLookupTableInjection<CloudType>::volumeToInject +( + const scalar time0, + const scalar time1 +) const +{ + scalar volume = 0.0; + if ((time0 >= 0.0) && (time0 < duration_)) + { + forAll(mDot_, injectorI) + { + volume += mDot_[injectorI]/rho_[injectorI]*(time1 - time0); + } + } + + return volume; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::ThermoLookupTableInjection<CloudType>::ThermoLookupTableInjection +( + const dictionary& dict, + CloudType& owner +) +: + InjectionModel<CloudType>(dict, owner, typeName), + inputFileName_(this->coeffDict().lookup("inputFile")), + duration_(readScalar(this->coeffDict().lookup("duration"))), + nParcelsPerSecond_ + ( + readScalar(this->coeffDict().lookup("parcelsPerSecond")) + ), + x_(0), + U_(0), + d_(0), + rho_(0), + mDot_(0), + T_(0), + cp_(0), + injectorCells_(0) +{ + scalarListIOList injectorData + ( + IOobject + ( + inputFileName_, + owner.db().time().constant(), + owner.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + x_.setSize(injectorData.size()); + U_.setSize(injectorData.size()); + d_.setSize(injectorData.size()); + rho_.setSize(injectorData.size()); + mDot_.setSize(injectorData.size()); + T_.setSize(injectorData.size()); + cp_.setSize(injectorData.size()); + + // Populate lists + forAll(injectorData, injectorI) + { + if (injectorData[injectorI].size() != INPUT_FILE_COLS) + { + FatalErrorIn + ( + "ThermoLookupTableInjection" + "(" + "const dictionary&," + "CloudType& owner" + ")" + ) << "Incorrect number of entries in injector specification " + << "- found " << injectorData[injectorI].size() + << ", expected " << INPUT_FILE_COLS << ":" << nl + << " x0 x1 x2 u0 u1 u2 d rho mDot T cp" + << nl << exit(FatalError); + } + x_[injectorI].component(0) = injectorData[injectorI][0]; + x_[injectorI].component(1) = injectorData[injectorI][1]; + x_[injectorI].component(2) = injectorData[injectorI][2]; + U_[injectorI].component(0) = injectorData[injectorI][3]; + U_[injectorI].component(1) = injectorData[injectorI][4]; + U_[injectorI].component(2) = injectorData[injectorI][5]; + d_[injectorI] = injectorData[injectorI][6]; + rho_[injectorI] = injectorData[injectorI][7]; + mDot_[injectorI] = injectorData[injectorI][8]; + T_[injectorI] = injectorData[injectorI][9]; + cp_[injectorI] = injectorData[injectorI][10]; + } + + // Set/cache the injector cells + injectorCells_.setSize(injectorData.size()); + forAll(x_, injectorI) + { + this->findCellAtPosition(injectorCells_[injectorI], x_[injectorI]); + } + + // Determine volume of particles to inject + this->volumeTotal_ = 0.0; + forAll(mDot_, injectorI) + { + this->volumeTotal_ += mDot_[injectorI]/rho_[injectorI]; + } + this->volumeTotal_ *= duration_; +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::ThermoLookupTableInjection<CloudType>::~ThermoLookupTableInjection() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class CloudType> +bool Foam::ThermoLookupTableInjection<CloudType>::active() const +{ + return true; +} + + +template<class CloudType> +Foam::scalar Foam::ThermoLookupTableInjection<CloudType>::timeEnd() const +{ + return this->SOI_ + duration_; +} + + +template<class CloudType> +void Foam::ThermoLookupTableInjection<CloudType>::setPositionAndCell +( + const label parcelI, + const label nParcels, + const scalar time, + vector& position, + label& cellOwner +) +{ + label injectorI = parcelI*injectorCells_.size()/nParcels; + + position = x_[injectorI]; + cellOwner = injectorCells_[injectorI]; +} + + +template<class CloudType> +void Foam::ThermoLookupTableInjection<CloudType>::setProperties +( + const label parcelI, + const label nParcels, + const scalar, + typename CloudType::parcelType* pPtr +) +{ + label injectorI = parcelI*injectorCells_.size()/nParcels; + + // set particle velocity + parcel.U() = U_[injectorI]; + + // set particle diameter + parcel.d() = d_[injectorI]; + + // set particle density + parcel.rho() = rho_[injectorI]; + + // set particle temperature + parcel.T() = T_[injectorI]; + + // set particle specific heat capacity + parcel.cp() = cp_[injectorI]; +} + + +template<class CloudType> +bool Foam::ThermoLookupTableInjection<CloudType>::fullyDescribed() const +{ + return true; +} + + +template<class CloudType> +bool Foam::ThermoLookupTableInjection<CloudType>::validInjection(const label) +{ + return true; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.H b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.H new file mode 100644 index 0000000000000000000000000000000000000000..9a5fd2c6a300b013f9867d1be1bfe1be57372890 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/InjectionModel/ThermoLookupTableInjection/ThermoLookupTableInjection.H @@ -0,0 +1,204 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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::ThermoLookupTableInjection + +Description + Particle injection sources read from look-up table. Each row corresponds to + an injection site. + + ( + (x y z u v w d rho mDot T cp) + ); + + where: + x, y, z = global cartesian co-ordinates [m] + u, v, w = global cartesian velocity components [m/s] + d = diameter [m] + rho = density [kg/m3] + mDot = mass flow rate [kg/m3] + T = temperature [K] + cp = specific heat capacity [J/kg/K] + +SourceFiles + ThermoLookupTableInjection.C + +\*---------------------------------------------------------------------------*/ + +#ifndef ThermoLookupTableInjection_H +#define ThermoLookupTableInjection_H + +#include "InjectionModel.H" +#include "pdf.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class ThermoLookupTableInjection Declaration +\*---------------------------------------------------------------------------*/ + +template<class CloudType> +class ThermoLookupTableInjection +: + public InjectionModel<CloudType> +{ + // Private data + + //- Name of file containing injector/parcel data + const word inputFileName_; + + //- Injection duration - common to all injection sources + const scalar duration_; + + //- Number of parcels per injector - common to all injection sources + const label nParcelsPerSecond_; + + //- List of parcel position per injector / [m] + List<point> x_; + + //- List of parcel velocity per injector / [m] + List<vector> U_; + + //- List of parcel diameter per injector / [m] + List<scalar> d_; + + //- List of parcel fluid density pre injector / [kg/m3] + List<scalar> rho_; + + //- List of parcel injection mass flow per injector / [kg/s] + List<scalar> mDot_; + + //- List of parcel temperature flow per injector / [K] + List<scalar> T_; + + //- List of parcel specific heat capacity per injector / [J/kg/K] + List<scalar> cp_; + + //- List of injector cells per injector + List<label> injectorCells_; + + //- Number of columns expected in input file + static label INPUT_FILE_COLS; + + +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("ThermoLookupTableInjection"); + + + // Constructors + + //- Construct from dictionary + ThermoLookupTableInjection + ( + const dictionary& dict, + CloudType& owner + ); + + + //- Destructor + virtual ~ThermoLookupTableInjection(); + + + // 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 + ); + + //- Set the parcel properties + 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 true; + } + + //- Return flag to identify whether or not injection in cellI is + // permitted + virtual bool validInjection(const label parcelI); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "ThermoLookupTableInjection.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C index ac45040c096840c13064609ed9b80de5b6ef4543..bc9c502ffb57f90181a70127c23c67563e4eb8f1 100644 --- a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C +++ b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C @@ -241,6 +241,28 @@ void Foam::molecule::setSiteSizes(label size) } +bool Foam::molecule::hitPatch +( + const polyPatch&, + molecule::trackData&, + const label +) +{ + return false; +} + + +bool Foam::molecule::hitPatch +( + const polyPatch&, + int&, + const label +) +{ + return false; +} + + void Foam::molecule::hitProcessorPatch ( const processorPolyPatch&, diff --git a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H index 04e33428e99948adae78dbf6645dabc258d42ddd..0ee16f461f00cc2b61c28b694aa290a877448175 100644 --- a/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H +++ b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H @@ -256,7 +256,8 @@ public: // Member Functions - //- Tracking + // Tracking + bool move(trackData&); void transformProperties(const tensor& T); @@ -267,6 +268,7 @@ public: void setSiteSizes(label size); + // Access inline const tensor& Q() const; @@ -305,8 +307,27 @@ public: inline label id() const; + // Member Operators + //- Overridable function to handle the particle hitting a patch + // Executed before other patch-hitting functions + bool hitPatch + ( + const polyPatch&, + molecule::trackData& td, + const label patchI + ); + + //- Overridable function to handle the particle hitting a patch + // Executed before other patch-hitting functions without trackData + bool hitPatch + ( + const polyPatch& p, + int& td, + const label patchI + ); + //- Overridable function to handle the particle hitting a processorPatch void hitProcessorPatch ( diff --git a/src/lagrangian/solidParticle/solidParticle.C b/src/lagrangian/solidParticle/solidParticle.C index 7b9fdf18a6444245442508c3dcd2971b558c0671..e77b9cf8a2f94ac4fd8736e217b9b0ebb9de3874 100644 --- a/src/lagrangian/solidParticle/solidParticle.C +++ b/src/lagrangian/solidParticle/solidParticle.C @@ -84,12 +84,9 @@ bool Foam::solidParticle::move(solidParticle::trackData& td) if (onBoundary() && td.keepParticle) { - if (face() > -1) + if (isType<processorPolyPatch>(pbMesh[patch(face())])) { - if (isType<processorPolyPatch>(pbMesh[patch(face())])) - { - td.switchProcessor = true; - } + td.switchProcessor = true; } } } @@ -98,6 +95,28 @@ bool Foam::solidParticle::move(solidParticle::trackData& td) } +bool Foam::solidParticle::hitPatch +( + const polyPatch&, + solidParticle::trackData&, + const label +) +{ + return false; +} + + +bool Foam::solidParticle::hitPatch +( + const polyPatch&, + int&, + const label +) +{ + return false; +} + + void Foam::solidParticle::hitProcessorPatch ( const processorPolyPatch&, diff --git a/src/lagrangian/solidParticle/solidParticle.H b/src/lagrangian/solidParticle/solidParticle.H index a0977520cc07a9e6f63ea47162fa7b59de26f722..4847970f2fc452a29ba8384c3103f1251fecb63c 100644 --- a/src/lagrangian/solidParticle/solidParticle.H +++ b/src/lagrangian/solidParticle/solidParticle.H @@ -163,68 +163,91 @@ public: inline scalar wallImpactDistance(const vector& n) const; - //- Tracking - bool move(trackData&); + // Tracking + //- Move + bool move(trackData&); - //- Overridable function to handle the particle hitting a processorPatch - void hitProcessorPatch - ( - const processorPolyPatch&, - solidParticle::trackData& td - ); - //- Overridable function to handle the particle hitting a processorPatch - //- without trackData - void hitProcessorPatch - ( - const processorPolyPatch&, - int& - ); + // Patch interactions - //- Overridable function to handle the particle hitting a wallPatch - void hitWallPatch - ( - const wallPolyPatch&, - solidParticle::trackData& td - ); + //- Overridable function to handle the particle hitting a patch + // Executed before other patch-hitting functions + bool hitPatch + ( + const polyPatch&, + solidParticle::trackData& td, + const label patchI + ); - //- Overridable function to handle the particle hitting a wallPatch - //- without trackData - void hitWallPatch - ( - const wallPolyPatch&, - int& - ); + //- Overridable function to handle the particle hitting a patch + // Executed before other patch-hitting functions without trackData + bool hitPatch + ( + const polyPatch& p, + int& td, + const label patchI + ); - //- Overridable function to handle the particle hitting a polyPatch - void hitPatch - ( - const polyPatch&, - solidParticle::trackData& td - ); + //- Overridable function to handle the particle hitting a + // processorPatch + void hitProcessorPatch + ( + const processorPolyPatch&, + solidParticle::trackData& td + ); - //- Overridable function to handle the particle hitting a polyPatch - //- without trackData - void hitPatch - ( - const polyPatch&, - int& - ); + //- Overridable function to handle the particle hitting a + // processorPatch without trackData + void hitProcessorPatch + ( + const processorPolyPatch&, + int& + ); - //- Transform the physical properties of the particle - // according to the given transformation tensor - void transformProperties - ( - const tensor& T - ); + //- Overridable function to handle the particle hitting a wallPatch + void hitWallPatch + ( + const wallPolyPatch&, + solidParticle::trackData& td + ); - //- Transform the physical properties of the particle - // according to the given separation vector - void transformProperties - ( - const vector& separation - ); + //- Overridable function to handle the particle hitting a wallPatch + //- without trackData + void hitWallPatch + ( + const wallPolyPatch&, + int& + ); + + //- Overridable function to handle the particle hitting a polyPatch + void hitPatch + ( + const polyPatch&, + solidParticle::trackData& td + ); + + //- Overridable function to handle the particle hitting a polyPatch + //- without trackData + void hitPatch + ( + const polyPatch&, + int& + ); + + //- Transform the physical properties of the particle + // according to the given transformation tensor + void transformProperties + ( + const tensor& T + ); + + //- Transform the physical properties of the particle + // according to the given separation vector + void transformProperties + ( + const vector& separation + ); // I-O diff --git a/src/meshTools/searchableSurface/searchableBox.C b/src/meshTools/searchableSurface/searchableBox.C index cb9ca7e4426cbc0397baf64d7188f2f9f5e1213e..8b4c0f5c76c5c8abfd0b0ab5f432e268766769a8 100644 --- a/src/meshTools/searchableSurface/searchableBox.C +++ b/src/meshTools/searchableSurface/searchableBox.C @@ -170,7 +170,20 @@ Foam::searchableBox::searchableBox : searchableSurface(io), treeBoundBox(bb) -{} +{ + if (!contains(midpoint())) + { + FatalErrorIn + ( + "Foam::searchableBox::searchableBox\n" + "(\n" + " const IOobject& io,\n" + " const treeBoundBox& bb\n" + ")\n" + ) << "Illegal bounding box specification : " + << static_cast<const treeBoundBox>(*this) << exit(FatalError); + } +} Foam::searchableBox::searchableBox @@ -181,7 +194,20 @@ Foam::searchableBox::searchableBox : searchableSurface(io), treeBoundBox(dict.lookup("min"), dict.lookup("max")) -{} +{ + if (!contains(midpoint())) + { + FatalErrorIn + ( + "Foam::searchableBox::searchableBox\n" + "(\n" + " const IOobject& io,\n" + " const treeBoundBox& bb\n" + ")\n" + ) << "Illegal bounding box specification : " + << static_cast<const treeBoundBox>(*this) << exit(FatalError); + } +} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // diff --git a/src/meshTools/searchableSurface/searchableSurfaceCollection.C b/src/meshTools/searchableSurface/searchableSurfaceCollection.C index 11b37bf97bba53761ebfe02e5e51016dfbd58435..306e78df25fd8242892b219ae4a9e63daf633be0 100644 --- a/src/meshTools/searchableSurface/searchableSurfaceCollection.C +++ b/src/meshTools/searchableSurface/searchableSurfaceCollection.C @@ -36,7 +36,12 @@ namespace Foam { defineTypeNameAndDebug(searchableSurfaceCollection, 0); -addToRunTimeSelectionTable(searchableSurface, searchableSurfaceCollection, dict); +addToRunTimeSelectionTable +( + searchableSurface, + searchableSurfaceCollection, + dict +); } @@ -63,15 +68,17 @@ void Foam::searchableSurfaceCollection::findNearest forAll(subGeom_, surfI) { - // Transform then divide - tmp<pointField> localSamples = cmptDivide + subGeom_[surfI].findNearest ( - transform_[surfI].localPosition(samples), - scale_[surfI] + cmptDivide // Transform then divide + ( + transform_[surfI].localPosition(samples), + scale_[surfI] + ), + localMinDistSqr, + hitInfo ); - subGeom_[surfI].findNearest(localSamples, localMinDistSqr, hitInfo); - forAll(hitInfo, pointI) { if (hitInfo[pointI].hit()) @@ -115,7 +122,8 @@ Foam::searchableSurfaceCollection::searchableSurfaceCollection instance_(dict.size()), scale_(dict.size()), transform_(dict.size()), - subGeom_(dict.size()) + subGeom_(dict.size()), + mergeSubRegions_(dict.lookup("mergeSubRegions")) { Info<< "SearchableCollection : " << name() << endl; @@ -181,12 +189,19 @@ const Foam::wordList& Foam::searchableSurfaceCollection::regions() const { regionOffset_[surfI] = allRegions.size(); - const wordList& subRegions = subGeom_[surfI].regions(); - - forAll(subRegions, i) + if (mergeSubRegions_) { - //allRegions.append(subRegions[i] + "_" + Foam::name(surfI)); - allRegions.append(instance_[surfI] + "_" + subRegions[i]); + // Single name regardless how many regions subsurface has + allRegions.append(instance_[surfI] + "_" + Foam::name(surfI)); + } + else + { + const wordList& subRegions = subGeom_[surfI].regions(); + + forAll(subRegions, i) + { + allRegions.append(instance_[surfI] + "_" + subRegions[i]); + } } } regions_.transfer(allRegions.shrink()); @@ -370,7 +385,15 @@ void Foam::searchableSurfaceCollection::getRegion {} else if (subGeom_.size() == 1) { - subGeom_[0].getRegion(info, region); + if (mergeSubRegions_) + { + region.setSize(info.size()); + region = regionOffset_[0]; + } + else + { + subGeom_[0].getRegion(info, region); + } } else { @@ -429,15 +452,25 @@ void Foam::searchableSurfaceCollection::getRegion // Collect points from my surface labelList indices(findIndices(nearestSurf, surfI)); - labelList surfRegion; - subGeom_[surfI].getRegion - ( - UIndirectList<pointIndexHit>(info, indices), - surfRegion - ); - forAll(indices, i) + if (mergeSubRegions_) { - region[indices[i]] = regionOffset_[surfI] + surfRegion[i]; + forAll(indices, i) + { + region[indices[i]] = regionOffset_[surfI]; + } + } + else + { + labelList surfRegion; + subGeom_[surfI].getRegion + ( + UIndirectList<pointIndexHit>(info, indices), + surfRegion + ); + forAll(indices, i) + { + region[indices[i]] = regionOffset_[surfI] + surfRegion[i]; + } } } } diff --git a/src/meshTools/searchableSurface/searchableSurfaceCollection.H b/src/meshTools/searchableSurface/searchableSurfaceCollection.H index 9c39923747f9abcb1c21b4b4ce3993086ba14773..2004bf9400c24c01a7bf2a1c475973f05a1c6562 100644 --- a/src/meshTools/searchableSurface/searchableSurfaceCollection.H +++ b/src/meshTools/searchableSurface/searchableSurfaceCollection.H @@ -40,6 +40,7 @@ SourceFiles #include "treeBoundBox.H" #include "coordinateSystem.H" #include "UPtrList.H" +#include "Switch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -73,6 +74,8 @@ private: UPtrList<searchableSurface> subGeom_; + Switch mergeSubRegions_; + //- Region names mutable wordList regions_; //- From individual regions to collection regions diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/IOfieldMinMax.H b/src/postProcessing/functionObjects/field/fieldMinMax/IOfieldMinMax.H index 6215d670ca4c15b329e6f186762d1610e56d58f6..90b2d1484018d6e689dcf82819d21d91583af49f 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/IOfieldMinMax.H +++ b/src/postProcessing/functionObjects/field/fieldMinMax/IOfieldMinMax.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C index 509e483f2b79c0b07b7d928a998f9d1b8b67f1fe..ec77782df4e7100291150b701ecb5bafb280bc0b 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H index 812359f71caa3edffcf8b43629c58db520f05823..8c8a3aaf479a3a788b43fd07d9ae1af829fa0f86 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxFunctionObject.C b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxFunctionObject.C index 384388833fe64bba0bdf69f0e59ff42b72ed2906..ad124b6e7b0f6254ee8a9b7b79e3fd546d0ed236 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxFunctionObject.C +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxFunctionObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxFunctionObject.H b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxFunctionObject.H index 7d9240ab7ecdd9e857d6ed24c64a693368477c2e..a5af27af513d1a0de44cd25052b0aae687ece873 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxFunctionObject.H +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxFunctionObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C index 06d6bd585e447b36db17f970c12fdd62c35820d4..25daf62dd6ee73ecaacf41d0a340eb7d30332327 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/systemCall/IOsystemCall.H b/src/postProcessing/functionObjects/systemCall/IOsystemCall.H index beb33d593c6f0cc3515952c5bb623821c9a60aac..827569da14d636245e534d097737f4e31d60e92c 100644 --- a/src/postProcessing/functionObjects/systemCall/IOsystemCall.H +++ b/src/postProcessing/functionObjects/systemCall/IOsystemCall.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/systemCall/systemCall.C b/src/postProcessing/functionObjects/systemCall/systemCall.C index 6fdf84d70c6adf76c53cb729e58d4667e38b9379..44f7948c80a1bdd00a524b4b7e69a1058a7f5cf7 100644 --- a/src/postProcessing/functionObjects/systemCall/systemCall.C +++ b/src/postProcessing/functionObjects/systemCall/systemCall.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/systemCall/systemCall.H b/src/postProcessing/functionObjects/systemCall/systemCall.H index 6dc8fed5294e6f3d7a8b58f17208581cb09437d3..042ee0fc4d8667749314e03cea856dbff25c6016 100644 --- a/src/postProcessing/functionObjects/systemCall/systemCall.H +++ b/src/postProcessing/functionObjects/systemCall/systemCall.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/systemCall/systemCallFunctionObject.C b/src/postProcessing/functionObjects/systemCall/systemCallFunctionObject.C index 096b43ca1cafc3bec63e72550886410c42b56cc6..196ed81e5cc1213b0b234b92d66d5a9899974014 100644 --- a/src/postProcessing/functionObjects/systemCall/systemCallFunctionObject.C +++ b/src/postProcessing/functionObjects/systemCall/systemCallFunctionObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/systemCall/systemCallFunctionObject.H b/src/postProcessing/functionObjects/systemCall/systemCallFunctionObject.H index 875c78970bf928d6b05c43647f6df51aa12f76e6..ad4f429cabd8feb81cfca8de8748e99b04dd2fd6 100644 --- a/src/postProcessing/functionObjects/systemCall/systemCallFunctionObject.H +++ b/src/postProcessing/functionObjects/systemCall/systemCallFunctionObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/utilities/staticPressure/IOstaticPressure.H b/src/postProcessing/functionObjects/utilities/staticPressure/IOstaticPressure.H index 8409c7f103b4c0d319d74acdedc5f8a85c763c53..524e44514445e362e801528435777b68211c257f 100644 --- a/src/postProcessing/functionObjects/utilities/staticPressure/IOstaticPressure.H +++ b/src/postProcessing/functionObjects/utilities/staticPressure/IOstaticPressure.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.C b/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.C index 9ca4f715df0025bee3e4e2c11c4e7f5cd7796d0a..f8678015f0ebe1db02f786bb81138a41db813642 100644 --- a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.C +++ b/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.H b/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.H index 0a7be2c6204bf045fd6f951e6cce23f33e8712f2..71c4fd3516b5d9947dbe70ac694b12de1f7258f0 100644 --- a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.H +++ b/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressureFunctionObject.C b/src/postProcessing/functionObjects/utilities/staticPressure/staticPressureFunctionObject.C index d84c802a4a8825cbaf49cd978f10b077fbf24a33..9d13a5739e03b9e8adf1fd36e79813d7aeb28d62 100644 --- a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressureFunctionObject.C +++ b/src/postProcessing/functionObjects/utilities/staticPressure/staticPressureFunctionObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressureFunctionObject.H b/src/postProcessing/functionObjects/utilities/staticPressure/staticPressureFunctionObject.H index 40f425d4b1892b8f09aa0edb442a44d2fae72614..0ddb184d22edc949f28fb4cdcc79c02d1bfc3364 100644 --- a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressureFunctionObject.H +++ b/src/postProcessing/functionObjects/utilities/staticPressure/staticPressureFunctionObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/combustionMixture/combustionMixture.H b/src/thermophysicalModels/combustion/mixtureThermos/mixtures/combustionMixture/combustionMixture.H index f109ace2ac149beeaa3a55e28033639198e019a3..5e00e79e80471bed612bd2b5b5e791ef2c0575d1 100644 --- a/src/thermophysicalModels/combustion/mixtureThermos/mixtures/combustionMixture/combustionMixture.H +++ b/src/thermophysicalModels/combustion/mixtureThermos/mixtures/combustionMixture/combustionMixture.H @@ -84,6 +84,12 @@ public: // Member functions + //- Return the table of species + const speciesTable& species() const + { + return species_; + } + //- Return the mass-fraction fields PtrList<volScalarField>& Y() { diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C index 38a275aeb573e2603e2418bcf1b342397b350a80..a6b699d20d6fda74edceb157834b4f392049bce4 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.C @@ -45,25 +45,23 @@ namespace RASModels scalar mutRoughWallFunctionFvPatchScalarField::fnRough ( const scalar KsPlus, - const scalar Cs, - const scalar kappa + const scalar Cs ) const { - // Set deltaB based on non-dimensional roughness height - scalar deltaB = 0.0; + // Return fn based on non-dimensional roughness height + if (KsPlus < 90.0) { - deltaB = - 1.0/kappa - *log((KsPlus - 2.25)/87.75 + Cs*KsPlus) - *sin(0.4258*(log(KsPlus) - 0.811)); + return pow + ( + (KsPlus - 2.25)/87.75 + Cs*KsPlus, + sin(0.4258*(log(KsPlus) - 0.811)) + ); } else { - deltaB = 1.0/kappa*log(1.0 + Cs*KsPlus); + return (1.0 + Cs*KsPlus); } - - return exp(min(deltaB*kappa, 50.0)); } @@ -216,8 +214,8 @@ void mutRoughWallFunctionFvPatchScalarField::updateCoeffs() scalar yPlusLamNew = yPlusLam; if (KsPlus > 2.25) { - Edash = E/fnRough(KsPlus, Cs_[faceI], kappa); - yPlusLam = rasModel.yPlusLam(kappa, Edash); + Edash = E/fnRough(KsPlus, Cs_[faceI]); + yPlusLamNew = rasModel.yPlusLam(kappa, Edash); } if (debug) @@ -231,7 +229,9 @@ void mutRoughWallFunctionFvPatchScalarField::updateCoeffs() if (yPlus > yPlusLamNew) { - mutw[faceI] = muw[faceI]*(yPlus*kappa/log(Edash*yPlus) - 1); + mutw[faceI] = + muw[faceI] + *(yPlus*kappa/log(max(Edash*yPlus, 1+1e-4)) - 1); } else { diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H index 88209f4184e215053badbfe174afd321ff03f801..b12ad6bc5765937ccb7226bb9580f9605fa91b6a 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutRoughWallFunction/mutRoughWallFunctionFvPatchScalarField.H @@ -83,12 +83,7 @@ class mutRoughWallFunctionFvPatchScalarField // Private member functions //- Compute the roughness function - scalar fnRough - ( - const scalar KsPlus, - const scalar Cs, - const scalar kappa - ) const; + scalar fnRough(const scalar KsPlus, const scalar Cs) const; public: diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C index 7b6e14493e85f1d27cdf8d7e8a16a46606c82f69..afb08a5d52320014e214532e6da48e6ebaad1a90 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C @@ -45,8 +45,7 @@ namespace RASModels scalar nutRoughWallFunctionFvPatchScalarField::fnRough ( const scalar KsPlus, - const scalar Cs, - const scalar kappa + const scalar Cs ) const { // Return fn based on non-dimensional roughness height @@ -205,7 +204,7 @@ void nutRoughWallFunctionFvPatchScalarField::updateCoeffs() if (KsPlus > 2.25) { - Edash = E/fnRough(KsPlus, Cs_[faceI], kappa); + Edash = E/fnRough(KsPlus, Cs_[faceI]); } if (yPlus > yPlusLam) diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.H index 968c5c3f8f86612779651182cc3a6f733dd1ec92..3371cbaa6d396ccdcb7ef8aec11ca662c10882f2 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.H @@ -80,12 +80,7 @@ class nutRoughWallFunctionFvPatchScalarField // Private member functions //- Compute the roughness function - scalar fnRough - ( - const scalar KsPlus, - const scalar Cs, - const scalar kappa - ) const; + scalar fnRough(const scalar KsPlus, const scalar Cs) const; public: diff --git a/tutorials/combustion/engineFoam/kivaTest/system/controlDict b/tutorials/combustion/engineFoam/kivaTest/system/controlDict index 359d4d135af67717be49fb54cd02cb64b8b16c58..2ae209cb5f6c44f1723423ec922326436a2e7b58 100644 --- a/tutorials/combustion/engineFoam/kivaTest/system/controlDict +++ b/tutorials/combustion/engineFoam/kivaTest/system/controlDict @@ -11,10 +11,12 @@ FoamFile format ascii; class dictionary; location "system"; - object controlDict; + object controlDict.1st; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +applicationClass engineFoam; + startFrom startTime; startTime -180; diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/alphat b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/alphat new file mode 100644 index 0000000000000000000000000000000000000000..dc2104f83c5ce3f90987cad077de403fcd15988e --- /dev/null +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/alphat @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + front + { + type compressible::alphatWallFunction; + value uniform 0; + } + back + { + type compressible::alphatWallFunction; + value uniform 0; + } + wall + { + type compressible::alphatWallFunction; + value uniform 0; + } + porosityWall + { + type compressible::alphatWallFunction; + value uniform 0; + } + inlet + { + type calculated; + value uniform 0; + } + outlet + { + type calculated; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/epsilon b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/epsilon index 13cfc84a0ec1f4c5046a0e4d04d0b7a446a7d611..e0c4dcffbcfbaa46aba58a4bc0f5f0f8f72f3c7e 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/epsilon +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/epsilon @@ -23,31 +23,31 @@ boundaryField { front { - type epsilonWallFunction; - value uniform 0; + type compressible::epsilonWallFunction; + value uniform 200; } back { - type epsilonWallFunction; - value uniform 0; + type compressible::epsilonWallFunction; + value uniform 200; } wall { - type epsilonWallFunction; - value uniform 0; + type compressible::epsilonWallFunction; + value uniform 200; } porosityWall { - type epsilonWallFunction; - value uniform 0; + type compressible::epsilonWallFunction; + value uniform 200; } inlet { - type turbulentMixingLengthDissipationRateInlet; + type compressible::turbulentMixingLengthDissipationRateInlet; mixingLength 0.005; value uniform 200; } diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/k b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/k index 16c1e28fb894fe44a909cc4caa010fb591b74072..1243952ec2d5bc9a98375a7c5de17f4f406689c2 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/k +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/k @@ -23,26 +23,26 @@ boundaryField { front { - type kQRWallFunction; - value uniform 0; + type compressible::kQRWallFunction; + value uniform 1; } back { - type kQRWallFunction; - value uniform 0; + type compressible::kQRWallFunction; + value uniform 1; } wall { - type kQRWallFunction; - value uniform 0; + type compressible::kQRWallFunction; + value uniform 1; } porosityWall { - type kQRWallFunction; - value uniform 0; + type compressible::kQRWallFunction; + value uniform 1; } inlet diff --git a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/alphat b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/alphat new file mode 100644 index 0000000000000000000000000000000000000000..5b9884a613ee886a95cb72e4cd55c77c0657e501 --- /dev/null +++ b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/alphat @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + floor + { + type compressible::alphatWallFunction; + value uniform 0; + } + ceiling + { + type compressible::alphatWallFunction; + value uniform 0; + } + fixedWalls + { + type compressible::alphatWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/mut b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/mut new file mode 100644 index 0000000000000000000000000000000000000000..7c893682965996d4b4b48036a27527eeab2ebdf6 --- /dev/null +++ b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/mut @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object mut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + floor + { + type mutWallFunction; + value uniform 0; + } + ceiling + { + type mutWallFunction; + value uniform 0; + } + fixedWalls + { + type mutWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/p b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/p index 10cf8ccf8e1db93392b06f55e43b51c5006cde71..188522464acb9b347136541e983dc3d02d2b0d32 100644 --- a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/p +++ b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/p @@ -16,26 +16,26 @@ FoamFile dimensions [1 -1 -2 0 0 0 0]; -internalField uniform 100000; +internalField uniform 1e5; boundaryField { floor { - type calculated; - value uniform 100000; + type fixedFluxBuoyantPressure; + value uniform 1e5; } ceiling { - type calculated; - value uniform 100000; + type fixedFluxBuoyantPressure; + value uniform 1e5; } fixedWalls { - type calculated; - value uniform 100000; + type fixedFluxBuoyantPressure; + value uniform 1e5; } } diff --git a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/fvSchemes index 583bf08e11cb06903ecea9b68ba94a197d2ebed3..35b5a3de97726aa485d4a2b0953e416448dbb7b3 100644 --- a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/fvSchemes @@ -42,7 +42,7 @@ laplacianSchemes { default none; laplacian(muEff,U) Gauss linear corrected; - laplacian((rho*(1|A(U))),pd) Gauss linear corrected; + laplacian((rho*(1|A(U))),p) Gauss linear corrected; laplacian(alphaEff,h) Gauss linear corrected; laplacian(DkEff,k) Gauss linear corrected; laplacian(DepsilonEff,epsilon) Gauss linear corrected; @@ -62,7 +62,7 @@ snGradSchemes fluxRequired { default no; - pd ; + p ; } diff --git a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/fvSolution b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/fvSolution index c7dcb8279da2f8d7c4afc7063a37071da1f38f73..ffe5b53f56aa268749c19d3ceede84925d35c365 100644 --- a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/fvSolution +++ b/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/system/fvSolution @@ -25,7 +25,7 @@ solvers relTol 0; } - pd + p { solver PCG; preconditioner DIC; @@ -33,7 +33,7 @@ solvers relTol 0.1; } - pdFinal + pFinal { solver PCG; preconditioner DIC; diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/mut b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/mut new file mode 100644 index 0000000000000000000000000000000000000000..7c893682965996d4b4b48036a27527eeab2ebdf6 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/mut @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object mut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + floor + { + type mutWallFunction; + value uniform 0; + } + ceiling + { + type mutWallFunction; + value uniform 0; + } + fixedWalls + { + type mutWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/p b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/p index 10cf8ccf8e1db93392b06f55e43b51c5006cde71..188522464acb9b347136541e983dc3d02d2b0d32 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/p +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/p @@ -16,26 +16,26 @@ FoamFile dimensions [1 -1 -2 0 0 0 0]; -internalField uniform 100000; +internalField uniform 1e5; boundaryField { floor { - type calculated; - value uniform 100000; + type fixedFluxBuoyantPressure; + value uniform 1e5; } ceiling { - type calculated; - value uniform 100000; + type fixedFluxBuoyantPressure; + value uniform 1e5; } fixedWalls { - type calculated; - value uniform 100000; + type fixedFluxBuoyantPressure; + value uniform 1e5; } } diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSchemes index 9dbebd21cbc1a0cd01091dde9e0cbcd63a459855..cb548b9d9fa88a28a17aefd4f99b9edeee80ea47 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSchemes +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSchemes @@ -41,7 +41,7 @@ laplacianSchemes { default none; laplacian(muEff,U) Gauss linear corrected; - laplacian((rho*(1|A(U))),pd) Gauss linear corrected; + laplacian((rho*(1|A(U))),p) Gauss linear corrected; laplacian(alphaEff,h) Gauss linear corrected; laplacian(DkEff,k) Gauss linear corrected; laplacian(DepsilonEff,epsilon) Gauss linear corrected; @@ -61,7 +61,7 @@ snGradSchemes fluxRequired { default no; - pd ; + p ; } diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSolution index dfbfd6a27f1d095120342e7f47910f85b53f92c8..9ff08c3657a4d84256fde4866772cbca40ae5dcf 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSolution +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/system/fvSolution @@ -17,7 +17,7 @@ FoamFile solvers { - pd + p { solver PCG; preconditioner DIC; @@ -69,16 +69,16 @@ solvers SIMPLE { nNonOrthogonalCorrectors 0; - pdRefCell 0; - pdRefValue 0; + pRefCell 0; + pRefValue 1e5; } relaxationFactors { rho 1; - pd 0.3; + p 0.3; U 0.7; - h 0.7; + h 0.1; k 0.7; epsilon 0.7; R 0.7; diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/radiationProperties b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/radiationProperties index d8bbfe7f595cd351683a08e8f1d8fe5974ea401d..5fc829b87cf5f1b92eaa88fe1ef7e7324601bbc1 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/radiationProperties +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/radiationProperties @@ -27,6 +27,9 @@ P1Coeffs { } +// Number of flow iterations per radiation iteration +solverFreq 1; + absorptionEmissionModel constantAbsorptionEmission; constantAbsorptionEmissionCoeffs diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/pd b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/G similarity index 68% rename from tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/pd rename to tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/G index dbfc6661058517618c784bf060911ebe265b98c9..cb9783649fe55f5f67032842ed34cefccd958808 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/pd +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/G @@ -10,45 +10,45 @@ FoamFile version 2.0; format ascii; class volScalarField; - object p; + object G; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [1 -1 -2 0 0 0 0]; +dimensions [1 0 -3 0 0 0 0]; internalField uniform 0; boundaryField { - minX + floor { - type zeroGradient; - value uniform 0; - } - maxX - { - type fixedValue; + type MarshakRadiation; + T T; + emissivity 1; value uniform 0; } - minY - { - type zeroGradient; - value uniform 0; - } - maxY + fixedWalls { - type zeroGradient; + type MarshakRadiation; + T T; + emissivity 1; value uniform 0; } - minZ + + ceiling { - type zeroGradient; + type MarshakRadiation; + T T; + emissivity 1; value uniform 0; } - maxZ + + box { - type zeroGradient; + type MarshakRadiation; + T T; + emissivity 1; value uniform 0; } } diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/IDefault b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/IDefault new file mode 100644 index 0000000000000000000000000000000000000000..bbb4ec4ca347db87a2f6d153c8a75e30f9abb452 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/IDefault @@ -0,0 +1,32 @@ +/*--------------------------------*- 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 IDefault; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 0 -3 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + ".*" + { + type greyDiffusiveRadiation; + T T; + emissivity 0.5; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/T b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/T new file mode 100644 index 0000000000000000000000000000000000000000..19ee7d9d08e1a184e767104e3384895d5ab2e4c0 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/T @@ -0,0 +1,47 @@ +/*--------------------------------*- 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 300; + +boundaryField +{ + floor + { + type fixedValue; + value uniform 300.0; + } + + ceiling + { + type fixedValue; + value uniform 300.0; + } + + fixedWalls + { + type zeroGradient; + } + + box + { + type fixedValue; + value uniform 500.0; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/U b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/U new file mode 100644 index 0000000000000000000000000000000000000000..9a0eaf66b54cacbc5eed28bb9ed45cf51b8e8ba3 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/U @@ -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 volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + floor + { + type fixedValue; + value uniform (0 0 0); + } + + ceiling + { + type fixedValue; + value uniform (0 0 0); + } + + fixedWalls + { + type fixedValue; + value uniform (0 0 0); + } + + box + { + type fixedValue; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/alphat b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/alphat new file mode 100644 index 0000000000000000000000000000000000000000..f11126d3f5379f99fbfa6dd2237ce2157f5189a9 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/alphat @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + box + { + type alphatWallFunction; + value uniform 0; + } + floor + { + type alphatWallFunction; + value uniform 0; + } + ceiling + { + type alphatWallFunction; + value uniform 0; + } + fixedWalls + { + type alphatWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/epsilon b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/epsilon new file mode 100644 index 0000000000000000000000000000000000000000..d5e7b9cd0273d6d3e2024e42e6ec4aaac6be4986 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/epsilon @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -3 0 0 0 0 ]; + +internalField uniform 0.01; + +boundaryField +{ + floor + { + type compressible::epsilonWallFunction; + value uniform 0; + } + + ceiling + { + type compressible::epsilonWallFunction; + value uniform 0; + } + + fixedWalls + { + type compressible::epsilonWallFunction; + value uniform 0; + } + + box + { + type compressible::epsilonWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/k b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/k new file mode 100644 index 0000000000000000000000000000000000000000..5b206f8e4e379cbc9d5a2764071140549649d354 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/k @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -2 0 0 0 0 ]; + +internalField uniform 0.1; + +boundaryField +{ + floor + { + type compressible::kQRWallFunction; + value uniform 0; + } + + ceiling + { + type compressible::kQRWallFunction; + value uniform 0; + } + + fixedWalls + { + type compressible::kQRWallFunction; + value uniform 0; + } + + box + { + type compressible::kQRWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/mut b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/mut new file mode 100644 index 0000000000000000000000000000000000000000..c609cbf3d2c865212d20992980a9b59a349b9c68 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/mut @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object mut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 1 -1 -1 0 0 0 0 ]; + +internalField uniform 0; + +boundaryField +{ + box + { + type mutWallFunction; + value uniform 0; + } + + floor + { + type mutWallFunction; + value uniform 0; + } + + ceiling + { + type mutWallFunction; + value uniform 0; + } + + fixedWalls + { + type mutWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p new file mode 100644 index 0000000000000000000000000000000000000000..f200e3eeb0f918f10cf34f5b87e5d04abd76b21d --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p @@ -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 p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 100000; + +boundaryField +{ + floor + { + type calculated; + value uniform 100000; + } + + ceiling + { + type calculated; + value uniform 100000; + } + + fixedWalls + { + type calculated; + value uniform 100000; + } + + box + { + type calculated; + value uniform 100000; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/pd b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/pd similarity index 92% rename from tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/pd rename to tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/pd index 3a679ba63a51f43776afa9f72c8fe4e69e328aac..1841d7882f5c06e25080901cd800391c09d11868 100644 --- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRoom/0/pd +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/pd @@ -37,6 +37,12 @@ boundaryField type fixedFluxBuoyantPressure; value uniform 0; } + + box + { + type fixedFluxBuoyantPressure; + value uniform 0; + } } // ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/RASProperties b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/RASProperties new file mode 100644 index 0000000000000000000000000000000000000000..35b5a409f230c180f07469bfe0679cdf00cb419d --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/RASProperties @@ -0,0 +1,100 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kEpsilon; + +turbulence on; + +printCoeffs on; + +laminarCoeffs +{ +} + +kEpsilonCoeffs +{ + Cmu 0.09; + C1 1.44; + C2 1.92; + C3 0.85; + alphah 1; + alphak 1; + alphaEps 0.76923; +} + +RNGkEpsilonCoeffs +{ + Cmu 0.0845; + C1 1.42; + C2 1.68; + C3 -0.33; + alphah 1; + alphak 1.39; + alphaEps 1.39; + eta0 4.38; + beta 0.012; +} + +LaunderSharmaKECoeffs +{ + Cmu 0.09; + C1 1.44; + C2 1.92; + C3 -0.33; + alphah 1; + alphak 1; + alphaEps 0.76923; +} + +LRRCoeffs +{ + Cmu 0.09; + Clrr1 1.8; + Clrr2 0.6; + C1 1.44; + C2 1.92; + alphah 1; + Cs 0.25; + Ceps 0.15; + alphaR 1; + alphaEps 0.76923; +} + +LaunderGibsonRSTMCoeffs +{ + Cmu 0.09; + Clg1 1.8; + Clg2 0.6; + C1 1.44; + C2 1.92; + alphah 1; + C1Ref 0.5; + C2Ref 0.3; + Cs 0.25; + Ceps 0.15; + alphaR 1; + alphaEps 0.76923; +} + +wallFunctionCoeffs +{ + kappa 0.4187; + E 9; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/environmentalProperties b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/environmentalProperties new file mode 100644 index 0000000000000000000000000000000000000000..639bd90b066ffdac881dc8722b84c1bf39170e9d --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/environmentalProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object environmentalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +g g [ 0 1 -2 0 0 0 0 ] ( 0 0 -9.81 ); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/blockMeshDict b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..e69de20d9d6c7b3b86178f0f7d486dae976931ad --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/blockMeshDict @@ -0,0 +1,170 @@ +/*--------------------------------*- 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 dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + ( 0.0 0.0 0.0) + ( 0.5 0.0 0.0) + ( 1.5 0.0 0.0) + (10.0 0.0 0.0) + ( 0.0 0.5 0.0) + ( 0.5 0.5 0.0) + ( 1.5 0.5 0.0) + (10.0 0.5 0.0) + ( 0.0 1.5 0.0) + ( 0.5 1.5 0.0) + ( 1.5 1.5 0.0) + (10.0 1.5 0.0) + ( 0.0 6.0 0.0) + ( 0.5 6.0 0.0) + ( 1.5 6.0 0.0) + (10.0 6.0 0.0) + + ( 0.0 0.0 0.5) + ( 0.5 0.0 0.5) + ( 1.5 0.0 0.5) + (10.0 0.0 0.5) + ( 0.0 0.5 0.5) + ( 0.5 0.5 0.5) + ( 1.5 0.5 0.5) + (10.0 0.5 0.5) + ( 0.0 1.5 0.5) + ( 0.5 1.5 0.5) + ( 1.5 1.5 0.5) + (10.0 1.5 0.5) + ( 0.0 6.0 0.5) + ( 0.5 6.0 0.5) + ( 1.5 6.0 0.5) + (10.0 6.0 0.5) + + ( 0.0 0.0 2.0) + ( 0.5 0.0 2.0) + ( 1.5 0.0 2.0) + (10.0 0.0 2.0) + ( 0.0 0.5 2.0) + ( 0.5 0.5 2.0) + ( 1.5 0.5 2.0) + (10.0 0.5 2.0) + ( 0.0 1.5 2.0) + ( 0.5 1.5 2.0) + ( 1.5 1.5 2.0) + (10.0 1.5 2.0) + ( 0.0 6.0 2.0) + ( 0.5 6.0 2.0) + ( 1.5 6.0 2.0) + (10.0 6.0 2.0) +); + +blocks +( + hex ( 0 1 5 4 16 17 21 20) ( 5 5 5) simpleGrading (1 1 1) + hex ( 1 2 6 5 17 18 22 21) (10 5 5) simpleGrading (1 1 1) + hex ( 2 3 7 6 18 19 23 22) (80 5 5) simpleGrading (1 1 1) + hex ( 4 5 9 8 20 21 25 24) ( 5 10 5) simpleGrading (1 1 1) + hex ( 6 7 11 10 22 23 27 26) (80 10 5) simpleGrading (1 1 1) + hex ( 8 9 13 12 24 25 29 28) ( 5 40 5) simpleGrading (1 1 1) + hex ( 9 10 14 13 25 26 30 29) (10 40 5) simpleGrading (1 1 1) + hex (10 11 15 14 26 27 31 30) (80 40 5) simpleGrading (1 1 1) + + hex (16 17 21 20 32 33 37 36) ( 5 5 15) simpleGrading (1 1 1) + hex (17 18 22 21 33 34 38 37) (10 5 15) simpleGrading (1 1 1) + hex (18 19 23 22 34 35 39 38) (80 5 15) simpleGrading (1 1 1) + hex (20 21 25 24 36 37 41 40) ( 5 10 15) simpleGrading (1 1 1) + + hex (21 22 26 25 37 38 42 41) (10 10 15) simpleGrading (1 1 1) + + hex (22 23 27 26 38 39 43 42) (80 10 15) simpleGrading (1 1 1) + hex (24 25 29 28 40 41 45 44) ( 5 40 15) simpleGrading (1 1 1) + hex (25 26 30 29 41 42 46 45) (10 40 15) simpleGrading (1 1 1) + hex (26 27 31 30 42 43 47 46) (80 40 15) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + wall box + ( + ( 6 22 21 5) + (10 26 22 6) + ( 9 25 26 10) + ( 5 21 25 9) + (22 26 25 21) + ) + wall floor + ( + ( 1 5 4 0) + ( 2 6 5 1) + ( 3 7 6 2) + ( 5 9 8 4) + ( 7 11 10 6) + ( 9 13 12 8) + (10 14 13 9) + (11 15 14 10) + ) + wall ceiling + ( + (33 37 36 32) + (34 38 37 33) + (35 39 38 34) + (37 41 40 36) + (38 42 41 37) + (39 43 42 38) + (41 45 44 40) + (42 46 45 41) + (43 47 46 42) + ) + wall fixedWalls + ( + ( 1 17 16 0) + ( 2 18 17 1) + ( 3 19 18 2) + (17 33 32 16) + (18 34 33 17) + (19 35 34 18) + + ( 7 23 19 3) + (11 27 23 7) + (15 31 27 11) + (23 39 35 19) + (27 43 39 23) + (31 47 43 27) + + (14 30 31 15) + (13 29 30 14) + (12 28 29 13) + (30 46 47 31) + (29 45 46 30) + (28 44 45 29) + + ( 8 24 28 12) + ( 4 20 24 8) + ( 0 16 20 4) + (24 40 44 28) + (20 36 40 24) + (16 32 36 20) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/boundary b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..ab64c00e2818ae921e8d7797fd57ddc8e836a70c --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/boundary @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +4 +( + box + { + type wall; + nFaces 300; + startFace 303675; + } + floor + { + type wall; + nFaces 5125; + startFace 303975; + } + ceiling + { + type wall; + nFaces 5225; + startFace 309100; + } + fixedWalls + { + type wall; + nFaces 6000; + startFace 314325; + } +) + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/radiationProperties b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/radiationProperties new file mode 100644 index 0000000000000000000000000000000000000000..1521e119a1c03763e3ee05efd9afd3fc4579c46a --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/radiationProperties @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object radiationProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +radiation on; + +radiationModel fvDOM; + +noRadiation +{ +} + +P1Coeffs +{ +} + +fvDOMCoeffs +{ + nPhi 3; // azimuthal angles in PI/2 on X-Y.(from Y to X) + nTheta 5; // polar angles in PI (from Z to X-Y plane) + convergence 1e-3; // convergence criteria for radiation iteration + maxIter 10; // maximum number of iterations +} + +// Number of flow iterations per radiation iteration +solverFreq 10; + +absorptionEmissionModel constantAbsorptionEmission; + +constantAbsorptionEmissionCoeffs +{ + a a [ 0 -1 0 0 0 0 0 ] 0.01; + e e [ 0 -1 0 0 0 0 0 ] 0; + E E [ 1 -1 -3 0 0 0 0 ] 0; +} + +scatterModel constantScatter; + +constantScatterCoeffs +{ + sigma sigma [ 0 -1 0 0 0 0 0 ] 0; + C C [ 0 0 0 0 0 0 0 ] 0; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties new file mode 100644 index 0000000000000000000000000000000000000000..f826516c2ebc44480f764103bbcc05c3f2e83efd --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; + +mixture air 1 28.9 1000 0 1.8e-05 0.7; + +pRef 100000; + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/controlDict b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..06eec5ead0b78d157eddd5c952c86b16a369c092 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/controlDict @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 1000; + +deltaT 1; + +writeControl timeStep; + +writeInterval 100; + +purgeWrite 0; + +writeFormat binary; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..0800e9f9323d8477caa278e74075c327f307206a --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes @@ -0,0 +1,70 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss upwind; + div(phi,h) Gauss upwind; + div(phi,k) Gauss upwind; + div(phi,epsilon) Gauss upwind; + div(phi,R) Gauss upwind; + div(R) Gauss linear; + div(Ji,Ii_h) Gauss linearUpwind Gauss linear; //Gauss upwind; + div((muEff*dev2(grad(U).T()))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(muEff,U) Gauss linear corrected; + laplacian((rho*(1|A(U))),pd) Gauss linear corrected; + laplacian(alphaEff,h) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DREff,R) Gauss linear corrected; + laplacian(gammaRad,G) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + pd ; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..a5d6208674369243cbae66f6912c317406ef60d3 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution @@ -0,0 +1,92 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + pd + { + solver GAMG; + tolerance 1e-06; + relTol 0.01; + smoother GaussSeidel; + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + U + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } + + h + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } + + k + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } + + epsilon + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } + + Ii + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } +} + +SIMPLE +{ + nNonOrthogonalCorrectors 0; + pdRefCell 0; + pdRefValue 0; +} + +relaxationFactors +{ + rho 1.0; + pd 0.3; + U 0.7; + h 0.7; + k 0.7; + epsilon 0.7; + "ILambda.*" 0.7; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/p b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/p index a98fc2825d0103495eea908d93fe1de81df15128..8a2a5d0a87887b19799c65d58f14a8c7aaf03b13 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/p +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/0/p @@ -16,40 +16,40 @@ FoamFile dimensions [1 -1 -2 0 0 0 0]; -internalField uniform 0; +internalField uniform 1e5; boundaryField { minX { - type calculated; - value uniform 0; + type fixedFluxBuoyantPressure; + value 1e5; } maxX { - type calculated; - value uniform 0; + type fixedFluxBuoyantPressure; + value 1e5; } minY { - type calculated; - value uniform 0; + type fixedFluxBuoyantPressure; + value 1e5; } maxY { - type calculated; - value uniform 0; + type fixedFluxBuoyantPressure; + value 1e5; } minZ { - type calculated; - value uniform 0; + type fixedFluxBuoyantPressure; + value 1e5; } maxZ { - type calculated; - value uniform 0; + type fixedFluxBuoyantPressure; + value 1e5; } } diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun index f4374b6a93079b3971e9000714616bab0a1a0685..1fce68e81c1dad9bb03027069d2cacfc6df06c26 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/Allrun @@ -30,7 +30,26 @@ do rm -f 0*/$i/{cp,K} done -runApplication chtMultiRegionFoam + +#-- Run on single processor +#runApplication chtMultiRegionFoam + +# Decompose +for i in bottomAir topAir heater leftSolid rightSolid +do + decomposePar -region $i +done + +# Run +hostname > system/machines +runParallel chtMultiRegionFoam 4 system/machines + +# Reconstruct +for i in bottomAir topAir heater leftSolid rightSolid +do + reconstructPar -region $i +done + echo echo "creating files for paraview post-processing" diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/bottomAir/turbulenceProperties b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/bottomAir/turbulenceProperties index 07f85c68df22113b7c7747b89457597b0ea41d66..0efb448180f1ba26ac35d2dda07035e9ec6873f6 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/bottomAir/turbulenceProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/bottomAir/turbulenceProperties @@ -14,6 +14,6 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -simulationType RASModel; +simulationType laminar; // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/polyMesh/boundary b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/polyMesh/boundary index 69a0952209dee387ae6cda9212a645086bba6b7a..73459cea0720d03956f9bd6cfb7f59f4d60a5d64 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/polyMesh/boundary +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/polyMesh/boundary @@ -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 diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/regionProperties b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/regionProperties index e72fde91a8b5918e35f833a9997d6ba34d496a92..4fc4b886687248dbf1cbc6b1d248c9e22b2d8ea2 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/regionProperties +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/regionProperties @@ -19,7 +19,4 @@ fluidRegionNames ( bottomAir topAir ); solidRegionNames ( heater leftSolid rightSolid ); -pRef 100000; - - // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/README b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/README index fd464e464c710813fac07db7d9ee31278ad58094..5a81b9a5708b0346c6cdd4bd2f6835feb3700bc1 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/README +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/README @@ -1,3 +1,3 @@ -fvSchemes and fvSolution are not used here -- added so that pre-processing activities can proceed +fvSolution is used for outer correctors specification. +fvSchemes is only so that pre-processing activities can proceed diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict index 5f75f1a76ddf1691f69796712f10ba8a2ec10238..7ee62d4bd7ab20aa698476583b6260258630fc37 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict @@ -16,6 +16,31 @@ FoamFile dictionaryReplacement { + boundary + { + bottomAir_to_leftSolid + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion leftSolid; + samplePatch leftSolid_to_bottomAir; + } + bottomAir_to_rightSolid + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion rightSolid; + samplePatch rightSolid_to_bottomAir; + } + bottomAir_to_heater + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion heater; + samplePatch heater_to_bottomAir; + } + } + U { internalField uniform (0 0 0); @@ -62,8 +87,6 @@ dictionaryReplacement bottomAir_to_leftSolid { type solidWallMixedTemperatureCoupled; - neighbourRegionName leftSolid; - neighbourPatchName leftSolid_to_bottomAir; neighbourFieldName T; K K; value uniform 300; @@ -72,8 +95,6 @@ dictionaryReplacement bottomAir_to_heater { type solidWallMixedTemperatureCoupled; - neighbourRegionName heater; - neighbourPatchName heater_to_bottomAir; neighbourFieldName T; K K; value uniform 300; @@ -81,8 +102,6 @@ dictionaryReplacement bottomAir_to_rightSolid { type solidWallMixedTemperatureCoupled; - neighbourRegionName rightSolid; - neighbourPatchName rightSolid_to_bottomAir; neighbourFieldName T; K K; value uniform 300; @@ -205,101 +224,55 @@ dictionaryReplacement } } - pd + p { + internalField uniform 1E5; + boundaryField { minX { type fixedFluxBuoyantPressure; - value 0; + value 1e5; } maxX { type fixedFluxBuoyantPressure; - value 0; + value 1e5; } minY { type fixedFluxBuoyantPressure; - value 0; + value 1e5; } minZ { type fixedFluxBuoyantPressure; - value 0; + value 1e5; } maxZ { type fixedFluxBuoyantPressure; - value 0; + value 1e5; } bottomAir_to_leftSolid { type fixedFluxBuoyantPressure; - value 0; + value 1e5; } bottomAir_to_heater { type fixedFluxBuoyantPressure; - value 0; + value 1e5; } bottomAir_to_rightSolid { type fixedFluxBuoyantPressure; - value 0; + value 1e5; } } } - p - { - internalField uniform 100000; - boundaryField - { - minX - { - type calculated; - value uniform 100000; - } - maxX - { - type calculated; - value uniform 100000; - } - minY - { - type calculated; - value uniform 100000; - } - minZ - { - type calculated; - value uniform 100000; - } - maxZ - { - type calculated; - value uniform 100000; - } - - bottomAir_to_leftSolid - { - type calculated; - value uniform 100000; - } - bottomAir_to_heater - { - type calculated; - value uniform 100000; - } - bottomAir_to_rightSolid - { - type calculated; - value uniform 100000; - } - } - } } // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..aad15ee459b6e01cdf6fabba08eb2fa5b8c2a4dd --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/decomposeParDict @@ -0,0 +1,86 @@ +/*-------------------------------*- C++ -*---------------------------------*\ +| ========= | +| \\ / OpenFOAM | +| \\ / | +| \\ / The Open Source CFD Toolbox | +| \\/ http://www.OpenFOAM.org | +\*-------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +//- Keep owner and neighbour on same processor for faces in zones: +// preserveFaceZones (heater solid1 solid3); + +method scotch; +// method hierarchical; +// method simple; +// method metis; +// method manual; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + /* + processorWeights + ( + 1 + 1 + 1 + 1 + ); + */ +} + +scotchCoeffs +{ + //processorWeights + //( + // 1 + // 1 + // 1 + // 1 + //); + //writeGraph true; + //strategy "b"; +} + +manualCoeffs +{ + dataFile "decompositionData"; +} + + +//// Is the case distributed +//distributed yes; +//// Per slave (so nProcs-1 entries) the directory above the case. +//roots +//( +// "/tmp" +// "/tmp" +//); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes index 9e792da55f1a212351fd1e5d2d26e2992642a502..5559e33626b9f62d129a9265641d3156edb4814d 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSchemes @@ -30,7 +30,7 @@ divSchemes { default none; div(phi,U) Gauss upwind; - div(phiU,p) Gauss upwind; + div(phiU,p) Gauss linear; div(phi,h) Gauss upwind; div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; @@ -43,7 +43,7 @@ laplacianSchemes { default none; laplacian(muEff,U) Gauss linear limited 0.333; - laplacian((rho*(1|A(U))),pd) Gauss linear limited 0.333; + laplacian((rho*(1|A(U))),p) Gauss linear limited 0.333; laplacian(alphaEff,h) Gauss linear limited 0.333; laplacian(DkEff,k) Gauss linear limited 0.333; laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333; @@ -63,7 +63,7 @@ snGradSchemes fluxRequired { default no; - pd; + p; } // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSolution index 84839fe0ac905869edce0e444073487c84f3c61e..e0ecb9405c6ee97475280b790e95176ff3b61e41 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSolution +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/bottomAir/fvSolution @@ -20,28 +20,14 @@ solvers { solver PCG preconditioner DIC; - tolerance 1e-6; + tolerance 1e-8; relTol 0; }; -// pd -// { -// solver PCG -// preconditioner DIC; -// tolerance 1e-6; -// relTol 0.1; -// }; -// pdFinal -// { -// solver PCG; -// preconditioner DIC; -// tolerance 1e-08; -// relTol 0; -// }; - pd + p { solver GAMG; - tolerance 1e-6; - relTol 0.1; + tolerance 1e-8; + relTol 0.01; smoother GaussSeidel; @@ -50,10 +36,10 @@ solvers agglomerator faceAreaPair; mergeLevels 1; }; - pdFinal + pFinal { solver GAMG; - tolerance 1e-6; + tolerance 1e-8; relTol 0; smoother GaussSeidel; @@ -70,32 +56,41 @@ solvers tolerance 1e-08; relTol 0; }; + h { solver PBiCG; preconditioner DILU; - tolerance 1e-06; + tolerance 1e-08; + relTol 0.1; + }; + hFinal + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-08; relTol 0; }; + k { solver PBiCG; preconditioner DILU; - tolerance 1e-06; + tolerance 1e-08; relTol 0; }; epsilon { solver PBiCG; preconditioner DILU; - tolerance 1e-06; + tolerance 1e-08; relTol 0; }; R { solver PBiCG; preconditioner DILU; - tolerance 1e-06; + tolerance 1e-08; relTol 0; }; } @@ -106,14 +101,23 @@ PISO nOuterCorrectors 1; nCorrectors 2; nNonOrthogonalCorrectors 1; - pdRefCell 0; - pdRefValue 0; + pRefPoint (-0.081 -0.0257 8.01); + pRefValue 1e5; +} + + +PIMPLE +{ + momentumPredictor on; + nCorrectors 2; + nNonOrthogonalCorrectors 0; } -//relaxationFactors -//{ -//// h 0.9; + +relaxationFactors +{ +// h 0.9; // U 0.9; -//} +} // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/controlDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/controlDict index 2a5d32fc95549424c2cb293f12ff9656a8daf9c9..ba30afed2a2f13c7f5362edb583baa00576c8ab0 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/controlDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/controlDict @@ -17,17 +17,17 @@ FoamFile startFrom latestTime; -startTime 0; +startTime 0.001; stopAt endTime; -endTime 180; +endTime 200; deltaT 0.001; writeControl adjustableRunTime; -writeInterval 5; +writeInterval 50; purgeWrite 0; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..aad15ee459b6e01cdf6fabba08eb2fa5b8c2a4dd --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/decomposeParDict @@ -0,0 +1,86 @@ +/*-------------------------------*- C++ -*---------------------------------*\ +| ========= | +| \\ / OpenFOAM | +| \\ / | +| \\ / The Open Source CFD Toolbox | +| \\/ http://www.OpenFOAM.org | +\*-------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +//- Keep owner and neighbour on same processor for faces in zones: +// preserveFaceZones (heater solid1 solid3); + +method scotch; +// method hierarchical; +// method simple; +// method metis; +// method manual; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + /* + processorWeights + ( + 1 + 1 + 1 + 1 + ); + */ +} + +scotchCoeffs +{ + //processorWeights + //( + // 1 + // 1 + // 1 + // 1 + //); + //writeGraph true; + //strategy "b"; +} + +manualCoeffs +{ + dataFile "decompositionData"; +} + + +//// Is the case distributed +//distributed yes; +//// Per slave (so nProcs-1 entries) the directory above the case. +//roots +//( +// "/tmp" +// "/tmp" +//); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/fvSolution index 78262ec2df008422f0817dc264bc8dab539bf568..50f28d672d7203b69ec909d90a6764a191c51631 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/fvSolution +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/fvSolution @@ -14,4 +14,9 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +PIMPLE +{ + nOuterCorrectors 1; +} + // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict index 92038e31df8fd503518e3a30e581e9d16756227c..2bea6785224723f43db9cba91aaaf21d5ebf8998 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict @@ -16,6 +16,38 @@ FoamFile dictionaryReplacement { + boundary + { + heater_to_bottomAir + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion bottomAir; + samplePatch bottomAir_to_heater; + } + heater_to_leftSolid + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion leftSolid; + samplePatch leftSolid_to_heater; + } + heater_to_rightSolid + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion rightSolid; + samplePatch rightSolid_to_heater; + } + heater_to_topAir + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion topAir; + samplePatch topAir_to_heater; + } + } + T { internalField uniform 300; @@ -40,8 +72,6 @@ dictionaryReplacement heater_to_bottomAir { type solidWallMixedTemperatureCoupled; - neighbourRegionName bottomAir; - neighbourPatchName bottomAir_to_heater; neighbourFieldName T; K K; value uniform 300; @@ -50,8 +80,6 @@ dictionaryReplacement heater_to_leftSolid { type solidWallMixedTemperatureCoupled; - neighbourRegionName leftSolid; - neighbourPatchName leftSolid_to_heater; neighbourFieldName T; K K; value uniform 300; @@ -59,8 +87,6 @@ dictionaryReplacement heater_to_rightSolid { type solidWallMixedTemperatureCoupled; - neighbourRegionName rightSolid; - neighbourPatchName rightSolid_to_heater; neighbourFieldName T; K K; value uniform 300; @@ -68,8 +94,6 @@ dictionaryReplacement heater_to_topAir { type solidWallMixedTemperatureCoupled; - neighbourRegionName topAir; - neighbourPatchName topAir_to_heater; neighbourFieldName T; K K; value uniform 300; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..aad15ee459b6e01cdf6fabba08eb2fa5b8c2a4dd --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/decomposeParDict @@ -0,0 +1,86 @@ +/*-------------------------------*- C++ -*---------------------------------*\ +| ========= | +| \\ / OpenFOAM | +| \\ / | +| \\ / The Open Source CFD Toolbox | +| \\/ http://www.OpenFOAM.org | +\*-------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +//- Keep owner and neighbour on same processor for faces in zones: +// preserveFaceZones (heater solid1 solid3); + +method scotch; +// method hierarchical; +// method simple; +// method metis; +// method manual; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + /* + processorWeights + ( + 1 + 1 + 1 + 1 + ); + */ +} + +scotchCoeffs +{ + //processorWeights + //( + // 1 + // 1 + // 1 + // 1 + //); + //writeGraph true; + //strategy "b"; +} + +manualCoeffs +{ + dataFile "decompositionData"; +} + + +//// Is the case distributed +//distributed yes; +//// Per slave (so nProcs-1 entries) the directory above the case. +//roots +//( +// "/tmp" +// "/tmp" +//); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/fvSolution index d1c768d4d4444eb6e1937e1840ddde4a19096376..342a7d4232540c1bcefb8362e4e638d7e9a3b9b0 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/fvSolution +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/fvSolution @@ -30,4 +30,9 @@ PISO nNonOrthogonalCorrectors 1; } +PIMPLE +{ + nNonOrthogonalCorrectors 1; +} + // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict index c30a9b5c4bb180f2b7541a0cbaefa68c62791b40..0fb3ee191c8a06de31849237b5bdd5499d40f8f0 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict @@ -16,6 +16,31 @@ FoamFile dictionaryReplacement { + boundary + { + leftSolid_to_bottomAir + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion bottomAir; + samplePatch bottomAir_to_leftSolid; + } + leftSolid_to_heater + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion heater; + samplePatch heater_to_leftSolid;; + } + leftSolid_to_topAir + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion topAir; + samplePatch topAir_to_leftSolid;; + } + } + T { internalField uniform 300; @@ -37,8 +62,6 @@ dictionaryReplacement leftSolid_to_bottomAir { type solidWallMixedTemperatureCoupled; - neighbourRegionName bottomAir; - neighbourPatchName bottomAir_to_leftSolid; neighbourFieldName T; K K; value uniform 300; @@ -47,8 +70,6 @@ dictionaryReplacement leftSolid_to_heater { type solidWallMixedTemperatureCoupled; - neighbourRegionName heater; - neighbourPatchName heater_to_leftSolid; neighbourFieldName T; K K; value uniform 300; @@ -56,8 +77,6 @@ dictionaryReplacement leftSolid_to_topAir { type solidWallMixedTemperatureCoupled; - neighbourRegionName topAir; - neighbourPatchName topAir_to_leftSolid; neighbourFieldName T; K K; value uniform 300; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..aad15ee459b6e01cdf6fabba08eb2fa5b8c2a4dd --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/decomposeParDict @@ -0,0 +1,86 @@ +/*-------------------------------*- C++ -*---------------------------------*\ +| ========= | +| \\ / OpenFOAM | +| \\ / | +| \\ / The Open Source CFD Toolbox | +| \\/ http://www.OpenFOAM.org | +\*-------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +//- Keep owner and neighbour on same processor for faces in zones: +// preserveFaceZones (heater solid1 solid3); + +method scotch; +// method hierarchical; +// method simple; +// method metis; +// method manual; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + /* + processorWeights + ( + 1 + 1 + 1 + 1 + ); + */ +} + +scotchCoeffs +{ + //processorWeights + //( + // 1 + // 1 + // 1 + // 1 + //); + //writeGraph true; + //strategy "b"; +} + +manualCoeffs +{ + dataFile "decompositionData"; +} + + +//// Is the case distributed +//distributed yes; +//// Per slave (so nProcs-1 entries) the directory above the case. +//roots +//( +// "/tmp" +// "/tmp" +//); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict index 292f92f1d3b4efdd81831370545adc34357fd586..c3d6b08a0d147cef9d91a02a45036fadc4cfa59b 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict @@ -16,6 +16,31 @@ FoamFile dictionaryReplacement { + boundary + { + rightSolid_to_heater + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion heater; + samplePatch heater_to_rightSolid; + } + rightSolid_to_bottomAir + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion bottomAir; + samplePatch bottomAir_to_rightSolid; + } + rightSolid_to_topAir + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion topAir; + samplePatch topAir_to_rightSolid; + } + } + T { internalField uniform 300; @@ -37,8 +62,6 @@ dictionaryReplacement rightSolid_to_heater { type solidWallMixedTemperatureCoupled; - neighbourRegionName heater; - neighbourPatchName heater_to_rightSolid; neighbourFieldName T; K K; value uniform 300; @@ -46,8 +69,6 @@ dictionaryReplacement rightSolid_to_bottomAir { type solidWallMixedTemperatureCoupled; - neighbourRegionName bottomAir; - neighbourPatchName bottomAir_to_rightSolid; neighbourFieldName T; K K; value uniform 300; @@ -55,8 +76,6 @@ dictionaryReplacement rightSolid_to_topAir { type solidWallMixedTemperatureCoupled; - neighbourRegionName topAir; - neighbourPatchName topAir_to_rightSolid; neighbourFieldName T; K K; value uniform 300; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..aad15ee459b6e01cdf6fabba08eb2fa5b8c2a4dd --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/decomposeParDict @@ -0,0 +1,86 @@ +/*-------------------------------*- C++ -*---------------------------------*\ +| ========= | +| \\ / OpenFOAM | +| \\ / | +| \\ / The Open Source CFD Toolbox | +| \\/ http://www.OpenFOAM.org | +\*-------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +//- Keep owner and neighbour on same processor for faces in zones: +// preserveFaceZones (heater solid1 solid3); + +method scotch; +// method hierarchical; +// method simple; +// method metis; +// method manual; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + /* + processorWeights + ( + 1 + 1 + 1 + 1 + ); + */ +} + +scotchCoeffs +{ + //processorWeights + //( + // 1 + // 1 + // 1 + // 1 + //); + //writeGraph true; + //strategy "b"; +} + +manualCoeffs +{ + dataFile "decompositionData"; +} + + +//// Is the case distributed +//distributed yes; +//// Per slave (so nProcs-1 entries) the directory above the case. +//roots +//( +// "/tmp" +// "/tmp" +//); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/changeDictionaryDict index e13083daa743d89571b74dfcac14d8605ea0b60b..f4f44ee6d49cc25317612a2ae6cd4355296aa3e1 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/changeDictionaryDict @@ -16,6 +16,31 @@ FoamFile dictionaryReplacement { + boundary + { + topAir_to_leftSolid + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion leftSolid; + samplePatch leftSolid_to_topAir; + } + topAir_to_heater + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion heater; + samplePatch heater_to_topAir; + } + topAir_to_rightSolid + { + offset ( 0 0 0 ); + sampleMode nearestPatchFace; + sampleRegion rightSolid; + samplePatch rightSolid_to_topAir; + } + } + U { internalField uniform ( 0.01 0 0 ); @@ -63,8 +88,6 @@ dictionaryReplacement topAir_to_leftSolid { type solidWallMixedTemperatureCoupled; - neighbourRegionName leftSolid; - neighbourPatchName leftSolid_to_topAir; neighbourFieldName T; K K; value uniform 300; @@ -73,8 +96,6 @@ dictionaryReplacement topAir_to_heater { type solidWallMixedTemperatureCoupled; - neighbourRegionName heater; - neighbourPatchName heater_to_topAir; neighbourFieldName T; K K; value uniform 300; @@ -82,8 +103,6 @@ dictionaryReplacement topAir_to_rightSolid { type solidWallMixedTemperatureCoupled; - neighbourRegionName rightSolid; - neighbourPatchName rightSolid_to_topAir; neighbourFieldName T; K K; value uniform 300; @@ -204,109 +223,61 @@ dictionaryReplacement } } - pd + p { + internalField uniform 1E5; + boundaryField { minX { type fixedFluxBuoyantPressure; - value 0; + value 1e5; } maxX { type waveTransmissive; - field pd; + //field p; phi phi; rho rho; psi psi; gamma 1.4; // cp/cv - fieldInf 0; + fieldInf 1e5; lInf 0.40; // double length of domain - value uniform 0; + value uniform 1e5; } minY { type fixedFluxBuoyantPressure; - value 0; + value 1e5; } minZ { type fixedFluxBuoyantPressure; - value 0; + value 1e5; } maxZ { type fixedFluxBuoyantPressure; - value 0; + value 1e5; } topAir_to_leftSolid { type fixedFluxBuoyantPressure; - value 0; + value 1e5; } topAir_to_heater { type fixedFluxBuoyantPressure; - value 0; + value 1e5; } topAir_to_rightSolid { type fixedFluxBuoyantPressure; - value 0; - } - } - } - - p - { - internalField uniform 100000; - - boundaryField - { - minX - { - type calculated; - value uniform 100000; - } - maxX - { - type calculated; - value uniform 100000; - } - maxY - { - type calculated; - value uniform 100000; - } - minZ - { - type calculated; - value uniform 100000; - } - maxZ - { - type calculated; - value uniform 100000; - } - - topAir_to_leftSolid - { - type calculated; - value uniform 100000; - } - topAir_to_heater - { - type calculated; - value uniform 100000; - } - topAir_to_rightSolid - { - type calculated; - value uniform 100000; + value 1e5; } } } diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..aad15ee459b6e01cdf6fabba08eb2fa5b8c2a4dd --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/topAir/decomposeParDict @@ -0,0 +1,86 @@ +/*-------------------------------*- C++ -*---------------------------------*\ +| ========= | +| \\ / OpenFOAM | +| \\ / | +| \\ / The Open Source CFD Toolbox | +| \\/ http://www.OpenFOAM.org | +\*-------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +//- Keep owner and neighbour on same processor for faces in zones: +// preserveFaceZones (heater solid1 solid3); + +method scotch; +// method hierarchical; +// method simple; +// method metis; +// method manual; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + /* + processorWeights + ( + 1 + 1 + 1 + 1 + ); + */ +} + +scotchCoeffs +{ + //processorWeights + //( + // 1 + // 1 + // 1 + // 1 + //); + //writeGraph true; + //strategy "b"; +} + +manualCoeffs +{ + dataFile "decompositionData"; +} + + +//// Is the case distributed +//distributed yes; +//// Per slave (so nProcs-1 entries) the directory above the case. +//roots +//( +// "/tmp" +// "/tmp" +//); + + +// ************************************************************************* // diff --git a/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C b/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C index 241b6930fc533a640da3e2074eca1754de2bbcb6..9225fe4cb7c20e4456307054f6ade7afa7aec3d3 100644 --- a/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C +++ b/tutorials/incompressible/MRFSimpleFoam/MRFSimpleFoam/MRFSimpleFoam.C @@ -40,15 +40,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; @@ -56,7 +55,7 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; -# include "readSIMPLEControls.H" + #include "readSIMPLEControls.H" p.storePrevIter(); @@ -101,7 +100,7 @@ int main(int argc, char *argv[]) } } -# include "continuityErrs.H" + #include "continuityErrs.H" // Explicitly relax pressure for momentum corrector p.relax(); diff --git a/tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSolution b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSolution index 486f7ad5fb2836444d68502c50b37e8c4e55b62a..ca87cfa23b842b53e1d7e75478f7e809c12c2083 100644 --- a/tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSolution +++ b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/fvSolution @@ -58,9 +58,10 @@ solvers } } -PISO +PIMPLE { - nCorrectors 2; + nOuterCorrectors 2; + nCorrectors 1; nNonOrthogonalCorrectors 0; } diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/CH4 b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/CH4 similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/CH4 rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/CH4 diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/CO b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/CO similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/CO rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/CO diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/CO2 b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/CO2 similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/CO2 rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/CO2 diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/G b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/G similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/G rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/G diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/H2 b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/H2 similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/H2 rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/H2 diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/H2O b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/H2O similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/H2O rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/H2O diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/N2 b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/N2 similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/N2 rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/N2 diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/O2 b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/O2 similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/O2 rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/O2 diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/T b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/T similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/T rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/T diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/U b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/U similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/U rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/U diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/epsilon b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/epsilon similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/epsilon rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/epsilon diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/k b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/k similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/k rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/k diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/p b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/p similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/p rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/p diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/p.org b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/p.org similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/0/p.org rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/0/p.org diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/chem.inp b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/chem.inp similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/chem.inp rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/chem.inp diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/foam.dat b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/foam.dat similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/foam.dat rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/foam.dat diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/foam.inp b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/foam.inp similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/foam.inp rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/foam.inp diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/therm.dat b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/therm.dat similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/therm.dat rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/chemkin/therm.dat diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/RASProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/RASProperties similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/RASProperties rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/RASProperties diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/chemistryProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/chemistryProperties similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/chemistryProperties rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/chemistryProperties diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Positions b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Positions similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Positions rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Positions diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties similarity index 97% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties index 4886a81f6f498f3647253329c44ec7b535ebd977..8f53d4c4b002c03c44517a65d7bf6f7c18153540 100644 --- a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties @@ -21,7 +21,7 @@ DragModel SphereDrag; DispersionModel StochasticDispersionRAS; -WallInteractionModel StandardWallInteraction; +PatchInteractionModel StandardWallInteraction; HeatTransferModel RanzMarshall; @@ -33,6 +33,8 @@ DevolatilisationModel ConstantRateDevolatilisation; SurfaceReactionModel COxidationDiffusionLimitedRate; +PostProcessingModel none; + radiation on; coupled true; @@ -52,7 +54,6 @@ constantProperties cp0 cp0 [ 0 2 -2 -1 0 ] 4187; epsilon0 epsilon0 [ 0 0 0 0 0 ] 1; f0 f0 [ 0 0 0 0 0 ] 0.5; - Tbp Tbp [ 0 0 0 1 0 ] 400; Tvap Tvap [ 0 0 0 1 0 ] 400; LDevol LDevol [ 0 0 0 0 0 ] 0; hRetentionCoeff hRetentionCoeff [ 0 0 0 0 0 ] 1; diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/enthalpySourceProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/enthalpySourceProperties similarity index 98% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/enthalpySourceProperties rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/enthalpySourceProperties index 614c9a41b3d7cf97812034dc06b9cf308fb3650b..9c1295cc93c7296b01b2e4f6a974827096d94134 100644 --- a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/enthalpySourceProperties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/enthalpySourceProperties @@ -15,6 +15,8 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +active yes; + cellSource sphereToCell; volumeType absolute; diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/environmentalProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/environmentalProperties similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/environmentalProperties rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/environmentalProperties diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties similarity index 97% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties index aec7c430a7183ef1b6295c5e4958d67f761a3ec5..51e1df08101c3ce45839e94cdfa1168e2f9a7d66 100644 --- a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties @@ -21,10 +21,12 @@ DragModel SphereDrag; DispersionModel StochasticDispersionRAS; -WallInteractionModel StandardWallInteraction; +PatchInteractionModel StandardWallInteraction; HeatTransferModel RanzMarshall; +PostProcessingModel none; + radiation on; coupled true; diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestonePositions b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestonePositions similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestonePositions rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestonePositions diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/polyMesh/blockMeshDict b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/polyMesh/blockMeshDict similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/polyMesh/blockMeshDict rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/polyMesh/blockMeshDict diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/radiationProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/radiationProperties similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/radiationProperties rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/radiationProperties diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/thermophysicalProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/thermophysicalProperties similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/thermophysicalProperties rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/thermophysicalProperties diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/turbulenceProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/turbulenceProperties similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/constant/turbulenceProperties rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/turbulenceProperties diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/system/controlDict b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/controlDict similarity index 98% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/system/controlDict rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/controlDict index 6cc0b6002cb72e1ffeaba9ab9897ffb023a34702..50cd97415e2827afb6d1ef6cca3d46ef50788b72 100644 --- a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/system/controlDict +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/controlDict @@ -47,7 +47,7 @@ runTimeModifiable yes; adjustTimeStep yes; -maxCo 0.2; +maxCo 1.0; maxDeltaT 1; diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/system/decomposeParDict b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/decomposeParDict similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/system/decomposeParDict rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/decomposeParDict diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/system/fvSchemes b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSchemes old mode 100644 new mode 100755 similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/system/fvSchemes rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSchemes diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/G b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/G similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/G rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/G diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/H2O b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/H2O similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/H2O rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/H2O diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/N2 b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/N2 similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/N2 rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/N2 diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/O2 b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/O2 similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/O2 rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/O2 diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/T b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/T similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/T rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/T diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/U b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/U similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/U rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/U diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/epsilon b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/epsilon similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/epsilon rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/epsilon diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/k b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/k similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/k rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/k diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/p b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/p similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/0/p rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/p diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/chemkin/chem.inp b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/chemkin/chem.inp similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/chemkin/chem.inp rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/chemkin/chem.inp diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/chemkin/foam.dat b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/chemkin/foam.dat similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/chemkin/foam.dat rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/chemkin/foam.dat diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/chemkin/foam.inp b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/chemkin/foam.inp similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/chemkin/foam.inp rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/chemkin/foam.inp diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/chemkin/therm.dat b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/chemkin/therm.dat similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/chemkin/therm.dat rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/chemkin/therm.dat diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/chemistryProperties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/chemistryProperties similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/chemistryProperties rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/chemistryProperties diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/environmentalProperties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/environmentalProperties similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/environmentalProperties rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/environmentalProperties diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/polyMesh/blockMeshDict b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/polyMesh/blockMeshDict similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/polyMesh/blockMeshDict rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/polyMesh/blockMeshDict diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/radiationProperties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/radiationProperties similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/radiationProperties rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/radiationProperties diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Positions b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Positions similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Positions rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Positions diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties similarity index 96% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties index 470165c7f2280f7e6f6ed277e687a27f33dd55c2..be03e91343092bf58fa5b353f4fa76a49d3d05d7 100644 --- a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties @@ -21,7 +21,7 @@ DragModel SphereDrag; DispersionModel none; -WallInteractionModel StandardWallInteraction; +PatchInteractionModel StandardWallInteraction; HeatTransferModel RanzMarshall; @@ -29,6 +29,8 @@ CompositionModel SinglePhaseMixture; PhaseChangeModel LiquidEvaporation; +PostProcessingModel none; + radiation off; coupled true; @@ -48,7 +50,6 @@ constantProperties cp0 cp0 [ 0 2 -2 -1 0 ] 4187; epsilon0 epsilon0 [ 0 0 0 0 0 ] 1; f0 f0 [ 0 0 0 0 0 ] 0.5; - Tbp Tbp [ 0 0 0 1 0 ] 393; Tvap Tvap [ 0 0 0 1 0 ] 273; constantVolume false; } diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/thermophysicalProperties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/thermophysicalProperties similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/thermophysicalProperties rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/thermophysicalProperties diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/turbulenceProperties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/turbulenceProperties similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/constant/turbulenceProperties rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/turbulenceProperties diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/system/controlDict b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/controlDict similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/system/controlDict rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/controlDict diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/system/decomposeParDict b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/decomposeParDict similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/system/decomposeParDict rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/decomposeParDict diff --git a/tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSchemes b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/fvSchemes old mode 100755 new mode 100644 similarity index 100% rename from tutorials/Lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSchemes rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/fvSchemes diff --git a/tutorials/Lagrangian/reactingParcelFoam/evaporationTest/system/fvSolution b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/fvSolution similarity index 100% rename from tutorials/Lagrangian/reactingParcelFoam/evaporationTest/system/fvSolution rename to tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/fvSolution diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/files b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/files similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/files rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/files diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/options b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/options similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/options rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/Make/options diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/UEqn.H b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/UEqn.H similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/UEqn.H rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/UEqn.H diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createClouds.H b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createClouds.H similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createClouds.H rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createClouds.H diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createFields.H b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createFields.H similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createFields.H rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/createFields.H diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/hEqn.H b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/hEqn.H similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/hEqn.H rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/hEqn.H diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/pEqn.H b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/pEqn.H similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/pEqn.H rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/pEqn.H diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam.C b/tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam.C similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam.C rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam/rhoPisoTwinParcelFoam.C diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/G b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/G similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/G rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/G diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/T b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/T similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/T rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/T diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/U b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/U similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/U rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/U diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/epsilon b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/epsilon similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/epsilon rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/epsilon diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/k b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/k similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/k rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/k diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/p b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/p similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/p rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/0/p diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/RASProperties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/RASProperties similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/RASProperties rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/RASProperties diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/environmentalProperties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/environmentalProperties similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/environmentalProperties rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/environmentalProperties diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Positions b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Positions similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Positions rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Positions diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/polyMesh/blockMeshDict b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/polyMesh/blockMeshDict similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/polyMesh/blockMeshDict rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/polyMesh/blockMeshDict diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/polyMesh/boundary b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/polyMesh/boundary similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/polyMesh/boundary rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/polyMesh/boundary diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Positions b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Positions similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Positions rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Positions diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermophysicalProperties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermophysicalProperties similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermophysicalProperties rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermophysicalProperties diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/controlDict b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/controlDict similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/controlDict rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/controlDict diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/decomposeParDict b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/decomposeParDict similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/decomposeParDict rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/decomposeParDict diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/fvSchemes b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/fvSchemes similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/fvSchemes rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/fvSchemes diff --git a/tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/fvSolution b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/fvSolution similarity index 100% rename from tutorials/Lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/fvSolution rename to tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/system/fvSolution diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/G b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/G new file mode 100644 index 0000000000000000000000000000000000000000..0b9581fe5cd0c4ddd5b7eea8b4487e96400da5f3 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/G @@ -0,0 +1,61 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object G; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 0 -3 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + walls + { + type MarshakRadiation; + T T; + emissivity 1.0; + value uniform 0; + } + + inlet + { + type MarshakRadiation; + T T; + emissivity 1.0; + value uniform 0; + } + + outlet + { + type zeroGradient; + } + + cycLeft + { + type cyclic; + } + + cycRight + { + type cyclic; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/H2O b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/H2O new file mode 100644 index 0000000000000000000000000000000000000000..cb32465490b8e610dfa66873fc9271648ecf6f5f --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/H2O @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object H2O; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.0; + +boundaryField +{ + walls + { + type zeroGradient; + } + + inlet + { + type fixedValue; + value uniform 0; + } + + outlet + { + type zeroGradient; + } + + cycLeft + { + type cyclic; + } + + cycRight + { + type cyclic; + } + + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/N2 b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/N2 new file mode 100644 index 0000000000000000000000000000000000000000..73ed14ee5dc38ff8073289c5f68bf0295d92bd7a --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/N2 @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object N2; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.79; + +boundaryField +{ + walls + { + type zeroGradient; + } + + inlet + { + type fixedValue; + value uniform 0.79; + } + + outlet + { + type zeroGradient; + } + + cycLeft + { + type cyclic; + } + + cycRight + { + type cyclic; + } + + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/O2 b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/O2 new file mode 100644 index 0000000000000000000000000000000000000000..708683ea5597ae05bc13c7c2b35a1ddddbaac0cb --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/O2 @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object O2; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.21; + +boundaryField +{ + walls + { + type zeroGradient; + } + + inlet + { + type fixedValue; + value uniform 0.21; + } + + outlet + { + type zeroGradient; + } + + cycLeft + { + type cyclic; + } + + cycRight + { + type cyclic; + } + + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/T b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/T new file mode 100644 index 0000000000000000000000000000000000000000..0d04413e056717eb2f0b91539c8f3a9b4b8cfa2e --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/T @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + location "0"; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 350; + +boundaryField +{ + walls + { + type fixedValue; + value uniform 400; + } + + inlet + { + type fixedValue; + value uniform 350; + } + + outlet + { + type zeroGradient; + } + + cycLeft + { + type cyclic; + } + + cycRight + { + type cyclic; + ] + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/U b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/U new file mode 100644 index 0000000000000000000000000000000000000000..206079cdbf9a0895a5bafee07d51eb6471efef91 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/U @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + location "0"; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + walls + { + type fixedValue; + value uniform (0 0 0); + } + + inlet + { + type fixedValue; + value uniform (0.5 0 0); + } + + outlet + { + type zeroGradient; + } + + cycLeft + { + type cyclic; + } + + cycRight + { + type cyclic; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/epsilon b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/epsilon new file mode 100644 index 0000000000000000000000000000000000000000..481f993b2829d6a1dcf4117d17ae7cb7e69bcacf --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/epsilon @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 4.49e-05; + +boundaryField +{ + walls + { + type compressible::epsilonWallFunction; + value uniform 4.49e-05; + } + + inlet + { + type fixedValue; + value uniform 4.49e-05; + } + + outlet + { + type zeroGradient; + } + + cycLeft + { + type cyclic; + } + + cycRight + { + type cyclic; + } + + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/k b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/k new file mode 100644 index 0000000000000000000000000000000000000000..55c9edb64c6304fac7c7ed48a9767bfac5681b76 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/k @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 9.38e-04; + +boundaryField +{ + walls + { + type compressible::kQRWallFunction; + value uniform 9.38e-04; + } + + inlet + { + type fixedValue; + value uniform 9.38e-04; + } + + outlet + { + type zeroGradient; + } + + cycLeft + { + type cyclic; + } + + cycRight + { + type cyclic; + } + + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/p b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/p new file mode 100644 index 0000000000000000000000000000000000000000..00a08bfea05e9cb76becb60bfc27cf7c07b6942e --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/0/p @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 100000; + +boundaryField +{ + walls + { + type zeroGradient; + } + + inlet + { + type zeroGradient; + } + + outlet + { + type fixedValue; + value uniform 100000; + } + + cycLeft + { + type cyclic; + } + + cycRight + { + type cyclic; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/Allrun b/tutorials/lagrangian/trackedReactingParcelFoam/filter/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..68d74e3f344237944e77206bc85e3c7df36d36e6 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/Allrun @@ -0,0 +1,24 @@ +#!/bin/sh + +# create mesh +blockMesh >& log.blockMesh + +# create sets - 1 +setSet -batch system/sets.setSet >& log.setSet1 + +# create the first cyclic - lhs of porous zone +createBaffles cycLeft cycLeft -overwrite >& log.createBaffles1 + +# create sets - 2 (ordering changed after createBaffles) +setSet -batch system/sets.setSet >& log.setSet2 + +# create the second cyclic - rhs of porous zone +createBaffles cycRight cycRight -overwrite >& log.createBaffles2 + +# create sets - 3 (ordering changed after createBaffles) +setSet -batch system/sets.setSet >& log.setSet3 + +# convert sets to zones +setsToZones -noFlipMap >& log.setsToZones + + diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/chemkin/foam.dat b/tutorials/lagrangian/trackedReactingParcelFoam/filter/chemkin/foam.dat new file mode 100644 index 0000000000000000000000000000000000000000..36ef32431218784d9c10aa1609870debbbbb5924 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/chemkin/foam.dat @@ -0,0 +1,17 @@ +( +O2 O2 1 31.9988 + 200 5000 1000 + 3.69758 0.00061352 -1.25884e-07 1.77528e-11 -1.13644e-15 -1233.93 3.18917 + 3.21294 0.00112749 -5.75615e-07 1.31388e-09 -8.76855e-13 -1005.25 6.03474 + 1.67212e-06 170.672 +H2O H2O 1 18.0153 + 200 5000 1000 + 2.67215 0.00305629 -8.73026e-07 1.201e-10 -6.39162e-15 -29899.2 6.86282 + 3.38684 0.00347498 -6.3547e-06 6.96858e-09 -2.50659e-12 -30208.1 2.59023 + 1.67212e-06 170.672 +N2 N2 1 28.0134 + 200 5000 1000 + 2.92664 0.00148798 -5.68476e-07 1.0097e-10 -6.75335e-15 -922.798 5.98053 + 3.29868 0.00140824 -3.96322e-06 5.64152e-09 -2.44486e-12 -1020.9 3.95037 + 1.67212e-06 170.672 +) diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/chemkin/foam.inp b/tutorials/lagrangian/trackedReactingParcelFoam/filter/chemkin/foam.inp new file mode 100644 index 0000000000000000000000000000000000000000..80d66f62c04dbc0e5638ad8912f02619e526e7be --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/chemkin/foam.inp @@ -0,0 +1,11 @@ +species +( + O2 + H2O + N2 +) +; + +reactions +( +); diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/chemistryProperties b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/chemistryProperties new file mode 100644 index 0000000000000000000000000000000000000000..53a5860d33ad658f415a68c944c3a89007fe22d3 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/chemistryProperties @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object chemistryProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +chemistry off; + +turbulentReaction off; + +chemistrySolver ODE; + +initialChemicalTimeStep 1e-07; + +sequentialCoeffs +{ + cTauChem 0.001; +} + +EulerImplicitCoeffs +{ + cTauChem 0.05; + equilibriumRateLimiter off; +} + +ODECoeffs +{ + ODESolver RK; + eps 0.05; + scale 1; +} + +Cmix Cmix [ 0 0 0 0 0 0 0 ] 1; + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/environmentalProperties b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/environmentalProperties new file mode 100644 index 0000000000000000000000000000000000000000..e5124f24528a9aefc741713cd06a11917107de2a --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/environmentalProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object environmentalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +g g [ 0 1 -2 0 0 0 0 ] ( 0 0 0 ); + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/parcelInjectionProperties b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/parcelInjectionProperties new file mode 100644 index 0000000000000000000000000000000000000000..fd263fee4922111dce6b8189d52a3017aec70c06 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/parcelInjectionProperties @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object scalarListList; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// x y z u v w d rho mDot T cp Y0..YN +( + (0.1 0.3 0.0 2.0 0.0 0.0 0.001 1000 0.2 300 4200 1.0) + (0.1 0.4 0.0 2.0 0.0 0.0 0.001 1000 0.2 300 4200 1.0) + (0.1 0.5 0.0 2.0 0.0 0.0 0.001 1000 0.2 300 4200 1.0) + (0.1 0.6 0.0 2.0 0.0 0.0 0.001 1000 0.2 300 4200 1.0) + (0.1 0.7 0.0 2.0 0.0 0.0 0.001 1000 0.2 300 4200 1.0) +); + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/particleTrackProperties b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/particleTrackProperties new file mode 100644 index 0000000000000000000000000000000000000000..1dcc0258d537ffe209e6ce5ea19a7a6a31a6536c --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/particleTrackProperties @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object particleTrackProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +cloudName reactingCloud1; + +sampleFrequency 1; + +maxPositions 1000000; + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/pointMassSourcesProperties b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/pointMassSourcesProperties new file mode 100644 index 0000000000000000000000000000000000000000..e4f61e9a20ca2f71479b0f558fdd4e3611920f55 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/pointMassSourcesProperties @@ -0,0 +1,34 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object pointMassSourcesProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +active true; + +pointSources +( + source1 + { + timeStart 0.2; + duration 0.5; + location (2.75 0.5 0); + fieldData + ( + (H2O 0.1) + ); + } +); + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/blockMeshDict b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..99b6b4f9111a08de5ed52c51e4ea6908a0dfbfde --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/blockMeshDict @@ -0,0 +1,113 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant/polyMesh"; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + (0.00 0.25 0) // 0 + (1.00 0.25 0) // 1 + (1.25 0.00 0) // 2 + (2.25 0.00 0) // 3 + (2.50 0.25 0) // 4 + (4.00 0.25 0) // 5 + + (4.00 0.75 0) // 6 + (2.50 0.75 0) // 7 + (2.25 1.00 0) // 8 + (1.25 1.00 0) // 9 + (1.00 0.75 0) // 10 + (0.00 0.75 0) // 11 + + + (0.00 0.25 0.1) // 12 + (1.00 0.25 0.1) // 13 + (1.25 0.00 0.1) // 14 + (2.25 0.00 0.1) // 15 + (2.50 0.25 0.1) // 16 + (4.00 0.25 0.1) // 17 + + (4.00 0.75 0.1) // 18 + (2.50 0.75 0.1) // 19 + (2.25 1.00 0.1) // 20 + (1.25 1.00 0.1) // 21 + (1.00 0.75 0.1) // 22 + (0.00 0.75 0.1) // 23 +); + +blocks +( + hex ( 0 1 10 11 12 13 22 23) (20 20 1) simpleGrading (1 1 1) + hex ( 1 2 9 10 13 14 21 22) ( 8 20 1) simpleGrading (1 1 1) + hex ( 2 3 8 9 14 15 20 21) (20 20 1) simpleGrading (1 1 1) + hex ( 3 4 7 8 15 16 19 20) ( 8 20 1) simpleGrading (1 1 1) + hex ( 4 5 6 7 16 17 18 19) (30 20 1) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + wall walls + ( + ( 0 1 13 12) + ( 1 2 14 13) + ( 2 3 15 14) + ( 3 4 16 15) + ( 4 5 17 16) + ( 6 7 19 18) + ( 7 8 20 19) + ( 8 9 21 20) + ( 9 10 22 21) + (10 11 23 22) + ) + + patch inlet + ( + (11 0 12 23) + ) + + patch outlet + ( + ( 5 6 18 17) + ) + + cyclic cycLeft + () + + cyclic cycRight + () + + empty frontAndBack + ( + ( 0 11 10 1) + ( 1 10 9 2) + ( 2 9 8 3) + ( 3 8 7 4) + ( 4 7 6 5) + (12 13 22 23) + (13 14 21 22) + (14 15 20 21) + (15 16 19 20) + (16 17 18 19) + ) +); + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycLeft b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycLeft new file mode 100644 index 0000000000000000000000000000000000000000..637d83fb4b41e5bbe9495fc5d1f3383a49045f61 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycLeft @@ -0,0 +1,63 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev.FT | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class faceSet; + location "constant/polyMesh/sets"; + object cycLeft; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +40 +( +3506 +3507 +3508 +3509 +3510 +3511 +3512 +3513 +3514 +3515 +3516 +3517 +3518 +3519 +3520 +3521 +3522 +3523 +3524 +3525 +3526 +3527 +3528 +3529 +3530 +3531 +3532 +3533 +3534 +3535 +3536 +3537 +3538 +3539 +3540 +3541 +3542 +3543 +3544 +3545 +) + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycLeft_old b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycLeft_old new file mode 100644 index 0000000000000000000000000000000000000000..c2d3df10a3d0dd05db43dbb11e3e30fd4bac28a4 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycLeft_old @@ -0,0 +1,893 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev.FT | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class topoSet; + location "constant/polyMesh/sets"; + object cycLeft_old; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +870 +( +6144 +6145 +6146 +6147 +6148 +6149 +6150 +6151 +6152 +6153 +6154 +6155 +6156 +6157 +6158 +6159 +6160 +6161 +6162 +6163 +6164 +6165 +4246 +4247 +4248 +4249 +4250 +4251 +4252 +4253 +4254 +4255 +4256 +4257 +4258 +4259 +4260 +4261 +4262 +4263 +4264 +4265 +4266 +4267 +4268 +4269 +4270 +4271 +4272 +4273 +4274 +4275 +4276 +4277 +4278 +4279 +4280 +4281 +4282 +4283 +4284 +4285 +4286 +4287 +4288 +4289 +4290 +4291 +4292 +4293 +4294 +4295 +4296 +4297 +4298 +4299 +4300 +4301 +4302 +4303 +4304 +4305 +4306 +4307 +4308 +4309 +4310 +4311 +4312 +4313 +4314 +4315 +4316 +4317 +4318 +4319 +4320 +4321 +4322 +4323 +4324 +4325 +4326 +4327 +4328 +4329 +4330 +4331 +4332 +4333 +4334 +4335 +4336 +4337 +4338 +4339 +4340 +4341 +4342 +4343 +4344 +4345 +4346 +4347 +4348 +4349 +4350 +4351 +4352 +4353 +4354 +4355 +4356 +4357 +4358 +4359 +4360 +4361 +4362 +4363 +4364 +4365 +4366 +4367 +4368 +4369 +4370 +4371 +4372 +4373 +4374 +4375 +4376 +4377 +4378 +4379 +4380 +4381 +4382 +4383 +4384 +4385 +4386 +4387 +4388 +4389 +4390 +4391 +4392 +4393 +4394 +4395 +4396 +4397 +4398 +4399 +4400 +4401 +4402 +4403 +4404 +4405 +4406 +4407 +4408 +4409 +4410 +4411 +4412 +4413 +4414 +4415 +4416 +4417 +4418 +4419 +4420 +4421 +4422 +4423 +4424 +4425 +4426 +4427 +4428 +4429 +4430 +4431 +4432 +4433 +4434 +4435 +4436 +4437 +4438 +4439 +4440 +4441 +4442 +4443 +4444 +4445 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231 +1232 +1233 +1253 +1254 +1255 +1256 +1257 +1258 +1259 +1260 +1261 +1262 +1263 +1264 +1265 +1266 +1267 +1268 +1269 +1270 +1271 +3327 +3328 +3329 +3330 +3331 +3332 +3333 +3334 +3335 +3336 +1291 +1292 +1293 +1294 +1295 +1296 +1297 +1298 +1299 +1300 +1301 +1302 +1303 +1304 +1305 +1306 +1307 +1308 +1309 +1329 +1330 +1331 +1332 +1333 +1334 +1335 +1336 +1337 +1338 +1339 +1340 +1341 +1342 +1343 +1344 +1345 +1346 +1347 +1367 +1368 +1369 +1370 +1371 +1372 +1373 +1374 +1375 +3423 +1376 +3424 +1377 +3425 +1378 +3426 +1379 +3427 +1380 +3428 +1381 +3429 +1382 +3430 +3431 +1383 +3432 +1384 +1385 +1405 +1406 +1407 +1408 +1409 +1410 +1411 +1412 +1413 +1414 +1415 +1416 +1417 +1418 +1419 +1420 +1421 +1422 +1423 +1443 +1444 +1445 +1446 +1447 +1448 +1449 +1450 +1451 +1452 +1453 +1454 +1455 +1456 +1457 +3506 +1458 +3507 +1459 +3508 +1460 +3509 +1461 +3510 +3511 +3512 +3513 +3514 +3515 +3516 +3517 +3518 +3519 +3520 +3521 +3522 +3523 +3524 +3525 +3526 +3527 +3528 +3529 +1481 +3530 +1482 +3531 +1483 +3532 +1484 +3533 +1485 +3534 +1486 +3535 +1487 +3536 +1488 +1489 +3537 +1490 +3538 +1491 +3539 +1492 +3540 +1493 +3541 +1494 +3542 +1495 +3543 +1496 +3544 +1497 +3545 +3546 +1498 +3547 +1499 +3548 +3549 +3550 +3551 +3552 +3553 +3554 +3555 +3556 +3557 +3558 +3559 +3560 +3561 +3562 +3563 +3564 +3565 +3566 +3567 +1519 +3568 +1520 +3569 +1521 +3570 +1522 +3571 +1523 +3572 +1524 +3573 +1525 +3574 +1526 +3575 +1527 +3576 +1528 +3577 +1529 +3578 +1530 +3579 +1531 +3580 +1532 +3581 +1533 +3582 +1534 +3583 +1535 +3584 +1536 +3585 +1537 +1557 +1558 +1559 +1560 +1561 +1562 +1563 +1564 +1565 +1566 +1567 +1568 +1569 +1570 +1571 +1572 +1573 +1574 +1575 +1595 +1596 +1597 +1598 +1599 +1600 +1601 +1602 +1603 +1604 +1605 +1606 +1607 +1608 +1609 +1610 +1611 +1612 +1613 +1633 +1634 +1635 +1636 +1637 +1638 +1639 +1640 +1641 +1642 +1643 +1644 +1645 +1646 +1647 +1648 +1649 +1650 +1651 +1671 +1672 +1673 +1674 +1675 +1676 +1677 +1678 +1679 +1680 +1681 +1682 +1683 +1684 +1685 +1686 +1687 +1688 +1689 +1709 +1710 +1711 +1712 +1713 +1714 +1715 +1716 +1717 +1718 +1719 +1720 +1721 +1722 +1723 +1724 +1725 +1726 +1727 +1747 +1748 +1749 +1750 +1751 +1752 +1753 +1754 +1755 +1756 +1757 +1758 +1759 +1760 +1761 +1762 +1763 +1764 +1765 +1785 +1786 +1787 +1788 +1789 +1790 +1791 +1792 +1793 +1794 +1795 +1796 +1797 +1798 +1799 +1800 +1801 +1802 +1803 +1818 +1819 +1820 +1821 +1822 +1823 +1824 +1825 +1826 +5966 +5967 +5968 +5969 +5970 +5971 +5972 +5973 +5974 +5975 +5976 +5977 +5978 +5979 +5980 +5981 +5982 +5983 +5984 +5985 +5986 +5987 +5988 +5989 +5990 +5991 +5992 +5993 +5994 +5995 +5996 +5997 +5998 +5999 +6000 +6001 +6002 +6003 +6004 +6005 +6006 +6007 +6008 +6009 +6010 +6011 +6012 +6013 +6014 +6015 +6016 +6017 +6018 +6019 +6020 +6021 +6022 +6023 +6024 +6025 +6026 +6027 +6028 +6029 +6030 +6031 +6032 +6033 +6034 +6035 +6036 +6037 +6038 +6039 +6040 +6041 +6042 +6043 +6044 +6045 +6046 +6047 +6048 +6049 +6050 +6051 +6052 +6053 +6054 +6055 +6056 +6057 +6058 +6059 +6060 +6061 +6062 +6063 +6064 +6065 +6066 +6067 +6068 +6069 +6070 +6071 +6072 +6073 +6074 +6075 +6076 +6077 +6078 +6079 +6080 +6081 +6082 +6083 +6084 +6085 +6086 +6087 +6088 +6089 +6090 +6091 +6092 +6093 +6094 +6095 +6096 +6097 +6098 +6099 +6100 +6101 +6102 +6103 +6104 +6105 +6106 +6107 +6108 +6109 +6110 +6111 +6112 +6113 +6114 +6115 +6116 +6117 +6118 +6119 +6120 +6121 +6122 +6123 +6124 +6125 +6126 +6127 +6128 +6129 +6130 +6131 +6132 +6133 +6134 +6135 +6136 +6137 +6138 +6139 +6140 +6141 +6142 +6143 +) + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycRight b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycRight new file mode 100644 index 0000000000000000000000000000000000000000..37cdc37250e049cea02c4c9272fc7629bfe4e90e --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycRight @@ -0,0 +1,63 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev.FT | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class faceSet; + location "constant/polyMesh/sets"; + object cycRight; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +40 +( +3546 +3547 +3548 +3549 +3550 +3551 +3552 +3553 +3554 +3555 +3556 +3557 +3558 +3559 +3560 +3561 +3562 +3563 +3564 +3565 +3566 +3567 +3568 +3569 +3570 +3571 +3572 +3573 +3574 +3575 +3576 +3577 +3578 +3579 +3580 +3581 +3582 +3583 +3584 +3585 +) + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycRight_old b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycRight_old new file mode 100644 index 0000000000000000000000000000000000000000..f0f4e98da521c1704c76e9c2dfc65df9a1d4534b --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/cycRight_old @@ -0,0 +1,893 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev.FT | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class topoSet; + location "constant/polyMesh/sets"; + object cycRight_old; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +870 +( +6144 +6145 +6146 +6147 +6148 +6149 +6150 +6151 +6152 +6153 +6154 +6155 +6156 +6157 +6158 +6159 +6160 +6161 +6162 +6163 +6164 +6165 +4246 +4247 +4248 +4249 +4250 +4251 +4252 +4253 +4254 +4255 +4256 +4257 +4258 +4259 +4260 +4261 +4262 +4263 +4264 +4265 +4266 +4267 +4268 +4269 +4270 +4271 +4272 +4273 +4274 +4275 +4276 +4277 +4278 +4279 +4280 +4281 +4282 +4283 +4284 +4285 +4286 +4287 +4288 +4289 +4290 +4291 +4292 +4293 +4294 +4295 +4296 +4297 +4298 +4299 +4300 +4301 +4302 +4303 +4304 +4305 +4306 +4307 +4308 +4309 +4310 +4311 +4312 +4313 +4314 +4315 +4316 +4317 +4318 +4319 +4320 +4321 +4322 +4323 +4324 +4325 +4326 +4327 +4328 +4329 +4330 +4331 +4332 +4333 +4334 +4335 +4336 +4337 +4338 +4339 +4340 +4341 +4342 +4343 +4344 +4345 +4346 +4347 +4348 +4349 +4350 +4351 +4352 +4353 +4354 +4355 +4356 +4357 +4358 +4359 +4360 +4361 +4362 +4363 +4364 +4365 +4366 +4367 +4368 +4369 +4370 +4371 +4372 +4373 +4374 +4375 +4376 +4377 +4378 +4379 +4380 +4381 +4382 +4383 +4384 +4385 +4386 +4387 +4388 +4389 +4390 +4391 +4392 +4393 +4394 +4395 +4396 +4397 +4398 +4399 +4400 +4401 +4402 +4403 +4404 +4405 +4406 +4407 +4408 +4409 +4410 +4411 +4412 +4413 +4414 +4415 +4416 +4417 +4418 +4419 +4420 +4421 +4422 +4423 +4424 +4425 +4426 +4427 +4428 +4429 +4430 +4431 +4432 +4433 +4434 +4435 +4436 +4437 +4438 +4439 +4440 +4441 +4442 +4443 +4444 +4445 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231 +1232 +1233 +1253 +1254 +1255 +1256 +1257 +1258 +1259 +1260 +1261 +1262 +1263 +1264 +1265 +1266 +1267 +1268 +1269 +1270 +1271 +3327 +3328 +3329 +3330 +3331 +3332 +3333 +3334 +3335 +3336 +1291 +1292 +1293 +1294 +1295 +1296 +1297 +1298 +1299 +1300 +1301 +1302 +1303 +1304 +1305 +1306 +1307 +1308 +1309 +1329 +1330 +1331 +1332 +1333 +1334 +1335 +1336 +1337 +1338 +1339 +1340 +1341 +1342 +1343 +1344 +1345 +1346 +1347 +1367 +1368 +1369 +1370 +1371 +1372 +1373 +1374 +1375 +3423 +1376 +3424 +1377 +3425 +1378 +3426 +1379 +3427 +1380 +3428 +1381 +3429 +1382 +3430 +3431 +1383 +3432 +1384 +1385 +1405 +1406 +1407 +1408 +1409 +1410 +1411 +1412 +1413 +1414 +1415 +1416 +1417 +1418 +1419 +1420 +1421 +1422 +1423 +1443 +1444 +1445 +1446 +1447 +1448 +1449 +1450 +1451 +1452 +1453 +1454 +1455 +1456 +1457 +3506 +1458 +3507 +1459 +3508 +1460 +3509 +1461 +3510 +3511 +3512 +3513 +3514 +3515 +3516 +3517 +3518 +3519 +3520 +3521 +3522 +3523 +3524 +3525 +3526 +3527 +3528 +3529 +1481 +3530 +1482 +3531 +1483 +3532 +1484 +3533 +1485 +3534 +1486 +3535 +1487 +3536 +1488 +1489 +3537 +1490 +3538 +1491 +3539 +1492 +3540 +1493 +3541 +1494 +3542 +1495 +3543 +1496 +3544 +1497 +3545 +3546 +1498 +3547 +1499 +3548 +3549 +3550 +3551 +3552 +3553 +3554 +3555 +3556 +3557 +3558 +3559 +3560 +3561 +3562 +3563 +3564 +3565 +3566 +3567 +1519 +3568 +1520 +3569 +1521 +3570 +1522 +3571 +1523 +3572 +1524 +3573 +1525 +3574 +1526 +3575 +1527 +3576 +1528 +3577 +1529 +3578 +1530 +3579 +1531 +3580 +1532 +3581 +1533 +3582 +1534 +3583 +1535 +3584 +1536 +3585 +1537 +1557 +1558 +1559 +1560 +1561 +1562 +1563 +1564 +1565 +1566 +1567 +1568 +1569 +1570 +1571 +1572 +1573 +1574 +1575 +1595 +1596 +1597 +1598 +1599 +1600 +1601 +1602 +1603 +1604 +1605 +1606 +1607 +1608 +1609 +1610 +1611 +1612 +1613 +1633 +1634 +1635 +1636 +1637 +1638 +1639 +1640 +1641 +1642 +1643 +1644 +1645 +1646 +1647 +1648 +1649 +1650 +1651 +1671 +1672 +1673 +1674 +1675 +1676 +1677 +1678 +1679 +1680 +1681 +1682 +1683 +1684 +1685 +1686 +1687 +1688 +1689 +1709 +1710 +1711 +1712 +1713 +1714 +1715 +1716 +1717 +1718 +1719 +1720 +1721 +1722 +1723 +1724 +1725 +1726 +1727 +1747 +1748 +1749 +1750 +1751 +1752 +1753 +1754 +1755 +1756 +1757 +1758 +1759 +1760 +1761 +1762 +1763 +1764 +1765 +1785 +1786 +1787 +1788 +1789 +1790 +1791 +1792 +1793 +1794 +1795 +1796 +1797 +1798 +1799 +1800 +1801 +1802 +1803 +1818 +1819 +1820 +1821 +1822 +1823 +1824 +1825 +1826 +5966 +5967 +5968 +5969 +5970 +5971 +5972 +5973 +5974 +5975 +5976 +5977 +5978 +5979 +5980 +5981 +5982 +5983 +5984 +5985 +5986 +5987 +5988 +5989 +5990 +5991 +5992 +5993 +5994 +5995 +5996 +5997 +5998 +5999 +6000 +6001 +6002 +6003 +6004 +6005 +6006 +6007 +6008 +6009 +6010 +6011 +6012 +6013 +6014 +6015 +6016 +6017 +6018 +6019 +6020 +6021 +6022 +6023 +6024 +6025 +6026 +6027 +6028 +6029 +6030 +6031 +6032 +6033 +6034 +6035 +6036 +6037 +6038 +6039 +6040 +6041 +6042 +6043 +6044 +6045 +6046 +6047 +6048 +6049 +6050 +6051 +6052 +6053 +6054 +6055 +6056 +6057 +6058 +6059 +6060 +6061 +6062 +6063 +6064 +6065 +6066 +6067 +6068 +6069 +6070 +6071 +6072 +6073 +6074 +6075 +6076 +6077 +6078 +6079 +6080 +6081 +6082 +6083 +6084 +6085 +6086 +6087 +6088 +6089 +6090 +6091 +6092 +6093 +6094 +6095 +6096 +6097 +6098 +6099 +6100 +6101 +6102 +6103 +6104 +6105 +6106 +6107 +6108 +6109 +6110 +6111 +6112 +6113 +6114 +6115 +6116 +6117 +6118 +6119 +6120 +6121 +6122 +6123 +6124 +6125 +6126 +6127 +6128 +6129 +6130 +6131 +6132 +6133 +6134 +6135 +6136 +6137 +6138 +6139 +6140 +6141 +6142 +6143 +) + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/filter b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/filter new file mode 100644 index 0000000000000000000000000000000000000000..69a220b27d6b5c8fdf9e6cd5e72e964fb2c6bffa --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/filter @@ -0,0 +1,223 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev.FT | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class cellSet; + location "constant/polyMesh/sets"; + object filter; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +200 +( +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +805 +806 +807 +808 +809 +810 +811 +812 +813 +814 +825 +826 +827 +828 +829 +830 +831 +832 +833 +834 +845 +846 +847 +848 +849 +850 +851 +852 +853 +854 +865 +866 +867 +868 +869 +870 +871 +872 +873 +874 +885 +886 +887 +888 +889 +890 +891 +892 +893 +894 +905 +906 +907 +908 +909 +910 +911 +912 +913 +914 +925 +926 +927 +928 +929 +930 +931 +932 +933 +934 +945 +946 +947 +948 +949 +950 +951 +952 +953 +954 +) + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/filter_old b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/filter_old new file mode 100644 index 0000000000000000000000000000000000000000..23213bdb87781ea3f3191ce47a8397401db7f408 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/filter_old @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev.FT | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class topoSet; + location "constant/polyMesh/sets"; + object filter_old; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +0 +( +) + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/leftFluid b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/leftFluid new file mode 100644 index 0000000000000000000000000000000000000000..f2907ad0b5a2f7e89636e423e6ab482b98f8fb6c --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/leftFluid @@ -0,0 +1,683 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev.FT | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class cellSet; + location "constant/polyMesh/sets"; + object leftFluid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +660 +( +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 +523 +524 +525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +580 +581 +582 +583 +584 +600 +601 +602 +603 +604 +620 +621 +622 +623 +624 +640 +641 +642 +643 +644 +660 +661 +662 +663 +664 +680 +681 +682 +683 +684 +700 +701 +702 +703 +704 +720 +721 +722 +723 +724 +740 +741 +742 +743 +744 +760 +761 +762 +763 +764 +780 +781 +782 +783 +784 +800 +801 +802 +803 +804 +820 +821 +822 +823 +824 +840 +841 +842 +843 +844 +860 +861 +862 +863 +864 +880 +881 +882 +883 +884 +900 +901 +902 +903 +904 +920 +921 +922 +923 +924 +940 +941 +942 +943 +944 +) + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/rightFluid b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/rightFluid new file mode 100644 index 0000000000000000000000000000000000000000..d1d4226be6df5334e86deba685cf2acbe2b74ce0 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/polyMesh/sets/rightFluid @@ -0,0 +1,883 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev.FT | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class cellSet; + location "constant/polyMesh/sets"; + object rightFluid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +860 +( +575 +576 +577 +578 +579 +595 +596 +597 +598 +599 +615 +616 +617 +618 +619 +635 +636 +637 +638 +639 +655 +656 +657 +658 +659 +675 +676 +677 +678 +679 +695 +696 +697 +698 +699 +715 +716 +717 +718 +719 +735 +736 +737 +738 +739 +755 +756 +757 +758 +759 +775 +776 +777 +778 +779 +795 +796 +797 +798 +799 +815 +816 +817 +818 +819 +835 +836 +837 +838 +839 +855 +856 +857 +858 +859 +875 +876 +877 +878 +879 +895 +896 +897 +898 +899 +915 +916 +917 +918 +919 +935 +936 +937 +938 +939 +955 +956 +957 +958 +959 +960 +961 +962 +963 +964 +965 +966 +967 +968 +969 +970 +971 +972 +973 +974 +975 +976 +977 +978 +979 +980 +981 +982 +983 +984 +985 +986 +987 +988 +989 +990 +991 +992 +993 +994 +995 +996 +997 +998 +999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023 +1024 +1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 +1044 +1045 +1046 +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056 +1057 +1058 +1059 +1060 +1061 +1062 +1063 +1064 +1065 +1066 +1067 +1068 +1069 +1070 +1071 +1072 +1073 +1074 +1075 +1076 +1077 +1078 +1079 +1080 +1081 +1082 +1083 +1084 +1085 +1086 +1087 +1088 +1089 +1090 +1091 +1092 +1093 +1094 +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 +1138 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159 +1160 +1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +1205 +1206 +1207 +1208 +1209 +1210 +1211 +1212 +1213 +1214 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231 +1232 +1233 +1234 +1235 +1236 +1237 +1238 +1239 +1240 +1241 +1242 +1243 +1244 +1245 +1246 +1247 +1248 +1249 +1250 +1251 +1252 +1253 +1254 +1255 +1256 +1257 +1258 +1259 +1260 +1261 +1262 +1263 +1264 +1265 +1266 +1267 +1268 +1269 +1270 +1271 +1272 +1273 +1274 +1275 +1276 +1277 +1278 +1279 +1280 +1281 +1282 +1283 +1284 +1285 +1286 +1287 +1288 +1289 +1290 +1291 +1292 +1293 +1294 +1295 +1296 +1297 +1298 +1299 +1300 +1301 +1302 +1303 +1304 +1305 +1306 +1307 +1308 +1309 +1310 +1311 +1312 +1313 +1314 +1315 +1316 +1317 +1318 +1319 +1320 +1321 +1322 +1323 +1324 +1325 +1326 +1327 +1328 +1329 +1330 +1331 +1332 +1333 +1334 +1335 +1336 +1337 +1338 +1339 +1340 +1341 +1342 +1343 +1344 +1345 +1346 +1347 +1348 +1349 +1350 +1351 +1352 +1353 +1354 +1355 +1356 +1357 +1358 +1359 +1360 +1361 +1362 +1363 +1364 +1365 +1366 +1367 +1368 +1369 +1370 +1371 +1372 +1373 +1374 +1375 +1376 +1377 +1378 +1379 +1380 +1381 +1382 +1383 +1384 +1385 +1386 +1387 +1388 +1389 +1390 +1391 +1392 +1393 +1394 +1395 +1396 +1397 +1398 +1399 +1400 +1401 +1402 +1403 +1404 +1405 +1406 +1407 +1408 +1409 +1410 +1411 +1412 +1413 +1414 +1415 +1416 +1417 +1418 +1419 +1420 +1421 +1422 +1423 +1424 +1425 +1426 +1427 +1428 +1429 +1430 +1431 +1432 +1433 +1434 +1435 +1436 +1437 +1438 +1439 +1440 +1441 +1442 +1443 +1444 +1445 +1446 +1447 +1448 +1449 +1450 +1451 +1452 +1453 +1454 +1455 +1456 +1457 +1458 +1459 +1460 +1461 +1462 +1463 +1464 +1465 +1466 +1467 +1468 +1469 +1470 +1471 +1472 +1473 +1474 +1475 +1476 +1477 +1478 +1479 +1480 +1481 +1482 +1483 +1484 +1485 +1486 +1487 +1488 +1489 +1490 +1491 +1492 +1493 +1494 +1495 +1496 +1497 +1498 +1499 +1500 +1501 +1502 +1503 +1504 +1505 +1506 +1507 +1508 +1509 +1510 +1511 +1512 +1513 +1514 +1515 +1516 +1517 +1518 +1519 +1520 +1521 +1522 +1523 +1524 +1525 +1526 +1527 +1528 +1529 +1530 +1531 +1532 +1533 +1534 +1535 +1536 +1537 +1538 +1539 +1540 +1541 +1542 +1543 +1544 +1545 +1546 +1547 +1548 +1549 +1550 +1551 +1552 +1553 +1554 +1555 +1556 +1557 +1558 +1559 +1560 +1561 +1562 +1563 +1564 +1565 +1566 +1567 +1568 +1569 +1570 +1571 +1572 +1573 +1574 +1575 +1576 +1577 +1578 +1579 +1580 +1581 +1582 +1583 +1584 +1585 +1586 +1587 +1588 +1589 +1590 +1591 +1592 +1593 +1594 +1595 +1596 +1597 +1598 +1599 +1600 +1601 +1602 +1603 +1604 +1605 +1606 +1607 +1608 +1609 +1610 +1611 +1612 +1613 +1614 +1615 +1616 +1617 +1618 +1619 +1620 +1621 +1622 +1623 +1624 +1625 +1626 +1627 +1628 +1629 +1630 +1631 +1632 +1633 +1634 +1635 +1636 +1637 +1638 +1639 +1640 +1641 +1642 +1643 +1644 +1645 +1646 +1647 +1648 +1649 +1650 +1651 +1652 +1653 +1654 +1655 +1656 +1657 +1658 +1659 +1660 +1661 +1662 +1663 +1664 +1665 +1666 +1667 +1668 +1669 +1670 +1671 +1672 +1673 +1674 +1675 +1676 +1677 +1678 +1679 +1680 +1681 +1682 +1683 +1684 +1685 +1686 +1687 +1688 +1689 +1690 +1691 +1692 +1693 +1694 +1695 +1696 +1697 +1698 +1699 +1700 +1701 +1702 +1703 +1704 +1705 +1706 +1707 +1708 +1709 +1710 +1711 +1712 +1713 +1714 +1715 +1716 +1717 +1718 +1719 +) + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/porousZones b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/porousZones new file mode 100644 index 0000000000000000000000000000000000000000..f938b2836e47c4ea4f1ffe254d9381dc282e7653 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/porousZones @@ -0,0 +1,36 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object porousZones; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +( + filter // name of cell zone + { + coordinateSystem + { + e1 (1 0 0); + e2 (0 1 1); + } + + Darcy + { + d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000); + f f [0 -1 0 0 0 0 0] (0 0 0); + } + } +) + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/radiationProperties b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/radiationProperties new file mode 100644 index 0000000000000000000000000000000000000000..59468cd924256aa242b4f679efcef467ddf95b20 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/radiationProperties @@ -0,0 +1,65 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object radiationProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +radiation off; + +radiationModel P1; + +solverFreq 10; + +noRadiation +{ +} + +P1Coeffs +{ + C C [ 0 0 0 0 0 0 0 ] 0; +} + +absorptionEmissionModel binaryAbsorptionEmission; + +binaryAbsorptionEmissionCoeffs +{ + model1 + { + absorptionEmissionModel constantAbsorptionEmission; + constantAbsorptionEmissionCoeffs + { + a a [ 0 -1 0 0 0 0 0 ] 0.5; + e e [ 0 -1 0 0 0 0 0 ] 0.5; + E E [ 1 -1 -3 0 0 0 0 ] 0; + } + } + model2 + { + absorptionEmissionModel cloudAbsorptionEmission; + cloudAbsorptionEmissionCoeffs + { + cloudNames ( coalCloud1 limestoneCloud1 ); + } + } +} + +scatterModel cloudScatter; + +cloudScatterCoeffs +{ + cloudNames ( coalCloud1 limestoneCloud1 ); +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/reactingCloud1Positions b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/reactingCloud1Positions new file mode 100644 index 0000000000000000000000000000000000000000..6d19cbc19bad9ca1c5c8ba0b7c51cd24b0778b37 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/reactingCloud1Positions @@ -0,0 +1,44 @@ +/*--------------------------------*- 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 vectorField; + location "constant"; + object reactingCloud1Positions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +( +(0.002 0.002 0.00005) +(0.004 0.002 0.00005) +(0.006 0.002 0.00005) +(0.008 0.002 0.00005) +(0.010 0.002 0.00005) +(0.002 0.004 0.00005) +(0.004 0.004 0.00005) +(0.006 0.004 0.00005) +(0.008 0.004 0.00005) +(0.010 0.004 0.00005) +(0.002 0.006 0.00005) +(0.004 0.006 0.00005) +(0.006 0.006 0.00005) +(0.008 0.006 0.00005) +(0.010 0.006 0.00005) +(0.002 0.008 0.00005) +(0.004 0.008 0.00005) +(0.006 0.008 0.00005) +(0.008 0.008 0.00005) +(0.010 0.008 0.00005) +(0.002 0.010 0.00005) +(0.004 0.010 0.00005) +(0.006 0.010 0.00005) +(0.008 0.010 0.00005) +(0.010 0.010 0.00005) +) +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/reactingCloud1Properties b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/reactingCloud1Properties new file mode 100644 index 0000000000000000000000000000000000000000..a1d4354ab1137adc7835e5cd87b3997653e0e40f --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/reactingCloud1Properties @@ -0,0 +1,167 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object reactingCloud1Properties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +InjectionModel ReactingLookupTableInjection; + +DragModel SphereDrag; + +DispersionModel none; + +PatchInteractionModel LocalInteraction; + +HeatTransferModel RanzMarshall; + +CompositionModel SinglePhaseMixture; + +PhaseChangeModel LiquidEvaporation; + +PostProcessingModel PatchPostProcessing; + +radiation off; + +coupled true; + +cellValueSourceCorrection on; + +parcelTypeId 1; + +constantProperties +{ + rhoMin rhoMin [ 1 -3 0 0 0 ] 1e-15; + TMin TMin [ 0 0 0 1 0 ] 200; + pMin pMin [ 1 -1 2 0 0 ] 1000; + rho0 rho0 [ 1 -3 0 0 0 ] 1000; + minParticleMass minParticleMass [ 1 0 0 0 0 ] 1e-15; + T0 T0 [ 0 0 0 1 0 ] 300; + cp0 cp0 [ 0 2 -2 -1 0 ] 4100; + epsilon0 epsilon0 [ 0 0 0 0 0 ] 1; + f0 f0 [ 0 0 0 0 0 ] 0.5; + Tvap Tvap [ 0 0 0 1 0 ] 273; + constantVolume false; +} + +interpolationSchemes +{ + rho cell; + U cellPointFace; + mu cell; + T cell; + Cp cell; + p cell; +} + +integrationSchemes +{ + U Euler; + T Analytical; +} + +particleForces +{ + gravity on; + virtualMass off; + Cvm 0.5; + pressureGradient off; + gradU gradU; +} + +ManualInjectionCoeffs +{ + massTotal massTotal [ 1 0 0 0 0 ] 1e-7; + parcelBasisType mass; + SOI 0; + positionsFile "reactingCloud1Positions"; + U0 ( 0 0 0 ); + parcelPDF + { + pdfType uniform; + uniformPDF + { + minValue 1e-04; + maxValue 1e-04; + } + } +} + +ReactingLookupTableInjectionCoeffs +{ + massTotal massTotal [ 1 0 0 0 0 ] 1e-7; + parcelBasisType mass; + SOI 0; + inputFile "parcelInjectionProperties"; + duration 1.0; + parcelsPerSecond 1e2; +} + + +StandardWallInteractionCoeffs +{ + e e [ 0 0 0 0 0 ] 1; + mu mu [ 0 0 0 0 0 ] 0; +} + +LocalInteractionCoeffs +{ + patches + ( + walls + { + e 1; + mu 0; + } + cycLeft + { + e 1; + mu 0; + } + ); +} + +RanzMarshallCoeffs +{ + Pr Pr [ 0 0 0 0 0 ] 0.7; +} + +SinglePhaseMixtureCoeffs +{ + phases + ( + liquid + { + H2O 1; + } + ); +} + +LiquidEvaporationCoeffs +{ + activeLiquids + ( + H2O + ); +} + +PatchPostProcessingCoeffs +{ + patches + ( + cycLeft + ); +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/thermophysicalProperties b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/thermophysicalProperties new file mode 100644 index 0000000000000000000000000000000000000000..04b13b12cf071d823be29a6c41dc37ec5ab58875 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/thermophysicalProperties @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType hMixtureThermo<reactingMixture>; + +chemistryReader foamChemistryReader; + +foamChemistryFile "$FOAM_CASE/chemkin/foam.inp"; + +foamChemistryThermoFile "$FOAM_CASE/chemkin/foam.dat"; + +liquidComponents ( H2O ); + +solidFuelComponents ( ); + +inertSpecie N2; + +H2O H2O defaultCoeffs; + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/turbulenceProperties b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..78f28eca604be4d8fc94d38d23ae0cbb679b18fb --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/cellSetDict b/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/cellSetDict new file mode 100644 index 0000000000000000000000000000000000000000..42393046f74652f8a8f671aac5d75b5b0504df03 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/cellSetDict @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object cellSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +name filter; + +action new; + +topoSetSources +( + // Cells with cell centre within box + boxToCell + { + box (1.5 -1 -1) (2 1 1); + } +); + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/controlDict b/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..a1aa89cd091f1ff7050767fd9afc25fdabc216b7 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/controlDict @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 5; + +deltaT 0.001; + +writeControl adjustableRunTime; + +writeInterval 0.1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 10; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 1.0; + +maxDeltaT 1; + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/decomposeParDict b/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..e9784a98d78f4c2d7f0435a759a78ad3f30a0226 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/decomposeParDict @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method metis; + +simpleCoeffs +{ + n ( 2 2 1 ); + delta 0.001; +} + +hierarchicalCoeffs +{ + n ( 1 1 1 ); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + processorWeights ( 1 1 1 1 ); +} + +manualCoeffs +{ + dataFile ""; +} + +distributed no; + +roots ( ); + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/fvSchemes b/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..99267208eae1f5130781bee35206d73e203fc64a --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/fvSchemes @@ -0,0 +1,72 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss upwind; + div(phid,p) Gauss upwind; + div(phiU,p) Gauss linear; + div(phi,h) Gauss upwind; + div(phi,k) Gauss upwind; + div(phi,epsilon) Gauss upwind; + div(U) Gauss linear; + div((muEff*dev2(grad(U).T()))) Gauss linear; + div(phi,Yi_h) Gauss upwind; +} + +laplacianSchemes +{ + default Gauss linear corrected; + laplacian(muEff,U) Gauss linear corrected; + laplacian(mut,U) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DREff,R) Gauss linear corrected; + laplacian((rho*(1|A(U))),p) Gauss linear corrected; + laplacian(alphaEff,h) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/fvSolution b/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..007553788aabe5cba859f93b043fc622f55414fb --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/fvSolution @@ -0,0 +1,154 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + rho + { + solver PCG; + preconditioner DIC; + tolerance 1e-05; + relTol 0; + } + U + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + p + { + solver GAMG; + + tolerance 1e-6; + relTol 0; + + smoother GaussSeidel; + nPreSweeps 0; + nPostSweeps 2; + + cacheAgglomeration true; + + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + }; + G + { + solver PCG; + preconditioner DIC; + tolerance 1e-05; + relTol 0; + } + Yi + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-06; + relTol 0; + } + CO2 + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-06; + relTol 0; + } + O2 + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-06; + relTol 0; + } + N2 + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-06; + relTol 0; + } + CH4 + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-06; + relTol 0; + } + H2 + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-06; + relTol 0; + } + H2O + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-06; + relTol 0; + } + CO + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-06; + relTol 0; + } + h + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + R + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + k + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + epsilon + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } +} + +PISO +{ + transonic no; + nOuterCorrectors 2; + nCorrectors 2; + nNonOrthogonalCorrectors 0; + momentumPredictor yes; +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/sets.setSet b/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/sets.setSet new file mode 100644 index 0000000000000000000000000000000000000000..b6137ed52b04b0259a4cc4c5617c95a634d14e12 --- /dev/null +++ b/tutorials/lagrangian/trackedReactingParcelFoam/filter/system/sets.setSet @@ -0,0 +1,10 @@ +cellSet filter new boxToCell (1.5 -10 -10) (2 10 10) +cellSet leftFluid new boxToCell (-10 -10 -10) (1.5 10 10) +cellSet rightFluid new boxToCell (2 -1 -1) (10 10 10) + +faceSet cycLeft new cellToFace filter all +faceSet cycLeft subset cellToFace leftFluid all + +faceSet cycRight new cellToFace filter all +faceSet cycRight subset cellToFace rightFluid all + diff --git a/tutorials/mesh/snappyHexMesh/iglooWithFridges/system/snappyHexMeshDict b/tutorials/mesh/snappyHexMesh/iglooWithFridges/system/snappyHexMeshDict index be30045c6d4d77a2bf014349a0e4890ff5d963bd..30da45333116a695a3d463d85d30aa98babc1b38 100644 --- a/tutorials/mesh/snappyHexMesh/iglooWithFridges/system/snappyHexMeshDict +++ b/tutorials/mesh/snappyHexMesh/iglooWithFridges/system/snappyHexMeshDict @@ -45,6 +45,8 @@ geometry fridgeFreezer { type searchableSurfaceCollection; + + mergeSubRegions true; freezer { @@ -75,6 +77,8 @@ geometry { type searchableSurfaceCollection; + mergeSubRegions true; + seal { surface fridgeFreezer; @@ -244,6 +248,8 @@ snapControls // Settings for the layer addition. addLayersControls { + relativeSizes true; + // Per final patch (so not geometry!) the layer information layers { @@ -264,7 +270,7 @@ addLayersControls // is the // thickness of the layer furthest away from the wall. // Relative to undistorted size of cell outside layer. - finalLayerRatio 0.5; + finalLayerThickness 0.5; //- Minimum thickness of cell layer. If for any reason layer // cannot be above minThickness do not add layer. diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/MRFInterFoam.C b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/MRFInterFoam.C new file mode 100644 index 0000000000000000000000000000000000000000..9f1efad337fce1be11e0728662c8980823f3ab80 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/MRFInterFoam.C @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-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 + +Application + MRFInterFoam + +Description + Solver for 2 incompressible, isothermal immiscible fluids using a VOF + (volume of fluid) phase-fraction based interface capturing approach. + The momentum and other fluid properties are of the "mixture" and a single + momentum equation is solved. + + Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. + + For a two-fluid approach see twoPhaseEulerFoam. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "MULES.H" +#include "subCycle.H" +#include "interfaceProperties.H" +#include "twoPhaseMixture.H" +#include "turbulenceModel.H" +#include "MRFZones.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readEnvironmentalProperties.H" + #include "readPISOControls.H" + #include "initContinuityErrs.H" + #include "createFields.H" + #include "createMRFZones.H" + #include "readTimeControls.H" + #include "correctPhi.H" + #include "CourantNo.H" + #include "setInitialDeltaT.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readPISOControls.H" + #include "readTimeControls.H" + #include "CourantNo.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + twoPhaseProperties.correct(); + + #include "alphaEqnSubCycle.H" + + #include "UEqn.H" + + // --- PISO loop + for (int corr=0; corr<nCorr; corr++) + { + #include "pEqn.H" + } + + #include "continuityErrs.H" + + turbulence->correct(); + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/Make/files b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..706858442e6a56a1a60fb8bb7377b9879e221fd0 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/Make/files @@ -0,0 +1,3 @@ +MRFInterFoam.C + +EXE = $(FOAM_USER_APPBIN)/MRFInterFoam diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/Make/options b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..e4acc4ce993fdad66ddeb7fb84c06b2824ccbc53 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/Make/options @@ -0,0 +1,14 @@ +EXE_INC = \ + -I$(FOAM_SOLVERS)/multiphase/interFoam \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ + -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -linterfaceProperties \ + -lincompressibleTransportModels \ + -lincompressibleRASModels \ + -lincompressibleLESModels \ + -lfiniteVolume diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/UEqn.H b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/UEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..ae944a9d0e5b4060da256b629f1ff0326d014967 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/UEqn.H @@ -0,0 +1,35 @@ + surfaceScalarField muEff + ( + "muEff", + twoPhaseProperties.muf() + + fvc::interpolate(rho*turbulence->nut()) + ); + + fvVectorMatrix UEqn + ( + fvm::ddt(rho, U) + + fvm::div(rhoPhi, U) + - fvm::laplacian(muEff, U) + - (fvc::grad(U) & fvc::grad(muEff)) + //- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf())) + ); + mrfZones.addCoriolis(rho, UEqn); + + UEqn.relax(); + + if (momentumPredictor) + { + solve + ( + UEqn + == + fvc::reconstruct + ( + fvc::interpolate(rho)*(g & mesh.Sf()) + + ( + fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1) + - fvc::snGrad(p) + ) * mesh.magSf() + ) + ); + } diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/createMRFZones.H b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/createMRFZones.H new file mode 100644 index 0000000000000000000000000000000000000000..161446a8e6f2397982c0579c232b8ce3e458053d --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/createMRFZones.H @@ -0,0 +1,2 @@ + MRFZones mrfZones(mesh); + mrfZones.correctBoundaryVelocity(U); diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/pEqn.H b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/pEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..5a67dd0497b150c4a46f62f306afdf814cfe17aa --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/MRFInterFoam/pEqn.H @@ -0,0 +1,48 @@ +{ + volScalarField rUA = 1.0/UEqn.A(); + surfaceScalarField rUAf = fvc::interpolate(rUA); + + U = rUA*UEqn.H(); + + surfaceScalarField phiU + ( + "phiU", + (fvc::interpolate(U) & mesh.Sf()) + //+ fvc::ddtPhiCorr(rUA, rho, U, phi) + ); + mrfZones.relativeFlux(phiU); + + phi = phiU + + ( + fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf() + + fvc::interpolate(rho)*(g & mesh.Sf()) + )*rUAf; + adjustPhi(phi, U, p); + + for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pEqn + ( + fvm::laplacian(rUAf, p) == fvc::div(phi) + ); + + pEqn.setReference(pRefCell, pRefValue); + + if (corr == nCorr-1 && nonOrth == nNonOrthCorr) + { + pEqn.solve(mesh.solver(p.name() + "Final")); + } + else + { + pEqn.solve(mesh.solver(p.name())); + } + + if (nonOrth == nNonOrthCorr) + { + phi -= pEqn.flux(); + } + } + + U += rUA*fvc::reconstruct((phi - phiU)/rUAf); + U.correctBoundaryConditions(); +} diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/U b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/U new file mode 100644 index 0000000000000000000000000000000000000000..500a0fbea165c8862b993215de7a33f21267fd13 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/U @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + rotor + { + type fixedValue; + value uniform (0 0 0); + } + stator + { + type fixedValue; + value uniform (0 0 0); + } + front + { + type empty; + } + back + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/alpha1 b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/alpha1 new file mode 100644 index 0000000000000000000000000000000000000000..f4e647e372dc3641e186e02d763fdb92a4217d95 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/alpha1 @@ -0,0 +1,3119 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha1; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField nonuniform List<scalar> +3072 +( +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +) +; + +boundaryField +{ + rotor + { + type zeroGradient; + } + stator + { + type zeroGradient; + } + front + { + type empty; + } + back + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/alpha1.org b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/alpha1.org new file mode 100644 index 0000000000000000000000000000000000000000..adc19d7f15a738efc8b7f2d48da4e25141e3e6d3 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/alpha1.org @@ -0,0 +1,44 @@ +/*--------------------------------*- 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 alpha1; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + rotor + { + type zeroGradient; + } + + stator + { + type zeroGradient; + } + + front + { + type empty; + } + + back + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/pd b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/p similarity index 74% rename from tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/pd rename to tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/p index 3a679ba63a51f43776afa9f72c8fe4e69e328aac..25b3e3f0d4d589ff4a01f1f88a5c627252dd7288 100644 --- a/tutorials/heatTransfer/buoyantPisoFoam/hotRoom/0/pd +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/0/p @@ -10,7 +10,7 @@ FoamFile version 2.0; format ascii; class volScalarField; - object pd; + object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -20,22 +20,24 @@ internalField uniform 0; boundaryField { - floor + rotor { - type fixedFluxBuoyantPressure; - value uniform 0; + type zeroGradient; } - ceiling + stator { - type fixedFluxBuoyantPressure; - value uniform 0; + type zeroGradient; } - fixedWalls + front { - type fixedFluxBuoyantPressure; - value uniform 0; + type empty; + } + + back + { + type empty; } } diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/Allrun b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..e8e310bf86a0faa6481cf8e4284b6fbfaf5780ce --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/Allrun @@ -0,0 +1,9 @@ +#!/bin/sh + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +application="MRFInterFoam" + +./makeMesh +runApplication $application diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/MRFZones b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/MRFZones new file mode 100644 index 0000000000000000000000000000000000000000..855e3864ce8f3fcf79fe47d6301ddaa13ae78306 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/MRFZones @@ -0,0 +1,31 @@ +/*--------------------------------*- 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 dictionary; + location "constant"; + object MRFZones; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +1 +( + rotor + { + // Fixed patches (by default they 'move' with the MRF zone) + nonRotatingPatches (); + + origin origin [0 1 0 0 0 0 0] (0 0 0); + axis axis [0 0 0 0 0 0 0] (0 0 1); + omega omega [0 0 -1 0 0 0 0] 6.2831853; + } +) + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/environmentalProperties b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/environmentalProperties new file mode 100644 index 0000000000000000000000000000000000000000..1f0ea06a3cb5296cd1202223d4955977d562ca1f --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/environmentalProperties @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object environmentalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +g g [0 1 -2 0 0 0 0] (0 0 0); + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..554df2afd61191c9b3b121c440c6fad3d4ceb429 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict @@ -0,0 +1,818 @@ +/*--------------------------------*- 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 dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// General macros to create 2D/extruded-2D meshes + + + + + + + + + + + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.1; + +// Hub radius + + +// Impeller-tip radius + + +// Baffle-tip radius + + +// Tank radius + + +// MRF region radius + + +// Thickness of 2D slab + + +// Base z + + +// Top z + + +// Number of cells radially between hub and impeller tip + + +// Number of cells radially in each of the two regions between +// impeller and baffle tips + + +// Number of cells radially between baffle tip and tank + + +// Number of cells azimuthally in each of the 8 blocks + + +// Number of cells in the thickness of the slab + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +vertices +( + (0.2 0 0) // Vertex r0b = 0 + (0.2 0 0) // Vertex r0sb = 1 + (0.141421356364228 -0.141421356110391 0) // Vertex r1b = 2 + (3.58979347393082e-10 -0.2 0) // Vertex r2b = 3 + (3.58979347393082e-10 -0.2 0) // Vertex r2sb = 4 + (-0.141421355856554 -0.141421356618065 0) // Vertex r3b = 5 + (-0.2 7.17958694786164e-10 0) // Vertex r4b = 6 + (-0.2 7.17958694786164e-10 0) // Vertex r4sb = 7 + (-0.141421355856554 0.141421356618065 0) // Vertex r5b = 8 + (3.58979347393082e-10 0.2 0) // Vertex r6b = 9 + (3.58979347393082e-10 0.2 0) // Vertex r6sb = 10 + (0.141421356364228 0.141421356110391 0) // Vertex r7b = 11 + + (0.5 0 0) // Vertex rb0b = 12 + (0.353553390910569 -0.353553390275978 0) // Vertex rb1b = 13 + (8.97448368482705e-10 -0.5 0) // Vertex rb2b = 14 + (-0.353553389641386 -0.353553391545162 0) // Vertex rb3b = 15 + (-0.5 1.79489673696541e-09 0) // Vertex rb4b = 16 + (-0.353553389641386 0.353553391545162 0) // Vertex rb5b = 17 + (8.97448368482705e-10 0.5 0) // Vertex rb6b = 18 + (0.353553390910569 0.353553390275978 0) // Vertex rb7b = 19 + + (0.6 0 0) // Vertex ri0b = 20 + (0.424264069092683 -0.424264068331174 0) // Vertex ri1b = 21 + (1.07693804217925e-09 -0.6 0) // Vertex ri2b = 22 + (-0.424264067569663 -0.424264069854194 0) // Vertex ri3b = 23 + (-0.6 2.15387608435849e-09 0) // Vertex ri4b = 24 + (-0.424264067569663 0.424264069854194 0) // Vertex ri5b = 25 + (1.07693804217925e-09 0.6 0) // Vertex ri6b = 26 + (0.424264069092683 0.424264068331174 0) // Vertex ri7b = 27 + + (0.7 0 0) // Vertex Rb0b = 28 + (0.494974747274797 -0.494974746386369 0) // Vertex Rb1b = 29 + (1.25642771587579e-09 -0.7 0) // Vertex Rb2b = 30 + (-0.49497474549794 -0.494974748163226 0) // Vertex Rb3b = 31 + (-0.7 2.51285543175157e-09 0) // Vertex Rb4b = 32 + (-0.49497474549794 0.494974748163226 0) // Vertex Rb5b = 33 + (1.25642771587579e-09 0.7 0) // Vertex Rb6b = 34 + (0.494974747274797 0.494974746386369 0) // Vertex Rb7b = 35 + + (1 0 0) // Vertex R0b = 36 + (0.707106781821139 -0.707106780551956 0) // Vertex R1b = 37 + (0.707106781821139 -0.707106780551956 0) // Vertex R1sb = 38 + (1.79489673696541e-09 -1 0) // Vertex R2b = 39 + (-0.707106779282772 -0.707106783090323 0) // Vertex R3b = 40 + (-0.707106779282772 -0.707106783090323 0) // Vertex R3sb = 41 + (-1 3.58979347393082e-09 0) // Vertex R4b = 42 + (-0.707106779282772 0.707106783090323 0) // Vertex R5b = 43 + (-0.707106779282772 0.707106783090323 0) // Vertex R5sb = 44 + (1.79489673696541e-09 1 0) // Vertex R6b = 45 + (0.707106781821139 0.707106780551956 0) // Vertex R7b = 46 + (0.707106781821139 0.707106780551956 0) // Vertex R7sb = 47 + + (0.2 0 0.1) // Vertex r0t = 48 + (0.2 0 0.1) // Vertex r0st = 49 + (0.141421356364228 -0.141421356110391 0.1) // Vertex r1t = 50 + (3.58979347393082e-10 -0.2 0.1) // Vertex r2t = 51 + (3.58979347393082e-10 -0.2 0.1) // Vertex r2st = 52 + (-0.141421355856554 -0.141421356618065 0.1) // Vertex r3t = 53 + (-0.2 7.17958694786164e-10 0.1) // Vertex r4t = 54 + (-0.2 7.17958694786164e-10 0.1) // Vertex r4st = 55 + (-0.141421355856554 0.141421356618065 0.1) // Vertex r5t = 56 + (3.58979347393082e-10 0.2 0.1) // Vertex r6t = 57 + (3.58979347393082e-10 0.2 0.1) // Vertex r6st = 58 + (0.141421356364228 0.141421356110391 0.1) // Vertex r7t = 59 + + (0.5 0 0.1) // Vertex rb0t = 60 + (0.353553390910569 -0.353553390275978 0.1) // Vertex rb1t = 61 + (8.97448368482705e-10 -0.5 0.1) // Vertex rb2t = 62 + (-0.353553389641386 -0.353553391545162 0.1) // Vertex rb3t = 63 + (-0.5 1.79489673696541e-09 0.1) // Vertex rb4t = 64 + (-0.353553389641386 0.353553391545162 0.1) // Vertex rb5t = 65 + (8.97448368482705e-10 0.5 0.1) // Vertex rb6t = 66 + (0.353553390910569 0.353553390275978 0.1) // Vertex rb7t = 67 + + (0.6 0 0.1) // Vertex ri0t = 68 + (0.424264069092683 -0.424264068331174 0.1) // Vertex ri1t = 69 + (1.07693804217925e-09 -0.6 0.1) // Vertex ri2t = 70 + (-0.424264067569663 -0.424264069854194 0.1) // Vertex ri3t = 71 + (-0.6 2.15387608435849e-09 0.1) // Vertex ri4t = 72 + (-0.424264067569663 0.424264069854194 0.1) // Vertex ri5t = 73 + (1.07693804217925e-09 0.6 0.1) // Vertex ri6t = 74 + (0.424264069092683 0.424264068331174 0.1) // Vertex ri7t = 75 + + (0.7 0 0.1) // Vertex Rb0t = 76 + (0.494974747274797 -0.494974746386369 0.1) // Vertex Rb1t = 77 + (1.25642771587579e-09 -0.7 0.1) // Vertex Rb2t = 78 + (-0.49497474549794 -0.494974748163226 0.1) // Vertex Rb3t = 79 + (-0.7 2.51285543175157e-09 0.1) // Vertex Rb4t = 80 + (-0.49497474549794 0.494974748163226 0.1) // Vertex Rb5t = 81 + (1.25642771587579e-09 0.7 0.1) // Vertex Rb6t = 82 + (0.494974747274797 0.494974746386369 0.1) // Vertex Rb7t = 83 + + (1 0 0.1) // Vertex R0t = 84 + (0.707106781821139 -0.707106780551956 0.1) // Vertex R1t = 85 + (0.707106781821139 -0.707106780551956 0.1) // Vertex R1st = 86 + (1.79489673696541e-09 -1 0.1) // Vertex R2t = 87 + (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3t = 88 + (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3st = 89 + (-1 3.58979347393082e-09 0.1) // Vertex R4t = 90 + (-0.707106779282772 0.707106783090323 0.1) // Vertex R5t = 91 + (-0.707106779282772 0.707106783090323 0.1) // Vertex R5st = 92 + (1.79489673696541e-09 1 0.1) // Vertex R6t = 93 + (0.707106781821139 0.707106780551956 0.1) // Vertex R7t = 94 + (0.707106781821139 0.707106780551956 0.1) // Vertex R7st = 95 +); + +blocks +( + // block0 + hex (0 2 13 12 48 50 61 60) + rotor + (12 12 1) + simpleGrading (1 1 1) + + // block1 + hex (2 4 14 13 50 52 62 61) + rotor + (12 12 1) + simpleGrading (1 1 1) + + // block2 + hex (3 5 15 14 51 53 63 62) + rotor + (12 12 1) + simpleGrading (1 1 1) + + // block3 + hex (5 7 16 15 53 55 64 63) + rotor + (12 12 1) + simpleGrading (1 1 1) + + // block4 + hex (6 8 17 16 54 56 65 64) + rotor + (12 12 1) + simpleGrading (1 1 1) + + // block5 + hex (8 10 18 17 56 58 66 65) + rotor + (12 12 1) + simpleGrading (1 1 1) + + // block6 + hex (9 11 19 18 57 59 67 66) + rotor + (12 12 1) + simpleGrading (1 1 1) + + // block7 + hex (11 1 12 19 59 49 60 67) + rotor + (12 12 1) + simpleGrading (1 1 1) + + // block0 + hex (12 13 21 20 60 61 69 68) + rotor + (12 4 1) + simpleGrading (1 1 1) + + // block1 + hex (13 14 22 21 61 62 70 69) + rotor + (12 4 1) + simpleGrading (1 1 1) + + // block2 + hex (14 15 23 22 62 63 71 70) + rotor + (12 4 1) + simpleGrading (1 1 1) + + // block3 + hex (15 16 24 23 63 64 72 71) + rotor + (12 4 1) + simpleGrading (1 1 1) + + // block4 + hex (16 17 25 24 64 65 73 72) + rotor + (12 4 1) + simpleGrading (1 1 1) + + // block5 + hex (17 18 26 25 65 66 74 73) + rotor + (12 4 1) + simpleGrading (1 1 1) + + // block6 + hex (18 19 27 26 66 67 75 74) + rotor + (12 4 1) + simpleGrading (1 1 1) + + // block7 + hex (19 12 20 27 67 60 68 75) + rotor + (12 4 1) + simpleGrading (1 1 1) + + // block0 + hex (20 21 29 28 68 69 77 76) + (12 4 1) + simpleGrading (1 1 1) + + // block1 + hex (21 22 30 29 69 70 78 77) + (12 4 1) + simpleGrading (1 1 1) + + // block2 + hex (22 23 31 30 70 71 79 78) + (12 4 1) + simpleGrading (1 1 1) + + // block3 + hex (23 24 32 31 71 72 80 79) + (12 4 1) + simpleGrading (1 1 1) + + // block4 + hex (24 25 33 32 72 73 81 80) + (12 4 1) + simpleGrading (1 1 1) + + // block5 + hex (25 26 34 33 73 74 82 81) + (12 4 1) + simpleGrading (1 1 1) + + // block6 + hex (26 27 35 34 74 75 83 82) + (12 4 1) + simpleGrading (1 1 1) + + // block7 + hex (27 20 28 35 75 68 76 83) + (12 4 1) + simpleGrading (1 1 1) + + // block0 + hex (28 29 38 36 76 77 86 84) + (12 12 1) + simpleGrading (1 1 1) + + // block1 + hex (29 30 39 37 77 78 87 85) + (12 12 1) + simpleGrading (1 1 1) + + // block2 + hex (30 31 41 39 78 79 89 87) + (12 12 1) + simpleGrading (1 1 1) + + // block3 + hex (31 32 42 40 79 80 90 88) + (12 12 1) + simpleGrading (1 1 1) + + // block4 + hex (32 33 44 42 80 81 92 90) + (12 12 1) + simpleGrading (1 1 1) + + // block5 + hex (33 34 45 43 81 82 93 91) + (12 12 1) + simpleGrading (1 1 1) + + // block6 + hex (34 35 47 45 82 83 95 93) + (12 12 1) + simpleGrading (1 1 1) + + // block7 + hex (35 28 36 46 83 76 84 94) + (12 12 1) + simpleGrading (1 1 1) +); + +edges +( + arc 0 2 (0.184775906536601 -0.0765366863901046 0) + arc 2 4 (0.0765366867217582 -0.184775906399226 0) + arc 3 5 (-0.0765366860584508 -0.184775906673977 0) + arc 5 7 (-0.18477590626185 -0.0765366870534118 0) + arc 6 8 (-0.18477590626185 0.0765366870534118 0) + arc 8 10 (-0.0765366860584508 0.184775906673977 0) + arc 9 11 (0.0765366867217582 0.184775906399226 0) + arc 11 1 (0.184775906536601 0.0765366863901046 0) + + arc 12 13 (0.461939766341503 -0.191341715975262 0) + arc 13 14 (0.191341716804395 -0.461939765998065 0) + arc 14 15 (-0.191341715146127 -0.461939766684942 0) + arc 15 16 (-0.461939765654626 -0.19134171763353 0) + arc 16 17 (-0.461939765654626 0.19134171763353 0) + arc 17 18 (-0.191341715146127 0.461939766684942 0) + arc 18 19 (0.191341716804395 0.461939765998065 0) + arc 19 12 (0.461939766341503 0.191341715975262 0) + + arc 20 21 (0.554327719609804 -0.229610059170314 0) + arc 21 22 (0.229610060165275 -0.554327719197677 0) + arc 22 23 (-0.229610058175352 -0.55432772002193 0) + arc 23 24 (-0.554327718785551 -0.229610061160235 0) + arc 24 25 (-0.554327718785551 0.229610061160235 0) + arc 25 26 (-0.229610058175352 0.55432772002193 0) + arc 26 27 (0.229610060165275 0.554327719197677 0) + arc 27 20 (0.554327719609804 0.229610059170314 0) + + arc 28 29 (0.646715672878104 -0.267878402365366 0) + arc 29 30 (0.267878403526154 -0.64671567239729 0) + arc 30 31 (-0.267878401204578 -0.646715673358918 0) + arc 31 32 (-0.646715671916476 -0.267878404686941 0) + arc 32 33 (-0.646715671916476 0.267878404686941 0) + arc 33 34 (-0.267878401204578 0.646715673358918 0) + arc 34 35 (0.267878403526154 0.64671567239729 0) + arc 35 28 (0.646715672878104 0.267878402365366 0) + + arc 36 38 (0.923879532683006 -0.382683431950523 0) + arc 37 39 (0.382683433608791 -0.923879531996129 0) + arc 39 41 (-0.382683430292254 -0.923879533369883 0) + arc 40 42 (-0.923879531309252 -0.382683435267059 0) + arc 42 44 (-0.923879531309252 0.382683435267059 0) + arc 43 45 (-0.382683430292254 0.923879533369883 0) + arc 45 47 (0.382683433608791 0.923879531996129 0) + arc 46 36 (0.923879532683006 0.382683431950523 0) + + arc 48 50 (0.184775906536601 -0.0765366863901046 0.1) + arc 50 52 (0.0765366867217582 -0.184775906399226 0.1) + arc 51 53 (-0.0765366860584508 -0.184775906673977 0.1) + arc 53 55 (-0.18477590626185 -0.0765366870534118 0.1) + arc 54 56 (-0.18477590626185 0.0765366870534118 0.1) + arc 56 58 (-0.0765366860584508 0.184775906673977 0.1) + arc 57 59 (0.0765366867217582 0.184775906399226 0.1) + arc 59 49 (0.184775906536601 0.0765366863901046 0.1) + + arc 60 61 (0.461939766341503 -0.191341715975262 0.1) + arc 61 62 (0.191341716804395 -0.461939765998065 0.1) + arc 62 63 (-0.191341715146127 -0.461939766684942 0.1) + arc 63 64 (-0.461939765654626 -0.19134171763353 0.1) + arc 64 65 (-0.461939765654626 0.19134171763353 0.1) + arc 65 66 (-0.191341715146127 0.461939766684942 0.1) + arc 66 67 (0.191341716804395 0.461939765998065 0.1) + arc 67 60 (0.461939766341503 0.191341715975262 0.1) + + arc 68 69 (0.554327719609804 -0.229610059170314 0.1) + arc 69 70 (0.229610060165275 -0.554327719197677 0.1) + arc 70 71 (-0.229610058175352 -0.55432772002193 0.1) + arc 71 72 (-0.554327718785551 -0.229610061160235 0.1) + arc 72 73 (-0.554327718785551 0.229610061160235 0.1) + arc 73 74 (-0.229610058175352 0.55432772002193 0.1) + arc 74 75 (0.229610060165275 0.554327719197677 0.1) + arc 75 68 (0.554327719609804 0.229610059170314 0.1) + + arc 76 77 (0.646715672878104 -0.267878402365366 0.1) + arc 77 78 (0.267878403526154 -0.64671567239729 0.1) + arc 78 79 (-0.267878401204578 -0.646715673358918 0.1) + arc 79 80 (-0.646715671916476 -0.267878404686941 0.1) + arc 80 81 (-0.646715671916476 0.267878404686941 0.1) + arc 81 82 (-0.267878401204578 0.646715673358918 0.1) + arc 82 83 (0.267878403526154 0.64671567239729 0.1) + arc 83 76 (0.646715672878104 0.267878402365366 0.1) + + arc 84 86 (0.923879532683006 -0.382683431950523 0.1) + arc 85 87 (0.382683433608791 -0.923879531996129 0.1) + arc 87 89 (-0.382683430292254 -0.923879533369883 0.1) + arc 88 90 (-0.923879531309252 -0.382683435267059 0.1) + arc 90 92 (-0.923879531309252 0.382683435267059 0.1) + arc 91 93 (-0.382683430292254 0.923879533369883 0.1) + arc 93 95 (0.382683433608791 0.923879531996129 0.1) + arc 94 84 (0.923879532683006 0.382683431950523 0.1) +); + +patches +( + wall rotor + ( + (0 2 50 48) + (2 4 52 50) + (3 5 53 51) + (5 7 55 53) + (6 8 56 54) + (8 10 58 56) + (9 11 59 57) + (11 1 49 59) + + (0 12 60 48) + (1 12 60 49) + + (3 14 62 51) + (4 14 62 52) + + (6 16 64 54) + (7 16 64 55) + + (9 18 66 57) + (10 18 66 58) + ) + + wall stator + ( + (36 38 86 84) + (37 39 87 85) + (39 41 89 87) + (40 42 90 88) + (42 44 92 90) + (43 45 93 91) + (45 47 95 93) + (46 36 84 94) + + (37 29 77 85) + (38 29 77 86) + + (40 31 79 88) + (41 31 79 89) + + (43 33 81 91) + (44 33 81 92) + + (46 35 83 94) + (47 35 83 95) + ) + + empty front + ( + (48 50 61 60) + (50 52 62 61) + (51 53 63 62) + (53 55 64 63) + (54 56 65 64) + (56 58 66 65) + (57 59 67 66) + (59 49 60 67) + (60 61 69 68) + (61 62 70 69) + (62 63 71 70) + (63 64 72 71) + (64 65 73 72) + (65 66 74 73) + (66 67 75 74) + (67 60 68 75) + (68 69 77 76) + (69 70 78 77) + (70 71 79 78) + (71 72 80 79) + (72 73 81 80) + (73 74 82 81) + (74 75 83 82) + (75 68 76 83) + (76 77 86 84) + (77 78 87 85) + (78 79 89 87) + (79 80 90 88) + (80 81 92 90) + (81 82 93 91) + (82 83 95 93) + (83 76 84 94) + ) + + empty back + ( + (0 12 13 2) + (2 13 14 4) + (3 14 15 5) + (5 15 16 7) + (6 16 17 8) + (8 17 18 10) + (9 18 19 11) + (11 19 12 1) + (12 20 21 13) + (13 21 22 14) + (14 22 23 15) + (15 23 24 16) + (16 24 25 17) + (17 25 26 18) + (18 26 27 19) + (19 27 20 12) + (20 28 29 21) + (21 29 30 22) + (22 30 31 23) + (23 31 32 24) + (24 32 33 25) + (25 33 34 26) + (26 34 35 27) + (27 35 28 20) + (28 36 38 29) + (29 37 39 30) + (30 39 41 31) + (31 40 42 32) + (32 42 44 33) + (33 43 45 34) + (34 45 47 35) + (35 46 36 28) + ) +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict.m4 b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict.m4 new file mode 100644 index 0000000000000000000000000000000000000000..eaa448596c06a89b270603aaabd722cf44fa7f3e --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict.m4 @@ -0,0 +1,818 @@ +/*--------------------------------*- 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 dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// General macros to create 2D/extruded-2D meshes + +changecom(//)changequote([,]) +define(calc, [esyscmd(perl -e 'print ($1)')]) +define(VCOUNT, 0) +define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) +define(pi, 3.14159265) + +define(hex2D, hex ($1b $2b $3b $4b $1t $2t $3t $4t)) +define(quad2D, ($1b $2b $2t $1t)) +define(frontQuad, ($1t $2t $3t $4t)) +define(backQuad, ($1b $4b $3b $2b)) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.1; + +// Hub radius +define(r, 0.2) + +// Impeller-tip radius +define(rb, 0.5) + +// Baffle-tip radius +define(Rb, 0.7) + +// Tank radius +define(R, 1) + +// MRF region radius +define(ri, calc(0.5*(rb + Rb))) + +// Thickness of 2D slab +define(z, 0.1) + +// Base z +define(Zb, 0) + +// Top z +define(Zt, calc(Zb + z)) + +// Number of cells radially between hub and impeller tip +define(Nr, 12) + +// Number of cells radially in each of the two regions between +// impeller and baffle tips +define(Ni, 4) + +// Number of cells radially between baffle tip and tank +define(NR, 12) + +// Number of cells azimuthally in each of the 8 blocks +define(Na, 12) + +// Number of cells in the thickness of the slab +define(Nz, 1) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +define(vert, (x$1$2 y$1$2 $3)) +define(evert, (ex$1$2 ey$1$2 $3)) + +define(a0, 0) +define(a1, -45) +define(a2, -90) +define(a3, -135) +define(a4, 180) +define(a5, 135) +define(a6, 90) +define(a7, 45) + +define(ea0, -22.5) +define(ea1, -67.5) +define(ea2, -112.5) +define(ea3, -157.5) +define(ea4, 157.5) +define(ea5, 112.5) +define(ea6, 67.5) +define(ea7, 22.5) + +define(ca0, calc(cos((pi/180)*a0))) +define(ca1, calc(cos((pi/180)*a1))) +define(ca2, calc(cos((pi/180)*a2))) +define(ca3, calc(cos((pi/180)*a3))) +define(ca4, calc(cos((pi/180)*a4))) +define(ca5, calc(cos((pi/180)*a5))) +define(ca6, calc(cos((pi/180)*a6))) +define(ca7, calc(cos((pi/180)*a7))) + +define(sa0, calc(sin((pi/180)*a0))) +define(sa1, calc(sin((pi/180)*a1))) +define(sa2, calc(sin((pi/180)*a2))) +define(sa3, calc(sin((pi/180)*a3))) +define(sa4, calc(sin((pi/180)*a4))) +define(sa5, calc(sin((pi/180)*a5))) +define(sa6, calc(sin((pi/180)*a6))) +define(sa7, calc(sin((pi/180)*a7))) + +define(cea0, calc(cos((pi/180)*ea0))) +define(cea1, calc(cos((pi/180)*ea1))) +define(cea2, calc(cos((pi/180)*ea2))) +define(cea3, calc(cos((pi/180)*ea3))) +define(cea4, calc(cos((pi/180)*ea4))) +define(cea5, calc(cos((pi/180)*ea5))) +define(cea6, calc(cos((pi/180)*ea6))) +define(cea7, calc(cos((pi/180)*ea7))) + +define(sea0, calc(sin((pi/180)*ea0))) +define(sea1, calc(sin((pi/180)*ea1))) +define(sea2, calc(sin((pi/180)*ea2))) +define(sea3, calc(sin((pi/180)*ea3))) +define(sea4, calc(sin((pi/180)*ea4))) +define(sea5, calc(sin((pi/180)*ea5))) +define(sea6, calc(sin((pi/180)*ea6))) +define(sea7, calc(sin((pi/180)*ea7))) + +define(x00, calc(r*ca0)) +define(x01, calc(r*ca1)) +define(x02, calc(r*ca2)) +define(x03, calc(r*ca3)) +define(x04, calc(r*ca4)) +define(x05, calc(r*ca5)) +define(x06, calc(r*ca6)) +define(x07, calc(r*ca7)) + +define(x10, calc(rb*ca0)) +define(x11, calc(rb*ca1)) +define(x12, calc(rb*ca2)) +define(x13, calc(rb*ca3)) +define(x14, calc(rb*ca4)) +define(x15, calc(rb*ca5)) +define(x16, calc(rb*ca6)) +define(x17, calc(rb*ca7)) + +define(x20, calc(ri*ca0)) +define(x21, calc(ri*ca1)) +define(x22, calc(ri*ca2)) +define(x23, calc(ri*ca3)) +define(x24, calc(ri*ca4)) +define(x25, calc(ri*ca5)) +define(x26, calc(ri*ca6)) +define(x27, calc(ri*ca7)) + +define(x30, calc(Rb*ca0)) +define(x31, calc(Rb*ca1)) +define(x32, calc(Rb*ca2)) +define(x33, calc(Rb*ca3)) +define(x34, calc(Rb*ca4)) +define(x35, calc(Rb*ca5)) +define(x36, calc(Rb*ca6)) +define(x37, calc(Rb*ca7)) + +define(x40, calc(R*ca0)) +define(x41, calc(R*ca1)) +define(x42, calc(R*ca2)) +define(x43, calc(R*ca3)) +define(x44, calc(R*ca4)) +define(x45, calc(R*ca5)) +define(x46, calc(R*ca6)) +define(x47, calc(R*ca7)) + +define(y00, calc(r*sa0)) +define(y01, calc(r*sa1)) +define(y02, calc(r*sa2)) +define(y03, calc(r*sa3)) +define(y04, calc(r*sa4)) +define(y05, calc(r*sa5)) +define(y06, calc(r*sa6)) +define(y07, calc(r*sa7)) + +define(y10, calc(rb*sa0)) +define(y11, calc(rb*sa1)) +define(y12, calc(rb*sa2)) +define(y13, calc(rb*sa3)) +define(y14, calc(rb*sa4)) +define(y15, calc(rb*sa5)) +define(y16, calc(rb*sa6)) +define(y17, calc(rb*sa7)) + +define(y20, calc(ri*sa0)) +define(y21, calc(ri*sa1)) +define(y22, calc(ri*sa2)) +define(y23, calc(ri*sa3)) +define(y24, calc(ri*sa4)) +define(y25, calc(ri*sa5)) +define(y26, calc(ri*sa6)) +define(y27, calc(ri*sa7)) + +define(y30, calc(Rb*sa0)) +define(y31, calc(Rb*sa1)) +define(y32, calc(Rb*sa2)) +define(y33, calc(Rb*sa3)) +define(y34, calc(Rb*sa4)) +define(y35, calc(Rb*sa5)) +define(y36, calc(Rb*sa6)) +define(y37, calc(Rb*sa7)) + +define(y40, calc(R*sa0)) +define(y41, calc(R*sa1)) +define(y42, calc(R*sa2)) +define(y43, calc(R*sa3)) +define(y44, calc(R*sa4)) +define(y45, calc(R*sa5)) +define(y46, calc(R*sa6)) +define(y47, calc(R*sa7)) + +define(ex00, calc(r*cea0)) +define(ex01, calc(r*cea1)) +define(ex02, calc(r*cea2)) +define(ex03, calc(r*cea3)) +define(ex04, calc(r*cea4)) +define(ex05, calc(r*cea5)) +define(ex06, calc(r*cea6)) +define(ex07, calc(r*cea7)) + +define(ex10, calc(rb*cea0)) +define(ex11, calc(rb*cea1)) +define(ex12, calc(rb*cea2)) +define(ex13, calc(rb*cea3)) +define(ex14, calc(rb*cea4)) +define(ex15, calc(rb*cea5)) +define(ex16, calc(rb*cea6)) +define(ex17, calc(rb*cea7)) + +define(ex20, calc(ri*cea0)) +define(ex21, calc(ri*cea1)) +define(ex22, calc(ri*cea2)) +define(ex23, calc(ri*cea3)) +define(ex24, calc(ri*cea4)) +define(ex25, calc(ri*cea5)) +define(ex26, calc(ri*cea6)) +define(ex27, calc(ri*cea7)) + +define(ex30, calc(Rb*cea0)) +define(ex31, calc(Rb*cea1)) +define(ex32, calc(Rb*cea2)) +define(ex33, calc(Rb*cea3)) +define(ex34, calc(Rb*cea4)) +define(ex35, calc(Rb*cea5)) +define(ex36, calc(Rb*cea6)) +define(ex37, calc(Rb*cea7)) + +define(ex40, calc(R*cea0)) +define(ex41, calc(R*cea1)) +define(ex42, calc(R*cea2)) +define(ex43, calc(R*cea3)) +define(ex44, calc(R*cea4)) +define(ex45, calc(R*cea5)) +define(ex46, calc(R*cea6)) +define(ex47, calc(R*cea7)) + +define(ey00, calc(r*sea0)) +define(ey01, calc(r*sea1)) +define(ey02, calc(r*sea2)) +define(ey03, calc(r*sea3)) +define(ey04, calc(r*sea4)) +define(ey05, calc(r*sea5)) +define(ey06, calc(r*sea6)) +define(ey07, calc(r*sea7)) + +define(ey10, calc(rb*sea0)) +define(ey11, calc(rb*sea1)) +define(ey12, calc(rb*sea2)) +define(ey13, calc(rb*sea3)) +define(ey14, calc(rb*sea4)) +define(ey15, calc(rb*sea5)) +define(ey16, calc(rb*sea6)) +define(ey17, calc(rb*sea7)) + +define(ey20, calc(ri*sea0)) +define(ey21, calc(ri*sea1)) +define(ey22, calc(ri*sea2)) +define(ey23, calc(ri*sea3)) +define(ey24, calc(ri*sea4)) +define(ey25, calc(ri*sea5)) +define(ey26, calc(ri*sea6)) +define(ey27, calc(ri*sea7)) + +define(ey30, calc(Rb*sea0)) +define(ey31, calc(Rb*sea1)) +define(ey32, calc(Rb*sea2)) +define(ey33, calc(Rb*sea3)) +define(ey34, calc(Rb*sea4)) +define(ey35, calc(Rb*sea5)) +define(ey36, calc(Rb*sea6)) +define(ey37, calc(Rb*sea7)) + +define(ey40, calc(R*sea0)) +define(ey41, calc(R*sea1)) +define(ey42, calc(R*sea2)) +define(ey43, calc(R*sea3)) +define(ey44, calc(R*sea4)) +define(ey45, calc(R*sea5)) +define(ey46, calc(R*sea6)) +define(ey47, calc(R*sea7)) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +vertices +( + vert(0, 0, Zb) vlabel(r0b) + vert(0, 0, Zb) vlabel(r0sb) + vert(0, 1, Zb) vlabel(r1b) + vert(0, 2, Zb) vlabel(r2b) + vert(0, 2, Zb) vlabel(r2sb) + vert(0, 3, Zb) vlabel(r3b) + vert(0, 4, Zb) vlabel(r4b) + vert(0, 4, Zb) vlabel(r4sb) + vert(0, 5, Zb) vlabel(r5b) + vert(0, 6, Zb) vlabel(r6b) + vert(0, 6, Zb) vlabel(r6sb) + vert(0, 7, Zb) vlabel(r7b) + + vert(1, 0, Zb) vlabel(rb0b) + vert(1, 1, Zb) vlabel(rb1b) + vert(1, 2, Zb) vlabel(rb2b) + vert(1, 3, Zb) vlabel(rb3b) + vert(1, 4, Zb) vlabel(rb4b) + vert(1, 5, Zb) vlabel(rb5b) + vert(1, 6, Zb) vlabel(rb6b) + vert(1, 7, Zb) vlabel(rb7b) + + vert(2, 0, Zb) vlabel(ri0b) + vert(2, 1, Zb) vlabel(ri1b) + vert(2, 2, Zb) vlabel(ri2b) + vert(2, 3, Zb) vlabel(ri3b) + vert(2, 4, Zb) vlabel(ri4b) + vert(2, 5, Zb) vlabel(ri5b) + vert(2, 6, Zb) vlabel(ri6b) + vert(2, 7, Zb) vlabel(ri7b) + + vert(3, 0, Zb) vlabel(Rb0b) + vert(3, 1, Zb) vlabel(Rb1b) + vert(3, 2, Zb) vlabel(Rb2b) + vert(3, 3, Zb) vlabel(Rb3b) + vert(3, 4, Zb) vlabel(Rb4b) + vert(3, 5, Zb) vlabel(Rb5b) + vert(3, 6, Zb) vlabel(Rb6b) + vert(3, 7, Zb) vlabel(Rb7b) + + vert(4, 0, Zb) vlabel(R0b) + vert(4, 1, Zb) vlabel(R1b) + vert(4, 1, Zb) vlabel(R1sb) + vert(4, 2, Zb) vlabel(R2b) + vert(4, 3, Zb) vlabel(R3b) + vert(4, 3, Zb) vlabel(R3sb) + vert(4, 4, Zb) vlabel(R4b) + vert(4, 5, Zb) vlabel(R5b) + vert(4, 5, Zb) vlabel(R5sb) + vert(4, 6, Zb) vlabel(R6b) + vert(4, 7, Zb) vlabel(R7b) + vert(4, 7, Zb) vlabel(R7sb) + + vert(0, 0, Zt) vlabel(r0t) + vert(0, 0, Zt) vlabel(r0st) + vert(0, 1, Zt) vlabel(r1t) + vert(0, 2, Zt) vlabel(r2t) + vert(0, 2, Zt) vlabel(r2st) + vert(0, 3, Zt) vlabel(r3t) + vert(0, 4, Zt) vlabel(r4t) + vert(0, 4, Zt) vlabel(r4st) + vert(0, 5, Zt) vlabel(r5t) + vert(0, 6, Zt) vlabel(r6t) + vert(0, 6, Zt) vlabel(r6st) + vert(0, 7, Zt) vlabel(r7t) + + vert(1, 0, Zt) vlabel(rb0t) + vert(1, 1, Zt) vlabel(rb1t) + vert(1, 2, Zt) vlabel(rb2t) + vert(1, 3, Zt) vlabel(rb3t) + vert(1, 4, Zt) vlabel(rb4t) + vert(1, 5, Zt) vlabel(rb5t) + vert(1, 6, Zt) vlabel(rb6t) + vert(1, 7, Zt) vlabel(rb7t) + + vert(2, 0, Zt) vlabel(ri0t) + vert(2, 1, Zt) vlabel(ri1t) + vert(2, 2, Zt) vlabel(ri2t) + vert(2, 3, Zt) vlabel(ri3t) + vert(2, 4, Zt) vlabel(ri4t) + vert(2, 5, Zt) vlabel(ri5t) + vert(2, 6, Zt) vlabel(ri6t) + vert(2, 7, Zt) vlabel(ri7t) + + vert(3, 0, Zt) vlabel(Rb0t) + vert(3, 1, Zt) vlabel(Rb1t) + vert(3, 2, Zt) vlabel(Rb2t) + vert(3, 3, Zt) vlabel(Rb3t) + vert(3, 4, Zt) vlabel(Rb4t) + vert(3, 5, Zt) vlabel(Rb5t) + vert(3, 6, Zt) vlabel(Rb6t) + vert(3, 7, Zt) vlabel(Rb7t) + + vert(4, 0, Zt) vlabel(R0t) + vert(4, 1, Zt) vlabel(R1t) + vert(4, 1, Zt) vlabel(R1st) + vert(4, 2, Zt) vlabel(R2t) + vert(4, 3, Zt) vlabel(R3t) + vert(4, 3, Zt) vlabel(R3st) + vert(4, 4, Zt) vlabel(R4t) + vert(4, 5, Zt) vlabel(R5t) + vert(4, 5, Zt) vlabel(R5st) + vert(4, 6, Zt) vlabel(R6t) + vert(4, 7, Zt) vlabel(R7t) + vert(4, 7, Zt) vlabel(R7st) +); + +blocks +( + // block0 + hex2D(r0, r1, rb1, rb0) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block1 + hex2D(r1, r2s, rb2, rb1) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block2 + hex2D(r2, r3, rb3, rb2) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block3 + hex2D(r3, r4s, rb4, rb3) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block4 + hex2D(r4, r5, rb5, rb4) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block5 + hex2D(r5, r6s, rb6, rb5) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block6 + hex2D(r6, r7, rb7, rb6) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block7 + hex2D(r7, r0s, rb0, rb7) + rotor + (Na Nr Nz) + simpleGrading (1 1 1) + + // block0 + hex2D(rb0, rb1, ri1, ri0) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block1 + hex2D(rb1, rb2, ri2, ri1) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block2 + hex2D(rb2, rb3, ri3, ri2) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block3 + hex2D(rb3, rb4, ri4, ri3) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block4 + hex2D(rb4, rb5, ri5, ri4) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block5 + hex2D(rb5, rb6, ri6, ri5) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block6 + hex2D(rb6, rb7, ri7, ri6) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block7 + hex2D(rb7, rb0, ri0, ri7) + rotor + (Na Ni Nz) + simpleGrading (1 1 1) + + // block0 + hex2D(ri0, ri1, Rb1, Rb0) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block1 + hex2D(ri1, ri2, Rb2, Rb1) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block2 + hex2D(ri2, ri3, Rb3, Rb2) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block3 + hex2D(ri3, ri4, Rb4, Rb3) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block4 + hex2D(ri4, ri5, Rb5, Rb4) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block5 + hex2D(ri5, ri6, Rb6, Rb5) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block6 + hex2D(ri6, ri7, Rb7, Rb6) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block7 + hex2D(ri7, ri0, Rb0, Rb7) + (Na Ni Nz) + simpleGrading (1 1 1) + + // block0 + hex2D(Rb0, Rb1, R1s, R0) + (Na NR Nz) + simpleGrading (1 1 1) + + // block1 + hex2D(Rb1, Rb2, R2, R1) + (Na NR Nz) + simpleGrading (1 1 1) + + // block2 + hex2D(Rb2, Rb3, R3s, R2) + (Na NR Nz) + simpleGrading (1 1 1) + + // block3 + hex2D(Rb3, Rb4, R4, R3) + (Na NR Nz) + simpleGrading (1 1 1) + + // block4 + hex2D(Rb4, Rb5, R5s, R4) + (Na NR Nz) + simpleGrading (1 1 1) + + // block5 + hex2D(Rb5, Rb6, R6, R5) + (Na NR Nz) + simpleGrading (1 1 1) + + // block6 + hex2D(Rb6, Rb7, R7s, R6) + (Na NR Nz) + simpleGrading (1 1 1) + + // block7 + hex2D(Rb7, Rb0, R0, R7) + (Na NR Nz) + simpleGrading (1 1 1) +); + +edges +( + arc r0b r1b evert(0, 0, Zb) + arc r1b r2sb evert(0, 1, Zb) + arc r2b r3b evert(0, 2, Zb) + arc r3b r4sb evert(0, 3, Zb) + arc r4b r5b evert(0, 4, Zb) + arc r5b r6sb evert(0, 5, Zb) + arc r6b r7b evert(0, 6, Zb) + arc r7b r0sb evert(0, 7, Zb) + + arc rb0b rb1b evert(1, 0, Zb) + arc rb1b rb2b evert(1, 1, Zb) + arc rb2b rb3b evert(1, 2, Zb) + arc rb3b rb4b evert(1, 3, Zb) + arc rb4b rb5b evert(1, 4, Zb) + arc rb5b rb6b evert(1, 5, Zb) + arc rb6b rb7b evert(1, 6, Zb) + arc rb7b rb0b evert(1, 7, Zb) + + arc ri0b ri1b evert(2, 0, Zb) + arc ri1b ri2b evert(2, 1, Zb) + arc ri2b ri3b evert(2, 2, Zb) + arc ri3b ri4b evert(2, 3, Zb) + arc ri4b ri5b evert(2, 4, Zb) + arc ri5b ri6b evert(2, 5, Zb) + arc ri6b ri7b evert(2, 6, Zb) + arc ri7b ri0b evert(2, 7, Zb) + + arc Rb0b Rb1b evert(3, 0, Zb) + arc Rb1b Rb2b evert(3, 1, Zb) + arc Rb2b Rb3b evert(3, 2, Zb) + arc Rb3b Rb4b evert(3, 3, Zb) + arc Rb4b Rb5b evert(3, 4, Zb) + arc Rb5b Rb6b evert(3, 5, Zb) + arc Rb6b Rb7b evert(3, 6, Zb) + arc Rb7b Rb0b evert(3, 7, Zb) + + arc R0b R1sb evert(4, 0, Zb) + arc R1b R2b evert(4, 1, Zb) + arc R2b R3sb evert(4, 2, Zb) + arc R3b R4b evert(4, 3, Zb) + arc R4b R5sb evert(4, 4, Zb) + arc R5b R6b evert(4, 5, Zb) + arc R6b R7sb evert(4, 6, Zb) + arc R7b R0b evert(4, 7, Zb) + + arc r0t r1t evert(0, 0, Zt) + arc r1t r2st evert(0, 1, Zt) + arc r2t r3t evert(0, 2, Zt) + arc r3t r4st evert(0, 3, Zt) + arc r4t r5t evert(0, 4, Zt) + arc r5t r6st evert(0, 5, Zt) + arc r6t r7t evert(0, 6, Zt) + arc r7t r0st evert(0, 7, Zt) + + arc rb0t rb1t evert(1, 0, Zt) + arc rb1t rb2t evert(1, 1, Zt) + arc rb2t rb3t evert(1, 2, Zt) + arc rb3t rb4t evert(1, 3, Zt) + arc rb4t rb5t evert(1, 4, Zt) + arc rb5t rb6t evert(1, 5, Zt) + arc rb6t rb7t evert(1, 6, Zt) + arc rb7t rb0t evert(1, 7, Zt) + + arc ri0t ri1t evert(2, 0, Zt) + arc ri1t ri2t evert(2, 1, Zt) + arc ri2t ri3t evert(2, 2, Zt) + arc ri3t ri4t evert(2, 3, Zt) + arc ri4t ri5t evert(2, 4, Zt) + arc ri5t ri6t evert(2, 5, Zt) + arc ri6t ri7t evert(2, 6, Zt) + arc ri7t ri0t evert(2, 7, Zt) + + arc Rb0t Rb1t evert(3, 0, Zt) + arc Rb1t Rb2t evert(3, 1, Zt) + arc Rb2t Rb3t evert(3, 2, Zt) + arc Rb3t Rb4t evert(3, 3, Zt) + arc Rb4t Rb5t evert(3, 4, Zt) + arc Rb5t Rb6t evert(3, 5, Zt) + arc Rb6t Rb7t evert(3, 6, Zt) + arc Rb7t Rb0t evert(3, 7, Zt) + + arc R0t R1st evert(4, 0, Zt) + arc R1t R2t evert(4, 1, Zt) + arc R2t R3st evert(4, 2, Zt) + arc R3t R4t evert(4, 3, Zt) + arc R4t R5st evert(4, 4, Zt) + arc R5t R6t evert(4, 5, Zt) + arc R6t R7st evert(4, 6, Zt) + arc R7t R0t evert(4, 7, Zt) +); + +patches +( + wall rotor + ( + quad2D(r0, r1) + quad2D(r1, r2s) + quad2D(r2, r3) + quad2D(r3, r4s) + quad2D(r4, r5) + quad2D(r5, r6s) + quad2D(r6, r7) + quad2D(r7, r0s) + + quad2D(r0, rb0) + quad2D(r0s, rb0) + + quad2D(r2, rb2) + quad2D(r2s, rb2) + + quad2D(r4, rb4) + quad2D(r4s, rb4) + + quad2D(r6, rb6) + quad2D(r6s, rb6) + ) + + wall stator + ( + quad2D(R0, R1s) + quad2D(R1, R2) + quad2D(R2, R3s) + quad2D(R3, R4) + quad2D(R4, R5s) + quad2D(R5, R6) + quad2D(R6, R7s) + quad2D(R7, R0) + + quad2D(R1, Rb1) + quad2D(R1s, Rb1) + + quad2D(R3, Rb3) + quad2D(R3s, Rb3) + + quad2D(R5, Rb5) + quad2D(R5s, Rb5) + + quad2D(R7, Rb7) + quad2D(R7s, Rb7) + ) + + empty front + ( + frontQuad(r0, r1, rb1, rb0) + frontQuad(r1, r2s, rb2, rb1) + frontQuad(r2, r3, rb3, rb2) + frontQuad(r3, r4s, rb4, rb3) + frontQuad(r4, r5, rb5, rb4) + frontQuad(r5, r6s, rb6, rb5) + frontQuad(r6, r7, rb7, rb6) + frontQuad(r7, r0s, rb0, rb7) + frontQuad(rb0, rb1, ri1, ri0) + frontQuad(rb1, rb2, ri2, ri1) + frontQuad(rb2, rb3, ri3, ri2) + frontQuad(rb3, rb4, ri4, ri3) + frontQuad(rb4, rb5, ri5, ri4) + frontQuad(rb5, rb6, ri6, ri5) + frontQuad(rb6, rb7, ri7, ri6) + frontQuad(rb7, rb0, ri0, ri7) + frontQuad(ri0, ri1, Rb1, Rb0) + frontQuad(ri1, ri2, Rb2, Rb1) + frontQuad(ri2, ri3, Rb3, Rb2) + frontQuad(ri3, ri4, Rb4, Rb3) + frontQuad(ri4, ri5, Rb5, Rb4) + frontQuad(ri5, ri6, Rb6, Rb5) + frontQuad(ri6, ri7, Rb7, Rb6) + frontQuad(ri7, ri0, Rb0, Rb7) + frontQuad(Rb0, Rb1, R1s, R0) + frontQuad(Rb1, Rb2, R2, R1) + frontQuad(Rb2, Rb3, R3s, R2) + frontQuad(Rb3, Rb4, R4, R3) + frontQuad(Rb4, Rb5, R5s, R4) + frontQuad(Rb5, Rb6, R6, R5) + frontQuad(Rb6, Rb7, R7s, R6) + frontQuad(Rb7, Rb0, R0, R7) + ) + + empty back + ( + backQuad(r0, r1, rb1, rb0) + backQuad(r1, r2s, rb2, rb1) + backQuad(r2, r3, rb3, rb2) + backQuad(r3, r4s, rb4, rb3) + backQuad(r4, r5, rb5, rb4) + backQuad(r5, r6s, rb6, rb5) + backQuad(r6, r7, rb7, rb6) + backQuad(r7, r0s, rb0, rb7) + backQuad(rb0, rb1, ri1, ri0) + backQuad(rb1, rb2, ri2, ri1) + backQuad(rb2, rb3, ri3, ri2) + backQuad(rb3, rb4, ri4, ri3) + backQuad(rb4, rb5, ri5, ri4) + backQuad(rb5, rb6, ri6, ri5) + backQuad(rb6, rb7, ri7, ri6) + backQuad(rb7, rb0, ri0, ri7) + backQuad(ri0, ri1, Rb1, Rb0) + backQuad(ri1, ri2, Rb2, Rb1) + backQuad(ri2, ri3, Rb3, Rb2) + backQuad(ri3, ri4, Rb4, Rb3) + backQuad(ri4, ri5, Rb5, Rb4) + backQuad(ri5, ri6, Rb6, Rb5) + backQuad(ri6, ri7, Rb7, Rb6) + backQuad(ri7, ri0, Rb0, Rb7) + backQuad(Rb0, Rb1, R1s, R0) + backQuad(Rb1, Rb2, R2, R1) + backQuad(Rb2, Rb3, R3s, R2) + backQuad(Rb3, Rb4, R4, R3) + backQuad(Rb4, Rb5, R5s, R4) + backQuad(Rb5, Rb6, R6, R5) + backQuad(Rb6, Rb7, R7s, R6) + backQuad(Rb7, Rb0, R0, R7) + ) +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/boundary b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..292f25b806357d9df75c7731f74dee0ec0aa3a40 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/polyMesh/boundary @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +4 +( + rotor + { + type wall; + nFaces 192; + startFace 5952; + } + stator + { + type wall; + nFaces 192; + startFace 6144; + } + front + { + type empty; + nFaces 3072; + startFace 6336; + } + back + { + type empty; + nFaces 3072; + startFace 9408; + } +) + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/transportProperties b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..e29c7f9fc04be3aafc3bf54d2ac9208b0250c4e6 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/transportProperties @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +phase1 +{ + transportModel Newtonian; + nu nu [ 0 2 -1 0 0 0 0 ] 1e-4; + rho rho [ 1 -3 0 0 0 0 0 ] 1000; +} + +phase2 +{ + transportModel Newtonian; + nu nu [ 0 2 -1 0 0 0 0 ] 1e-4; + rho rho [ 1 -3 0 0 0 0 0 ] 500; +} + +sigma sigma [ 1 0 -2 0 0 0 0 ] 0.05; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/turbulenceProperties b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..886d34bdef135c39216d342240a96bf0530bdd62 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/makeMesh b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/makeMesh new file mode 100755 index 0000000000000000000000000000000000000000..b0be10d8e5f2b0525cec8f23c93585fde73f5879 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/makeMesh @@ -0,0 +1,11 @@ +#!/bin/sh + +m4 < constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict +blockMesh +cellSet +#- MRF determines its own faceZone if not supplied +#cp system/faceSetDict_rotorFaces system/faceSetDict +#faceSet +#cp system/faceSetDict_noBoundaryFaces system/faceSetDict +#faceSet +setsToZones -noFlipMap diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/cellSetDict b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/cellSetDict new file mode 100644 index 0000000000000000000000000000000000000000..6d1af846e3c61c753852a90c8c8bcc5cfd68cf4d --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/cellSetDict @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object cellSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +name rotor; + +action new; + +topoSetSources ( zoneToCell { name rotor ; } ); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/controlDict b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..249378f87cac7f374e958053846a949d585e047e --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/controlDict @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 4; + +deltaT 1e-3; + +writeControl adjustableRunTime; + +writeInterval 0.125; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.5; + +maxDeltaT 1; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/faceSetDict b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/faceSetDict new file mode 100644 index 0000000000000000000000000000000000000000..5507dbd729453219d583c8c3f7e8867eee0ac1a4 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/faceSetDict @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object faceSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +name rotor; + +action delete; + +topoSetSources ( boundaryToFace { } ); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/faceSetDict_noBoundaryFaces b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/faceSetDict_noBoundaryFaces new file mode 100644 index 0000000000000000000000000000000000000000..062727698328907a23480d3aaae086f2030a1537 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/faceSetDict_noBoundaryFaces @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object faceSetDict_noBoundaryFaces; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +name rotor; + +action delete; + +topoSetSources ( boundaryToFace { } ); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/faceSetDict_rotorFaces b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/faceSetDict_rotorFaces new file mode 100644 index 0000000000000000000000000000000000000000..5e7917b2fe4f3eae8b3dd4db38d66a39f29a92a3 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/faceSetDict_rotorFaces @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object faceSetDict_rotorFaces; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +name rotor; + +action new; + +topoSetSources ( cellToFace { set rotor ; option all ; } ); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/fvSchemes b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..75d5813812fc769d95a0204eab2181acc078ca8c --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/fvSchemes @@ -0,0 +1,61 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + grad(U) Gauss linear; + grad(alpha1) Gauss linear; +} + +divSchemes +{ + div(rho*phi,U) Gauss linear; + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss interfaceCompression; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; + pcorr ; + alpha1 ; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/fvSolution b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..febd619c4824c91a5fee8280895288ecf80e408e --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/fvSolution @@ -0,0 +1,66 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + pcorr + { + solver PCG; + preconditioner DIC; + tolerance 1e-10; + relTol 0; + } + + p + { + solver PCG; + preconditioner DIC; + tolerance 1e-07; + relTol 0.05; + } + + pFinal + { + solver PCG; + preconditioner DIC; + tolerance 1e-07; + relTol 0; + } + + U + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-06; + relTol 0; + } +} + +PISO +{ + momentumPredictor no; + nCorrectors 3; + nNonOrthogonalCorrectors 0; + nAlphaCorr 1; + nAlphaSubCycles 2; + cAlpha 1; + pRefCell 0; + pRefValue 0; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/setFieldsDict b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/setFieldsDict new file mode 100644 index 0000000000000000000000000000000000000000..2de344506d223ab76e1bb8cc7b273c285b37d5a3 --- /dev/null +++ b/tutorials/multiphase/interFoam/MRFInterFoam/mixerVessel2D/system/setFieldsDict @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue alpha1 0 + volVectorFieldValue U (0 0 0) +); + +regions +( + boxToCell + { + box (0 0 -1) (1 1 1); + fieldValues + ( + volScalarFieldValue alpha1 1 + ); + } +); + + +// ************************************************************************* //