diff --git a/applications/solvers/combustion/dieselEngineFoam/Make/files b/applications/solvers/combustion/dieselEngineFoam/Make/files deleted file mode 100644 index f643bc91442943263e15c104aa562f92129f68b5..0000000000000000000000000000000000000000 --- a/applications/solvers/combustion/dieselEngineFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -dieselEngineFoam.C - -EXE = $(FOAM_APPBIN)/dieselEngineFoam diff --git a/applications/solvers/combustion/dieselEngineFoam/UEqn.H b/applications/solvers/combustion/dieselEngineFoam/UEqn.H deleted file mode 100644 index c6caf5989c765318cae79507c8c44845f05e1fc4..0000000000000000000000000000000000000000 --- a/applications/solvers/combustion/dieselEngineFoam/UEqn.H +++ /dev/null @@ -1,14 +0,0 @@ - fvVectorMatrix UEqn - ( - fvm::ddt(rho, U) - + fvm::div(phi, U) - + turbulence->divDevRhoReff(U) - == - rho*g - + dieselSpray.momentumSource() - ); - - if (pimple.momentumPredictor()) - { - solve(UEqn == -fvc::grad(p)); - } diff --git a/applications/solvers/combustion/dieselEngineFoam/YEqn.H b/applications/solvers/combustion/dieselEngineFoam/YEqn.H deleted file mode 100644 index 46d0f364e69f5689c9cc45301696d02ac19a6df1..0000000000000000000000000000000000000000 --- a/applications/solvers/combustion/dieselEngineFoam/YEqn.H +++ /dev/null @@ -1,48 +0,0 @@ -tmp<fv::convectionScheme<scalar> > mvConvection -( - fv::convectionScheme<scalar>::New - ( - mesh, - fields, - phi, - mesh.divScheme("div(phi,Yi_h)") - ) -); - -{ - combustion->correct(); - dQ = combustion->dQ(); - label inertIndex = -1; - volScalarField Yt(0.0*Y[0]); - - forAll(Y, i) - { - if (Y[i].name() != inertSpecie) - { - volScalarField& Yi = Y[i]; - - fvScalarMatrix YiEqn - ( - fvm::ddt(rho, Yi) - + mvConvection->fvmDiv(phi, Yi) - - fvm::laplacian(turbulence->muEff(), Yi) - == - dieselSpray.evaporationSource(i) - + combustion->R(Yi) - ); - - YiEqn.relax(); - YiEqn.solve(mesh.solver("Yi")); - - Yi.max(0.0); - Yt += Yi; - } - else - { - inertIndex = i; - } - } - - Y[inertIndex] = scalar(1) - Yt; - Y[inertIndex].max(0.0); -} diff --git a/applications/solvers/combustion/dieselEngineFoam/createFields.H b/applications/solvers/combustion/dieselEngineFoam/createFields.H deleted file mode 100644 index bbb9000943dd0aef392551be5b1fe2a60156b2fb..0000000000000000000000000000000000000000 --- a/applications/solvers/combustion/dieselEngineFoam/createFields.H +++ /dev/null @@ -1,104 +0,0 @@ -Info<< "Creating combustion model\n" << endl; - -autoPtr<combustionModels::psiChemistryCombustionModel> combustion -( - combustionModels::psiChemistryCombustionModel::New - ( - mesh - ) -); - -psiChemistryModel& chemistry = combustion->pChemistry(); - -hsCombustionThermo& thermo = chemistry.thermo(); - -basicMultiComponentMixture& composition = thermo.composition(); -PtrList<volScalarField>& Y = composition.Y(); - -word inertSpecie(thermo.lookup("inertSpecie")); - -if (!composition.contains(inertSpecie)) -{ - FatalErrorIn(args.executable()) - << "Specified inert specie '" << inertSpecie << "' not found in " - << "species list. Available species:" << composition.species() - << exit(FatalError); -} - -volScalarField rho -( - IOobject - ( - "rho", - runTime.timeName(), - mesh - ), - thermo.rho() -); - -Info<< "Reading field U\n" << endl; -volVectorField U -( - IOobject - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); - - -volScalarField& p = thermo.p(); -const volScalarField& psi = thermo.psi(); -const volScalarField& T = thermo.T(); -volScalarField& hs = thermo.hs(); - - -#include "compressibleCreatePhi.H" - -Info << "Creating turbulence model.\n" << nl; -autoPtr<compressible::turbulenceModel> turbulence -( - compressible::turbulenceModel::New - ( - rho, - U, - phi, - thermo - ) -); - -// Set the turbulence into the combustion model -combustion->setTurbulence(turbulence()); - -Info<< "Creating field DpDt\n" << endl; -volScalarField DpDt -( - fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) -); - - -multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; - -forAll(Y, i) -{ - fields.add(Y[i]); -} -fields.add(hs); - -volScalarField dQ -( - IOobject - ( - "dQ", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - mesh, - dimensionedScalar("dQ", dimEnergy/dimTime, 0.0) -); diff --git a/applications/solvers/combustion/dieselEngineFoam/createSpray.H b/applications/solvers/combustion/dieselEngineFoam/createSpray.H deleted file mode 100644 index 8c6706e0bab890bc943826e3c4aaa5c3fa85499f..0000000000000000000000000000000000000000 --- a/applications/solvers/combustion/dieselEngineFoam/createSpray.H +++ /dev/null @@ -1,37 +0,0 @@ -Info << "Constructing Spray" << endl; - -PtrList<gasThermoPhysics> gasProperties(Y.size()); -forAll(gasProperties, i) -{ - gasProperties.set - ( - i, - new gasThermoPhysics - ( - dynamic_cast<const reactingMixture<gasThermoPhysics>&> - (thermo).speciesData()[i] - ) - ); -} - -spray dieselSpray -( - U, - rho, - p, - T, - composition, - gasProperties, - thermo, - g -); - -scalar gasMass0 = fvc::domainIntegrate(rho).value(); - -if (dieselSpray.twoD()) -{ - gasMass0 *= constant::mathematical::twoPi/dieselSpray.angleOfWedge(); -} - -gasMass0 -= - dieselSpray.injectedMass(runTime.value()) - dieselSpray.liquidMass(); diff --git a/applications/solvers/combustion/dieselEngineFoam/hsEqn.H b/applications/solvers/combustion/dieselEngineFoam/hsEqn.H deleted file mode 100644 index 7c0b7f9dc3327b65fa9a1a49b8e7e33e2e0a92e3..0000000000000000000000000000000000000000 --- a/applications/solvers/combustion/dieselEngineFoam/hsEqn.H +++ /dev/null @@ -1,21 +0,0 @@ -{ - fvScalarMatrix hsEqn - ( - fvm::ddt(rho, hs) - + mvConvection->fvmDiv(phi, hs) - - fvm::laplacian(turbulence->alphaEff(), hs) - == - DpDt - + combustion->Sh() - + dieselSpray.heatTransferSource()() - - ); - - hsEqn.relax(); - hsEqn.solve(); - - thermo.correct(); - - Info<< "min/max(T) = " - << min(T).value() << ", " << max(T).value() << endl; -} diff --git a/applications/solvers/combustion/dieselEngineFoam/pEqn.H b/applications/solvers/combustion/dieselEngineFoam/pEqn.H deleted file mode 100644 index 0493a1ff6c60560c2dc1fab40c6f800216f78402..0000000000000000000000000000000000000000 --- a/applications/solvers/combustion/dieselEngineFoam/pEqn.H +++ /dev/null @@ -1,65 +0,0 @@ -rho = thermo.rho(); - -volScalarField A(UEqn.A()); -U = UEqn.H()/A; - -if (pimple.transonic()) -{ - surfaceScalarField phid - ( - "phid", - fvc::interpolate(psi) - *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)) - ); - - while (pimple.correctNonOrthogonal()) - { - fvScalarMatrix pEqn - ( - fvm::ddt(psi, p) - + fvm::div(phid, p) - - fvm::laplacian(rho/A, p) - == - Sevap - ); - - pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); - - if (pimple.finalNonOrthogonalIter()) - { - phi == pEqn.flux(); - } - } -} -else -{ - phi = fvc::interpolate(rho) - *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U)); - - while (pimple.correctNonOrthogonal()) - { - fvScalarMatrix pEqn - ( - fvm::ddt(psi, p) - + fvc::div(phi) - - fvm::laplacian(rho/A, p) - == - Sevap - ); - - pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); - - if (pimple.finalNonOrthogonalIter()) - { - phi += pEqn.flux(); - } - } -} - -#include "rhoEqn.H" -#include "compressibleContinuityErrs.H" - -U -= fvc::grad(p)/A; -U.correctBoundaryConditions(); - -DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); diff --git a/applications/solvers/combustion/dieselEngineFoam/rhoEqn.H b/applications/solvers/combustion/dieselEngineFoam/rhoEqn.H deleted file mode 100644 index ff594d40b4f33bd0a8da643c45e72bb6048078dc..0000000000000000000000000000000000000000 --- a/applications/solvers/combustion/dieselEngineFoam/rhoEqn.H +++ /dev/null @@ -1,64 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Global - rhoEqn - -Description - Solve the continuity for density. - -\*---------------------------------------------------------------------------*/ - -volScalarField Sevap -( - IOobject - ( - "Sevap", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimensionedScalar("zero", dimensionSet(1, -3, -1, 0, 0), 0.0) -); - -forAll(Y, i) -{ - if (dieselSpray.isLiquidFuel()[i]) - { - Sevap += dieselSpray.evaporationSource(i); - } -} - -{ - solve - ( - fvm::ddt(rho) - + fvc::div(phi) - == - Sevap - ); -} - -// ************************************************************************* // diff --git a/applications/solvers/combustion/dieselEngineFoam/spraySummary.H b/applications/solvers/combustion/dieselEngineFoam/spraySummary.H deleted file mode 100644 index 5c1e43dc99477f9b880c4663ee3ec89ddfa0be8a..0000000000000000000000000000000000000000 --- a/applications/solvers/combustion/dieselEngineFoam/spraySummary.H +++ /dev/null @@ -1,30 +0,0 @@ - label Nparcels = dieselSpray.size(); - reduce(Nparcels, sumOp<label>()); - - Info<< "\nNumber of parcels in system.... | " - << Nparcels << endl - << "Injected liquid mass........... | " - << 1e6*dieselSpray.injectedMass(runTime.value()) << " mg" << endl - << "Liquid Mass in system.......... | " - << 1e6*dieselSpray.liquidMass() << " mg" << endl - << "SMD, Dmax...................... | " - << dieselSpray.smd()*1e6 << " mu, " - << dieselSpray.maxD()*1e6 << " mu" - << endl; - - scalar evapMass = - dieselSpray.injectedMass(runTime.value()) - - dieselSpray.liquidMass(); - - scalar gasMass = fvc::domainIntegrate(rho).value(); - - if (dieselSpray.twoD()) - { - gasMass *= constant::mathematical::twoPi/dieselSpray.angleOfWedge(); - } - - scalar addedMass = gasMass - gasMass0; - - Info<< "Added gas mass................. | " << 1e6*addedMass << " mg" - << nl << "Evaporation Continuity Error... | " - << 1e6*(addedMass - evapMass) << " mg" << endl; diff --git a/applications/solvers/combustion/dieselFoam/Make/files b/applications/solvers/combustion/dieselFoam/Make/files deleted file mode 100644 index 9cbf4079f69460ea061324b69b5f9cc25309fc4e..0000000000000000000000000000000000000000 --- a/applications/solvers/combustion/dieselFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -dieselFoam.C - -EXE = $(FOAM_APPBIN)/dieselFoam diff --git a/applications/solvers/combustion/dieselFoam/Make/options b/applications/solvers/combustion/dieselFoam/Make/options deleted file mode 100644 index 4083a59e9f6d148b4b2206fd2053b78c874e7383..0000000000000000000000000000000000000000 --- a/applications/solvers/combustion/dieselFoam/Make/options +++ /dev/null @@ -1,38 +0,0 @@ -EXE_INC = \ - -I../dieselEngineFoam \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ - -I$(LIB_SRC)/lagrangian/basic/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ - -I$(LIB_SRC)/../applications/solvers/reactionThermo/XiFoam \ - -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ - -I$(LIB_SRC)/ODE/lnInclude \ - -I$(LIB_SRC)/combustionModels/lnInclude - -EXE_LIBS = \ - -lcompressibleTurbulenceModel \ - -lcompressibleRASModels \ - -lcompressibleLESModels \ - -lreactionThermophysicalModels \ - -llagrangian \ - -lmeshTools \ - -ldieselSpray \ - -lliquidProperties \ - -lliquidMixtureProperties \ - -lthermophysicalFunctions \ - -lspecie \ - -lbasicThermophysicalModels \ - -llaminarFlameSpeedModels \ - -lchemistryModel \ - -lODE \ - -ldistributionModels \ - -lfiniteVolume \ - -lcombustionModels diff --git a/applications/solvers/combustion/dieselFoam/dieselFoam.C b/applications/solvers/combustion/dieselFoam/dieselFoam.C deleted file mode 100644 index 5bcb6b327353a3aab13bda4054cb4350742efe47..0000000000000000000000000000000000000000 --- a/applications/solvers/combustion/dieselFoam/dieselFoam.C +++ /dev/null @@ -1,118 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Application - dieselFoam - -Description - Solver for diesel spray and combustion. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "psiChemistryCombustionModel.H" -#include "turbulenceModel.H" -#include "psiChemistryModel.H" -#include "chemistrySolver.H" -#include "spray.H" -#include "multivariateScheme.H" -#include "IFstream.H" -#include "OFstream.H" -#include "Switch.H" -#include "mathematicalConstants.H" -#include "pimpleControl.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "setRootCase.H" - #include "createTime.H" - #include "createMesh.H" - #include "createFields.H" - #include "readGravitationalAcceleration.H" - #include "createSpray.H" - #include "initContinuityErrs.H" - #include "readTimeControls.H" - #include "compressibleCourantNo.H" - #include "setInitialDeltaT.H" - - pimpleControl pimple(mesh); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.run()) - { - #include "compressibleCourantNo.H" - #include "setDeltaT.H" - - runTime++; - Info<< "Time = " << runTime.timeName() << nl << endl; - - Info<< "Evolving Spray" << endl; - - dieselSpray.evolve(); - - Info<< "Solving chemistry" << endl; - - #include "rhoEqn.H" - - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) - { - #include "UEqn.H" - #include "YEqn.H" - #include "hsEqn.H" - - // --- Pressure corrector loop - while (pimple.correct()) - { - #include "pEqn.H" - } - - if (pimple.turbCorr()) - { - turbulence->correct(); - } - } - - #include "spraySummary.H" - - rho = thermo.rho(); - - runTime.write(); - - Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" - << " ClockTime = " << runTime.elapsedClockTime() << " s" - << nl << endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/solvers/combustion/dieselFoam/pEqn.H b/applications/solvers/combustion/dieselFoam/pEqn.H deleted file mode 100644 index 8ef13cde9d20f04be8e1e897ddb78e28f496dc11..0000000000000000000000000000000000000000 --- a/applications/solvers/combustion/dieselFoam/pEqn.H +++ /dev/null @@ -1,72 +0,0 @@ -rho = thermo.rho(); - -volScalarField rAU(1.0/UEqn.A()); -U = rAU*UEqn.H(); - -if (pimple.transonic()) -{ - surfaceScalarField phid - ( - "phid", - fvc::interpolate(psi) - *( - (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) - ) - ); - - while (pimple.correctNonOrthogonal()) - { - fvScalarMatrix pEqn - ( - fvm::ddt(psi, p) - + fvm::div(phid, p) - - fvm::laplacian(rho*rAU, p) - == - Sevap - ); - - pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); - - if (pimple.finalNonOrthogonalIter()) - { - phi == pEqn.flux(); - } - } -} -else -{ - phi = - fvc::interpolate(rho) - *( - (fvc::interpolate(U) & mesh.Sf()) - + fvc::ddtPhiCorr(rAU, rho, U, phi) - ); - - while (pimple.correctNonOrthogonal()) - { - fvScalarMatrix pEqn - ( - fvm::ddt(psi, p) - + fvc::div(phi) - - fvm::laplacian(rho*rAU, p) - == - Sevap - ); - - pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); - - if (pimple.finalNonOrthogonalIter()) - { - phi == pEqn.flux(); - } - } -} - -#include "rhoEqn.H" -#include "compressibleContinuityErrs.H" - -U -= rAU*fvc::grad(p); -U.correctBoundaryConditions(); - -DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); diff --git a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/Make/files b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/Make/files deleted file mode 100644 index cd3553a3027dc21ead56f619b6615465267c60aa..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -buoyantBaffleSimpleFoam.C - -EXE = $(FOAM_APPBIN)/buoyantBaffleSimpleFoam diff --git a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/Make/options deleted file mode 100644 index 0c40e8943020cd29877db0aaf0eba8941f6504e6..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/Make/options +++ /dev/null @@ -1,22 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/turbulenceModels \ - -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ - -I$(LIB_SRC)/finiteVolume/cfdTools \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ - -I$(LIB_SRC)/regionModels/thermoBaffleModels/lnInclude - -EXE_LIBS = \ - -lmeshTools \ - -lbasicThermophysicalModels \ - -lspecie \ - -lcompressibleTurbulenceModel \ - -lcompressibleRASModels \ - -lfiniteVolume \ - -lmeshTools \ - -lthermoBaffleModels \ - -lregionModels diff --git a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/UEqn.H deleted file mode 100644 index ca28910aaf3c51186663b2fb5919104d4fd07398..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/UEqn.H +++ /dev/null @@ -1,25 +0,0 @@ - // Solve the Momentum equation - - tmp<fvVectorMatrix> UEqn - ( - fvm::div(phi, U) - + turbulence->divDevRhoReff(U) - ); - - UEqn().relax(); - - if (simple.momentumPredictor()) - { - solve - ( - UEqn() - == - fvc::reconstruct - ( - ( - - ghf*fvc::snGrad(rho) - - fvc::snGrad(p_rgh) - )*mesh.magSf() - ) - ); - } diff --git a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/buoyantBaffleSimpleFoam.C b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/buoyantBaffleSimpleFoam.C deleted file mode 100644 index 1a5b66f0c74786b871aa65769536d868a889f65b..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/buoyantBaffleSimpleFoam.C +++ /dev/null @@ -1,83 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Application - buoyantBaffleSimpleFoam - -Description - Steady-state solver for buoyant, turbulent flow of compressible fluids - using thermal baffles - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "basicPsiThermo.H" -#include "RASModel.H" -#include "fixedGradientFvPatchFields.H" -#include "simpleControl.H" -#include "thermoBaffleModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "setRootCase.H" - #include "createTime.H" - #include "createMesh.H" - #include "readGravitationalAcceleration.H" - #include "createFields.H" - #include "initContinuityErrs.H" - - simpleControl simple(mesh); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (simple.loop()) - { - Info<< "Time = " << runTime.timeName() << nl << endl; - - // Pressure-velocity SIMPLE corrector - { - #include "UEqn.H" - #include "hEqn.H" - #include "pEqn.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/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/createFields.H deleted file mode 100644 index 7adb8e41e712d34bfde5fae5152a1567cc26bb42..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/createFields.H +++ /dev/null @@ -1,94 +0,0 @@ - Info<< "Reading thermophysical properties\n" << endl; - - autoPtr<basicPsiThermo> pThermo - ( - basicPsiThermo::New(mesh) - ); - basicPsiThermo& thermo = pThermo(); - - volScalarField rho - ( - IOobject - ( - "rho", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - thermo.rho() - ); - - volScalarField& p = thermo.p(); - volScalarField& h = thermo.h(); - const volScalarField& psi = thermo.psi(); - - Info<< "Reading field U\n" << endl; - volVectorField U - ( - IOobject - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - #include "compressibleCreatePhi.H" - - Info<< "Creating turbulence model\n" << endl; - autoPtr<compressible::RASModel> turbulence - ( - compressible::RASModel::New - ( - rho, - U, - phi, - thermo - ) - ); - - - Info<< "Calculating field g.h\n" << endl; - volScalarField gh("gh", g & mesh.C()); - surfaceScalarField ghf("ghf", g & mesh.Cf()); - - Info<< "Reading field p_rgh\n" << endl; - volScalarField p_rgh - ( - IOobject - ( - "p_rgh", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ); - - // Force p_rgh to be consistent with p - p_rgh = p - rho*gh; - - - label pRefCell = 0; - scalar pRefValue = 0.0; - setRefCell - ( - p, - p_rgh, - mesh.solutionDict().subDict("SIMPLE"), - pRefCell, - pRefValue - ); - - autoPtr<regionModels::thermoBaffleModels::thermoBaffleModel> baffles - ( - regionModels::thermoBaffleModels::thermoBaffleModel::New(mesh) - ); - - dimensionedScalar initialMass = fvc::domainIntegrate(rho); - dimensionedScalar totalVolume = sum(mesh.V()); diff --git a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/hEqn.H b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/hEqn.H deleted file mode 100644 index 23313b56cf10d7819fe0cd0f69cae76341941cc9..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/hEqn.H +++ /dev/null @@ -1,17 +0,0 @@ -{ - fvScalarMatrix hEqn - ( - fvm::div(phi, h) - - fvm::Sp(fvc::div(phi), h) - - fvm::laplacian(turbulence->alphaEff(), h) - == - fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p)) - - p*fvc::div(phi/fvc::interpolate(rho)) - ); - - hEqn.relax(); - hEqn.solve(); - - baffles->evolve(); - thermo.correct(); -} diff --git a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/pEqn.H deleted file mode 100644 index d2793d719261317317db265f4909c3594aa50fa4..0000000000000000000000000000000000000000 --- a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/pEqn.H +++ /dev/null @@ -1,59 +0,0 @@ -{ - rho = thermo.rho(); - rho.relax(); - - volScalarField rAU(1.0/UEqn().A()); - surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU)); - - U = rAU*UEqn().H(); - UEqn.clear(); - - phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf()); - bool closedVolume = adjustPhi(phi, U, p_rgh); - - surfaceScalarField buoyancyPhi(rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); - phi -= buoyancyPhi; - - while (simple.correctNonOrthogonal()) - { - fvScalarMatrix p_rghEqn - ( - fvm::laplacian(rhorAUf, p_rgh) == fvc::div(phi) - ); - - p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); - p_rghEqn.solve(); - - if (simple.finalNonOrthogonalIter()) - { - // Calculate the conservative fluxes - phi -= p_rghEqn.flux(); - - // Explicitly relax pressure for momentum corrector - p_rgh.relax(); - - // Correct the momentum source with the pressure gradient flux - // calculated from the relaxed pressure - U -= rAU*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rhorAUf); - U.correctBoundaryConditions(); - } - } - - #include "continuityErrs.H" - - p = p_rgh + rho*gh; - - // For closed-volume cases adjust the pressure level - // to obey overall mass continuity - if (closedVolume) - { - p += (initialMass - fvc::domainIntegrate(psi*p)) - /fvc::domainIntegrate(psi); - p_rgh = p - rho*gh; - } - - rho = thermo.rho(); - rho.relax(); - Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() - << endl; -} diff --git a/applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/Make/files b/applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..17d05fbdf74b88e456a1cb951cef67b9830c8457 --- /dev/null +++ b/applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/Make/files @@ -0,0 +1,3 @@ +sprayEngineFoam.C + +EXE = $(FOAM_APPBIN)/sprayEngineFoam diff --git a/applications/solvers/combustion/dieselEngineFoam/Make/options b/applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/Make/options similarity index 56% rename from applications/solvers/combustion/dieselEngineFoam/Make/options rename to applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/Make/options index 8fdb0c5c33d6d9af10af064876dbea071641d0c9..772d4099b0d9954cc48a8f5ebdc0e1ca91846f82 100644 --- a/applications/solvers/combustion/dieselEngineFoam/Make/options +++ b/applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/Make/options @@ -1,40 +1,53 @@ EXE_INC = \ - -I../engineFoam \ + -I$(FOAM_SOLVERS)/lagrangian/sprayFoam \ + -I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam \ + -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)/meshTools/lnInclude \ - -I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \ + -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ + -I$(LIB_SRC)/lagrangian/spray/lnInclude \ + -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ - -I$(LIB_SRC)/../applications/solvers/reactionThermo/XiFoam \ + -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/engine/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ + -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ -I$(LIB_SRC)/combustionModels/lnInclude + EXE_LIBS = \ - -lengine \ + -lfiniteVolume \ + -lmeshTools \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ - -lreactionThermophysicalModels \ - -lfiniteVolume \ -llagrangian \ - -lmeshTools \ - -ldieselSpray \ + -llagrangianIntermediate \ + -llagrangianSpray \ + -lspecie \ + -lbasicThermophysicalModels \ -lliquidProperties \ -lliquidMixtureProperties \ + -lsolidProperties \ + -lsolidMixtureProperties \ -lthermophysicalFunctions \ - -lspecie \ - -lbasicThermophysicalModels \ - -llaminarFlameSpeedModels \ + -lreactionThermophysicalModels \ + -lSLGThermo \ -lchemistryModel \ + -lradiationModels \ -lODE \ - -ldistributionModels \ + -lengine \ + -lregionModels \ + -lsurfaceFilmModels \ -lcombustionModels diff --git a/applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/createClouds.H b/applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/createClouds.H new file mode 100644 index 0000000000000000000000000000000000000000..ee0985ff709cf5a732882f424733dba62eded72b --- /dev/null +++ b/applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/createClouds.H @@ -0,0 +1,9 @@ +Info<< "\nConstructing reacting cloud" << endl; +basicSprayCloud parcels +( + "sprayCloud", + rho, + U, + g, + slgThermo +); diff --git a/applications/solvers/combustion/dieselEngineFoam/logSummary.H b/applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/logSummary.H similarity index 100% rename from applications/solvers/combustion/dieselEngineFoam/logSummary.H rename to applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/logSummary.H diff --git a/applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/readEngineTimeControls.H b/applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/readEngineTimeControls.H new file mode 100644 index 0000000000000000000000000000000000000000..8d6d5f28b3b50a9d5fd54f33fd5c0a565e187b84 --- /dev/null +++ b/applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/readEngineTimeControls.H @@ -0,0 +1,3 @@ + #include "readTimeControls.H" + + maxDeltaT = runTime.userTimeToTime(maxDeltaT); diff --git a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C b/applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/sprayEngineFoam.C similarity index 86% rename from applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C rename to applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/sprayEngineFoam.C index 3c60e9c9eace15d17b5a66f678ecf81a4a398b24..7014cc1af336606af346029cf124c96557915bf0 100644 --- a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C +++ b/applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/sprayEngineFoam.C @@ -22,10 +22,11 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Application - dieselEngineFoam + sprayEngineFoam Description - Solver for diesel engine spray and combustion. + Transient PIMPLE solver for compressible, laminar or turbulent engine + flow swith spray parcels. \*---------------------------------------------------------------------------*/ @@ -33,16 +34,10 @@ Description #include "engineTime.H" #include "engineMesh.H" #include "turbulenceModel.H" +#include "basicSprayCloud.H" #include "psiChemistryCombustionModel.H" -#include "spray.H" -#include "psiChemistryModel.H" -#include "chemistrySolver.H" -#include "multivariateScheme.H" -#include "Switch.H" -#include "OFstream.H" -#include "volPointInterpolation.H" -#include "thermoPhysicsTypes.H" -#include "mathematicalConstants.H" +#include "radiationModel.H" +#include "SLGThermo.H" #include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,11 +45,13 @@ Description int main(int argc, char *argv[]) { #include "setRootCase.H" + #include "createEngineTime.H" #include "createEngineMesh.H" - #include "createFields.H" #include "readGravitationalAcceleration.H" - #include "createSpray.H" + #include "createFields.H" + #include "createClouds.H" + #include "createRadiationModel.H" #include "initContinuityErrs.H" #include "readEngineTimeControls.H" #include "compressibleCourantNo.H" @@ -77,12 +74,11 @@ int main(int argc, char *argv[]) Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl; - mesh.move(); - - dieselSpray.evolve(); + parcels.evolve(); #include "rhoEqn.H" + // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { #include "UEqn.H" @@ -102,11 +98,13 @@ int main(int argc, char *argv[]) } #include "logSummary.H" - #include "spraySummary.H" rho = thermo.rho(); - runTime.write(); + if (runTime.write()) + { + chemistry.dQ()().write(); + } Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" @@ -115,7 +113,7 @@ int main(int argc, char *argv[]) Info<< "End\n" << endl; - return 0; + return(0); } diff --git a/applications/solvers/combustion/dieselEngineFoam/startSummary.H b/applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/startSummary.H similarity index 100% rename from applications/solvers/combustion/dieselEngineFoam/startSummary.H rename to applications/solvers/lagrangian/sprayFoam/sprayEnginFoam/startSummary.H diff --git a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options index 99eae02e71691717374db22d62d9a9ff0d7c0804..ca4f0799001c144838dfd5a615783c612c74e61f 100644 --- a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options +++ b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options @@ -11,7 +11,6 @@ EXE_LIBS = \ -lcompressibleTurbulenceModel \ -lconversion \ -ldecompositionMethods \ - -ldieselSpray \ -ldistributed \ -ldistributionModels \ -ldsmc \ diff --git a/applications/utilities/postProcessing/dataConversion/foamToGMV/Make/options b/applications/utilities/postProcessing/dataConversion/foamToGMV/Make/options index 5664dc4494ee8c6c86e7fc98266f8297e0254b06..5c515d8f95b74b2155dc0d75f0fda4bc389a7130 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToGMV/Make/options +++ b/applications/utilities/postProcessing/dataConversion/foamToGMV/Make/options @@ -10,8 +10,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/browser/lnInclude \ -I$(LIB_SRC)/foam/lnInclude \ - -I$(LIB_SRC)/lagrangian/basic/lnInclude \ - -I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude + -I$(LIB_SRC)/lagrangian/basic/lnInclude EXE_LIBS = \ -lfiniteVolume \ diff --git a/src/lagrangian/Allwmake b/src/lagrangian/Allwmake index bedfd29f6b0120e1b21f0eabe66cc70334db8802..a4be085658abaefd479e1d9714cb54b165df949e 100755 --- a/src/lagrangian/Allwmake +++ b/src/lagrangian/Allwmake @@ -8,7 +8,6 @@ wmake $makeType basic wmake $makeType solidParticle wmake $makeType intermediate wmake $makeType spray -wmake $makeType dieselSpray wmake $makeType dsmc wmake $makeType coalCombustion diff --git a/src/lagrangian/dieselSpray/Make/files b/src/lagrangian/dieselSpray/Make/files deleted file mode 100644 index a619925bbc48a24b131be4d9c063e80a5fc63c4d..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/Make/files +++ /dev/null @@ -1,95 +0,0 @@ -parcel = parcel -spray = spray -injector = injector - -atomizationModels = spraySubModels/atomizationModel -breakupModels = spraySubModels/breakupModel -dragModels = spraySubModels/dragModel -evaporationModels = spraySubModels/evaporationModel -heatTransferModels = spraySubModels/heatTransferModel -wallModels = spraySubModels/wallModel -collisionModels = spraySubModels/collisionModel -dispersionModels = spraySubModels/dispersionModel -injectorModels = spraySubModels/injectorModel - -$(parcel)/parcel.C -$(parcel)/parcelFunctions.C -$(parcel)/parcelIO.C -$(parcel)/setRelaxationTimes.C - -$(spray)/spray.C -$(spray)/sprayOps.C -$(spray)/sprayInject.C -$(spray)/sprayFunctions.C - -$(injector)/injector/injector.C -$(injector)/injector/injectorIO.C -$(injector)/injectorType/injectorType.C -$(injector)/unitInjector/unitInjector.C -$(injector)/multiHoleInjector/multiHoleInjector.C -$(injector)/commonRailInjector/commonRailInjector.C -$(injector)/swirlInjector/swirlInjector.C -$(injector)/definedInjector/definedInjector.C - -$(atomizationModels)/atomizationModel/atomizationModel.C -$(atomizationModels)/atomizationModel/atomizationModelNew.C -$(atomizationModels)/LISA/LISA.C -$(atomizationModels)/noAtomization/noAtomization.C -$(atomizationModels)/blobsSheetAtomization/blobsSheetAtomization.C - -$(breakupModels)/breakupModel/breakupModelNew.C -$(breakupModels)/breakupModel/breakupModel.C -$(breakupModels)/noBreakup/noBreakup.C -$(breakupModels)/reitzDiwakar/reitzDiwakar.C -$(breakupModels)/reitzKHRT/reitzKHRT.C -$(breakupModels)/SHF/SHF.C -$(breakupModels)/TAB/TAB.C -$(breakupModels)/ETAB/ETAB.C - -$(dragModels)/dragModel/dragModelNew.C -$(dragModels)/dragModel/dragModel.C -$(dragModels)/noDragModel/noDragModel.C -$(dragModels)/standardDragModel/standardDragModel.C - -$(evaporationModels)/evaporationModel/evaporationModelNew.C -$(evaporationModels)/evaporationModel/evaporationModel.C -$(evaporationModels)/noEvaporation/noEvaporation.C -$(evaporationModels)/RutlandFlashBoil/RutlandFlashBoil.C -$(evaporationModels)/standardEvaporationModel/standardEvaporationModel.C -$(evaporationModels)/saturateEvaporationModel/saturateEvaporationModel.C - -$(heatTransferModels)/heatTransferModel/heatTransferModelNew.C -$(heatTransferModels)/heatTransferModel/heatTransferModel.C -$(heatTransferModels)/noHeatTransfer/noHeatTransfer.C -$(heatTransferModels)/RanzMarshall/RanzMarshall.C - -$(injectorModels)/injectorModel/injectorModelNew.C -$(injectorModels)/injectorModel/injectorModel.C -$(injectorModels)/constant/constInjector.C -$(injectorModels)/Chomiak/Chomiak.C -$(injectorModels)/hollowCone/hollowCone.C -$(injectorModels)/pressureSwirl/pressureSwirlInjector.C -$(injectorModels)/definedHollowCone/definedHollowCone.C -$(injectorModels)/definedPressureSwirl/definedPressureSwirl.C -$(injectorModels)/blobsSwirl/blobsSwirlInjector.C - -$(wallModels)/wallModel/wallModelNew.C -$(wallModels)/wallModel/wallModel.C -$(wallModels)/removeParcel/removeParcel.C -$(wallModels)/reflectParcel/reflectParcel.C - -$(collisionModels)/collisionModel/collisionModel.C -$(collisionModels)/collisionModel/collisionModelNew.C -$(collisionModels)/noCollision/noCollision.C -$(collisionModels)/ORourke/ORourkeCollisionModel.C -$(collisionModels)/trajectoryModel/trajectoryModel.C - -$(dispersionModels)/dispersionModel/dispersionModel.C -$(dispersionModels)/dispersionModel/dispersionModelNew.C -$(dispersionModels)/dispersionRASModel/dispersionRASModel.C -$(dispersionModels)/dispersionLESModel/dispersionLESModel.C -$(dispersionModels)/noDispersion/noDispersion.C -$(dispersionModels)/gradientDispersionRAS/gradientDispersionRAS.C -$(dispersionModels)/stochasticDispersionRAS/stochasticDispersionRAS.C - -LIB = $(FOAM_LIBBIN)/libdieselSpray diff --git a/src/lagrangian/dieselSpray/Make/options b/src/lagrangian/dieselSpray/Make/options deleted file mode 100644 index 4d4eba8a2d56feae98e84bda81839c7e71c82a1f..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/Make/options +++ /dev/null @@ -1,29 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/lagrangian/basic/lnInclude \ - -I$(LIB_SRC)/turbulenceModels \ - -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ - -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ - -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude - -LIB_LIBS = \ - -llagrangian \ - -lmeshTools \ - -lfiniteVolume \ - -lcompressibleRASModels \ - -lcompressibleLESModels \ - -lLESdeltas \ - -lliquidProperties \ - -lliquidMixtureProperties \ - -lthermophysicalFunctions \ - -lspecie \ - -ldistributionModels diff --git a/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.C b/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.C deleted file mode 100644 index a1fd92ac2eaf62cf1ef9f07e9300f50b79588b42..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.C +++ /dev/null @@ -1,436 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "commonRailInjector.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -namespace Foam -{ - defineTypeNameAndDebug(commonRailInjector, 0); - - addToRunTimeSelectionTable - ( - injectorType, - commonRailInjector, - dictionary - ); -} - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::commonRailInjector::commonRailInjector -( - const Foam::Time& t, - const Foam::dictionary& dict -) -: - injectorType(t, dict), - propsDict_(dict.subDict(typeName + "Props")), - position_(propsDict_.lookup("position")), - direction_(propsDict_.lookup("direction")), - d_(readScalar(propsDict_.lookup("diameter"))), - mass_(readScalar(propsDict_.lookup("mass"))), - injectionPressure_(readScalar(propsDict_.lookup("injectionPressure"))), - T_(readScalar(propsDict_.lookup("temperature"))), - nParcels_(readLabel(propsDict_.lookup("nParcels"))), - X_(propsDict_.lookup("X")), - massFlowRateProfile_(propsDict_.lookup("massFlowRateProfile")), - velocityProfile_(massFlowRateProfile_), - injectionPressureProfile_(propsDict_.lookup("injectionPressureProfile")), - 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]); - velocityProfile_[i][0] = t.userTimeToTime(massFlowRateProfile_[i][0]); - } - - forAll(injectionPressureProfile_, i) - { - injectionPressureProfile_[i][0] = - t.userTimeToTime(injectionPressureProfile_[i][0]); - } - - if - ( - mag(injectionPressureProfile_[0][0] - massFlowRateProfile_[0][0]) - > SMALL - ) - { - FatalErrorIn - ( - "commonRailInjector::commonRailInjector" - "(const time& t, const dictionary dict)" - ) << " start-time entries for injectionPressureProfile and " - << "massFlowRateProfile do no match" - << abort(FatalError); - } - Info<< "injectionPressureProfile_.size() = " - << injectionPressureProfile_.size() - << ", massFlowRateProfile_.size() = " << massFlowRateProfile_.size() - << endl; - - if - ( - mag(injectionPressureProfile_.last()[0] - - massFlowRateProfile_.last()[0]) - > SMALL - ) - { - FatalErrorIn - ( - "commonRailInjector::commonRailInjector" - "(const time& t, const dictionary dict)" - ) << "End-time entries for injectionPressureProfile and " - << "massFlowRateProfile do no match" - << abort(FatalError); - } - - scalar integratedMFR = integrateTable(massFlowRateProfile_); - scalar integratedP = - integrateTable(injectionPressureProfile_)/(teoi() - tsoi()); - - forAll(massFlowRateProfile_, i) - { - // correct the massFlowRateProfile to match the injected mass - massFlowRateProfile_[i][1] *= mass_/integratedMFR; - - TProfile_[i][0] = massFlowRateProfile_[i][0]; - TProfile_[i][1] = T_; - - CdProfile_[i][0] = massFlowRateProfile_[i][0]; - } - - forAll(injectionPressureProfile_, i) - { - injectionPressureProfile_[i][1] *= injectionPressure_/integratedP; - } - // Normalize the direction vector - direction_ /= mag(direction_); - - setTangentialVectors(); - - // check molar fractions - scalar Xsum = 0.0; - forAll(X_, i) - { - Xsum += X_[i]; - } - - if (mag(Xsum - 1.0) > SMALL) - { - WarningIn - ( - "commonRailInjector::commonRailInjector" - "(const time& t, const dictionary dict)" - ) << "X does not add up to 1.0, correcting molar fractions." - << endl; - forAll(X_, i) - { - X_[i] /= Xsum; - } - } - - Info<< "end constructor. in commonRail" << endl; -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::commonRailInjector::~commonRailInjector() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::commonRailInjector::setTangentialVectors() -{ - cachedRandom rndGen(label(0), -1); - scalar magV = 0.0; - vector tangent; - - while (magV < SMALL) - { - vector testThis = rndGen.sample01<vector>(); - - tangent = testThis - (testThis & direction_)*direction_; - magV = mag(tangent); - } - - tangentialInjectionVector1_ = tangent/magV; - tangentialInjectionVector2_ = direction_ ^ tangentialInjectionVector1_; - -} - - -Foam::label Foam::commonRailInjector::nParcelsToInject -( - const scalar time0, - const scalar time1 -) const -{ - - scalar mInj = - mass_*(fractionOfInjection(time1) - fractionOfInjection(time0)); - label nParcels = label(mInj/averageParcelMass_ + 0.49); - - return nParcels; -} - - -const Foam::vector Foam::commonRailInjector::position(const label n) const -{ - return position_; -} - - -Foam::vector Foam::commonRailInjector::position -( - const label n, - const scalar time, - const bool twoD, - const scalar angleOfWedge, - const vector& axisOfSymmetry, - const vector& axisOfWedge, - const vector& axisOfWedgeNormal, - cachedRandom& rndGen -) const -{ - if (twoD) - { - scalar is = position_ & axisOfSymmetry; - scalar magInj = mag(position_ - is*axisOfSymmetry); - - vector halfWedge = - axisOfWedge*cos(0.5*angleOfWedge) - + axisOfWedgeNormal*sin(0.5*angleOfWedge); - halfWedge /= mag(halfWedge); - - return (is*axisOfSymmetry + magInj*halfWedge); - } - else - { - // otherwise, disc injection - scalar iRadius = d_*rndGen.sample01<scalar>(); - scalar iAngle = constant::mathematical::twoPi*rndGen.sample01<scalar>(); - - return - ( - position_ - + iRadius - *( - tangentialInjectionVector1_*cos(iAngle) - + tangentialInjectionVector2_*sin(iAngle) - ) - ); - } - - return position_; -} - - -Foam::label Foam::commonRailInjector::nHoles() const -{ - return 1; -} - - -Foam::scalar Foam::commonRailInjector::d() const -{ - return d_; -} - - -const Foam::vector& Foam::commonRailInjector::direction -( - const label i, - const scalar time -) const -{ - return direction_; -} - - -Foam::scalar Foam::commonRailInjector::mass -( - const scalar time0, - const scalar time1, - const bool twoD, - const scalar angleOfWedge -) const -{ - scalar mInj = - mass_*(fractionOfInjection(time1) - fractionOfInjection(time0)); - - // correct mass if calculation is 2D - if (twoD) - { - mInj *= 0.5*angleOfWedge/constant::mathematical::pi; - } - - return mInj; -} - - -Foam::scalar Foam::commonRailInjector::mass() const -{ - return mass_; -} - - -const Foam::scalarField& Foam::commonRailInjector::X() const -{ - return X_; -} - - -Foam::List<Foam::commonRailInjector::pair> Foam::commonRailInjector::T() const -{ - return TProfile_; -} - - -Foam::scalar Foam::commonRailInjector::T(const scalar time) const -{ - return T_; -} - - -Foam::scalar Foam::commonRailInjector::tsoi() const -{ - return massFlowRateProfile_.first()[0]; -} - - -Foam::scalar Foam::commonRailInjector::teoi() const -{ - return massFlowRateProfile_.last()[0]; -} - - -Foam::scalar Foam::commonRailInjector::massFlowRate -( - const scalar time -) const -{ - return getTableValue(massFlowRateProfile_, time); -} - - -Foam::scalar Foam::commonRailInjector::injectionPressure -( - const scalar time -) const -{ - return getTableValue(injectionPressureProfile_, time); -} - - -Foam::scalar Foam::commonRailInjector::velocity -( - const scalar time -) const -{ - return getTableValue(velocityProfile_, time); -} - - -Foam::List<Foam::commonRailInjector::pair> Foam::commonRailInjector::CdProfile() -const -{ - return CdProfile_; -} - - -Foam::scalar Foam::commonRailInjector::Cd -( - const scalar time -) const -{ - return getTableValue(CdProfile_, time); -} - - -Foam::scalar Foam::commonRailInjector::fractionOfInjection -( - const scalar time -) const -{ - return integrateTable(massFlowRateProfile_, time)/mass_; -} - - -Foam::scalar Foam::commonRailInjector::injectedMass -( - const scalar t -) const -{ - return mass_*fractionOfInjection(t); -} - - -void Foam::commonRailInjector::correctProfiles -( - const liquidMixtureProperties& fuel, - const scalar referencePressure -) -{ - scalar A = 0.25*constant::mathematical::pi*sqr(d_); - scalar pDummy = 1.0e+5; - scalar rho = fuel.rho(pDummy, T_, X_); - - forAll(velocityProfile_, i) - { - scalar Pinj = - getTableValue(injectionPressureProfile_, velocityProfile_[i][0]); - scalar Vinj = sqrt(2.0*(Pinj - referencePressure)/rho); - scalar mfr = massFlowRateProfile_[i][1]/(rho*A); - scalar Cd = mfr/Vinj; - velocityProfile_[i][1] = Vinj; - CdProfile_[i][1] = Cd; - } -} - - -Foam::vector Foam::commonRailInjector::tan1(const label n) const -{ - return tangentialInjectionVector1_; -} - - -Foam::vector Foam::commonRailInjector::tan2(const label n) const -{ - return tangentialInjectionVector2_; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.H b/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.H deleted file mode 100644 index 3e6b72a059d68c7b7dd269afd2f43868cf9b78b7..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/commonRailInjector/commonRailInjector.H +++ /dev/null @@ -1,235 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::commonRailInjector - -Description - Common-rail injector - -SourceFiles - commonRailInjectorI.H - commonRailInjector.C - commonRailInjectorIO.C - -\*---------------------------------------------------------------------------*/ - -#ifndef commonRailInjector_H -#define commonRailInjector_H - -#include "injectorType.H" -#include "vector.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class commonRailInjector Declaration -\*---------------------------------------------------------------------------*/ - -class commonRailInjector -: - public injectorType -{ - -private: - - typedef VectorSpace<Vector<scalar>, scalar, 2> pair; - - // Private data - - dictionary propsDict_; - - vector position_; - vector direction_; - scalar d_; - scalar mass_; - scalar injectionPressure_; - scalar T_; - label nParcels_; - scalarField X_; - List<pair> massFlowRateProfile_; - List<pair> velocityProfile_; - List<pair> injectionPressureProfile_; - List<pair> CdProfile_; - List<pair> TProfile_; - scalar averageParcelMass_; - - bool pressureIndependentVelocity_; - - //- two orthogonal vectors that are also orthogonal - // to the injection direction - vector tangentialInjectionVector1_, tangentialInjectionVector2_; - - - // Private Member Functions - - //- Disallow default bitwise copy construct - commonRailInjector(const commonRailInjector&); - - //- Disallow default bitwise assignment - void operator=(const commonRailInjector&); - - //- Create two vectors orthonoal to each other - // and the injection vector - void setTangentialVectors(); - - //- Return the fraction of the total injected liquid - scalar fractionOfInjection(const scalar time) const; - - -public: - - //- Runtime type information - TypeName("commonRailInjector"); - - - // Constructors - - //- Construct from components - commonRailInjector(const Time& t, const dictionary& dict); - - - //- Destructor - virtual ~commonRailInjector(); - - - // Member Functions - - //- Return number of particles to inject - label nParcelsToInject - ( - const scalar t0, - const scalar t1 - ) const; - - //- Return the injection position - const vector position(const label n) const; - - //- Return the injection position - vector position - ( - const label n, - const scalar time, - const bool twoD, - const scalar angleOfWedge, - const vector& axisOfSymmetry, - const vector& axisOfWedge, - const vector& axisOfWedgeNormal, - cachedRandom& rndGen - ) const; - - //- Return the number of holes - label nHoles() const; - - //- Return the injector diameter - scalar d() const; - - //- Return the injection direction - const vector& direction - ( - const label i, - const scalar time - ) const; - - //- Return the mass of the injected particle - scalar mass - ( - const scalar t0, - const scalar t1, - const bool twoD, - const scalar angleOfWedge - ) const; - - //- Return the mass injected by the injector - scalar mass() const; - - //- Return the fuel mass fractions of the injected particle - const scalarField& X() const; - - //- Return the temperature profile of the injected particle - List<pair> T() const; - - //- Return the temperature of the injected particle - scalar T(const scalar time) const; - - //- Return the start-of-injection time - scalar tsoi() const; - - //- Return the end-of-injection time - scalar teoi() const; - - //- Return the injected liquid mass - scalar injectedMass(const scalar t) const; - - List<pair> massFlowRateProfile() const - { - return massFlowRateProfile_; - } - - scalar massFlowRate(const scalar time) const; - - List<pair> injectionPressureProfile() const - { - return injectionPressureProfile_; - } - - scalar injectionPressure(const scalar time) const; - - List<pair> velocityProfile() const - { - return velocityProfile_; - } - - scalar velocity(const scalar time) const; - - List<pair> CdProfile() const; - scalar Cd(const scalar time) const; - - vector tan1(const label n) const; - vector tan2(const label n) const; - - void correctProfiles - ( - const liquidMixtureProperties& fuel, - const scalar referencePressure - ); - - bool pressureIndependentVelocity() const - { - return pressureIndependentVelocity_; - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.C b/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.C deleted file mode 100644 index 05cc63881992aaa99dd07c93c1ac2ce2f9237554..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.C +++ /dev/null @@ -1,399 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "definedInjector.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -namespace Foam -{ - defineTypeNameAndDebug(definedInjector, 0); - - addToRunTimeSelectionTable - ( - injectorType, - definedInjector, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::definedInjector::definedInjector -( - const Time& t, - const dictionary& dict -) -: - injectorType(t, dict), - propsDict_(dict.subDict(typeName + "Props")), - position_(propsDict_.lookup("position")), - direction_(propsDict_.lookup("direction")), - d_(readScalar(propsDict_.lookup("diameter"))), - mass_(readScalar(propsDict_.lookup("mass"))), - T_(readScalar(propsDict_.lookup("temperature"))), - nParcels_(readLabel(propsDict_.lookup("nParcels"))), - X_(propsDict_.lookup("X")), - massFlowRateProfile_(propsDict_.lookup("massFlowRateProfile")), - velocityProfile_(propsDict_.lookup("velocityProfile")), - injectionPressureProfile_(massFlowRateProfile_), - CdProfile_(massFlowRateProfile_), - averageParcelMass_(mass_/nParcels_), - pressureIndependentVelocity_(true) -{ - // convert CA to real time - mass flow rate profile - forAll(massFlowRateProfile_, i) - { - massFlowRateProfile_[i][0] = - t.userTimeToTime(massFlowRateProfile_[i][0]); - // dummy - injectionPressureProfile_[i][0] = massFlowRateProfile_[i][0]; - injectionPressureProfile_[i][1] = 0.0; - CdProfile_[i][0] = massFlowRateProfile_[i][0]; - CdProfile_[i][1] = 1.0; - } - - forAll(velocityProfile_, i) - { - velocityProfile_[i][0] = t.userTimeToTime(velocityProfile_[i][0]); - } - - // check if time entries match - if (mag(massFlowRateProfile_[0][0]-velocityProfile_[0][0]) > SMALL) - { - FatalErrorIn - ( - "definedInjector::definedInjector" - "(const time& t, const dictionary dict)" - ) << "Start-times do not match for velocityProfile and " - << "massFlowRateProfile." << nl - << abort(FatalError); - } - - if - ( - mag(massFlowRateProfile_.last()[0] - velocityProfile_.last()[0]) - > SMALL - ) - { - FatalErrorIn - ( - "definedInjector::definedInjector" - "(const time& t, const dictionary dict)" - ) << "End-times do not match for velocityProfile and " - << "massFlowRateProfile." - << abort(FatalError); - } - - // calculate integral of mass flow rate profile - scalar integratedMFR = integrateTable(massFlowRateProfile_); - - // correct the massFlowRate profile to match the injector - forAll(massFlowRateProfile_, i) - { - massFlowRateProfile_[i][1] *= mass_/integratedMFR; - } - - // Normalize the direction vector - direction_ /= mag(direction_); - - setTangentialVectors(); - - // check molar fractions - scalar Xsum = 0.0; - forAll(X_, i) - { - Xsum += X_[i]; - } - - if (mag(Xsum - 1.0) > SMALL) - { - WarningIn - ( - "definedInjector::definedInjector" - "(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::definedInjector::~definedInjector() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::definedInjector::setTangentialVectors() -{ - cachedRandom rndGen(label(0), -1); - scalar magV = 0.0; - vector tangent; - - while (magV < SMALL) - { - vector testThis = rndGen.sample01<vector>(); - - tangent = testThis - (testThis & direction_)*direction_; - magV = mag(tangent); - } - - tangentialInjectionVector1_ = tangent/magV; - tangentialInjectionVector2_ = direction_ ^ tangentialInjectionVector1_; -} - - -Foam::label Foam::definedInjector::nParcelsToInject -( - const scalar time0, - const scalar time1 -) const -{ - - scalar mInj = mass_*(fractionOfInjection(time1)-fractionOfInjection(time0)); - label nParcels = label(mInj/averageParcelMass_ + 0.49); - - return nParcels; -} - - -const Foam::vector Foam::definedInjector::position(const label n) const -{ - return position_; -} - - -Foam::vector Foam::definedInjector::position -( - const label n, - const scalar time, - const bool twoD, - const scalar angleOfWedge, - const vector& axisOfSymmetry, - const vector& axisOfWedge, - const vector& axisOfWedgeNormal, - cachedRandom& rndGen -) const -{ - if (twoD) - { - scalar is = position_ & axisOfSymmetry; - scalar magInj = mag(position_ - is*axisOfSymmetry); - - vector halfWedge = - axisOfWedge*cos(0.5*angleOfWedge) - + axisOfWedgeNormal*sin(0.5*angleOfWedge); - halfWedge /= mag(halfWedge); - - return (is*axisOfSymmetry + magInj*halfWedge); - } - else - { - // otherwise, disc injection - scalar iRadius = d_*rndGen.sample01<scalar>(); - scalar iAngle = constant::mathematical::twoPi*rndGen.sample01<scalar>(); - - return - ( - position_ - + iRadius - * ( - tangentialInjectionVector1_*cos(iAngle) - + tangentialInjectionVector2_*sin(iAngle) - ) - ); - - } - - return position_; -} - - -Foam::label Foam::definedInjector::nHoles() const -{ - return 1; -} - - -Foam::scalar Foam::definedInjector::d() const -{ - return d_; -} - - -const Foam::vector& Foam::definedInjector::direction -( - const label i, - const scalar time -) const -{ - return direction_; -} - - -Foam::scalar Foam::definedInjector::mass -( - const scalar time0, - const scalar time1, - const bool twoD, - const scalar angleOfWedge -) const -{ - scalar mInj = - mass_*(fractionOfInjection(time1) - fractionOfInjection(time0)); - - // correct mass if calculation is 2D - if (twoD) - { - mInj *= 0.5*angleOfWedge/constant::mathematical::pi; - } - - return mInj; -} - - -Foam::scalar Foam::definedInjector::mass() const -{ - return mass_; -} - - -Foam::scalar Foam::definedInjector::massFlowRate(const scalar time) const -{ - return getTableValue(massFlowRateProfile_, time); -} - - -Foam::scalar Foam::definedInjector::injectionPressure(const scalar time) const -{ - return getTableValue(injectionPressureProfile_, time); -} - - -Foam::scalar Foam::definedInjector::Cd(const scalar time) const -{ - return getTableValue(CdProfile_, time); -} - - -const Foam::scalarField& Foam::definedInjector::X() const -{ - return X_; -} - - -Foam::List<Foam::definedInjector::pair> Foam::definedInjector::T() const -{ - return TProfile_; -} - - -Foam::scalar Foam::definedInjector::T(const scalar time) const -{ - return T_; -} - - -Foam::scalar Foam::definedInjector::tsoi() const -{ - return massFlowRateProfile_.first()[0]; -} - - -Foam::scalar Foam::definedInjector::teoi() const -{ - return massFlowRateProfile_.last()[0]; -} - - -Foam::scalar Foam::definedInjector::fractionOfInjection -( - const scalar time -) const -{ - return integrateTable(massFlowRateProfile_, time)/mass_; -} - - -Foam::scalar Foam::definedInjector::velocity -( - const scalar time -) const -{ - return getTableValue(velocityProfile_, time); -} - - -Foam::scalar Foam::definedInjector::injectedMass -( - const scalar t -) const -{ - return mass_*fractionOfInjection(t); -} - - -void Foam::definedInjector::correctProfiles -( - const liquidMixtureProperties& fuel, - const scalar referencePressure -) -{ - scalar A = 0.25*constant::mathematical::pi*sqr(d_); - scalar pDummy = 1.0e+5; - scalar rho = fuel.rho(pDummy, T_, X_); - - forAll(velocityProfile_, i) - { - scalar mfr = massFlowRateProfile_[i][1]; - scalar v = velocityProfile_[i][1]; - injectionPressureProfile_[i][1] = referencePressure + 0.5*rho*v*v; - CdProfile_[i][1] = mfr/(v*rho*A); - } -} - - -Foam::vector Foam::definedInjector::tan1(const label n) const -{ - return tangentialInjectionVector1_; -} - - -Foam::vector Foam::definedInjector::tan2(const label n) const -{ - return tangentialInjectionVector2_; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.H b/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.H deleted file mode 100644 index 21f4e0bebdca2ea1cd0c2e8737ac6f1fba4cd399..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/definedInjector/definedInjector.H +++ /dev/null @@ -1,240 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::definedInjector - -Description - User specified MFR vs time and velocity vs time - -SourceFiles - definedInjectorI.H - definedInjector.C - -\*---------------------------------------------------------------------------*/ - -#ifndef definedInjector_H -#define definedInjector_H - -#include "injectorType.H" -#include "vector.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class definedInjector Declaration -\*---------------------------------------------------------------------------*/ - -class definedInjector -: - public injectorType -{ - -private: - - // Private data - - typedef VectorSpace<Vector<scalar>, scalar, 2> pair; - - dictionary propsDict_; - - vector position_; - vector direction_; - scalar d_; - scalar mass_; - scalar T_; - label nParcels_; - scalarField X_; - List<pair> massFlowRateProfile_; - List<pair> velocityProfile_; - List<pair> injectionPressureProfile_; - List<pair> CdProfile_; - List<pair> TProfile_; - scalar averageParcelMass_; - - bool pressureIndependentVelocity_; - - //- two orthogonal vectors that are also orthogonal - // to the injection direction - vector tangentialInjectionVector1_, tangentialInjectionVector2_; - - - // Private Member Functions - - //- Disallow default bitwise copy construct - definedInjector(const definedInjector&); - - //- Disallow default bitwise assignment - void operator=(const definedInjector&); - - //- Create two vectors orthonoal to each other - // and the injection vector - void setTangentialVectors(); - - //- Return the fraction of the total injected liquid - scalar fractionOfInjection(const scalar time) const; - - //- Return the instantaneous injection velocity - scalar injectionVelocity(const scalar) const; - - -public: - - //- Runtime type information - TypeName("definedInjector"); - - - // Constructors - - //- Construct from components - definedInjector(const Time& t, const dictionary& dict); - - - //- Destructor - virtual ~definedInjector(); - - - // Member Functions - - //- Return number of particles to inject - label nParcelsToInject - ( - const scalar t0, - const scalar t1 - ) const; - - //- Return the injection position - const vector position(const label n) const; - - //- Return the injection position - vector position - ( - const label n, - const scalar time, - const bool twoD, - const scalar angleOfWedge, - const vector& axisOfSymmetry, - const vector& axisOfWedge, - const vector& axisOfWedgeNormal, - cachedRandom& rndGen - ) const; - - //- Return the number of holes - label nHoles() const; - - //- Return the injector diameter - scalar d() const; - - //- Return the injection direction - const vector& direction - ( - const label i, - const scalar time - ) const; - - //- Return the mass of the injected particle - scalar mass - ( - const scalar t0, - const scalar t1, - const bool twoD, - const scalar angleOfWedge - ) const; - - //- Return the mass injected by the injector - scalar mass() const; - - //- Return the fuel mass fractions of the injected particle - const scalarField& X() const; - - //- Return the temperature profile of the injected particle - List<pair> T() const; - - //- Return the temperature of the injected particle - scalar T(const scalar time) const; - - //- Return the start-of-injection time - scalar tsoi() const; - - //- Return the end-of-injection time - scalar teoi() const; - - //- Return the injected liquid mass - scalar injectedMass(const scalar t) const; - - List<pair> massFlowRateProfile() const - { - return massFlowRateProfile_; - } - - scalar massFlowRate(const scalar time) const; - - List<pair> injectionPressureProfile() const - { - return injectionPressureProfile_; - } - - scalar injectionPressure(const scalar time) const; - - List<pair> velocityProfile() const - { - return velocityProfile_; - } - - scalar velocity(const scalar time) const; - - List<pair> CdProfile() const - { - return CdProfile_; - } - - scalar Cd(const scalar time) const; - - vector tan1(const label n) const; - vector tan2(const label n) const; - - void correctProfiles - ( - const liquidMixtureProperties& fuel, - const scalar referencePressure - ); - - bool pressureIndependentVelocity() const - { - return pressureIndependentVelocity_; - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/injector/injector.C b/src/lagrangian/dieselSpray/injector/injector/injector.C deleted file mode 100644 index 3ab789cfa5c0dd8267340fbe06da764e11a311f5..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/injector/injector.C +++ /dev/null @@ -1,41 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "injector.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// No code - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/injector/injector.H b/src/lagrangian/dieselSpray/injector/injector/injector.H deleted file mode 100644 index 1ac8ca2a61a39d7da4513e9a1bf3a101058920be..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/injector/injector.H +++ /dev/null @@ -1,115 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::injector - -Description - Spray injector - -\*---------------------------------------------------------------------------*/ - -#ifndef injector_H -#define injector_H - -#include "vector.H" -#include "List.H" -#include "dictionary.H" -#include "autoPtr.H" -#include "runTimeSelectionTables.H" -#include "Time.H" -#include "injectorType.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class injector Declaration -\*---------------------------------------------------------------------------*/ - -class injector -{ - // Private data - - dictionary injectorDict_; - - autoPtr<injectorType> properties_; - - -public: - - // Constructors - - //- Constructor from Istream - injector(const Time&, Istream&); - - //- Return clone - inline autoPtr<injector> clone() const; - - //- Return a pointer to a new injector created on freestore - // from Istream - class iNew - { - const Time& time_; - - public: - - iNew(const Time& t) - : - time_(t) - {} - - autoPtr<injector> operator()(Istream& is) const - { - return autoPtr<injector>(new injector(time_, is)); - } - }; - - - // Member Functions - - inline autoPtr<injectorType>& properties(); - inline const autoPtr<injectorType>& properties() const; - - - // Ostream Operator - - friend Ostream& operator<<(Ostream&, const injector&); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "injectorI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/injector/injectorI.H b/src/lagrangian/dieselSpray/injector/injector/injectorI.H deleted file mode 100644 index ca73188e670a63df01b1f2196f4768e6b9a105c8..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/injector/injectorI.H +++ /dev/null @@ -1,47 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -inline Foam::autoPtr<Foam::injector> -Foam::injector::clone() const -{ - return autoPtr<injector>(new injector(*this)); -} - -inline Foam::autoPtr<Foam::injectorType>& -Foam::injector::properties() -{ - return properties_; -} - -inline const Foam::autoPtr<Foam::injectorType>& -Foam::injector::properties() const -{ - return properties_; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/injector/injectorIO.C b/src/lagrangian/dieselSpray/injector/injector/injectorIO.C deleted file mode 100644 index 7058f200526abcd85b244ce2bdfaf9daf7594589..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/injector/injectorIO.C +++ /dev/null @@ -1,56 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "injector.H" -#include "dictionary.H" - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::injector::injector(const Time& t, Istream& is) -: - injectorDict_(is), - properties_(injectorType::New(t, injectorDict_)) -{ - // Check state of Istream - is.check("Istream& operator>>(Istream&, injector&)"); - -} - - -// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // - -Foam::Ostream& Foam::operator<<(Ostream& os, const injector& injector) -{ - // Check state of Ostream - os.check("Ostream& operator<<(Ostream&, const injector&)"); - - os << injector.injectorDict_ << endl; - - return os; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/injectorType/injectorType.C b/src/lagrangian/dieselSpray/injector/injectorType/injectorType.C deleted file mode 100644 index 7eaca438617a9cc56b187626f1fe9a7bdeb725ae..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/injectorType/injectorType.C +++ /dev/null @@ -1,176 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "injectorType.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(injectorType, 0); - defineRunTimeSelectionTable(injectorType, dictionary); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::injectorType::injectorType -( - const Foam::Time&, - const Foam::dictionary& -) -{} - - -// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::injectorType> Foam::injectorType::New -( - const Time& t, - const dictionary& dict -) -{ - const word modelType(dict.lookup("injectorType")); - - Info<< "Selecting injectorType " << modelType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn("injectorType::New(const dictionary&)") - << "Unknown injectorType type " - << modelType << nl << nl - << "Valid injectorTypes are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); - } - - return autoPtr<injectorType>(cstrIter()(t, dict)); -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::injectorType::~injectorType() -{} - - -Foam::scalar Foam::injectorType::getTableValue -( - const List<pair>& table, - const scalar value -) const -{ - // iterator - label i = 0; - - // max items - label maxRow = table.size() - 1; - - // check lower bound - if (value < table[0][0]) - { - return table[0][1]; - } - // check upper bound - else if (value > table[maxRow][0]) - { - return table[maxRow][1]; - } - // interpolate intermediate value - else - { - while - ( - (i < maxRow-1) && (table[i+1][0] < value) - ) - { - i++; - } - // value sits bewteen table[i][0] and table[i+1][0] - return table[i][1] - + (value-table[i][0])/(table[i+1][0]-table[i][0]) - * (table[i+1][1]-table[i][1]); - } -} - - -Foam::scalar Foam::injectorType::integrateTable -( - const List<pair>& table, - const scalar value -) const -{ - label N = table.size() - 1; - scalar sum = 0.0; - scalar t = max(table[0][0], min(value, table[N][0])); - - label i = 0; - while - ( - (i < N - 1) - && (table[i+1][0] < t) - ) - { - scalar deltaH = table[i+1][1] + table[i][1]; - scalar deltaT = table[i+1][0] - table[i][0]; - sum += 0.5*deltaH*deltaT; - i++; - } - - scalar interpolatedValue = - table[i][1] - + (t - table[i][0]) - * (table[i+1][1] - table[i][1]) - / (table[i+1][0] - table[i][0]); - - sum += - 0.5*(interpolatedValue + table[i][1]) - *(t - table[i][0]); - - return sum; -} - - -Foam::scalar Foam::injectorType::integrateTable -( - const List<pair>& table -) const -{ - scalar integratedTable = 0.0; - for (label i=0; i < table.size() - 1; i++) - { - scalar deltaH = table[i+1][1] + table[i][1]; - scalar deltaT = table[i+1][0] - table[i][0]; - integratedTable += 0.5*deltaH*deltaT; - } - - return integratedTable; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/injectorType/injectorType.H b/src/lagrangian/dieselSpray/injector/injectorType/injectorType.H deleted file mode 100644 index 644938101c962a8d7bedf299c4bb13c5fb02dbc0..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/injectorType/injectorType.H +++ /dev/null @@ -1,235 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::injectorType - -Description - Base class for injectors - -SourceFiles - injectorTypeI.H - injectorType.C - injectorTypeIO.C - -\*---------------------------------------------------------------------------*/ - -#ifndef injectorType_H -#define injectorType_H - -#include "IOdictionary.H" -#include "Time.H" -#include "autoPtr.H" -#include "runTimeSelectionTables.H" -#include "vector.H" -#include "scalarField.H" -#include "cachedRandom.H" -#include "liquidMixtureProperties.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class injectorType Declaration -\*---------------------------------------------------------------------------*/ - -class injectorType -{ - typedef VectorSpace<Vector<scalar>, scalar, 2> pair; - -public: - - //- Runtime type information - TypeName("injectorType"); - - // Declare runtime constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - injectorType, - dictionary, - ( - const Time& t, - const dictionary& dict - ), - (t, dict) - ); - - - // Constructors - - //- Construct from components - injectorType(const Time& t, const dictionary& dict); - - - // Selectors - - static autoPtr<injectorType> New - ( - const Time& t, - const dictionary& dict - ); - - - //- Destructor - virtual ~injectorType(); - - - // Member Functions - - //- Return number of particles to inject - virtual label nParcelsToInject - ( - const scalar time0, - const scalar time1 - ) const = 0; - - //- Return the injection position - virtual const vector position(const label n) const = 0; - - //- Return the injection position - virtual vector position - ( - const label n, - const scalar time, - const bool twoD, - const scalar angleOfWedge, - const vector& axisOfSymmetry, - const vector& axisOfWedge, - const vector& axisOfWedgeNormal, - cachedRandom& rndGen - ) const = 0; - - //- Return the number of holes - virtual label nHoles() const = 0; - - //- Return the injector diameter - virtual scalar d() const = 0; - - //- Return the injection direction for hole i - virtual const vector& direction - ( - const label i, - const scalar time - ) const = 0; - - //- Return the mass of the injected liquid between times - virtual scalar mass - ( - const scalar time0, - const scalar time1, - const bool twoD, - const scalar angleOfWedge - ) const = 0; - - //- Return the mass injected by the injector - virtual scalar mass() const = 0; - - //- Return the mass flow rate profile - virtual List<pair> massFlowRateProfile() const = 0; - - //- Return the instantaneous mass flow rate profile - virtual scalar massFlowRate(const scalar time) const = 0; - - //- Return the pressure injection profile - virtual List<pair> injectionPressureProfile() const = 0; - - //- Return the instantaneous injection pressure - virtual scalar injectionPressure(const scalar time) const = 0; - - //- Return the velocity injection profile - virtual List<pair> velocityProfile() const = 0; - - //- Return the instantaneous velocity - virtual scalar velocity(const scalar time) const = 0; - - //- Return the discharge coefficient - virtual List<pair> CdProfile() const = 0; - - //- Return the instantaneous discharge coefficient - virtual scalar Cd(const scalar time) const = 0; - - //- Return the fuel mass fractions of the injected particle - virtual const scalarField& X() const = 0; - - //- Return the temperatue profile of the injected parcel - virtual List<pair> T() const = 0; - - //- Return the temperatue of the injected parcel - virtual scalar T(const scalar time) const = 0; - - //- Return the start-of-injection time - virtual scalar tsoi() const = 0; - - //- Return the end-of-injection time - virtual scalar teoi() const = 0; - - virtual scalar injectedMass(const scalar t) const = 0; - - virtual bool pressureIndependentVelocity() const = 0; - - //- Return a vector perpendicular to the injection direction and tan2 - // for hole n - virtual vector tan1(const label n) const = 0; - - //- Return a vector perpendicular to the injection direction and tan1 - // for hole n - virtual vector tan2(const label n) const = 0; - - scalar getTableValue - ( - const List<pair>& table, - const scalar value - ) const; - - scalar integrateTable - ( - const List<pair>& table, - const scalar value - ) const; - - scalar integrateTable - ( - const List<pair>& table - ) const; - - virtual void correctProfiles - ( - const liquidMixtureProperties& fuel, - const scalar referencePressure - ) = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.C b/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.C deleted file mode 100644 index d7255abd2a60440395561f06d3ab543abf6857be..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.C +++ /dev/null @@ -1,452 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "multiHoleInjector.H" -#include "addToRunTimeSelectionTable.H" -#include "unitConversion.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -namespace Foam -{ - defineTypeNameAndDebug(multiHoleInjector, 0); - - addToRunTimeSelectionTable - ( - injectorType, - multiHoleInjector, - dictionary - ); -} - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::multiHoleInjector::multiHoleInjector -( - const Foam::Time& t, - const Foam::dictionary& dict -) -: - injectorType(t, dict), - propsDict_(dict.subDict(typeName + "Props")), - centerPosition_(propsDict_.lookup("position")), - xyAngle_(readScalar(propsDict_.lookup("xyAngle"))), - zAngle_(readScalar(propsDict_.lookup("zAngle"))), - nHoles_(readLabel(propsDict_.lookup("nHoles"))), - umbrellaAngle_(readScalar(propsDict_.lookup("umbrellaAngle"))), - nozzleTipDiameter_(readScalar(propsDict_.lookup("nozzleTipDiameter"))), - angleSpacing_(propsDict_.lookup("angleSpacing")), - d_(readScalar(propsDict_.lookup("diameter"))), - Cd_(readScalar(propsDict_.lookup("Cd"))), - mass_(readScalar(propsDict_.lookup("mass"))), - nParcels_(readLabel(propsDict_.lookup("nParcels"))), - X_(propsDict_.lookup("X")), - massFlowRateProfile_(propsDict_.lookup("massFlowRateProfile")), - velocityProfile_(massFlowRateProfile_), - injectionPressureProfile_(massFlowRateProfile_), - CdProfile_(massFlowRateProfile_), - TProfile_(propsDict_.lookup("temperatureProfile")), - averageParcelMass_(nHoles_*mass_/nParcels_), - direction_(nHoles_), - position_(nHoles_), - pressureIndependentVelocity_(true), - tangentialInjectionVector1_(nHoles_), - tangentialInjectionVector2_(nHoles_) -{ - // check if time entries for soi and eoi match - if (mag(massFlowRateProfile_[0][0] - TProfile_[0][0]) > SMALL) - { - FatalErrorIn - ( - "multiHoleInjector::multiHoleInjector" - "(const time& t, const dictionary dict)" - ) << "Start-times do not match for TemperatureProfile and " - << "massFlowRateProfile." - << abort(FatalError); - } - - if - ( - mag(massFlowRateProfile_.last()[0] - TProfile_.last()[0]) - > SMALL - ) - { - FatalErrorIn - ( - "multiHoleInjector::multiHoleInjector" - "(const time& t, const dictionary dict)" - ) << "End-times do not match for TemperatureProfile and " - << "massFlowRateProfile." - << abort(FatalError); - } - - // convert CA to real time - forAll(massFlowRateProfile_, i) - { - massFlowRateProfile_[i][0] = - t.userTimeToTime(massFlowRateProfile_[i][0]); - velocityProfile_[i][0] = massFlowRateProfile_[i][0]; - injectionPressureProfile_[i][0] = massFlowRateProfile_[i][0]; - } - - forAll(TProfile_, i) - { - TProfile_[i][0] = t.userTimeToTime(TProfile_[i][0]); - } - - scalar integratedMFR = integrateTable(massFlowRateProfile_); - - forAll(massFlowRateProfile_, i) - { - // correct the massFlowRateProfile to match the injected mass - massFlowRateProfile_[i][1] *= mass_/integratedMFR; - - CdProfile_[i][0] = massFlowRateProfile_[i][0]; - CdProfile_[i][1] = Cd_; - } - - setTangentialVectors(); - - // check molar fractions - scalar Xsum = 0.0; - forAll(X_, i) - { - Xsum += X_[i]; - } - - if (mag(Xsum - 1.0) > SMALL) - { - WarningIn - ( - "multiHoleInjector::multiHoleInjector" - "(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::multiHoleInjector::~multiHoleInjector() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::multiHoleInjector::setTangentialVectors() -{ - scalar alpha = degToRad(xyAngle_); - scalar phi = degToRad(zAngle_); - - vector xp(cos(alpha), sin(alpha), 0.0); - vector zp(cos(alpha)*sin(phi), sin(alpha)*sin(phi), cos(phi)); - if (mag(zp-xp) < 1.0e-15) - { - xp = vector(0.0, 0.0, -1.0); - xp -= (xp & zp)*zp; - xp /= mag(xp); - } - vector yp = zp^xp; - -// Info<< "xp = " << xp << endl; -// Info<< "yp = " << yp << endl; -// Info<< "zp = " << zp << endl; - - scalar angle = 0.0; - scalar u = degToRad(umbrellaAngle_/2.0); - for (label i=0; i<nHoles_; i++) - { - angle += angleSpacing_[i]; - scalar v = degToRad(angle); - direction_[i] = cos(v)*sin(u)*xp + sin(v)*sin(u)*yp + cos(u)*zp; - vector dp = direction_[i] - (direction_[i] & zp)*direction_[i]; - if (mag(dp) > SMALL) - { - dp /= mag(dp); - } - position_[i] = centerPosition_ + 0.5*nozzleTipDiameter_*dp; - } - - cachedRandom rndGen(label(0), -1); - - for (label i=0; i<nHoles_; i++) - { - vector tangent(vector::zero); - scalar magV = 0; - while (magV < SMALL) - { - vector testThis = rndGen.sample01<vector>(); - - tangent = testThis - (testThis & direction_[i])*direction_[i]; - magV = mag(tangent); - } - - tangentialInjectionVector1_[i] = tangent/magV; - tangentialInjectionVector2_[i] = - direction_[i] ^ tangentialInjectionVector1_[i]; - } -} - - -Foam::label Foam::multiHoleInjector::nParcelsToInject -( - const scalar time0, - const scalar time1 -) const -{ - scalar mInj = - mass_*(fractionOfInjection(time1) - fractionOfInjection(time0)); - label nParcels = label(mInj/averageParcelMass_ + 0.49); - - return nParcels; -} - - -const Foam::vector Foam::multiHoleInjector::position(const label n) const -{ - return position_[n]; -} - - -Foam::vector Foam::multiHoleInjector::position -( - const label n, - const scalar time, - const bool twoD, - const scalar angleOfWedge, - const vector& axisOfSymmetry, - const vector& axisOfWedge, - const vector& axisOfWedgeNormal, - cachedRandom& rndGen -) const -{ - if (twoD) - { - scalar is = position_[n] & axisOfSymmetry; - scalar magInj = mag(position_[n] - is*axisOfSymmetry); - - vector halfWedge = - axisOfWedge*cos(0.5*angleOfWedge) - + axisOfWedgeNormal*sin(0.5*angleOfWedge); - halfWedge /= mag(halfWedge); - - return (is*axisOfSymmetry + magInj*halfWedge); - } - else - { - // otherwise, disc injection - scalar iRadius = d_*rndGen.sample01<scalar>(); - scalar iAngle = constant::mathematical::twoPi*rndGen.sample01<scalar>(); - - return - ( - position_[n] - + iRadius - * ( - tangentialInjectionVector1_[n]*cos(iAngle) - + tangentialInjectionVector2_[n]*sin(iAngle) - ) - ); - } - return position_[0]; -} - - -Foam::label Foam::multiHoleInjector::nHoles() const -{ - return nHoles_; -} - - -Foam::scalar Foam::multiHoleInjector::d() const -{ - return d_; -} - - -const Foam::vector& Foam::multiHoleInjector::direction -( - const label i, - const scalar time -) const -{ - return direction_[i]; -} - - -Foam::scalar Foam::multiHoleInjector::mass -( - const scalar time0, - const scalar time1, - const bool twoD, - const scalar angleOfWedge -) const -{ - scalar mInj = - mass_*(fractionOfInjection(time1) - fractionOfInjection(time0)); - - // correct mass if calculation is 2D - if (twoD) - { - mInj *= 0.5*angleOfWedge/constant::mathematical::pi; - } - - return mInj; -} - - -Foam::scalar Foam::multiHoleInjector::mass() const -{ - return mass_; -} - - -const Foam::scalarField& Foam::multiHoleInjector::X() const -{ - return X_; -} - - -Foam::List<Foam::multiHoleInjector::pair> Foam::multiHoleInjector::T() const -{ - return TProfile_; -} - - -Foam::scalar Foam::multiHoleInjector::T(const scalar time) const -{ - return getTableValue(TProfile_, time); -} - - -Foam::scalar Foam::multiHoleInjector::tsoi() const -{ - return massFlowRateProfile_.first()[0]; -} - - -Foam::scalar Foam::multiHoleInjector::teoi() const -{ - return massFlowRateProfile_.last()[0]; -} - - -Foam::scalar Foam::multiHoleInjector::massFlowRate -( - const scalar time -) const -{ - return getTableValue(massFlowRateProfile_, time); -} - - -Foam::scalar Foam::multiHoleInjector::injectionPressure -( - const scalar time -) const -{ - return getTableValue(injectionPressureProfile_, time); -} - - -Foam::scalar Foam::multiHoleInjector::velocity -( - const scalar time -) const -{ - return getTableValue(velocityProfile_, time); -} - - -Foam::List<Foam::multiHoleInjector::pair> Foam::multiHoleInjector::CdProfile() -const -{ - return CdProfile_; -} - - -Foam::scalar Foam::multiHoleInjector::Cd -( - const scalar time -) const -{ - return Cd_; -} - - -Foam::scalar Foam::multiHoleInjector::fractionOfInjection -( - const scalar time -) const -{ - return integrateTable(massFlowRateProfile_, time)/mass_; -} - - -Foam::scalar Foam::multiHoleInjector::injectedMass -( - const scalar t -) const -{ - return mass_*fractionOfInjection(t); -} - - -void Foam::multiHoleInjector::correctProfiles -( - const liquidMixtureProperties& fuel, - const scalar referencePressure -) -{ - scalar A = nHoles_*0.25*constant::mathematical::pi*sqr(d_); - - forAll(velocityProfile_, i) - { - scalar time = velocityProfile_[i][0]; - scalar rho = fuel.rho(referencePressure, T(time), X_); - scalar v = massFlowRateProfile_[i][1]/(Cd_*rho*A); - velocityProfile_[i][1] = v; - injectionPressureProfile_[i][1] = referencePressure + 0.5*rho*v*v; - } -} - - -Foam::vector Foam::multiHoleInjector::tan1(const label n) const -{ - return tangentialInjectionVector1_[n]; -} - - -Foam::vector Foam::multiHoleInjector::tan2(const label n) const -{ - return tangentialInjectionVector2_[n]; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.H b/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.H deleted file mode 100644 index 14c899d1990ba77949a75a702c72f1a329291ba9..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/multiHoleInjector/multiHoleInjector.H +++ /dev/null @@ -1,245 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::multiHoleInjector - -Description - The unit injector - -SourceFiles - multiHoleInjectorI.H - multiHoleInjector.C - multiHoleInjectorIO.C - -\*---------------------------------------------------------------------------*/ - -#ifndef multiHoleInjector_H -#define multiHoleInjector_H - -#include "injectorType.H" -#include "vector.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class multiHoleInjector Declaration -\*---------------------------------------------------------------------------*/ - -class multiHoleInjector -: - public injectorType -{ - -private: - - typedef VectorSpace<Vector<scalar>, scalar, 2> pair; - - // Private data - - dictionary propsDict_; - - vector centerPosition_; - scalar xyAngle_; - scalar zAngle_; - label nHoles_; - scalar umbrellaAngle_; - scalar nozzleTipDiameter_; - List<scalar> angleSpacing_; - scalar d_; - scalar Cd_; - scalar mass_; - label nParcels_; - scalarField X_; - List<pair> massFlowRateProfile_; - List<pair> velocityProfile_; - List<pair> injectionPressureProfile_; - List<pair> CdProfile_; - List<pair> TProfile_; - scalar averageParcelMass_; - List<vector> direction_; - List<vector> position_; - - bool pressureIndependentVelocity_; - - //- two orthogonal vectors that are also orthogonal - // to the injection direction - List<vector> tangentialInjectionVector1_, tangentialInjectionVector2_; - - - // Private Member Functions - - //- Disallow default bitwise copy construct - multiHoleInjector(const multiHoleInjector&); - - //- Disallow default bitwise assignment - void operator=(const multiHoleInjector&); - - //- Create two vectors orthonoal to each other - // and the injection vector - void setTangentialVectors(); - - //- Return the fraction of the total injected liquid - scalar fractionOfInjection(const scalar time) const; - - -public: - - //- Runtime type information - TypeName("multiHoleInjector"); - - - // Constructors - - //- Construct from components - multiHoleInjector - ( - const Time& t, - const dictionary& dict - ); - - - //- Destructor - virtual ~multiHoleInjector(); - - - // Member Functions - - //- Return number of particles to inject - label nParcelsToInject - ( - const scalar t0, - const scalar t1 - ) const; - - //- Return the injection position - const vector position(const label n) const; - - //- Return the injection position - vector position - ( - const label n, - const scalar time, - const bool twoD, - const scalar angleOfWedge, - const vector& axisOfSymmetry, - const vector& axisOfWedge, - const vector& axisOfWedgeNormal, - cachedRandom& rndGen - ) const; - - //- Return the number of holes - label nHoles() const; - - //- Return the injector diameter - scalar d() const; - - //- Return the injection direction - const vector& direction - ( - const label i, - const scalar time - ) const; - - //- Return the mass of the injected particle - scalar mass - ( - const scalar t0, - const scalar t1, - const bool twoD, - const scalar angleOfWedge - ) const; - - //- Return the mass injected by the injector - scalar mass() const; - - //- Return the fuel mass fractions of the injected particle - const scalarField& X() const; - - //- Return the temperature profile of the injected particle - List<pair> T() const; - - //- Return the temperature of the injected particle - scalar T(const scalar time) const; - - //- Return the start-of-injection time - scalar tsoi() const; - - //- Return the end-of-injection time - scalar teoi() const; - - //- Return the injected liquid mass - scalar injectedMass(const scalar t) const; - - List<pair> massFlowRateProfile() const - { - return massFlowRateProfile_; - } - - scalar massFlowRate(const scalar time) const; - - List<pair> injectionPressureProfile() const - { - return injectionPressureProfile_; - } - - scalar injectionPressure(const scalar time) const; - - List<pair> velocityProfile() const - { - return velocityProfile_; - } - - scalar velocity(const scalar time) const; - - List<pair> CdProfile() const; - scalar Cd(const scalar time) const; - - vector tan1(const label n) const; - vector tan2(const label n) const; - - void correctProfiles - ( - const liquidMixtureProperties& fuel, - const scalar referencePressure - ); - - bool pressureIndependentVelocity() const - { - return pressureIndependentVelocity_; - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C deleted file mode 100644 index 7609535dc2778a1b89c23ca0d42bec03ca0d4b9b..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.C +++ /dev/null @@ -1,447 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "swirlInjector.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(swirlInjector, 0); - - addToRunTimeSelectionTable - ( - injectorType, - swirlInjector, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::swirlInjector::swirlInjector -( - const Foam::Time& t, - const Foam::dictionary& dict -) -: - injectorType(t, dict), - propsDict_(dict.subDict(typeName + "Props")), - position_(propsDict_.lookup("position")), - direction_(propsDict_.lookup("direction")), - d_(readScalar(propsDict_.lookup("diameter"))), - mass_(readScalar(propsDict_.lookup("mass"))), - injectionPressure_(readScalar(propsDict_.lookup("injectionPressure"))), - T_(readScalar(propsDict_.lookup("temperature"))), - nParcels_(readLabel(propsDict_.lookup("nParcels"))), - X_(propsDict_.lookup("X")), - massFlowRateProfile_(propsDict_.lookup("massFlowRateProfile")), - injectionPressureProfile_(propsDict_.lookup("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]); - } - forAll(injectionPressureProfile_, i) - { - injectionPressureProfile_[i][0] = - t.userTimeToTime(injectionPressureProfile_[i][0]); - } - - // check if time entries match - if - ( - mag(massFlowRateProfile_[0][0] - injectionPressureProfile_[0][0]) - > SMALL - ) - { - 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_.last()[0] - - injectionPressureProfile_.last()[0] - ) > SMALL - ) - { - 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()); - - forAll(massFlowRateProfile_, i) - { - // correct the massFlowRateProfile to match the injected mass - massFlowRateProfile_[i][1] *= mass_/integratedMFR; - - velocityProfile_[i][0] = massFlowRateProfile_[i][0]; - - TProfile_[i][0] = massFlowRateProfile_[i][0]; - TProfile_[i][1] = T_; - - CdProfile_[i][0] = massFlowRateProfile_[i][0]; - - } - - forAll(injectionPressureProfile_, i) - { - // correct the pressureProfile to match the injection pressure - injectionPressureProfile_[i][1] *= - injectionPressure_/integratedPressure; - } - - // Normalize the direction vector - direction_ /= mag(direction_); - - setTangentialVectors(); - - // check molar fractions - scalar Xsum = 0.0; - forAll(X_, i) - { - Xsum += X_[i]; - } - - if (mag(Xsum - 1.0) > SMALL) - { - 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() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::swirlInjector::setTangentialVectors() -{ - cachedRandom rndGen(label(0), -1); - scalar magV = 0.0; - vector tangent; - - while (magV < SMALL) - { - vector testThis = rndGen.sample01<vector>(); - - tangent = testThis - (testThis & direction_)*direction_; - magV = mag(tangent); - } - - tangentialInjectionVector1_ = tangent/magV; - tangentialInjectionVector2_ = direction_^tangentialInjectionVector1_; -} - - -Foam::label Foam::swirlInjector::nParcelsToInject -( - const scalar time0, - const scalar time1 -) const -{ - - scalar mInj = - mass_*(fractionOfInjection(time1) - fractionOfInjection(time0)); - label nParcels = label(mInj/averageParcelMass_ + 0.49); - - return nParcels; -} - - -const Foam::vector Foam::swirlInjector::position(const label n) const -{ - return position_; -} - - -Foam::vector Foam::swirlInjector::position -( - const label n, - const scalar time, - const bool twoD, - const scalar angleOfWedge, - const vector& axisOfSymmetry, - const vector& axisOfWedge, - const vector& axisOfWedgeNormal, - cachedRandom& rndGen -) const -{ - if (twoD) - { - scalar is = position_ & axisOfSymmetry; - scalar magInj = mag(position_ - is*axisOfSymmetry); - - vector halfWedge = - axisOfWedge*cos(0.5*angleOfWedge) - + axisOfWedgeNormal*sin(0.5*angleOfWedge); - halfWedge /= mag(halfWedge); - - return (is*axisOfSymmetry + magInj*halfWedge); - } - else - { - // otherwise, disc injection - scalar iRadius = d_*rndGen.sample01<scalar>(); - scalar iAngle = constant::mathematical::twoPi*rndGen.sample01<scalar>(); - - return - ( - position_ - + iRadius - * ( - tangentialInjectionVector1_*cos(iAngle) - + tangentialInjectionVector2_*sin(iAngle) - ) - ); - - } - - return position_; -} - - -Foam::label Foam::swirlInjector::nHoles() const -{ - return 1; -} - - -Foam::scalar Foam::swirlInjector::d() const -{ - return d_; -} - - -const Foam::vector& Foam::swirlInjector::direction -( - const label i, - const scalar time -) const -{ - return direction_; -} - - -Foam::scalar Foam::swirlInjector::mass -( - const scalar time0, - const scalar time1, - const bool twoD, - const scalar angleOfWedge -) const -{ - scalar mInj = - mass_*(fractionOfInjection(time1) - fractionOfInjection(time0)); - - // correct mass if calculation is 2D - if (twoD) - { - mInj *= 0.5*angleOfWedge/constant::mathematical::pi; - } - - return mInj; -} - - -Foam::scalar Foam::swirlInjector::mass() const -{ - return mass_; -} - - -Foam::List<Foam::swirlInjector::pair> -Foam::swirlInjector::massFlowRateProfile() const -{ - return massFlowRateProfile_; -} - - -Foam::scalar Foam::swirlInjector::massFlowRate(const scalar time) const -{ - return getTableValue(massFlowRateProfile_, time); -} - - -Foam::List<Foam::swirlInjector::pair> -Foam::swirlInjector::injectionPressureProfile() const -{ - return injectionPressureProfile_; -} - - -Foam::scalar Foam::swirlInjector::injectionPressure(const scalar time) const -{ - return getTableValue(injectionPressureProfile_, time); -} - - -Foam::List<Foam::swirlInjector::pair> -Foam::swirlInjector::velocityProfile() const -{ - return velocityProfile_; -} - - -Foam::scalar Foam::swirlInjector::velocity(const scalar time) const -{ - return getTableValue(velocityProfile_, time); -} - - -Foam::List<Foam::swirlInjector::pair> Foam::swirlInjector::CdProfile() const -{ - return CdProfile_; -} - - -Foam::scalar Foam::swirlInjector::Cd(const scalar time) const -{ - return getTableValue(CdProfile_, time); -} - - -const Foam::scalarField& Foam::swirlInjector::X() const -{ - return X_; -} - - -Foam::List<Foam::swirlInjector::pair> Foam::swirlInjector::T() const -{ - return TProfile_; -} - - -Foam::scalar Foam::swirlInjector::T(const scalar time) const -{ - return T_; -} - - -Foam::scalar Foam::swirlInjector::tsoi() const -{ - return massFlowRateProfile_.first()[0]; -} - - -Foam::scalar Foam::swirlInjector::teoi() const -{ - return massFlowRateProfile_.last()[0]; -} - - -Foam::scalar Foam::swirlInjector::fractionOfInjection(const scalar time) const -{ - return integrateTable(massFlowRateProfile_, time)/mass_; -} - - -Foam::scalar Foam::swirlInjector::injectedMass -( - const scalar t -) const -{ - return mass_*fractionOfInjection(t); -} - - -void Foam::swirlInjector::correctProfiles -( - const liquidMixtureProperties& fuel, - const scalar referencePressure -) -{ - scalar A = 0.25*constant::mathematical::pi*sqr(d_); - scalar pDummy = 1.0e+5; - scalar rho = fuel.rho(pDummy, T_, X_); - - forAll(velocityProfile_, i) - { - 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; - CdProfile_[i][1] = mfr/v; - } -} - - -Foam::vector Foam::swirlInjector::tan1(const label n) const -{ - return tangentialInjectionVector1_; -} - - -Foam::vector Foam::swirlInjector::tan2(const label n) const -{ - return tangentialInjectionVector2_; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.H b/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.H deleted file mode 100644 index 0de4ee1f7f9fea4259ebe2d26fef214cdc65956d..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/swirlInjector/swirlInjector.H +++ /dev/null @@ -1,254 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::swirlInjector - -Description - The swirl injector - -SourceFiles - swirlInjectorI.H - swirlInjector.C - swirlInjectorIO.C - -\*---------------------------------------------------------------------------*/ - -#ifndef swirlInjector_H -#define swirlInjector_H - -#include "injectorType.H" -#include "vector.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class swirlInjector Declaration -\*---------------------------------------------------------------------------*/ - -class swirlInjector -: - public injectorType -{ - -private: - - // Private data - - typedef VectorSpace<Vector<scalar>, scalar, 2> pair; - - dictionary propsDict_; - - vector position_; - vector direction_; - scalar d_; - scalar mass_; - scalar injectionPressure_; - scalar T_; - label nParcels_; - scalarField X_; - List<pair> massFlowRateProfile_; - List<pair> injectionPressureProfile_; - List<pair> velocityProfile_; - List<pair> CdProfile_; - List<pair> TProfile_; - scalar averageParcelMass_; - - bool pressureIndependentVelocity_; - - //- two orthogonal vectors that are also orthogonal - // to the injection direction - vector tangentialInjectionVector1_, tangentialInjectionVector2_; - - - // Private Member Functions - - //- Disallow default bitwise copy construct - swirlInjector(const swirlInjector&); - - //- Disallow default bitwise assignment - void operator=(const swirlInjector&); - - //- Integrate the mass-flow profile and set - // the integral value - void setIntegralProfileValue(); - - //- Create two vectors orthonoal to each other - // and the injection vector - void setTangentialVectors(); - - //- Return the fraction of the total injected liquid - scalar fractionOfInjection(const scalar time) const; - - - // //- Return the average injection velocity - // scalar averageInjectionVelocityTime - // ( - // const scalar liquidDensity - // ) const; - - // //- Return the instantaneous injection velocity - // scalar injectionVelocity - // ( - // const scalar, - // const scalar liquidDensity - // ) const; - - - -public: - - //- Runtime type information - TypeName("swirlInjector"); - - - // Constructors - - //- Construct from components - swirlInjector(const Time& t, const dictionary& dict); - - - //- Destructor - virtual ~swirlInjector(); - - - // Member Functions - - //- Return number of particles to inject - label nParcelsToInject - ( - const scalar t0, - const scalar t1 - ) const; - - //- Return the injection position - const vector position(const label n) const; - - //- Return the injection position - vector position - ( - const label n, - const scalar time, - const bool twoD, - const scalar angleOfWedge, - const vector& axisOfSymmetry, - const vector& axisOfWedge, - const vector& axisOfWedgeNormal, - cachedRandom& rndGen - ) const; - - //- Return the number of holes - label nHoles() const; - - //- Return the injector diameter - scalar d() const; - - //- Return the injection direction - const vector& direction - ( - const label i, - const scalar time - ) const; - - //- Return the mass of the injected particle - scalar mass - ( - const scalar t0, - const scalar t1, - const bool twoD, - const scalar angleOfWedge - ) const; - - //- Return the mass injected by the injector - scalar mass() const; - - //- Return the mass flow rate profile - List<pair> massFlowRateProfile() const; - - //- Return the instantaneous mass flow rate profile - scalar massFlowRate(const scalar time) const; - - //- Return the pressure injection profile - List<pair> injectionPressureProfile() const; - - //- Return the instantaneous injection pressure - scalar injectionPressure(const scalar time) const; - - //- Return the velocity injection profile - List<pair> velocityProfile() const; - - //- Return the instantaneous velocity - scalar velocity(const scalar time) const; - - //- Return the discharge coefficient - List<pair> CdProfile() const; - - //- Return the instantaneous discharge coefficient - scalar Cd(const scalar time) const; - - //- Return the fuel mass fractions of the injected particle - const scalarField& X() const; - - //- Return the temperatue profile of the injected parcel - List<pair> T() const; - - //- Return the temperatue of the injected parcel - scalar T(const scalar time) const; - - //- Return the start-of-injection time - scalar tsoi() const; - - //- Return the end-of-injection time - scalar teoi() const; - - //- Return the injected liquid mass - scalar injectedMass(const scalar t) const; - - vector tan1(const label n) const; - vector tan2(const label n) const; - - void correctProfiles - ( - const liquidMixtureProperties& fuel, - const scalar referencePressure - ); - - bool pressureIndependentVelocity() const - { - return pressureIndependentVelocity_; - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.C b/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.C deleted file mode 100644 index b9426fc53daa3654f95c937615d3243e6d36528e..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.C +++ /dev/null @@ -1,390 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "unitInjector.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(unitInjector, 0); - - addToRunTimeSelectionTable - ( - injectorType, - unitInjector, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::unitInjector::unitInjector -( - const Foam::Time& t, - const Foam::dictionary& dict -) -: - injectorType(t, dict), - propsDict_(dict.subDict(typeName + "Props")), - position_(propsDict_.lookup("position")), - direction_(propsDict_.lookup("direction")), - d_(readScalar(propsDict_.lookup("diameter"))), - Cd_(readScalar(propsDict_.lookup("Cd"))), - mass_(readScalar(propsDict_.lookup("mass"))), - nParcels_(readLabel(propsDict_.lookup("nParcels"))), - X_(propsDict_.lookup("X")), - massFlowRateProfile_(propsDict_.lookup("massFlowRateProfile")), - velocityProfile_(massFlowRateProfile_), - injectionPressureProfile_(massFlowRateProfile_), - CdProfile_(massFlowRateProfile_), - TProfile_(propsDict_.lookup("temperatureProfile")), - averageParcelMass_(mass_/nParcels_), - pressureIndependentVelocity_(true) -{ - - // check if time entries for soi and eoi match - if (mag(massFlowRateProfile_[0][0]-TProfile_[0][0]) > SMALL) - { - FatalErrorIn - ( - "unitInjector::unitInjector(const time& t, const dictionary dict)" - ) << "start-times do not match for TemperatureProfile and " - << " massFlowRateProfile." << nl << exit (FatalError); - } - - if - ( - mag(massFlowRateProfile_.last()[0] - - TProfile_.last()[0]) - > SMALL - ) - { - FatalErrorIn - ( - "unitInjector::unitInjector(const time& t, const dictionary dict)" - ) << "end-times do not match for TemperatureProfile and " - << "massFlowRateProfile." << nl << exit(FatalError); - } - - // convert CA to real time - forAll(massFlowRateProfile_, i) - { - massFlowRateProfile_[i][0] = - t.userTimeToTime(massFlowRateProfile_[i][0]); - velocityProfile_[i][0] = massFlowRateProfile_[i][0]; - injectionPressureProfile_[i][0] = massFlowRateProfile_[i][0]; - } - - forAll(TProfile_, i) - { - TProfile_[i][0] = t.userTimeToTime(TProfile_[i][0]); - } - - scalar integratedMFR = integrateTable(massFlowRateProfile_); - - forAll(massFlowRateProfile_, i) - { - // correct the massFlowRateProfile to match the injected mass - massFlowRateProfile_[i][1] *= mass_/integratedMFR; - - CdProfile_[i][0] = massFlowRateProfile_[i][0]; - CdProfile_[i][1] = Cd_; - } - - // Normalize the direction vector - direction_ /= mag(direction_); - - setTangentialVectors(); - - // check molar fractions - scalar Xsum = 0.0; - forAll(X_, i) - { - Xsum += X_[i]; - } - - if (mag(Xsum - 1.0) > SMALL) - { - WarningIn("unitInjector::unitInjector(const time& t, Istream& is)") - << "X does not sum to 1.0, correcting molar fractions." - << nl << endl; - forAll(X_, i) - { - X_[i] /= Xsum; - } - } - -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::unitInjector::~unitInjector() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::unitInjector::setTangentialVectors() -{ - cachedRandom rndGen(label(0), -1); - scalar magV = 0.0; - vector tangent; - - while (magV < SMALL) - { - vector testThis = rndGen.sample01<vector>(); - - tangent = testThis - (testThis & direction_)*direction_; - magV = mag(tangent); - } - - tangentialInjectionVector1_ = tangent/magV; - tangentialInjectionVector2_ = direction_ ^ tangentialInjectionVector1_; -} - - -Foam::label Foam::unitInjector::nParcelsToInject -( - const scalar time0, - const scalar time1 -) const -{ - scalar mInj = - mass_*(fractionOfInjection(time1) - fractionOfInjection(time0)); - label nParcels = label(mInj/averageParcelMass_ + 0.49); - return nParcels; -} - - -const Foam::vector Foam::unitInjector::position(const label n) const -{ - return position_; -} - - -Foam::vector Foam::unitInjector::position -( - const label n, - const scalar time, - const bool twoD, - const scalar angleOfWedge, - const vector& axisOfSymmetry, - const vector& axisOfWedge, - const vector& axisOfWedgeNormal, - cachedRandom& rndGen -) const -{ - if (twoD) - { - scalar is = position_ & axisOfSymmetry; - scalar magInj = mag(position_ - is*axisOfSymmetry); - - vector halfWedge = - axisOfWedge*cos(0.5*angleOfWedge) - + axisOfWedgeNormal*sin(0.5*angleOfWedge); - halfWedge /= mag(halfWedge); - - return (is*axisOfSymmetry + magInj*halfWedge); - } - else - { - // otherwise, disc injection - scalar iRadius = d_*rndGen.sample01<scalar>(); - scalar iAngle = constant::mathematical::twoPi*rndGen.sample01<scalar>(); - - return - ( - position_ - + iRadius - * ( - tangentialInjectionVector1_*cos(iAngle) - + tangentialInjectionVector2_*sin(iAngle) - ) - ); - } - - return position_; -} - - -Foam::label Foam::unitInjector::nHoles() const -{ - return 1; -} - - -Foam::scalar Foam::unitInjector::d() const -{ - return d_; -} - - -const Foam::vector& Foam::unitInjector::direction -( - const label i, - const scalar time -) const -{ - return direction_; -} - - -Foam::scalar Foam::unitInjector::mass -( - const scalar time0, - const scalar time1, - const bool twoD, - const scalar angleOfWedge -) const -{ - scalar mInj = - mass_*(fractionOfInjection(time1) - fractionOfInjection(time0)); - - // correct mass if calculation is 2D - if (twoD) - { - mInj *= 0.5*angleOfWedge/constant::mathematical::pi; - } - - return mInj; -} - - -Foam::scalar Foam::unitInjector::mass() const -{ - return mass_; -} - - -const Foam::scalarField& Foam::unitInjector::X() const -{ - return X_; -} - - -Foam::List<Foam::unitInjector::pair> Foam::unitInjector::T() const -{ - return TProfile_; -} - - -Foam::scalar Foam::unitInjector::T(const scalar time) const -{ - return getTableValue(TProfile_, time); -} - - -Foam::scalar Foam::unitInjector::tsoi() const -{ - return massFlowRateProfile_.first()[0]; -} - - -Foam::scalar Foam::unitInjector::teoi() const -{ - return massFlowRateProfile_.last()[0]; -} - - -Foam::scalar Foam::unitInjector::massFlowRate(const scalar time) const -{ - return getTableValue(massFlowRateProfile_, time); -} - - -Foam::scalar Foam::unitInjector::injectionPressure(const scalar time) const -{ - return getTableValue(injectionPressureProfile_, time); -} - - -Foam::scalar Foam::unitInjector::velocity(const scalar time) const -{ - return getTableValue(velocityProfile_, time); -} - - -Foam::List<Foam::unitInjector::pair> Foam::unitInjector::CdProfile() const -{ - return CdProfile_; -} - - -Foam::scalar Foam::unitInjector::Cd(const scalar time) const -{ - return Cd_; -} - - -Foam::scalar Foam::unitInjector::fractionOfInjection(const scalar time) const -{ - return integrateTable(massFlowRateProfile_, time)/mass_; -} - - -Foam::scalar Foam::unitInjector::injectedMass(const scalar t) const -{ - return mass_*fractionOfInjection(t); -} - - -void Foam::unitInjector::correctProfiles -( - const liquidMixtureProperties& fuel, - const scalar referencePressure -) -{ - scalar A = 0.25*constant::mathematical::pi*sqr(d_); - scalar pDummy = 1.0e+5; - - forAll(velocityProfile_, i) - { - scalar time = velocityProfile_[i][0]; - scalar rho = fuel.rho(pDummy, T(time), X_); - scalar v = massFlowRateProfile_[i][1]/(Cd_*rho*A); - velocityProfile_[i][1] = v; - injectionPressureProfile_[i][1] = referencePressure + 0.5*rho*v*v; - } -} - - -Foam::vector Foam::unitInjector::tan1(const label) const -{ - return tangentialInjectionVector1_; -} - - -Foam::vector Foam::unitInjector::tan2(const label) const -{ - return tangentialInjectionVector2_; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.H b/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.H deleted file mode 100644 index 56092850b9db94598780c5757cfd19117266d1d7..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/injector/unitInjector/unitInjector.H +++ /dev/null @@ -1,234 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::unitInjector - -Description - The unit injector - -SourceFiles - unitInjectorI.H - unitInjector.C - unitInjectorIO.C - -\*---------------------------------------------------------------------------*/ - -#ifndef unitInjector_H -#define unitInjector_H - -#include "injectorType.H" -#include "vector.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class unitInjector Declaration -\*---------------------------------------------------------------------------*/ - -class unitInjector -: - public injectorType -{ - -private: - - typedef VectorSpace<Vector<scalar>, scalar, 2> pair; - - // Private data - - dictionary propsDict_; - - vector position_; - vector direction_; - scalar d_; - scalar Cd_; - scalar mass_; - label nParcels_; - scalarField X_; - List<pair> massFlowRateProfile_; - List<pair> velocityProfile_; - List<pair> injectionPressureProfile_; - List<pair> CdProfile_; - List<pair> TProfile_; - scalar averageParcelMass_; - - bool pressureIndependentVelocity_; - - //- two orthogonal vectors that are also orthogonal - // to the injection direction - vector tangentialInjectionVector1_, tangentialInjectionVector2_; - - - // Private Member Functions - - //- Disallow default bitwise copy construct - unitInjector(const unitInjector&); - - //- Disallow default bitwise assignment - void operator=(const unitInjector&); - - //- Create two vectors orthonoal to each other - // and the injection vector - void setTangentialVectors(); - - //- Return the fraction of the total injected liquid - scalar fractionOfInjection(const scalar time) const; - - -public: - - //- Runtime type information - TypeName("unitInjector"); - - - // Constructors - - //- Construct from components - unitInjector(const Time& t, const dictionary& dict); - - - //- Destructor - virtual ~unitInjector(); - - - // Member Functions - - //- Return number of particles to inject - label nParcelsToInject - ( - const scalar t0, - const scalar t1 - ) const; - - //- Return the injection position - const vector position(const label n) const; - - //- Return the injection position - vector position - ( - const label n, - const scalar time, - const bool twoD, - const scalar angleOfWedge, - const vector& axisOfSymmetry, - const vector& axisOfWedge, - const vector& axisOfWedgeNormal, - cachedRandom& rndGen - ) const; - - //- Return the number of holes - label nHoles() const; - - //- Return the injector diameter - scalar d() const; - - //- Return the injection direction - const vector& direction - ( - const label i, - const scalar time - ) const; - - //- Return the mass of the injected particle - scalar mass - ( - const scalar t0, - const scalar t1, - const bool twoD, - const scalar angleOfWedge - ) const; - - //- Return the mass injected by the injector - scalar mass() const; - - //- Return the fuel mass fractions of the injected particle - const scalarField& X() const; - - //- Return the temperature profile of the injected particle - List<pair> T() const; - - //- Return the temperature of the injected particle - scalar T(const scalar time) const; - - //- Return the start-of-injection time - scalar tsoi() const; - - //- Return the end-of-injection time - scalar teoi() const; - - //- Return the injected liquid mass - scalar injectedMass(const scalar t) const; - - List<pair> massFlowRateProfile() const - { - return massFlowRateProfile_; - } - - scalar massFlowRate(const scalar time) const; - - List<pair> injectionPressureProfile() const - { - return injectionPressureProfile_; - } - - scalar injectionPressure(const scalar time) const; - - List<pair> velocityProfile() const - { - return velocityProfile_; - } - - scalar velocity(const scalar time) const; - - List<pair> CdProfile() const; - scalar Cd(const scalar time) const; - - vector tan1(const label n) const; - vector tan2(const label n) const; - - void correctProfiles - ( - const liquidMixtureProperties& fuel, - const scalar referencePressure - ); - - bool pressureIndependentVelocity() const - { - return pressureIndependentVelocity_; - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/parcel/boundaryTreatment.H b/src/lagrangian/dieselSpray/parcel/boundaryTreatment.H deleted file mode 100644 index e4031d29c246d12fce6c1d8dc5eb02e7848fc03e..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/parcel/boundaryTreatment.H +++ /dev/null @@ -1,54 +0,0 @@ -if (isA<wallPolyPatch>(pbMesh[patch(face())])) -{ - td.keepParticle = sDB.wall().wallTreatment(*this, face()); - - if (sDB.twoD()) - { - scalar vs = U() & sDB.axisOfSymmetry(); - vector Us = U() - (vs * sDB.axisOfSymmetry()); - scalar magUs = mag(Us); - scalar v1 = Us & n(); - scalar magV1 = mag(v1); - U() = (magUs/magV1)*v1*n() + vs*sDB.axisOfSymmetry(); - } -} -else if (isA<wedgePolyPatch>(pbMesh[patch(face())])) -{ - // check if parcel is trying to move out of the domain - - vector nf = normal(); - - scalar Un = U() & nf; - - if (Un > 0) - { - scalar Un2 = U() & n(); - U() -= 2.0*Un2*n(); - } -} -else if (isA<symmetryPolyPatch>(pbMesh[patch(face())])) -{ - // check if parcel is trying to move out of the domain - - vector nf = normal(); - - scalar Un = U() & nf; - - if (Un > 0) - { - if (sDB.twoD()) - { - U() -= 2.0*(U() & n())*n(); - } - else - { - nf /= mag(nf); - U() -= 2.0*(U() & nf)*nf; - } - } -} -else if (isType<polyPatch>(pbMesh[patch(face())])) -{ - // Parcel has hit an inlet or outlet or some such so throw it away - td.keepParticle = false; -} diff --git a/src/lagrangian/dieselSpray/parcel/parcel.C b/src/lagrangian/dieselSpray/parcel/parcel.C deleted file mode 100644 index 55ec31ce118f8ec2a7b5a437fcffae14c2280441..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/parcel/parcel.C +++ /dev/null @@ -1,685 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "parcel.H" - -#include "spray.H" -#include "dragModel.H" -#include "evaporationModel.H" -#include "heatTransferModel.H" -#include "wallModel.H" -#include "wallPolyPatch.H" -#include "wedgePolyPatch.H" -#include "processorPolyPatch.H" -#include "basicMultiComponentMixture.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::parcel::parcel -( - const polyMesh& mesh, - const vector& position, - const label cellI, - const label tetFaceI, - const label tetPtI, - const vector& n, - const scalar d, - const scalar T, - const scalar m, - const scalar y, - const scalar yDot, - const scalar ct, - const scalar ms, - const scalar tTurb, - const scalar liquidCore, - const scalar injector, - const vector& U, - const vector& Uturb, - const scalarField& X, - const List<word>& liquidNames -) -: - particle(mesh, position, cellI, tetFaceI, tetPtI), - liquidComponents_(liquidNames), - d_(d), - T_(T), - m_(m), - y_(y), - yDot_(yDot), - ct_(ct), - ms_(ms), - tTurb_(tTurb), - liquidCore_(liquidCore), - injector_(injector), - U_(U), - Uturb_(Uturb), - n_(n), - X_(X), - tMom_(GREAT) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::parcel::move(trackingData& td, const scalar trackTime) -{ - td.switchProcessor = false; - td.keepParticle = true; - - const polyBoundaryMesh& pbMesh = mesh_.boundaryMesh(); - - spray& sDB = td.cloud(); - const liquidMixtureProperties& fuels = sDB.fuels(); - - label Nf = fuels.components().size(); - label Ns = sDB.composition().Y().size(); - - tetIndices tetIs = this->currentTetIndices(); - - // Calculate the interpolated gas properties at the position of the parcel - vector Up = sDB.UInterpolator().interpolate(position(), tetIs) + Uturb(); - scalar rhog = sDB.rhoInterpolator().interpolate(position(), tetIs); - scalar pg = sDB.pInterpolator().interpolate(position(), tetIs); - scalar Tg = sDB.TInterpolator().interpolate(position(), tetIs); - - scalarField Yfg(Nf, 0.0); - - scalar cpMixture = 0.0; - for (label i=0; i<Ns; i++) - { - const volScalarField& Yi = sDB.composition().Y()[i]; - if (sDB.isLiquidFuel()[i]) - { - label j = sDB.gasToLiquidIndex()[i]; - scalar YicellI = Yi[cell()]; - Yfg[j] = YicellI; - } - cpMixture += Yi[cell()]*sDB.gasProperties()[i].Cp(Tg); - } - - // correct the gaseous temperature for evaporated fuel - - scalar cellV = sDB.mesh().V()[cell()]; - scalar cellMass = rhog*cellV; - Tg += sDB.shs()[cell()]/(cpMixture*cellMass); - Tg = max(200.0, Tg); - - scalar tauMomentum = GREAT; - scalar tauHeatTransfer = GREAT; - scalarField tauEvaporation(Nf, GREAT); - scalarField tauBoiling(Nf, GREAT); - - setRelaxationTimes - ( - cell(), - tauMomentum, - tauEvaporation, - tauHeatTransfer, - tauBoiling, - sDB, - rhog, - Up, - Tg, - pg, - Yfg, - m()*fuels.Y(X()), - trackTime - ); - - - // set the end-time for the track - scalar tEnd = (1.0 - stepFraction())*trackTime; - - // set the maximum time step for this parcel - scalar dtMax = min - ( - tEnd, - min - ( - tauMomentum, - min - ( - 1.0e+10*mag(min(tauEvaporation)), // evaporation is not an issue - min - ( - mag(tauHeatTransfer), - mag(min(tauBoiling)) - ) - ) - ) - )/sDB.subCycles(); - - // prevent the number of subcycles from being too many - // (10 000 seems high enough) - dtMax = max(dtMax, 1.0e-4*tEnd); - - vector planeNormal = vector::zero; - if (sDB.twoD()) - { - planeNormal = n() ^ sDB.axisOfSymmetry(); - planeNormal /= mag(planeNormal); - } - - // move the parcel until there is no 'timeLeft' - while (td.keepParticle && !td.switchProcessor && tEnd > SMALL) - { - // set the lagrangian time-step - scalar dt = min(dtMax, tEnd); - - // remember which cell the parcel is in - // since this will change if a face is hit - label cellI = cell(); - scalar p = sDB.p()[cellI]; - - // track parcel to face, or end of trajectory - if (td.keepParticle) - { - // Track and adjust the time step if the trajectory is not completed - dt *= trackToFace(position() + dt*U_, td); - - // Decrement the end-time acording to how much time the track took - tEnd -= dt; - - // Set the current time-step fraction. - stepFraction() = 1.0 - tEnd/trackTime; - - if (onBoundary()) // hit face - { - #include "boundaryTreatment.H" - } - } - - if (td.keepParticle && sDB.twoD()) - { - scalar z = position() & sDB.axisOfSymmetry(); - vector r = position() - z*sDB.axisOfSymmetry(); - if (mag(r) > SMALL) - { - correctNormal(sDB.axisOfSymmetry()); - } - } - - // **** calculate the lagrangian source terms **** - // First we get the 'old' properties. - // and then 'update' them to get the 'new' - // properties. - // The difference is then added to the source terms. - - scalar oRho = fuels.rho(p, T(), X()); - scalarField oMass(Nf, 0.0); - scalar oHg = 0.0; - scalar oTotMass = m(); - scalarField oYf(fuels.Y(X())); - - forAll(oMass, i) - { - oMass[i] = m()*oYf[i]; - label j = sDB.liquidToGasIndex()[i]; - oHg += oYf[i]*sDB.gasProperties()[j].Hs(T()); - } - - vector oMom = m()*U(); - scalar oHv = fuels.hl(p, T(), X()); - scalar oH = oHg - oHv; - scalar oPE = (p - fuels.pv(p, T(), X()))/oRho; - - // update the parcel properties (U, T, D) - updateParcelProperties - ( - dt, - sDB, - cellI, - face() - ); - - scalar nRho = fuels.rho(p, T(), X()); - scalar nHg = 0.0; - scalarField nMass(Nf, 0.0); - scalarField nYf(fuels.Y(X())); - - forAll(nMass, i) - { - nMass[i] = m()*nYf[i]; - label j = sDB.liquidToGasIndex()[i]; - nHg += nYf[i]*sDB.gasProperties()[j].Hs(T()); - } - - vector nMom = m()*U(); - scalar nHv = fuels.hl(p, T(), X()); - scalar nH = nHg - nHv; - scalar nPE = (p - fuels.pv(p, T(), X()))/nRho; - - // Update the Spray Source Terms - forAll(nMass, i) - { - sDB.srhos()[i][cellI] += oMass[i] - nMass[i]; - } - sDB.sms()[cellI] += oMom - nMom; - - sDB.shs()[cellI] += oTotMass*(oH + oPE) - m()*(nH + nPE); - - // Remove evaporated mass from stripped mass - ms() -= ms()*(oTotMass - m())/oTotMass; - - // remove parcel if it is 'small' - if (m() < 1.0e-12) - { - td.keepParticle = false; - - // ... and add the removed 'stuff' to the gas - forAll(nMass, i) - { - sDB.srhos()[i][cellI] += nMass[i]; - } - - sDB.sms()[cellI] += nMom; - sDB.shs()[cellI] += m()*(nH + nPE); - } - - if (onBoundary() && td.keepParticle) - { - if (face() > -1) - { - if (isA<processorPolyPatch>(pbMesh[patch(face())])) - { - td.switchProcessor = true; - } - } - } - } - - return td.keepParticle; -} - - -void Foam::parcel::updateParcelProperties -( - const scalar dt, - spray& sDB, - const label cellI, - const label faceI -) -{ - const liquidMixtureProperties& fuels = sDB.fuels(); - - label Nf = sDB.fuels().components().size(); - label Ns = sDB.composition().Y().size(); - - // calculate mean molecular weight - scalar W = 0.0; - for (label i=0; i<Ns; i++) - { - W += sDB.composition().Y()[i][cellI]/sDB.gasProperties()[i].W(); - - } - W = 1.0/W; - - // Calculate the interpolated gas properties at the position of the parcel - vector Up = sDB.UInterpolator().interpolate(position(), cellI, faceI) - + Uturb(); - scalar rhog = sDB.rhoInterpolator().interpolate(position(), cellI, faceI); - scalar pg = sDB.pInterpolator().interpolate(position(), cellI, faceI); - scalar Tg0 = sDB.TInterpolator().interpolate(position(), cellI, faceI); - - // correct the gaseous temperature for evaporated fuel - scalar cpMix = 0.0; - for (label i=0; i<Ns; i++) - { - cpMix += sDB.composition().Y()[i][cellI] - *sDB.gasProperties()[i].Cp(T()); - } - scalar cellV = sDB.mesh().V()[cellI]; - scalar rho = sDB.rho()[cellI]; - scalar cellMass = rho*cellV; - scalar dh = sDB.shs()[cellI]; - scalarField addedMass(Nf, 0.0); - - forAll(addedMass, i) - { - addedMass[i] += sDB.srhos()[i][cellI]*cellV; - } - - scalar Tg = Tg0 + dh/(cpMix*cellMass); - Tg = max(200.0, Tg); - - scalarField Yfg(Nf, 0.0); - forAll(Yfg, i) - { - label j = sDB.liquidToGasIndex()[i]; - const volScalarField& Yj = sDB.composition().Y()[j]; - scalar Yfg0 = Yj[cellI]; - Yfg[i] = (Yfg0*cellMass + addedMass[i])/(addedMass[i] + cellMass); - } - - scalar tauMomentum = GREAT; - scalar tauHeatTransfer = GREAT; - scalarField tauEvaporation(Nf, GREAT); - scalarField tauBoiling(Nf, GREAT); - - setRelaxationTimes - ( - cellI, - tauMomentum, - tauEvaporation, - tauHeatTransfer, - tauBoiling, - sDB, - rhog, - Up, - Tg, - pg, - Yfg, - m()*fuels.Y(X()), - dt - ); - - scalar timeRatio = dt/tauMomentum; - - vector Ucorr = Up; - vector gcorr = sDB.g(); - - if (sDB.twoD()) - { - // remove the tangential velocity component - scalar v1 = Up & sDB.axisOfSymmetry(); - scalar v2 = Up & n(); - Ucorr = v1*sDB.axisOfSymmetry() + v2*n(); - - // Remove the tangential gravity component - scalar g1 = gcorr & sDB.axisOfSymmetry(); - scalar g2 = gcorr & n(); - gcorr = g1*sDB.axisOfSymmetry() + g2*n(); - } - - U() = (U() + timeRatio*Ucorr + gcorr*dt)/(1.0 + timeRatio); - - if (sDB.twoD()) - { - vector normal = n() ^ sDB.axisOfSymmetry(); - normal /= mag(normal); - scalar dU = U() & normal; - U() -= dU*normal; - } - - scalar TDroplet = T(); - scalar oldDensity = fuels.rho(pg, T(), X()); - scalar oldMass = m(); - scalarField Yf0(fuels.Y(X())); - scalarField mi0(m()*Yf0); - scalarField mi(mi0); - - scalar oldhg = 0.0; - for (label i=0; i<Nf; i++) - { - label j = sDB.liquidToGasIndex()[i]; - oldhg += Yf0[i]*sDB.gasProperties()[j].Hs(T()); - } - - scalar oldhv = fuels.hl(pg, T(), X()); - scalar Np = N(oldDensity); - - scalar newMass = oldMass; - scalar newhg = oldhg; - scalar newhv = oldhv; - - scalar Tnew = T(); - - // first calculate the new temperature and droplet mass, - // then calculate the energy source and correct the - // gaseous temperature, Tg, and mass fraction, Yfg, - // to calculate the new properties for the parcel - // This procedure seems to be more stable - label n = 0; - while ((n < sDB.evaporation().nEvapIter()) && (m() > VSMALL)) - { - n++; - // new characteristic times does not need to be calculated the - // first time - if (n > 1) - { - newMass = m(); - newhg = 0.0; - scalarField Ynew(fuels.Y(X())); - for (label i=0; i<Nf; i++) - { - label j = sDB.liquidToGasIndex()[i]; - newhg += Ynew[i]*sDB.gasProperties()[j].Hs(Tnew); - } - - newhv = fuels.hl(pg, Tnew, X()); - - scalar dm = oldMass - newMass; - scalar dhNew = oldMass*(oldhg-oldhv) - newMass*(newhg-newhv); - - // Prediction of new gaseous temperature and fuel mass fraction - Tg = Tg0 + (dh+dhNew)/(cpMix*cellMass); - Tg = max(200.0, Tg); - - forAll(Yfg, i) - { - label j = sDB.liquidToGasIndex()[i]; - const volScalarField& Yj = sDB.composition().Y()[j]; - scalar Yfg0 = Yj[cellI]; - Yfg[i] = (Yfg0*cellMass + addedMass[i] + dm) - /(addedMass[i] + cellMass + dm); - } - - setRelaxationTimes - ( - cellI, - tauMomentum, - tauEvaporation, - tauHeatTransfer, - tauBoiling, - sDB, - rhog, - Up, - Tg, - pg, - Yfg, - m()*fuels.Y(X()), - dt - ); - - } - - scalar Taverage = TDroplet + (Tg - TDroplet)/3.0; - // for a liquid Cl \approx Cp - scalar liquidcL = sDB.fuels().Cp(pg, TDroplet, X()); - - cpMix = 0.0; - for (label i=0; i<Ns; i++) - { - if (sDB.isLiquidFuel()[i]) - { - label j = sDB.gasToLiquidIndex()[i]; - cpMix += Yfg[j]*sDB.gasProperties()[i].Cp(Taverage); - } - else - { - scalar Y = sDB.composition().Y()[i][cellI]; - cpMix += Y*sDB.gasProperties()[i].Cp(Taverage); - } - } - - scalar evaporationSource = 0.0; - scalar z = 0.0; - scalar tauEvap = 0.0; - - for (label i=0; i<Nf; i++) - { - tauEvap += X()[i]*fuels.properties()[i].W()/tauEvaporation[i]; - } - tauEvap = fuels.W(X())/tauEvap; - - - if (sDB.evaporation().evaporation()) - { - scalar hv = fuels.hl(pg, TDroplet, X()); - evaporationSource = - hv/liquidcL/tauEvap; - - z = cpMix*tauHeatTransfer/liquidcL/tauEvap; - } - - if (sDB.heatTransfer().heatTransfer()) - { - scalar fCorrect = - sDB.heatTransfer().fCorrection(z)/tauHeatTransfer; - - Tnew = - (TDroplet + dt*(fCorrect * Tg - evaporationSource)) - /(1.0 + dt*fCorrect); - - // Prevent droplet temperature to go above critial value - Tnew = min(Tnew, fuels.Tc(X())); - - // Prevent droplet temperature to go too low - // Mainly a numerical stability issue - Tnew = max(200.0, Tnew); - scalar Td = Tnew; - - scalar pAtSurface = fuels.pv(pg, Td, X()); - scalar pCompare = 0.999*pg; - scalar boiling = pAtSurface >= pCompare; - if (boiling) - { - // can not go above boiling temperature - scalar Terr = 1.0e-3; - label n = 0; - scalar dT = 1.0; - scalar pOld = pAtSurface; - while (dT > Terr) - { - n++; - pAtSurface = fuels.pv(pg, Td, X()); - if ((pAtSurface < pCompare) && (pOld < pCompare)) - { - Td += dT; - } - else - { - if ((pAtSurface > pCompare) && (pOld > pCompare)) - { - Td -= dT; - } - else - { - dT *= 0.5; - if ((pAtSurface > pCompare) && (pOld < pCompare)) - { - Td -= dT; - } - else - { - Td += dT; - } - } - } - pOld = pAtSurface; - if (debug) - { - if (n>100) - { - Info<< "n = " << n << ", T = " << Td << ", pv = " - << pAtSurface << endl; - } - } - } - Tnew = Td; - } - } - - // Evaporate droplet! - // if the droplet is NOT boiling use implicit scheme. - if (sDB.evaporation().evaporation()) - { - for (label i=0; i<Nf; i++) - { - // immediately evaporate mass that has reached critical - // condition - if (mag(Tnew - fuels.Tc(X())) < SMALL) - { - mi[i] = 0.0; - } - else - { - scalar Td = min(Tnew, 0.999*fuels.properties()[i].Tc()); - - scalar pAtSurface = fuels.properties()[i].pv(pg, Td); - scalar boiling = pAtSurface >= 0.999*pg; - - if (!boiling) - { - scalar fr = dt/tauEvaporation[i]; - mi[i] = mi0[i]/(1.0 + fr); - } - else - { - scalar fr = dt/tauBoiling[i]; - mi[i] = mi0[i]/(1.0 + fr); - } - } - } - - scalar mTot = sum(mi); - if (mTot > VSMALL) - { - scalarField Ynew(mi/mTot); - scalarField Xnew(sDB.fuels().X(Ynew)); - forAll(Xnew, i) - { - X()[i] = Xnew[i]; - } - m() = mTot; - } - else - { - m() = 0.0; - } - } - T() = Tnew; - scalar rhod = fuels.rho(pg, T(), X()); - d() = cbrt(6.0*m()/(Np*rhod*M_PI)); - } - - T() = Tnew; - scalar rhod = fuels.rho(pg, T(), X()); - m() = sum(mi); - d() = cbrt(6.0*m()/(Np*rhod*M_PI)); -} - - -void Foam::parcel::transformProperties(const tensor& T) -{ - U_ = transform(T, U_); -} - - -void Foam::parcel::transformProperties(const vector&) -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/parcel/parcel.H b/src/lagrangian/dieselSpray/parcel/parcel.H deleted file mode 100644 index e52eb928f23e01ee87d9a660716fba9f0e07e57e..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/parcel/parcel.H +++ /dev/null @@ -1,432 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::parcel - -Description - A parcel of particles - -\*---------------------------------------------------------------------------*/ - -#ifndef parcel_H -#define parcel_H - -#include "particle.H" -#include "contiguous.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -class spray; - -/*---------------------------------------------------------------------------*\ - Class parcel Declaration -\*---------------------------------------------------------------------------*/ - -class parcel -: - public particle -{ - // Private member data - - //- Reference to the names of the liquid components - List<word> liquidComponents_; - - - // Defining data (read and written to field files) - - //- Diameter of droplets in parcel - scalar d_; - - //- Temperature of droplets in parcel - scalar T_; - - //- Total parcel mass - scalar m_; - - //- Spherical deviation of droplets in parcel - scalar y_; - - //- Rate of change of spherical deviation of droplets in parcel - scalar yDot_; - - //- Characteristic time of droplets in parcel - scalar ct_; - - //- Stripped mass of droplets in parcel - scalar ms_; - - //- Time spent in turbulent eddy - scalar tTurb_; - - //- Part of liquid core (1-fully liquid, 0-droplet) - scalar liquidCore_; - - //- injected from injector - // Should really be a label, but is scalar due to - // post-processing reasons - scalar injector_; - - //- Velocity of parcel - vector U_; - - //- Turbulent velocity fluctuation - vector Uturb_; - - //- Normal n_ and axis describe the 2D plane - // in which the particle moves - vector n_; - - //- Liquid components molar fractions - scalarField X_; - - // Derived state information (not read or written) - - //- Momentum relaxation time of droplets in parcel - scalar tMom_; - - - // Private Member Functions - - //- Set the relaxation times - void setRelaxationTimes - ( - label cellI, - scalar& tauMomentum, - scalarField& tauEvaporation, - scalar& tauHeatTransfer, - scalarField& tauBoiling, - const spray& sprayDatabase, - const scalar rho, - const vector& Up, - const scalar temperature, - const scalar pressure, - const scalarField& Yf, - const scalarField& m0, - const scalar dt - ); - - - void updateParcelProperties - ( - const scalar dt, - spray& sprayData, - const label cellI, - const label faceI - ); - - -public: - - friend class Cloud<parcel>; - - //- Class used to pass tracking data to the trackToFace function - class trackingData - : - public particle::TrackingData<spray> - { - public: - - trackingData(spray& cloud) - : - particle::TrackingData<spray>(cloud) - {} - }; - - // Constructors - - //- Construct from components - parcel - ( - const polyMesh& mesh, - const vector& position, - const label cellI, - const label tetFaceI, - const label tetPtI, - const vector& n, - const scalar d, - const scalar T, - const scalar m, - const scalar y, - const scalar yDot, - const scalar ct, - const scalar ms, - const scalar tTurb, - const scalar liquidCore, - const scalar injector, - const vector& U, - const vector& Uturb, - const scalarField& X, - const List<word>& liquidNames - ); - - //- Construct from Istream reading field values if required - parcel - ( - const polyMesh& mesh, - Istream& is, - bool readFields = true - ); - - //- Factory class to read-construct particles used for - // parallel transfer - class iNew - { - const polyMesh& mesh_; - - public: - - iNew(const polyMesh& mesh) - : - mesh_(mesh) - {} - - autoPtr<parcel> operator()(Istream& is) const - { - return autoPtr<parcel>(new parcel(mesh_, is, true)); - } - }; - - - // Member Functions - - // Access - - //- Return the names of the liquid components - inline const List<word>& liquidNames() const; - - //- Return the names of the liquid fuel components - // - identical with liquidNames - inline const List<word>& fuelNames() const; - - //- Return diameter of droplets in parcel - inline scalar d() const; - - //- Return diameter of droplets in parcel - inline scalar& d(); - - //- Return temperature of droplets in parcel - inline scalar T() const; - - //- Return temperature of droplets in parcel - inline scalar& T(); - - //- Return total parcel mass - inline scalar m() const; - - //- Return total parcel mass - inline scalar& m(); - - //- Return spherical deviation of droplets in parcel - inline scalar dev() const; - - //- Return spherical deviation of droplets in parcel - inline scalar& dev(); - - //- Return rate of change of spherical deviation of - // droplets in parcel - inline scalar ddev() const; - - //- Return rate of change of spherical deviation of - // droplets in parcel - inline scalar& ddev(); - - //- Return characteristic time of droplets in parcel - inline scalar ct() const; - - //- Return characteristic time of droplets in parcel - inline scalar& ct(); - - //- Return stripped mass of droplets in parcel - inline scalar& ms(); - - //- Return stripped mass of droplets in parcel - inline scalar ms() const; - - //- Return time spent in turbulent eddy - inline scalar& tTurb(); - - //- Return time spent in turbulent eddy - inline scalar tTurb() const; - - //- Return part of liquid liquidCore - inline scalar& liquidCore(); - - //- Return part of liquid liquidCore - inline scalar liquidCore() const; - - //- Return the injector from which is injected - inline scalar& injector(); - - //- Return the injector from which is injected - inline scalar injector() const; - - //- Return velocity of parcel - inline const vector& U() const; - - //- Return velocity of parcel - inline vector& U(); - - //- Return turbulent velocity fluctuation - inline const vector& Uturb() const; - - //- Return turbulent velocity fluctuation - inline vector& Uturb(); - - //- Return the normal used for 2D purposes - inline const vector& n() const; - - //- Return the normal used for 2D purposes - inline vector& n(); - - //- Return the liquid components molar fractions - inline const scalarField& X() const; - - //- Return the liquid components molar fractions - inline scalarField& X(); - - //- Return the momentum relaxation time of droplets in parcel - inline scalar& tMom(); - - //- Return the momentum relaxation time of droplets in parcel - inline scalar tMom() const; - - - // Derived information - - //- Return statistical number of drops in parcel - scalar N(const scalar rho) const; - - //- Return relative velocity between given vector and parcel - inline vector Urel(const vector&) const; - - - // Dimensionless Numbers - - //- Reynolds number based on rho an dynamic viscosity - scalar Re - ( - const scalar rho, - const vector& U, - const scalar mu - ) const; - - //- Reynolds number based on kinematic viscosity - scalar Re - ( - const vector& U, - const scalar nu - ) const; - - //- Weber number - scalar We - ( - const vector& U, - const scalar rho, - const scalar sigma - ) const; - - //- Schmidt number based on dynamic viscosity and rho - scalar Sc - ( - const scalar mu, - const scalar rho, - const scalar massDiffusion - ) const; - - //- Schmidt number based on kinematic viscosity - scalar Sc - ( - const scalar nu, - const scalar massDiffusion - ) const; - - //- Prandtl number - scalar Pr - ( - const scalar cp, - const scalar mu, - const scalar kappa - ) const; - - //- Volume of one droplet in the parcel - scalar Vd() const; - - //- Volume of all droplets in parcel - scalar V(const scalar rho) const; - - - // Parcel operations - - bool move(trackingData& td, const scalar trackTime); - - //- Transform the position and physical properties of the particle - // according to the given transformation tensor - virtual void transformProperties(const tensor& T); - - //- Transform the position and physical properties of the particle - // according to the given separation vector - virtual void transformProperties(const vector& separation); - - //- fix the 2D plane normal, - // when particle hits a face it is slightly perturbed - // towards the face centre and n_ will no longer be valid - inline void correctNormal(const vector& sym); - - - // I/O - - static void readFields(Cloud<parcel>& c); - - static void writeFields(const Cloud<parcel>& c); - - - // Ostream Operator - - friend Ostream& operator<<(Ostream&, const parcel&); -}; - - -template<> -inline bool contiguous<parcel>() -{ - return true; -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "parcelI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/parcel/parcelFunctions.C b/src/lagrangian/dieselSpray/parcel/parcelFunctions.C deleted file mode 100644 index 59f53481a2d36a82b48db4a397b4b204c0873bc8..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/parcel/parcelFunctions.C +++ /dev/null @@ -1,115 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "parcel.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -// The diameter based Reynolds number -Foam::scalar Foam::parcel::Re -( - const vector& U, - const scalar nu -) const -{ - return mag(Urel(U))*d_/nu; -} - -// The diameter based Reynolds number -Foam::scalar Foam::parcel::Re -( - const scalar rho, - const vector& U, - const scalar mu -) const -{ - - return rho*mag(Urel(U))*d_/mu; -} - -// The diameter based Weber number -Foam::scalar Foam::parcel::We -( - const vector& U, - const scalar rho, - const scalar sigma -) const -{ - return 0.5*rho*pow(mag(Urel(U)),2)*d_/sigma; -} - - -Foam::scalar Foam::parcel::Sc -( - const scalar mu, - const scalar rho, - const scalar massDiffusion -) const -{ - return mu/(rho*massDiffusion); -} - - -Foam::scalar Foam::parcel::Sc -( - const scalar nu, - const scalar massDiffusion -) const -{ - return nu/massDiffusion; -} - - -Foam::scalar Foam::parcel::Pr -( - const scalar cp, - const scalar mu, - const scalar kappa -) const -{ - return cp*mu/kappa; -} - - -Foam::scalar Foam::parcel::N(const scalar rho) const -{ - return 6.0*m_/(rho*pow3(d_)*constant::mathematical::pi); -} - - -Foam::scalar Foam::parcel::Vd() const -{ - return pow3(d_)*constant::mathematical::pi/6.0; -} - - -Foam::scalar Foam::parcel::V(const scalar rho) const -{ - return m_/rho; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/parcel/parcelI.H b/src/lagrangian/dieselSpray/parcel/parcelI.H deleted file mode 100644 index a541fdedddd11fa3e2a8a9b8b9f1eb31c73462e0..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/parcel/parcelI.H +++ /dev/null @@ -1,232 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -inline const Foam::List<Foam::word>& Foam::parcel::liquidNames() const -{ - return liquidComponents_; -} - - -inline const Foam::List<Foam::word>& Foam::parcel::fuelNames() const -{ - return liquidComponents_; -} - - -inline Foam::scalar Foam::parcel::d() const -{ - return d_; -} - - -inline Foam::scalar& Foam::parcel::d() -{ - return d_; -} - - -inline Foam::scalar Foam::parcel::T() const -{ - return T_; -} - - -inline Foam::scalar& Foam::parcel::T() -{ - return T_; -} - - -inline Foam::scalar Foam::parcel::m() const -{ - return m_; -} - - -inline Foam::scalar& Foam::parcel::m() -{ - return m_; -} - - -inline Foam::scalar Foam::parcel::dev() const -{ - return y_; -} - - -inline Foam::scalar& Foam::parcel::dev() -{ - return y_; -} - - -inline Foam::scalar Foam::parcel::ddev() const -{ - return yDot_; -} - - -inline Foam::scalar& Foam::parcel::ddev() -{ - return yDot_; -} - - -inline Foam::scalar Foam::parcel::ct() const -{ - return ct_; -} - - -inline Foam::scalar& Foam::parcel::ct() -{ - return ct_; -} - - -inline Foam::scalar& Foam::parcel::ms() -{ - return ms_; -} - - -inline Foam::scalar Foam::parcel::ms() const -{ - return ms_; -} - - -inline Foam::scalar& Foam::parcel::tTurb() -{ - return tTurb_; -} - - -inline Foam::scalar Foam::parcel::tTurb() const -{ - return tTurb_; -} - - -inline Foam::scalar& Foam::parcel::liquidCore() -{ - return liquidCore_; -} - - -inline Foam::scalar Foam::parcel::liquidCore() const -{ - return liquidCore_; -} - - -inline Foam::scalar& Foam::parcel::injector() -{ - return injector_; -} - - -inline Foam::scalar Foam::parcel::injector() const -{ - return injector_; -} - - -inline const Foam::vector& Foam::parcel::U() const -{ - return U_; -} - - -inline Foam::vector& Foam::parcel::U() -{ - return U_; -} - - -inline const Foam::vector& Foam::parcel::Uturb() const -{ - return Uturb_; -} - - -inline Foam::vector& Foam::parcel::Uturb() -{ - return Uturb_; -} - - -inline const Foam::vector& Foam::parcel::n() const -{ - return n_; -} - - -inline Foam::vector& Foam::parcel::n() -{ - return n_; -} - - -inline const Foam::scalarField& Foam::parcel::X() const -{ - return X_; -} - - -inline Foam::scalarField& Foam::parcel::X() -{ - return X_; -} - - -inline Foam::scalar& Foam::parcel::tMom() -{ - return tMom_; -} - - -inline Foam::scalar Foam::parcel::tMom() const -{ - return tMom_; -} - - -inline Foam::vector Foam::parcel::Urel(const vector& U) const -{ - return U_ - U; -} - - -inline void Foam::parcel::correctNormal(const vector& sym) -{ - scalar d = position() & sym; - n_ = position() - d*sym; - n_ /= mag(n_); -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/parcel/parcelIO.C b/src/lagrangian/dieselSpray/parcel/parcelIO.C deleted file mode 100644 index 9a456eec7fb76cf24b6cd7ac37491afa0ca03a03..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/parcel/parcelIO.C +++ /dev/null @@ -1,337 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "parcel.H" -#include "IOstreams.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::parcel::parcel -( - const polyMesh& mesh, - Istream& is, - bool readFields -) -: - particle(mesh, is, readFields), - - liquidComponents_ - ( - ( - mesh.lookupObject<dictionary>("thermophysicalProperties") - ).lookup("liquidComponents") - ), - X_(liquidComponents_.size(), 0.0), - - tMom_(GREAT) -{ - - label nX = X_.size(); - - if (readFields) - { - if (is.format() == IOstream::ASCII) - { - d_ = readScalar(is); - T_ = readScalar(is); - m_ = readScalar(is); - y_ = readScalar(is); - yDot_ = readScalar(is); - ct_ = readScalar(is); - ms_ = readScalar(is); - tTurb_ = readScalar(is); - liquidCore_ = readScalar(is); - injector_ = readScalar(is); - is >> U_; - is >> Uturb_; - is >> n_; - for (label j=0; j<nX; j++) - { - X_[j] = readScalar(is); - } - } - else - { - is.read - ( - reinterpret_cast<char*>(&d_), - sizeof(d_) + sizeof(T_) + sizeof(m_) + sizeof(y_) - + sizeof(yDot_) + sizeof(ct_) + sizeof(ms_) + sizeof(tTurb_) - + sizeof(liquidCore_) + sizeof(injector_) - + sizeof(U_) + sizeof(Uturb_) + sizeof(n_) - ); - - is.read - ( - reinterpret_cast<char*>(X_.begin()), - X_.size()*sizeof(scalar) - ); - } - } - - // Check state of Istream - is.check("parcel::parcel(Istream&)"); -} - - -void Foam::parcel::readFields(Cloud<parcel>& c) -{ - if (!c.size()) - { - return; - } - - particle::readFields(c); - - IOField<scalar> d(c.fieldIOobject("d", IOobject::MUST_READ)); - c.checkFieldIOobject(c, d); - - IOField<scalar> T(c.fieldIOobject("T", IOobject::MUST_READ)); - c.checkFieldIOobject(c, T); - - IOField<scalar> m(c.fieldIOobject("m", IOobject::MUST_READ)); - c.checkFieldIOobject(c, m); - - IOField<scalar> y(c.fieldIOobject("y", IOobject::MUST_READ)); - c.checkFieldIOobject(c, y); - - IOField<scalar> yDot(c.fieldIOobject("yDot", IOobject::MUST_READ)); - c.checkFieldIOobject(c, yDot); - - IOField<scalar> ct(c.fieldIOobject("ct", IOobject::MUST_READ)); - c.checkFieldIOobject(c, ct); - - IOField<scalar> ms(c.fieldIOobject("ms", IOobject::MUST_READ)); - c.checkFieldIOobject(c, ms); - - IOField<scalar> tTurb(c.fieldIOobject("tTurb", IOobject::MUST_READ)); - c.checkFieldIOobject(c, tTurb); - - IOField<scalar> liquidCore - ( - c.fieldIOobject("liquidCore", IOobject::MUST_READ) - ); - c.checkFieldIOobject(c, liquidCore); - - IOField<scalar> injector(c.fieldIOobject("injector", IOobject::MUST_READ)); - c.checkFieldIOobject(c, injector); - - IOField<vector> U(c.fieldIOobject("U", IOobject::MUST_READ)); - c.checkFieldIOobject(c, U); - - IOField<vector> Uturb(c.fieldIOobject("Uturb", IOobject::MUST_READ)); - c.checkFieldIOobject(c, Uturb); - - IOField<vector> n(c.fieldIOobject("n", IOobject::MUST_READ)); - c.checkFieldIOobject(c, n); - - label i = 0; - forAllIter(Cloud<parcel>, c, iter) - { - parcel& p = iter(); - - p.d_ = d[i]; - p.T_ = T[i]; - p.m_ = m[i]; - p.y_ = y[i]; - p.yDot_ = yDot[i]; - p.ct_ = ct[i]; - p.ms_ = ms[i]; - p.tTurb_ = tTurb[i]; - p.liquidCore_ = liquidCore[i]; - p.injector_ = injector[i]; - - p.U_ = U[i]; - p.Uturb_ = Uturb[i]; - p.n_ = n[i]; - - i++; - } - - // read the liquid molar fractions - if (c.size()) - { - Cloud<parcel>::const_iterator iter = c.begin(); - const parcel& p0 = iter(); - - label nX = p0.X().size(); - const List<word>& names = p0.liquidNames(); - - for (label j=0; j<nX; j++) - { - IOField<scalar> X(c.fieldIOobject(names[j], IOobject::MUST_READ)); - - label i = 0; - forAllIter(Cloud<parcel>, c, iter) - { - parcel& p = iter(); - p.X_[j] = X[i++]; - } - } - } -} - - -void Foam::parcel::writeFields(const Cloud<parcel>& c) -{ - particle::writeFields(c); - - label np = c.size(); - - IOField<scalar> d(c.fieldIOobject("d", IOobject::NO_READ), np); - IOField<scalar> T(c.fieldIOobject("T", IOobject::NO_READ), np); - IOField<scalar> m(c.fieldIOobject("m", IOobject::NO_READ), np); - IOField<scalar> y(c.fieldIOobject("y", IOobject::NO_READ), np); - IOField<scalar> yDot(c.fieldIOobject("yDot", IOobject::NO_READ), np); - IOField<scalar> ct(c.fieldIOobject("ct", IOobject::NO_READ), np); - IOField<scalar> ms(c.fieldIOobject("ms", IOobject::NO_READ), np); - IOField<scalar> tTurb(c.fieldIOobject("tTurb", IOobject::NO_READ), np); - IOField<scalar> liquidCore - ( - c.fieldIOobject("liquidCore", IOobject::NO_READ), - np - ); - IOField<scalar> injector - ( - c.fieldIOobject("injector", IOobject::NO_READ), - np - ); - IOField<vector> U(c.fieldIOobject("U", IOobject::NO_READ), np); - IOField<vector> Uturb(c.fieldIOobject("Uturb", IOobject::NO_READ), np); - IOField<vector> n(c.fieldIOobject("n", IOobject::NO_READ), np); - - label i = 0; - forAllConstIter(Cloud<parcel>, c, iter) - { - const parcel& p = iter(); - - d[i] = p.d_; - T[i] = p.T_; - m[i] = p.m_; - y[i] = p.y_; - yDot[i] = p.yDot_; - ct[i] = p.ct_; - ms[i] = p.ms_; - tTurb[i] = p.tTurb_; - liquidCore[i] = p.liquidCore_; - injector[i] = p.injector_; - - U[i] = p.U_; - Uturb[i] = p.Uturb_; - n[i] = p.n_; - - i++; - } - - d.write(); - T.write(); - m.write(); - y.write(); - yDot.write(); - ct.write(); - ms.write(); - tTurb.write(); - liquidCore.write(); - injector.write(); - - U.write(); - Uturb.write(); - n.write(); - - // write the liquid molar fractions - if (np > 0) - { - Cloud<parcel>::const_iterator iter = c.begin(); - const parcel& p0 = iter(); - - label nX = p0.X().size(); - const List<word>& names = p0.liquidNames(); - - for (label j=0; j<nX; j++) - { - IOField<scalar> X(c.fieldIOobject(names[j], IOobject::NO_READ), np); - - label i = 0; - forAllConstIter(Cloud<parcel>, c, iter) - { - const parcel& p = iter(); - X[i++] = p.X()[j]; - } - - X.write(); - } - } -} - - -// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // - -Foam::Ostream& Foam::operator<<(Ostream& os, const parcel& p) -{ - if (os.format() == IOstream::ASCII) - { - os << static_cast<const particle&>(p) - << token::SPACE << p.d_ - << token::SPACE << p.T_ - << token::SPACE << p.m_ - << token::SPACE << p.y_ - << token::SPACE << p.yDot_ - << token::SPACE << p.ct_ - << token::SPACE << p.ms_ - << token::SPACE << p.tTurb_ - << token::SPACE << p.liquidCore_ - << token::SPACE << p.injector_ - << token::SPACE << p.U_ - << token::SPACE << p.Uturb_ - << token::SPACE << p.n_ - << token::SPACE << p.X_; - } - else - { - os << static_cast<const particle>(p); - os.write - ( - reinterpret_cast<const char*>(&p.d_), - sizeof(p.d_) + sizeof(p.T_) + sizeof(p.m_) + sizeof(p.y_) - + sizeof(p.yDot_) + sizeof(p.ct_) + sizeof(p.ms_) + sizeof(p.tTurb_) - + sizeof(p.liquidCore_) + sizeof(p.injector_) - + sizeof(p.U_) + sizeof(p.Uturb_) + sizeof(p.n_) - ); - - os.write - ( - reinterpret_cast<const char*>(p.X_.begin()), - p.X_.size()*sizeof(scalar) - ); - } - - // Check state of Ostream - os.check("Ostream& operator<<(Ostream&, const parcel&)"); - - return os; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C b/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C deleted file mode 100644 index 8ff9bdc61a69922708374c1e97abfd47bb1d69c5..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/parcel/setRelaxationTimes.C +++ /dev/null @@ -1,306 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "parcel.H" - -#include "spray.H" -#include "dragModel.H" -#include "evaporationModel.H" -#include "heatTransferModel.H" -#include "basicMultiComponentMixture.H" - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::parcel::setRelaxationTimes -( - label cellI, - scalar& tauMomentum, - scalarField& tauEvaporation, - scalar& tauHeatTransfer, - scalarField& tauBoiling, - const spray& sDB, - const scalar rho, - const vector& Up, - const scalar temperature, - const scalar pressure, - const scalarField& Yfg, - const scalarField& m0, - const scalar dt -) -{ - const liquidMixtureProperties& fuels = sDB.fuels(); - - scalar mCell = rho*sDB.mesh().V()[cell()]; - scalarField mfg(Yfg*mCell); - - label Ns = sDB.composition().Y().size(); - label Nf = fuels.components().size(); - - // Tf is based on the 1/3 rule - scalar Tf = T() + (temperature - T())/3.0; - - // calculate mixture properties - scalar W = 0.0; - scalar kMixture = 0.0; - scalar CpMixture = 0.0; - scalar muf = 0.0; - - for (label i=0; i<Ns; i++) - { - scalar Y = sDB.composition().Y()[i][cellI]; - W += Y/sDB.gasProperties()[i].W(); - // Using mass-fractions to average... - kMixture += Y*sDB.gasProperties()[i].kappa(Tf); - CpMixture += Y*sDB.gasProperties()[i].Cp(Tf); - muf += Y*sDB.gasProperties()[i].mu(Tf); - } - W = 1.0/W; - - scalarField Xf(Nf, 0.0); - scalarField Yf(Nf, 0.0); - scalarField psat(Nf, 0.0); - scalarField msat(Nf, 0.0); - - for (label i=0; i<Nf; i++) - { - label j = sDB.liquidToGasIndex()[i]; - scalar Y = sDB.composition().Y()[j][cellI]; - scalar Wi = sDB.gasProperties()[j].W(); - Yf[i] = Y; - Xf[i] = Y*W/Wi; - psat[i] = fuels.properties()[i].pv(pressure, temperature); - msat[i] = min(1.0, psat[i]/pressure)*Wi/W; - } - - scalar nuf = muf/rho; - - scalar liquidDensity = fuels.rho(pressure, T(), X()); - scalar liquidcL = fuels.Cp(pressure, T(), X()); - scalar heatOfVapour = fuels.hl(pressure, T(), X()); - - // calculate the partial rho of the fuel vapour - // alternative is to use the mass fraction - // however, if rhoFuelVap is small (zero) - // d(mass)/dt = 0 => no evaporation... hmmm... is that good? NO! - - // Assume equilibrium at drop-surface => pressure @ surface - // = vapour pressure to calculate fuel-vapour density @ surface - scalar pressureAtSurface = fuels.pv(pressure, T(), X()); - scalar rhoFuelVap = pressureAtSurface*fuels.W(X())/(specie::RR*Tf); - - scalarField Xs(sDB.fuels().Xs(pressure, temperature, T(), Xf, X())); - scalarField Ys(Nf, 0.0); - scalar Wliq = 0.0; - - for (label i=0; i<Nf; i++) - { - label j = sDB.liquidToGasIndex()[i]; - scalar Wi = sDB.gasProperties()[j].W(); - Wliq += Xs[i]*Wi; - } - - for (label i=0; i<Nf; i++) - { - label j = sDB.liquidToGasIndex()[i]; - scalar Wi = sDB.gasProperties()[j].W(); - Ys[i] = Xs[i]*Wi/Wliq; - } - - scalar Reynolds = Re(Up, nuf); - scalar Prandtl = Pr(CpMixture, muf, kMixture); - - // calculate the characteritic times - - if (liquidCore_> 0.5) - { - // no drag for parcels in the liquid core. - tauMomentum = GREAT; - } - else - { - tauMomentum = sDB.drag().relaxationTime - ( - Urel(Up), - d(), - rho, - liquidDensity, - nuf, - dev() - ); - } - - // store the relaxationTime since it is needed in some breakup models. - tMom_ = tauMomentum; - - tauHeatTransfer = sDB.heatTransfer().relaxationTime - ( - liquidDensity, - d(), - liquidcL, - kMixture, - Reynolds, - Prandtl - ); - - // evaporation-properties are evaluated at averaged temperature - // set the boiling conditions true if pressure @ surface is 99.9% - // of the pressure - // this is mainly to put a limit on the evaporation time, - // since tauEvaporation is very very small close to the boiling point. - - for (label i=0; i<Nf; i++) - { - scalar Td = min(T(), 0.999*fuels.properties()[i].Tc()); - bool boiling = fuels.properties()[i].pv(pressure, Td) >= 0.999*pressure; - scalar Di = fuels.properties()[i].D(pressure, Td); - scalar Schmidt = Sc(nuf, Di); - - scalar partialPressure = Xf[i]*pressure; - -// saturated vapour - if (partialPressure > psat[i]) - { - tauEvaporation[i] = GREAT; - } -// not saturated vapour - else - { - if (!boiling) - { - // for saturation evaporation, only use 99.99% for - // numerical robustness - scalar dm = max(SMALL, 0.9999*msat[i] - mfg[i]); - - tauEvaporation[i] = sDB.evaporation().relaxationTime - ( - d(), - fuels.properties()[i].rho(pressure, Td), - rhoFuelVap, - Di, - Reynolds, - Schmidt, - Xs[i], - Xf[i], - m0[i], - dm, - dt - ); - } - else - { - scalar Nusselt = - sDB.heatTransfer().Nu(Reynolds, Prandtl); - - // calculating the boiling temperature of the liquid - // at ambient pressure - scalar tBoilingSurface = Td; - - label Niter = 0; - scalar deltaT = 10.0; - scalar dp0 = - fuels.properties()[i].pv(pressure, tBoilingSurface) - - pressure; - while ((Niter < 200) && (mag(deltaT) > 1.0e-3)) - { - Niter++; - scalar pBoil = fuels.properties()[i].pv - ( - pressure, - tBoilingSurface - ); - scalar dp = pBoil - pressure; - if ((dp > 0.0) && (dp0 > 0.0)) - { - tBoilingSurface -= deltaT; - } - else - { - if ((dp < 0.0) && (dp0 < 0.0)) - { - tBoilingSurface += deltaT; - } - else - { - deltaT *= 0.5; - if ((dp > 0.0) && (dp0 < 0.0)) - { - tBoilingSurface -= deltaT; - } - else - { - tBoilingSurface += deltaT; - } - } - } - dp0 = dp; - } - - scalar vapourSurfaceEnthalpy = 0.0; - scalar vapourFarEnthalpy = 0.0; - - forAll(sDB.gasProperties(), k) - { - vapourSurfaceEnthalpy += - sDB.composition().Y()[k][cellI] - *sDB.gasProperties()[k].H(tBoilingSurface); - vapourFarEnthalpy += - sDB.composition().Y()[k][cellI] - *sDB.gasProperties()[k].H(temperature); - } - - scalar kLiquid = fuels.properties()[i].K - ( - pressure, - 0.5*(tBoilingSurface+T()) - ); - - tauBoiling[i] = sDB.evaporation().boilingTime - ( - fuels.properties()[i].rho(pressure, Td), - fuels.properties()[i].Cp(pressure, Td), - heatOfVapour, - kMixture, - Nusselt, - temperature - T(), - d(), - liquidCore(), - sDB.runTime().value() - ct(), - Td, - tBoilingSurface, - vapourSurfaceEnthalpy, - vapourFarEnthalpy, - CpMixture, - temperature, - kLiquid - ); - } - - } - } -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spray/findInjectorCell.H b/src/lagrangian/dieselSpray/spray/findInjectorCell.H deleted file mode 100644 index 9ff2141c4c26701d34e2d27564287c3180d1d7d9..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spray/findInjectorCell.H +++ /dev/null @@ -1,67 +0,0 @@ -{ - -bool foundCell = false; -if (injectorCell >= 0) -{ - const vector& C = mesh_.C()[injectorCell]; - injectionPosition += 1.0e-9*(C - injectionPosition); - - foundCell = mesh_.pointInCell(injectionPosition, injectorCell); -} - -reduce(foundCell, orOp<bool>()); - -// Due to the disc injection, the injectionPosition -// can be moved outside the domain. -// try point injection - -if (!foundCell) -{ - injectionPosition = it->position(n); - - mesh_.findCellFacePt - ( - injectionPosition, - injectorCell, - injectorTetFaceI, - injectorTetPtI - ); - - if (injectorCell >= 0) - { - const vector& C = mesh_.C()[injectorCell]; - injectionPosition += 1.0e-6*(C - injectionPosition); - - foundCell = mesh_.pointInCell(injectionPosition, injectorCell); - } - reduce(foundCell, orOp<bool>()); - - // if point injection also failed then - // find nearest cell and try that one - // the point is probably on an edge - if (!foundCell) - { - injectorCell = - mesh_.findNearestCell(injectionPosition); - - if (injectorCell >= 0) - { - - const vector& C = mesh_.C()[injectorCell]; - injectionPosition += 1.0e-9*(C - injectionPosition); - - foundCell = mesh_.pointInCell(injectionPosition, injectorCell); - } - reduce(foundCell, orOp<bool>()); - - if (!foundCell) - { - FatalError - << "Cannot find injection position " - << injectionPosition - << abort(FatalError); - } - } -} - -} diff --git a/src/lagrangian/dieselSpray/spray/spray.C b/src/lagrangian/dieselSpray/spray/spray.C deleted file mode 100644 index b70bb0f42ad4675c9d5c160c044fc9418654d302..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spray/spray.C +++ /dev/null @@ -1,364 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "spray.H" - -#include "atomizationModel.H" -#include "breakupModel.H" -#include "collisionModel.H" -#include "dispersionModel.H" -#include "dragModel.H" -#include "evaporationModel.H" -#include "heatTransferModel.H" -#include "injectorModel.H" -#include "wallModel.H" - -#include "basicMultiComponentMixture.H" - -#include "symmetryPolyPatch.H" -#include "wedgePolyPatch.H" - -#include "unitConversion.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTemplateTypeNameAndDebug(Cloud<parcel>, 0); - defineTemplateTypeNameAndDebug(IOPtrList<injector>, 0); -} - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::spray::spray -( - const volVectorField& U, - const volScalarField& rho, - const volScalarField& p, - const volScalarField& T, - const basicMultiComponentMixture& composition, - const PtrList<gasThermoPhysics>& gasProperties, - const dictionary&, - const dimensionedVector& g, - bool readFields -) -: - Cloud<parcel>(U.mesh(), false), // suppress className checking on positions - runTime_(U.time()), - time0_(runTime_.value()), - mesh_(U.mesh()), - rndGen_(label(0), -1), - g_(g.value()), - - U_(U), - rho_(rho), - p_(p), - T_(T), - - sprayProperties_ - ( - IOobject - ( - "sprayProperties", - U.time().constant(), - U.db(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ), - - ambientPressure_(p_.average().value()), - ambientTemperature_(T_.average().value()), - - injectors_ - ( - IOobject - ( - "injectorProperties", - U.time().constant(), - U.db(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ), - injector::iNew(U.time()) - ), - atomization_ - ( - atomizationModel::New - ( - sprayProperties_, - *this - ) - ), - drag_ - ( - dragModel::New - ( - sprayProperties_ - ) - ), - evaporation_ - ( - evaporationModel::New - ( - sprayProperties_ - ) - ), - heatTransfer_ - ( - heatTransferModel::New - ( - sprayProperties_ - ) - ), - wall_ - ( - wallModel::New - ( - sprayProperties_, - U, - *this - ) - ), - breakupModel_ - ( - breakupModel::New - ( - sprayProperties_, - *this - ) - ), - collisionModel_ - ( - collisionModel::New - ( - sprayProperties_, - *this, - rndGen_ - ) - ), - dispersionModel_ - ( - dispersionModel::New - ( - sprayProperties_, - *this - ) - ), - - fuels_ - ( - liquidMixtureProperties::New - ( - mesh_.lookupObject<dictionary>("thermophysicalProperties") - ) - ), - injectorModel_ - ( - injectorModel::New - ( - sprayProperties_, - *this - ) - ), - - subCycles_(readLabel(sprayProperties_.lookup("subCycles"))), - - gasProperties_(gasProperties), - composition_(composition), - - liquidToGasIndex_(fuels_->components().size(), -1), - gasToLiquidIndex_(composition.Y().size(), -1), - isLiquidFuel_(composition.Y().size(), false), - - twoD_(0), - axisOfSymmetry_(vector::zero), - axisOfWedge_(vector(0,0,0)), - axisOfWedgeNormal_(vector(0,0,0)), - angleOfWedge_(0.0), - - interpolationSchemes_(sprayProperties_.subDict("interpolationSchemes")), - UInterpolator_(NULL), - rhoInterpolator_(NULL), - pInterpolator_(NULL), - TInterpolator_(NULL), - - sms_(mesh_.nCells(), vector::zero), - shs_(mesh_.nCells(), 0.0), - srhos_(fuels_->components().size()), - - totalInjectedLiquidMass_(0.0), - injectedLiquidKE_(0.0) - -{ - // create the evaporation source fields - forAll(srhos_, i) - { - srhos_.set(i, new scalarField(mesh_.nCells(), 0.0)); - } - - // Write some information about injection parameters - forAll(injectors_, i) - { - const injectorType& it = injectors_[i].properties(); - - scalar v = injection().averageVelocity(i); - - scalar ip = it.integrateTable(it.injectionPressureProfile()); - scalar dt = it.teoi() - it.tsoi(); - Info<< "Average Velocity for injector " << i << ": " << v << " m/s" - << ", injection pressure = " - << 1.0e-5*ip/dt << " bar" - << endl; - } - - // Check if the case is 2D wedge - const polyBoundaryMesh& bMesh = mesh().boundaryMesh(); - bool symPlaneExist = false; - bool wedgeExist = false; - label patches[2]; - label n=0; - - // check for the type of boundary condition - forAll(bMesh, patchI) - { - if (isA<symmetryPolyPatch>(bMesh[patchI])) - { - symPlaneExist = true; - } - else if (isA<wedgePolyPatch>(bMesh[patchI])) - { - wedgeExist = true; - patches[n++] = patchI; - } - } - - // if wedge exist we assume that this is a 2D run. - twoD_ = wedgeExist; - - if (twoD_) - { - if (n<2) - { - FatalErrorIn - ( - "spray::spray(const volVectorField& U, " - "const volScalarField& rho, const volScalarField& p, " - "const volScalarField& T, const combustionMixture& composition," - "const PtrList<gasThermoPhsyics>& gaseousFuelProperties, " - "const dictionary& thermophysicalProperties, " - "const dimensionedScalar& g)" - ) << "spray::(...) only one wedgePolyPatch found. " - "Please check you BC-setup." - << abort(FatalError); - } - - Info<< "Constructing two dimensional spray injection."; - - vector v1 = bMesh[patches[0]].faceAreas()[0]; - vector v2 = bMesh[patches[1]].faceAreas()[0]; - v1 /= mag(v1); - v2 /= mag(v2); - axisOfSymmetry_ = v1 ^ v2; - axisOfSymmetry_ /= mag(axisOfSymmetry_); - - // assuming that 'v2' is the 'front' face - axisOfWedge_ = axisOfSymmetry_ ^ v2; - axisOfWedge_ /= mag(axisOfWedge_); - - axisOfWedgeNormal_ = axisOfSymmetry_ ^ axisOfWedge_; - axisOfWedgeNormal_ /= mag(axisOfWedgeNormal_); - - scalar arcCos = (v1 & v2)/mag(v1); - angleOfWedge_ = constant::mathematical::pi - acos(arcCos); - - Info<< "Calculated angle of wedge is " - << radToDeg(angleOfWedge_) << " deg." - << endl; - } - else - { - if (symPlaneExist) - { - angleOfWedge_ = constant::mathematical::pi; - Info<< "Constructing 180 deg three dimensional spray injection." - << endl; - } - else - { - Info<< "Constructing three dimensional spray injection." << endl; - } - - } - - // find index mapping between liquid indeces and gas indeces - label Ns = composition_.Y().size(); - - forAll(fuels_->components(), i) - { - word liquidName(fuels_->components()[i]); - - for (label j=0; j<Ns; j++) - { - word specieName(composition_.Y()[j].name()); - - if (specieName == liquidName) - { - liquidToGasIndex_[i] = j; - gasToLiquidIndex_[j] = i; - isLiquidFuel_[j] = true; - } - } - if (liquidToGasIndex_[i] == -1) - { - Info<< "In composition:" << endl; - for (label k=0; k<Ns; k++) - { - word specieName(composition_.Y()[k].name()); - Info<< specieName << endl; - } - - FatalError - << "The liquid component " << liquidName - << " does not exist in the species composition.Y() list.\n" - << "(Probably not defined in <chem.inp>)" - << abort(FatalError); - } - } - - if (readFields) - { - parcel::readFields(*this); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::spray::~spray() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spray/spray.H b/src/lagrangian/dieselSpray/spray/spray.H deleted file mode 100644 index 42729aea9d57130daa79dad60b7b9818d0c33148..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spray/spray.H +++ /dev/null @@ -1,356 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::spray - -Description - A spray is a cloud of parcels - -\*---------------------------------------------------------------------------*/ - -#ifndef spray_H -#define spray_H - -#include "autoPtr.H" -#include "parcel.H" -#include "injector.H" -#include "IOPtrList.H" -#include "interpolation.H" -#include "liquidProperties.H" -#include "liquidMixtureProperties.H" -#include "cachedRandom.H" -#include "thermoPhysicsTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -class atomizationModel; -class breakupModel; -class collisionModel; -class dispersionModel; -class dragModel; -class evaporationModel; -class injectorModel; -class heatTransferModel; -class wallModel; - -class basicMultiComponentMixture; - -/*---------------------------------------------------------------------------*\ - Class spray Declaration -\*---------------------------------------------------------------------------*/ - -class spray -: - public Cloud<parcel> -{ - // Private data - - // References to the database and meshes - - const Time& runTime_; - scalar time0_; - const fvMesh& mesh_; - - //- Random number generator - cachedRandom rndGen_; - - //- Acceleration due to gravity - const vector& g_; - - - // References to the physical fields - - const volVectorField& U_; - const volScalarField& rho_; - const volScalarField& p_; - const volScalarField& T_; - - - //- The spray properties - IOdictionary sprayProperties_; - - - //- Ambient Pressure - scalar ambientPressure_; - - //- Ambient Temperature - scalar ambientTemperature_; - - - //- The injectors - IOPtrList<injector> injectors_; - - - // References to the spray sub-models - - autoPtr<atomizationModel> atomization_; - autoPtr<dragModel> drag_; - autoPtr<evaporationModel> evaporation_; - autoPtr<heatTransferModel> heatTransfer_; - autoPtr<wallModel> wall_; - autoPtr<breakupModel> breakupModel_; - autoPtr<collisionModel> collisionModel_; - autoPtr<dispersionModel> dispersionModel_; - autoPtr<liquidMixtureProperties> fuels_; - autoPtr<injectorModel> injectorModel_; - - - //- Minimum number of lagrangian subcycles - const label subCycles_; - - - // Composition properties - - const PtrList<gasThermoPhysics>& gasProperties_; - const basicMultiComponentMixture& composition_; - - List<label> liquidToGasIndex_; - List<label> gasToLiquidIndex_; - List<bool> isLiquidFuel_; - - - // Necessary 2D-information - - bool twoD_; - vector axisOfSymmetry_; - vector axisOfWedge_; - vector axisOfWedgeNormal_; - scalar angleOfWedge_; - - - // Interpolation - - dictionary interpolationSchemes_; - - autoPtr<interpolation<vector> > UInterpolator_; - autoPtr<interpolation<scalar> > rhoInterpolator_; - autoPtr<interpolation<scalar> > pInterpolator_; - autoPtr<interpolation<scalar> > TInterpolator_; - - - // Spray Source Terms - - //- Momentum - vectorField sms_; - - //- Enthalpy - scalarField shs_; - - //- Mass - PtrList<scalarField> srhos_; - - //- The total mass of the injected liquid - scalar totalInjectedLiquidMass_; - - //- The (total added) injected kinetic energy of the liquid - scalar injectedLiquidKE_; - - - // Private Member Functions - - //- Disallow default bitwise copy construct - spray(const spray&); - - //- Disallow default bitwise assignment - void operator=(const spray&); - - -public: - - // Constructors - - //- Construct from components - spray - ( - const volVectorField& U, - const volScalarField& rho, - const volScalarField& p, - const volScalarField& T, - const basicMultiComponentMixture& composition, - const PtrList<gasThermoPhysics>& gasProperties, - const dictionary& thermophysicalProperties, - const dimensionedVector& g, - bool readFields = true - ); - - - //- Destructor - ~spray(); - - - // Member Functions - - // Spray tracking and evolution functions - - //- Evolve the spray (move, inject and breakup) - void evolve(); - - //- Move the spray parcels - void move(); - - //- Inject more parcels - void inject(); - - //- Primary breakup droplets - void atomizationLoop(); - - - //- Secondary breakup droplets - void breakupLoop(); - - - // Access - - inline const Time& runTime() const; - inline const fvMesh& mesh() const; - - inline const volVectorField& U() const; - inline const volScalarField& rho() const; - inline const volScalarField& p() const; - inline const volScalarField& T() const; - - inline PtrList<injector>& injectors(); - inline const PtrList<injector>& injectors() const; - - inline const atomizationModel& atomization() const; - inline const breakupModel& breakup() const; - inline const collisionModel& collisions() const; - inline const dispersionModel& dispersion() const; - inline const dragModel& drag() const; - inline const evaporationModel& evaporation() const; - inline const heatTransferModel& heatTransfer() const; - inline const injectorModel& injection() const; - inline const wallModel& wall() const; - - inline tmp<volVectorField> momentumSource() const; - inline tmp<volScalarField> evaporationSource(const label i) const; - inline tmp<volScalarField> heatTransferSource() const; - - inline cachedRandom& rndGen(); - inline label subCycles() const; - inline const vector& g() const; - - inline const liquidMixtureProperties& fuels() const; - inline const PtrList<gasThermoPhysics>& gasProperties() const; - inline const basicMultiComponentMixture& composition() const; - - inline const List<label>& liquidToGasIndex() const; - inline const List<label>& gasToLiquidIndex() const; - inline const List<bool>& isLiquidFuel() const; - - inline bool twoD() const; - inline const vector& axisOfSymmetry() const; - inline const vector& axisOfWedge() const; - inline const vector& axisOfWedgeNormal() const; - inline scalar angleOfWedge() const; - - inline const interpolation<vector>& UInterpolator() const; - inline const interpolation<scalar>& rhoInterpolator() const; - inline const interpolation<scalar>& pInterpolator() const; - inline const interpolation<scalar>& TInterpolator() const; - - inline vectorField& sms(); - inline const vectorField& sms() const; - - inline scalarField& shs(); - inline const scalarField& shs() const; - - inline PtrList<scalarField>& srhos(); - inline const PtrList<scalarField>& srhos() const; - - inline scalar ambientPressure() const; - - inline scalar ambientTemperature() const; - - - // Check - - //- Returns the liquid mass that has been injected - scalar injectedMass(const scalar t) const; - - //- Returns the liquid mass that will be injected by the injectors - scalar totalMassToInject() const; - - //- Returns the injected enthalpy - scalar injectedEnthalpy(const scalar t) const; - - //- Returns current total liquid mass in the domain - scalar liquidMass() const; - - //- Returns the enthalpy of all the liquid in the domain - // Hdrop = Hgas - Hlat - scalar liquidEnthalpy() const; - - //- Returns the enthalpy (total) of all the liquid in the domain - // Hdrop = Hgas - Hlat + (P-Psat)/rhoDrop; - scalar liquidTotalEnthalpy() const; - - //- Returns the kinetic energy of the liquid phase - scalar liquidKineticEnergy() const; - - //- Returns the injected kinetic energy of the liquid phase - scalar injectedLiquidKineticEnergy() const; - - //- Returns the droplet penetration for 'prc' percent of the - // liquid from nozzle 'nozzlei' - scalar liquidPenetration - ( - const label nozzlei, - const scalar prc - ) const; - - //- Returns the droplet penetration for 'prc' percent of the - // liquid from nozzle 0 - scalar liquidPenetration(const scalar prc) const; - - //- Return Sauter Mean Diameter - scalar smd() const; - - //- Return Maximum Diameter - scalar maxD() const; - - //- Return Ambient Pressure - void calculateAmbientPressure(); - - //- Return Ambient Temperature - void calculateAmbientTemperature(); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "sprayI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spray/sprayFunctions.C b/src/lagrangian/dieselSpray/spray/sprayFunctions.C deleted file mode 100644 index 74cfea0ff3ae99ffc51c694bb403e150eb467963..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spray/sprayFunctions.C +++ /dev/null @@ -1,398 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "spray.H" -#include "mathematicalConstants.H" - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::scalar Foam::spray::injectedMass(const scalar t) const -{ - scalar sum = 0.0; - - forAll(injectors_, i) - { - sum += injectors_[i].properties()->injectedMass(t); - } - - return sum; -} - - -Foam::scalar Foam::spray::totalMassToInject() const -{ - scalar sum = 0.0; - - forAll(injectors_, i) - { - sum += injectors_[i].properties()->mass(); - } - - return sum; -} - - -Foam::scalar Foam::spray::injectedEnthalpy -( - const scalar time -) const -{ - scalar sum = 0.0; - label Nf = fuels_->components().size(); - - forAll(injectors_, i) - { - scalar T = injectors_[i].properties()->T(time); - scalarField X(injectors_[i].properties()->X()); - scalar pi = 1.0e+5; - scalar hl = fuels_->hl(pi, T, X); - scalar Wl = fuels_->W(X); - scalar hg = 0.0; - - for (label j=0; j<Nf; j++) - { - label k = liquidToGasIndex_[j]; - hg += gasProperties()[k].H(T)*gasProperties()[k].W()*X[j]/Wl; - } - - sum += injectors_[i].properties()->injectedMass(time)*(hg-hl); - } - - return sum; -} - - -Foam::scalar Foam::spray::liquidMass() const -{ - scalar sum = 0.0; - - forAllConstIter(spray, *this, iter) - { - sum += iter().m(); - } - - if (twoD()) - { - sum *= constant::mathematical::twoPi/angleOfWedge(); - } - - reduce(sum, sumOp<scalar>()); - - return sum; -} - - -Foam::scalar Foam::spray::liquidEnthalpy() const -{ - scalar sum = 0.0; - label Nf = fuels().components().size(); - - forAllConstIter(spray, *this, iter) - { - scalar T = iter().T(); - scalar pc = p()[iter().cell()]; - scalar hlat = fuels().hl(pc, T, iter().X()); - scalar hg = 0.0; - scalar Wl = fuels().W(iter().X()); - - for (label j=0; j<Nf; j++) - { - label k = liquidToGasIndex_[j]; - - hg += - gasProperties()[k].H(T)*gasProperties()[k].W()*iter().X()[j] - /Wl; - } - - scalar h = hg - hlat; - sum += iter().m()*h; - } - - if (twoD()) - { - sum *= constant::mathematical::twoPi/angleOfWedge(); - } - - reduce(sum, sumOp<scalar>()); - - return sum; -} - - -Foam::scalar Foam::spray::liquidTotalEnthalpy() const -{ - scalar sum = 0.0; - label Nf = fuels().components().size(); - - forAllConstIter(spray, *this, iter) - { - label cellI = iter().cell(); - scalar T = iter().T(); - scalar pc = p()[cellI]; - scalar rho = fuels().rho(pc, T, iter().X()); - scalar hlat = fuels().hl(pc, T, iter().X()); - scalar hg = 0.0; - scalar Wl = fuels().W(iter().X()); - - for (label j=0; j<Nf; j++) - { - label k = liquidToGasIndex_[j]; - hg += - gasProperties()[k].H(T)*gasProperties()[k].W()*iter().X()[j] - /Wl; - } - - scalar psat = fuels().pv(pc, T, iter().X()); - - scalar h = hg - hlat + (pc - psat)/rho; - sum += iter().m()*h; - } - - if (twoD()) - { - sum *= constant::mathematical::twoPi/angleOfWedge(); - } - - reduce(sum, sumOp<scalar>()); - - return sum; -} - - -Foam::scalar Foam::spray::liquidKineticEnergy() const -{ - scalar sum = 0.0; - - forAllConstIter(spray, *this, iter) - { - const scalar ke = pow(mag(iter().U()), 2.0); - sum += iter().m()*ke; - } - - if (twoD()) - { - sum *= constant::mathematical::twoPi/angleOfWedge(); - } - - reduce(sum, sumOp<scalar>()); - - return 0.5*sum; - -} - - -Foam::scalar Foam::spray::injectedLiquidKineticEnergy() const -{ - return injectedLiquidKE_; -} - - -Foam::scalar Foam::spray::liquidPenetration(const scalar prc) const -{ - return liquidPenetration(0, prc); -} - - -Foam::scalar Foam::spray::liquidPenetration -( - const label nozzlei, - const scalar prc -) const -{ - - label nHoles = injectors_[nozzlei].properties()->nHoles(); - vector ip(vector::zero); - if (nHoles > 1) - { - for (label i=0;i<nHoles;i++) - { - ip += injectors_[nozzlei].properties()->position(i); - } - ip /= nHoles; - } - else - { - ip = injectors_[nozzlei].properties()->position(0); - } - -// vector ip = injectors_[nozzlei].properties()->position(); - scalar d = 0.0; - scalar mTot = 0.0; - - label Np = size(); - - // arrays containing the parcels mass and - // distance from injector in ascending order - scalarField m(Np); - scalarField dist(Np); - label n = 0; - - if (Np > 1) - { - // first arrange the parcels in ascending order - // the first parcel is closest to injector - // and the last one is most far away. - spray::const_iterator first = begin(); - m[n] = first().m(); - dist[n] = mag(first().position() - ip); - - mTot += m[n]; - - for - ( - spray::const_iterator iter = ++first; - iter != end(); - ++iter - ) - { - scalar de = mag(iter().position() - ip); - scalar me = iter().m(); - mTot += me; - - n++; - - label i = 0; - bool found = false; - - // insert the parcel in the correct place - // and move the others - while ( ( i < n-1 ) && ( !found ) ) - { - if (de < dist[i]) - { - found = true; - for (label j=n; j>i; j--) - { - m[j] = m[j-1]; - dist[j] = dist[j-1]; - } - m[i] = me; - dist[i] = de; - } - i++; - } - - if (!found) - { - m[n] = me; - dist[n] = de; - } - } - } - - reduce(mTot, sumOp<scalar>()); - - if (Np > 1) - { - scalar mLimit = prc*mTot; - scalar mOff = (1.0 - prc)*mTot; - - // 'prc' is large enough that the parcel most far - // away will be used, no need to loop... - if (mLimit > mTot - m[Np-1]) - { - d = dist[Np-1]; - } - else - { - scalar mOffSum = 0.0; - label i = Np; - - while ((mOffSum < mOff) && (i>0)) - { - i--; - mOffSum += m[i]; - } - d = dist[i]; - } - - } - else - { - if (Np > 0) - { - spray::const_iterator iter = begin(); - d = mag(iter().position() - ip); - } - } - - reduce(d, maxOp<scalar>()); - - return d; -} - - -Foam::scalar Foam::spray::smd() const -{ - scalar numerator = 0.0, denominator = VSMALL; - - forAllConstIter(spray, *this, iter) - { - label cellI = iter().cell(); - scalar Pc = p()[cellI]; - scalar T = iter().T(); - scalar rho = fuels_->rho(Pc, T, iter().X()); - - scalar tmp = iter().N(rho)*pow(iter().d(), 2.0); - numerator += tmp*iter().d(); - denominator += tmp; - } - - reduce(numerator, sumOp<scalar>()); - reduce(denominator, sumOp<scalar>()); - - return numerator/denominator; -} - - -Foam::scalar Foam::spray::maxD() const -{ - scalar maxD = 0.0; - - forAllConstIter(spray, *this, iter) - { - maxD = max(maxD, iter().d()); - } - - reduce(maxD, maxOp<scalar>()); - - return maxD; -} - - -void Foam::spray::calculateAmbientPressure() -{ - ambientPressure_ = p_.average().value(); -} - - -void Foam::spray::calculateAmbientTemperature() -{ - ambientTemperature_ = T_.average().value(); -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spray/sprayI.H b/src/lagrangian/dieselSpray/spray/sprayI.H deleted file mode 100644 index 7f7aa209841f6e498a5645a13772fcd089b2ee3c..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spray/sprayI.H +++ /dev/null @@ -1,382 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -inline const Foam::Time& Foam::spray::runTime() const -{ - return runTime_; -} - - -inline const Foam::fvMesh& Foam::spray::mesh() const -{ - return mesh_; -} - - -inline const Foam::volVectorField& Foam::spray::U() const -{ - return U_; -} - - -inline const Foam::volScalarField& Foam::spray::rho() const -{ - return rho_; -} - - -inline const Foam::volScalarField& Foam::spray::p() const -{ - return p_; -} - - -inline const Foam::volScalarField& Foam::spray::T() const -{ - return T_; -} - - -inline Foam::PtrList<Foam::injector>& Foam::spray::injectors() -{ - return injectors_; -} - - -inline const Foam::PtrList<Foam::injector>& Foam::spray::injectors() const -{ - return injectors_; -} - - -inline const Foam::atomizationModel& Foam::spray::atomization() const -{ - return atomization_(); -} - - -inline const Foam::breakupModel& Foam::spray::breakup() const -{ - return breakupModel_(); -} - - -inline const Foam::collisionModel& Foam::spray::collisions() const -{ - return collisionModel_(); -} - - -inline const Foam::dispersionModel& Foam::spray::dispersion() const -{ - return dispersionModel_(); -} - - -inline const Foam::dragModel& Foam::spray::drag() const -{ - return drag_(); -} - - -inline const Foam::evaporationModel& Foam::spray::evaporation() const -{ - return evaporation_(); -} - - -inline const Foam::heatTransferModel& Foam::spray::heatTransfer() const -{ - return heatTransfer_(); -} - - -inline const Foam::injectorModel& Foam::spray::injection() const -{ - return injectorModel_(); -} - - -inline const Foam::wallModel& Foam::spray::wall() const -{ - return wall_(); -} - - -inline Foam::tmp<Foam::volVectorField> Foam::spray::momentumSource() const -{ - tmp<volVectorField> tsource - ( - new volVectorField - ( - IOobject - ( - "sms", - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedVector - ( - "zero", - dimensionSet(1, -2, -2, 0, 0), - vector::zero - ) - ) - ); - - tsource().internalField() = sms_/runTime_.deltaTValue()/mesh_.V(); - - return tsource; -} - - -inline Foam::tmp<Foam::volScalarField> -Foam::spray::evaporationSource(const label si) const -{ - tmp<volScalarField> tsource - ( - new volScalarField - ( - IOobject - ( - "srhos", - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedScalar("zero", dimensionSet(1, -3, -1, 0, 0), 0.0) - ) - ); - - if (isLiquidFuel_[si]) - { - label fi = gasToLiquidIndex_[si]; - tsource().internalField() = srhos_[fi]/runTime_.deltaTValue()/mesh_.V(); - } - else - { - scalarField s(mesh_.nCells(), 0.0); - tsource().internalField() = s; - } - - return tsource; -} - - -inline Foam::tmp<Foam::volScalarField> Foam::spray::heatTransferSource() const -{ - tmp<volScalarField> tsource - ( - new volScalarField - ( - IOobject - ( - "shs", - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedScalar("zero", dimensionSet(1, -1, -3, 0, 0), 0.0) - ) - ); - - tsource().internalField() = shs_/runTime_.deltaTValue()/mesh_.V(); - - return tsource; -} - - -inline Foam::cachedRandom& Foam::spray::rndGen() -{ - return rndGen_; -} - - -inline Foam::label Foam::spray::subCycles() const -{ - return subCycles_; -} - - -inline const Foam::vector& Foam::spray::g() const -{ - return g_; -} - - -inline const Foam::liquidMixtureProperties& Foam::spray::fuels() const -{ - return fuels_(); -} - - -inline const Foam::PtrList<Foam::gasThermoPhysics>& -Foam::spray::gasProperties() const -{ - return gasProperties_; -} - - -inline const Foam::basicMultiComponentMixture& Foam::spray::composition() const -{ - return composition_; -} - - -inline const Foam::List<Foam::label>& Foam::spray::liquidToGasIndex() const -{ - return liquidToGasIndex_; -} - - -inline const Foam::List<Foam::label>& Foam::spray::gasToLiquidIndex() const -{ - return gasToLiquidIndex_; -} - - -inline const Foam::List<bool>& Foam::spray::isLiquidFuel() const -{ - return isLiquidFuel_; -} - - -inline bool Foam::spray::twoD() const -{ - return twoD_; -} - - -inline const Foam::vector& Foam::spray::axisOfSymmetry() const -{ - return axisOfSymmetry_; -} - - -inline const Foam::vector& Foam::spray::axisOfWedge() const -{ - return axisOfWedge_; -} - - -inline const Foam::vector& Foam::spray::axisOfWedgeNormal() const -{ - return axisOfWedgeNormal_; -} - - -inline Foam::scalar Foam::spray::angleOfWedge() const -{ - return angleOfWedge_; -} - - -inline const Foam::interpolation<Foam::vector>& -Foam::spray::UInterpolator() const -{ - return UInterpolator_; -} - - -inline const Foam::interpolation<Foam::scalar>& -Foam::spray::rhoInterpolator() const -{ - return rhoInterpolator_; -} - - -inline const Foam::interpolation<Foam::scalar>& -Foam::spray::pInterpolator() const -{ - return pInterpolator_; -} - - -inline const Foam::interpolation<Foam::scalar>& -Foam::spray::TInterpolator() const -{ - return TInterpolator_; -} - - -inline Foam::vectorField& Foam::spray::sms() -{ - return sms_; -} - - -inline const Foam::vectorField& Foam::spray::sms() const -{ - return sms_; -} - - -inline Foam::scalarField& Foam::spray::shs() -{ - return shs_; -} - - -inline const Foam::scalarField& Foam::spray::shs() const -{ - return shs_; -} - - -inline Foam::PtrList<Foam::scalarField>& Foam::spray::srhos() -{ - return srhos_; -} - - -inline const Foam::PtrList<Foam::scalarField>& Foam::spray::srhos() const -{ - return srhos_; -} - - -inline Foam::scalar Foam::spray::ambientPressure() const -{ - return ambientPressure_; -} - - -inline Foam::scalar Foam::spray::ambientTemperature() const -{ - return ambientTemperature_; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spray/sprayInject.C b/src/lagrangian/dieselSpray/spray/sprayInject.C deleted file mode 100644 index a1f5d666f52faf54eabf8212d6b121e8baf12307..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spray/sprayInject.C +++ /dev/null @@ -1,185 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "spray.H" -#include "breakupModel.H" -#include "collisionModel.H" -#include "dispersionModel.H" -#include "injectorModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -void Foam::spray::inject() -{ - scalar time = runTime_.value(); - scalar time0 = time0_; - - parcel::trackingData td(*this); - - // Inject the parcels for each injector sequentially - forAll(injectors_, i) - { - autoPtr<injectorType>& it = injectors()[i].properties(); - if (!it->pressureIndependentVelocity()) - { - scalar referencePressure = p().average().value(); - it->correctProfiles(fuels(), referencePressure); - } - - const label nHoles = it->nHoles(); - - // parcels have the same mass during a timestep - scalar mass = it->mass(time0, time, twoD_, angleOfWedge_); - - label Np = it->nParcelsToInject(time0, time); - - if (mass > 0) - { - Np = max(1, Np); - scalar mp = mass/Np/nHoles; - - // constT is only larger than zero for the first - // part of the injection - scalar constT = max(0.0, it->tsoi() - time0); - - // deltaT is the duration of injection during this timestep - scalar deltaT = min - ( - runTime_.deltaTValue(), - min - ( - time - it->tsoi(), - it->teoi() - time0 - ) - ); - - for (label j=0; j<Np; j++) - { - // calculate the time of injection for parcel 'j' - scalar toi = time0 + constT + deltaT*j/scalar(Np); - - for (label n=0; n<nHoles; n++) - { - - // calculate the velocity of the injected parcel - vector injectionPosition = it->position - ( - n, - toi, - twoD_, - angleOfWedge_, - axisOfSymmetry_, - axisOfWedge_, - axisOfWedgeNormal_, - rndGen_ - ); - - scalar diameter = injection().d0(i, toi); - vector direction = - injection().direction(i, n, toi, diameter); - vector U = injection().velocity(i, toi)*direction; - - scalar symComponent = direction & axisOfSymmetry_; - vector normal = direction - symComponent*axisOfSymmetry_; - normal /= mag(normal); - - // should be set from dict or model - scalar deviation = breakup().y0(); - scalar ddev = breakup().yDot0(); - - label injectorCell = -1; - label injectorTetFaceI = -1; - label injectorTetPtI = -1; - - mesh_.findCellFacePt - ( - injectionPosition, - injectorCell, - injectorTetFaceI, - injectorTetPtI - ); - - #include "findInjectorCell.H" - - if (injectorCell >= 0) - { - scalar liquidCore = 1.0; - - // construct the parcel that is to be injected - - parcel* pPtr = new parcel - ( - mesh_, - injectionPosition, - injectorCell, - injectorTetFaceI, - injectorTetPtI, - normal, - diameter, - it->T(toi), - mp, - deviation, - ddev, - 0.0, - 0.0, - 0.0, - liquidCore, - scalar(i), - U, - vector::zero, - it->X(), - fuels_->components() - ); - - injectedLiquidKE_ += 0.5*pPtr->m()*magSqr(U); - - scalar dt = time - toi; - - pPtr->stepFraction() = - (runTime_.deltaTValue() - dt) - /runTime_.deltaTValue(); - - bool keepParcel = - pPtr->move(td, runTime_.deltaTValue()); - - if (keepParcel) - { - addParticle(pPtr); - } - else - { - delete pPtr; - } - } // if (injectorCell.... - } // for (label n=0... - } // for (label j=0.... - } // if (mass>0)... - } // forAll(injectors)... - - time0_ = time; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spray/sprayOps.C b/src/lagrangian/dieselSpray/spray/sprayOps.C deleted file mode 100644 index 83f7612100aeec6fa0c648fd2e13146c7b15626b..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spray/sprayOps.C +++ /dev/null @@ -1,144 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "spray.H" -#include "atomizationModel.H" -#include "breakupModel.H" -#include "collisionModel.H" -#include "dispersionModel.H" -#include "interpolation.H" -#include "processorPolyPatch.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -void Foam::spray::evolve() -{ - sms_.setSize(rho_.size()); - shs_.setSize(rho_.size()); - forAll(srhos_, i) - { - srhos_[i].setSize(rho_.size()); - } - - UInterpolator_ = interpolation<vector>::New(interpolationSchemes_, U_); - - rhoInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, rho_); - - pInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, p_); - - TInterpolator_ = interpolation<scalar>::New(interpolationSchemes_, T_); - - calculateAmbientPressure(); - calculateAmbientTemperature(); - collisions().collideParcels(runTime_.deltaTValue()); - move(); - dispersion().disperseParcels(); - inject(); - atomizationLoop(); - breakupLoop(); - - UInterpolator_.clear(); - rhoInterpolator_.clear(); - pInterpolator_.clear(); - TInterpolator_.clear(); -} - - -void Foam::spray::move() -{ - // Reset Spray Source Terms - sms_ = vector::zero; - shs_ = 0.0; - forAll(srhos_, i) - { - srhos_[i] = 0.0; - } - - parcel::trackingData td(*this); - Cloud<parcel>::move(td, runTime_.deltaTValue()); -} - - -void Foam::spray::breakupLoop() -{ - forAllIter(spray, *this, elmnt) - { - // interpolate... - vector velocity = UInterpolator().interpolate - ( - elmnt().position(), - elmnt().currentTetIndices() - ); - - // liquidCore < 0.5 indicates discrete drops - if (elmnt().liquidCore() <= 0.5) - { - breakup().updateParcelProperties - ( - elmnt(), - runTime_.deltaTValue(), - velocity, - fuels_ - ); - - breakup().breakupParcel - ( - elmnt(), - runTime_.deltaTValue(), - velocity, - fuels_ - ); - } - } -} - - -void Foam::spray::atomizationLoop() -{ - forAllIter(spray, *this, elmnt) - { - // interpolate... - vector velocity = UInterpolator().interpolate - ( - elmnt().position(), - elmnt().currentTetIndices() - ); - - // liquidCore > 0.5 indicates a liquid core - if (elmnt().liquidCore() > 0.5) - { - atomization().atomizeParcel - ( - elmnt(), - runTime_.deltaTValue(), - velocity, - fuels_ - ); - } - } -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C deleted file mode 100644 index 598b5ec7d59cadac8099350479f9ce27b6d588d6..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.C +++ /dev/null @@ -1,375 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "LISA.H" -#include "addToRunTimeSelectionTable.H" -#include "basicMultiComponentMixture.H" -#include "mathematicalConstants.H" -#include "RosinRammler.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(LISA, 0); - - addToRunTimeSelectionTable - ( - atomizationModel, - LISA, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::LISA::LISA -( - const dictionary& dict, - spray& sm -) -: - atomizationModel(dict, sm), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - Cl_(readScalar(coeffsDict_.lookup("Cl"))), - cTau_(readScalar(coeffsDict_.lookup("cTau"))), - Q_(readScalar(coeffsDict_.lookup("Q"))), - J_(readScalar(coeffsDict_.lookup("J"))) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::LISA::~LISA() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::LISA::atomizeParcel -( - parcel& p, - const scalar deltaT, - const vector& vel, - const liquidMixtureProperties& fuels -) const -{ - const PtrList<volScalarField>& Y = spray_.composition().Y(); - - label cellI = p.cell(); - scalar pressure = spray_.p()[cellI]; - scalar temperature = spray_.T()[cellI]; - scalar Taverage = p.T() + (temperature - p.T())/3.0; - scalar Winv = 0.0; - - forAll(Y, i) - { - Winv += Y[i][cellI]/spray_.gasProperties()[i].W(); - } - - scalar R = specie::RR*Winv; - - // ideal gas law to evaluate density - scalar rhoAverage = pressure/R/Taverage; - //scalar nuAverage = muAverage/rhoAverage; - scalar sigma = fuels.sigma(pressure, p.T(), p.X()); - - - // The We and Re numbers are to be evaluated using the 1/3 rule. - - scalar WeberNumber = p.We(vel, rhoAverage, sigma); - - scalar tau = 0.0; - scalar dL = 0.0; - scalar k = 0.0; - scalar muFuel = fuels.mu(pressure, p.T(), p.X()); - scalar rhoFuel = fuels.rho(1.0e+5, p.T(), p.X()); - scalar nuFuel = muFuel/rhoFuel; - - // Might be the relative velocity between Liquid and Gas, but using the - // absolute velocity of the parcel as suggested by the authors - // scalar U = mag(p.Urel(vel)); - scalar U = mag(p.U()); - - p.ct() += deltaT; - - scalar Q = rhoAverage/rhoFuel; - - const injectorType& it = - spray_.injectors()[label(p.injector())].properties(); - - if (it.nHoles() > 1) - { - Info<< "Warning: This atomization model is not suitable for " - << "multihole injectors. " - << "Only the first hole will be used." << endl; - } - - const vector itPosition = it.position(0); - scalar pWalk = mag(p.position() - itPosition); - - - // Updating liquid sheet tickness... that is the droplet diameter - - const vector direction = it.direction(0, spray_.runTime().value()); - - scalar h = (p.position() - itPosition) & direction; - - scalar d = sqrt(sqr(pWalk)-sqr(h)); - - scalar time = pWalk/mag(p.U()); - - scalar elapsedTime = spray_.runTime().value(); - - scalar massFlow = it.massFlowRate(max(0.0,elapsedTime-time)); - - scalar hSheet = massFlow/(constant::mathematical::pi*d*rhoFuel*mag(p.U())); - - p.d() = min(hSheet,p.d()); - - if (WeberNumber > 27.0/16.0) - { - scalar kPos = 0.0; - scalar kNeg = Q*sqr(U)*rhoFuel/sigma; - - scalar derivativePos = sqrt(Q*pow(U,2.0)); - - scalar derivativeNeg = - ( - 8.0*sqr(nuFuel)*pow3(kNeg) - + Q*sqr(U)*kNeg - - 3.0*sigma/2.0/rhoFuel*sqr(kNeg) - ) - /sqrt - ( - 4.0*sqr(nuFuel)*pow4(kNeg) - + Q*sqr(U)*sqr(kNeg) - - sigma*pow3(kNeg)/rhoFuel - ) - - 4.0*nuFuel*kNeg; - - scalar kOld = 0.0; - - - for (label i=0; i<40; i++) - { - - k = kPos - - (derivativePos/((derivativeNeg - derivativePos)/(kNeg - kPos))); - - scalar derivativek = - ( - 8.0*sqr(nuFuel)*pow3(k) - + Q*sqr(U)*k - - 3.0*sigma/2.0/rhoFuel*sqr(k) - ) - /sqrt - ( - 4.0*sqr(nuFuel)*pow4(k) - + Q*sqr(U)*sqr(k) - - sigma*pow3(k)/rhoFuel - ) - - 4.0*nuFuel*k; - - if (derivativek > 0) - { - derivativePos = derivativek; - kPos = k; - } - else - { - derivativeNeg = derivativek; - kNeg = k; - } - - if (mag(k - kOld)/k < 1e-4) - { - break; - } - - kOld = k; - } - - scalar omegaS = - - 2.0 * nuFuel * pow(k, 2.0) - + sqrt - ( - 4.0*sqr(nuFuel)*pow4(k) - + Q*sqr(U)*sqr(k) - - sigma*pow3(k)/rhoFuel - ); - - tau = cTau_/omegaS; - - dL = sqrt(8.0*p.d()/k); - } - else - { - k = rhoAverage*pow(U, 2.0)/2.0*sigma; - - scalar J = pWalk*p.d()/2.0; - - tau = pow(3.0*cTau_, 2.0/3.0)*cbrt(J*sigma/(sqr(Q)*pow4(U)*rhoFuel)); - - dL = sqrt(4.0*p.d()/k); - } - - - scalar kL = 1.0/(dL*sqrt(0.5 + 1.5*muFuel/sqrt(rhoFuel*sigma*dL))); - - scalar dD = cbrt(3.0*constant::mathematical::pi*sqr(dL)/kL); - - scalar lisaExp = 0.27; - scalar ambientPressure = 1.0e+5; - - scalar pRatio = spray_.ambientPressure()/ambientPressure; - - dD = dD*pow(pRatio,lisaExp); - - - // modifications to take account of the flash boiling on primary breakUp - - scalar pExp = 0.135; - - scalar chi = 0.0; - - label Nf = fuels.components().size(); - - scalar Td = p.T(); - - for (label i = 0; i < Nf; i++) - { - if - ( - fuels.properties()[i].pv(spray_.ambientPressure(), Td) - >= 0.999*spray_.ambientPressure() - ) - { - // The fuel is boiling..... - // Calculation of the boiling temperature - - scalar tBoilingSurface = Td; - - label Niter = 200; - - for (label k=0; k< Niter ; k++) - { - scalar pBoil = - fuels.properties()[i].pv(pressure, tBoilingSurface); - - if (pBoil > pressure) - { - tBoilingSurface = - tBoilingSurface - (Td - temperature)/Niter; - } - else - { - break; - } - } - - scalar hl = - fuels.properties()[i].hl - ( - spray_.ambientPressure(), - tBoilingSurface - ); - - scalar iTp = - fuels.properties()[i].h(spray_.ambientPressure(), Td) - - spray_.ambientPressure() - /fuels.properties()[i].rho(spray_.ambientPressure(), Td); - - scalar iTb = - fuels.properties()[i].h - ( - spray_.ambientPressure(), - tBoilingSurface - ) - - spray_.ambientPressure() - /fuels.properties()[i].rho - ( - spray_.ambientPressure(), - tBoilingSurface - ); - - chi += p.X()[i]*(iTp - iTb)/hl; - } - } - - // bounding chi - - chi = max(chi, 0.0); - chi = min(chi, 1.0); - - // modifing dD to take account of flash boiling - - dD = dD*(1.0 - chi*pow(pRatio, -pExp)); - - scalar lBU = Cl_ * mag(p.U())*tau; - - if (pWalk > lBU) - { - p.liquidCore() = 0.0; - - // calculate the new diameter with a Rosin Rammler distribution - - scalar minValue = min(p.d(), dD/10.0); - - scalar maxValue = dD; - - if (maxValue - minValue < SMALL) - { - minValue = p.d()/10.0; - } - - scalar range = maxValue - minValue; - - scalar y = 0; - scalar x = 0; - scalar px = 0.0; - scalar nExp = 1; - - do - { - x = minValue + range*rndGen_.sample01<scalar>(); - y = rndGen_.sample01<scalar>(); - - scalar xx = pow(x/dD, nExp); - - px = xx*exp(-xx); - - } while (y >= px); - - // New droplet diameter - - p.d() = x; - p.ct() = 0.0; - } -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.H b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.H deleted file mode 100644 index 69e8649a14e59ed1419099a2e8017ca11311e7e6..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/LISA/LISA.H +++ /dev/null @@ -1,113 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::LISA - -Description - Primary Breakup Model for pressure swirl atomizers. - - Accurate description in - \verbatim - P.K. Senecal, D.P. Shmidt, I. Nouar, C.J. Rutland, R.D. Reitz, M. Corradini - "Modeling high-speed viscous liquid sheet atomization" - International Journal of Multiphase Flow 25 (1999) pags. 1073-1097 - \endverbatim - - and - - \verbatim - D.P. Schmidt, I. Nouar, P.K. Senecal, C.J. Rutland, J.K. Martin, R.D. Reitz - "Pressure-Swirl Atomization in the Near Field" - SAE Techical Paper Series 1999-01-0496 - \endverbatim - - -\*---------------------------------------------------------------------------*/ - -#ifndef LISA_H -#define LISA_H - -#include "atomizationModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class LISA Declaration -\*---------------------------------------------------------------------------*/ - -class LISA -: - public atomizationModel -{ -private: - - // Private data - - dictionary coeffsDict_; - scalar Cl_; - scalar cTau_; - scalar Q_; - scalar J_; - - -public: - - //- Runtime type information - TypeName("LISA"); - - - // Constructors - - //- Construct from components - LISA(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~LISA(); - - - // Member Operators - - void atomizeParcel - ( - parcel& parcel, - const scalar deltaT, - const vector& vel, - const liquidMixtureProperties& fuels - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModel.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModel.C deleted file mode 100644 index b859220c32fe34e0225f9a594027d66e2299422f..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModel.C +++ /dev/null @@ -1,58 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" -#include "atomizationModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(atomizationModel, 0); - defineRunTimeSelectionTable(atomizationModel, dictionary); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::atomizationModel::atomizationModel -( - const dictionary& dict, - spray& sm -) -: - dict_(dict), - spray_(sm), - rndGen_(sm.rndGen()) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // - -Foam::atomizationModel::~atomizationModel() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModel.H b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModel.H deleted file mode 100644 index bde0432f0db2ac120fe13f3b3049a495eb085760..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModel.H +++ /dev/null @@ -1,121 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::atomizationModel - -Description - Base class for selecting the atomization model - -\*---------------------------------------------------------------------------*/ - -#ifndef atomizationModel_H -#define atomizationModel_H - -#include "IOdictionary.H" -#include "spray.H" -#include "autoPtr.H" -#include "runTimeSelectionTables.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class atomizationModel Declaration -\*---------------------------------------------------------------------------*/ - -class atomizationModel -{ - -protected: - - // Protected data - - const dictionary& dict_; - spray& spray_; - cachedRandom& rndGen_; - - -public: - - //- Runtime type information - TypeName("atomizationModel"); - - // Declare runtime constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - atomizationModel, - dictionary, - ( - const dictionary& dict, - spray& sm - ), - (dict, sm) - ); - - - // Constructors - - //- Construct from components - atomizationModel(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~atomizationModel(); - - - // Selector - - static autoPtr<atomizationModel> New - ( - const dictionary& dict, - spray& sm - ); - - - // Member Functions - - virtual void atomizeParcel - ( - parcel& parcel, - const scalar deltaT, - const vector& vel, - const liquidMixtureProperties& fuels - ) const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // - diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModelNew.C deleted file mode 100644 index de0ee4641c1b8013c454a594590b2246aec23f26..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/atomizationModelNew.C +++ /dev/null @@ -1,63 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" -#include "atomizationModel.H" -#include "LISA.H" -#include "noAtomization.H" - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::atomizationModel> Foam::atomizationModel::New -( - const dictionary& dict, - spray& sm -) -{ - const word modelType(dict.lookup("atomizationModel")); - - Info<< "Selecting atomizationModel " << modelType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn - ( - "atomizationModel::New(const dictionary&, const spray&)" - ) << "Unknown atomizationModel type " - << modelType << nl << nl - << "Valid atomizationModel types are :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); - } - - return autoPtr<atomizationModel>(cstrIter()(dict, sm)); -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.C deleted file mode 100644 index b06becb42d576f9b118d733d94b1bede596b6946..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.C +++ /dev/null @@ -1,140 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "blobsSheetAtomization.H" -#include "addToRunTimeSelectionTable.H" -#include "basicMultiComponentMixture.H" -#include "mathematicalConstants.H" -#include "RosinRammler.H" - - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(blobsSheetAtomization, 0); - - addToRunTimeSelectionTable - ( - atomizationModel, - blobsSheetAtomization, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::blobsSheetAtomization::blobsSheetAtomization -( - const dictionary& dict, - spray& sm -) -: - atomizationModel(dict, sm), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - B_(readScalar(coeffsDict_.lookup("B"))), - angle_(readScalar(coeffsDict_.lookup("angle"))) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::blobsSheetAtomization::~blobsSheetAtomization() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::blobsSheetAtomization::atomizeParcel -( - parcel& p, - const scalar deltaT, - const vector& vel, - const liquidMixtureProperties& fuels -) const -{ - const PtrList<volScalarField>& Y = spray_.composition().Y(); - - label cellI = p.cell(); - scalar pressure = spray_.p()[cellI]; - scalar temperature = spray_.T()[cellI]; - scalar Taverage = p.T() + (temperature - p.T())/3.0; - - scalar Winv = 0.0; - forAll(Y, i) - { - Winv += Y[i][cellI]/spray_.gasProperties()[i].W(); - } - scalar R = specie::RR*Winv; - - // ideal gas law to evaluate density - scalar rhoAverage = pressure/R/Taverage; - scalar sigma = fuels.sigma(pressure, p.T(), p.X()); - - - // The We and Re numbers are to be evaluated using the 1/3 rule. - - scalar rhoFuel = fuels.rho(1.0e+5, p.T(), p.X()); - - scalar U = mag(p.Urel(vel)); - - const injectorType& it = - spray_.injectors()[label(p.injector())].properties(); - - vector itPosition(vector::zero); - label nHoles = it.nHoles(); - if (nHoles > 1) - { - for (label i=0; i<nHoles;i++) - { - itPosition += it.position(i); - } - itPosition /= nHoles; - } - else - { - itPosition = it.position(0); - } -// const vector itPosition = it.position(); - - - scalar lBU = - B_*sqrt - ( - rhoFuel*sigma*p.d()*cos(angle_*constant::mathematical::pi/360.0) - /sqr(rhoAverage*U) - ); - - scalar pWalk = mag(p.position() - itPosition); - - if (pWalk > lBU && p.liquidCore() == 1.0) - { - p.liquidCore() = 0.0; - } -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.H b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.H deleted file mode 100644 index 44ed713f113fa5a7cba5c29fe2f91a03a60fb989..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/blobsSheetAtomization/blobsSheetAtomization.H +++ /dev/null @@ -1,108 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::blobsSheetAtomization - -Description - Primary Breakup Model for pressure swirl atomizers. - - Accurate description in - \verbatim - Z. Han, S. Parrish, P.V. Farrell, R.D. Reitz - "Modeling Atomization Processes Of Pressure Swirl Hollow-Cone Fuel Sprays" - Atomization and Sprays, vol. 7, pp. 663-684, 1997 - - and - - L. Allocca, G. Bella, A. De Vita, L. Di Angelo - "Experimental Validation of a GDI Spray Model" - SAE Technical Paper Series, 2002-01-1137 - \endverbatim - -\*---------------------------------------------------------------------------*/ - -#ifndef blobsSheetAtomization_H -#define blobsSheetAtomization_H - -#include "atomizationModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class blobsSheetAtomization Declaration -\*---------------------------------------------------------------------------*/ - -class blobsSheetAtomization -: - public atomizationModel -{ -private: - - // Private data - - dictionary coeffsDict_; - scalar B_; - scalar angle_; - - -public: - - //- Runtime type information - TypeName("blobsSheetAtomization"); - - - // Constructors - - //- Construct from components - blobsSheetAtomization(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~blobsSheetAtomization(); - - - // Member Operators - - void atomizeParcel - ( - parcel& parcel, - const scalar deltaT, - const vector& vel, - const liquidMixtureProperties& fuels - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.C deleted file mode 100644 index 20326eb8123dc8a6d34665a3bee8636b530ed122..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.C +++ /dev/null @@ -1,79 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "noAtomization.H" -#include "addToRunTimeSelectionTable.H" -#include "basicMultiComponentMixture.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(noAtomization, 0); - - addToRunTimeSelectionTable - ( - atomizationModel, - noAtomization, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::noAtomization::noAtomization -( - const dictionary& dict, - spray& sm -) -: - atomizationModel(dict, sm) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::noAtomization::~noAtomization() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::noAtomization::atomizeParcel -( - parcel& p, - const scalar deltaT, - const vector& vel, - const liquidMixtureProperties& fuels -) const -{ - p.liquidCore() = 0.0; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.H b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.H deleted file mode 100644 index b10b606a07f513a6de5ea8d1875a72abb580fbc6..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/noAtomization/noAtomization.H +++ /dev/null @@ -1,87 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::noAtomization - -Description - secondary atomization model for the spray - -\*---------------------------------------------------------------------------*/ - -#ifndef noAtomization_H -#define noAtomization_H - -#include "atomizationModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class noAtomization Declaration -\*---------------------------------------------------------------------------*/ - -class noAtomization -: - public atomizationModel -{ - -public: - - //- Runtime type information - TypeName("off"); - - - // Constructors - - //- Construct from components - noAtomization(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~noAtomization(); - - - // Member Operators - - void atomizeParcel - ( - parcel& parcel, - const scalar deltaT, - const vector& vel, - const liquidMixtureProperties& fuels - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.C deleted file mode 100644 index eecccabf0dfeb8c915338434f0bccf95c9c3713f..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.C +++ /dev/null @@ -1,191 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "ETAB.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - - defineTypeNameAndDebug(ETAB, 0); - - addToRunTimeSelectionTable - ( - breakupModel, - ETAB, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::ETAB::ETAB -( - const dictionary& dict, - spray& sm -) -: - breakupModel(dict, sm), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - Cmu_(readScalar(coeffsDict_.lookup("Cmu"))), - Comega_(readScalar(coeffsDict_.lookup("Comega"))), - k1_(readScalar(coeffsDict_.lookup("k1"))), - k2_(readScalar(coeffsDict_.lookup("k2"))), - WeCrit_(readScalar(coeffsDict_.lookup("WeCrit"))), - WeTransition_(readScalar(coeffsDict_.lookup("WeTransition"))), - AWe_(0.0) -{ - scalar k21 = k2_/k1_; - AWe_ = (k21*sqrt(WeTransition_) - 1.0)/pow4(WeTransition_); -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::ETAB::~ETAB() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::ETAB::breakupParcel -( - parcel& p, - const scalar deltaT, - const vector& Ug, - const liquidMixtureProperties& fuels -) const -{ - scalar T = p.T(); - scalar pc = spray_.p()[p.cell()]; - scalar r = 0.5*p.d(); - scalar r2 = r*r; - scalar r3 = r*r2; - - scalar rho = fuels.rho(pc, T, p.X()); - scalar sigma = fuels.sigma(pc, T, p.X()); - scalar mu = fuels.mu(pc, T, p.X()); - - // inverse of characteristic viscous damping time - scalar rtd = 0.5*Cmu_*mu/(rho*r2); - - // oscillation frequency (squared) - scalar omega2 = Comega_*sigma/(rho*r3) - rtd*rtd; - - if (omega2 > 0) - { - scalar omega = sqrt(omega2); - scalar romega = 1.0/omega; - - scalar rhog = spray_.rho()[p.cell()]; - scalar We = p.We(Ug, rhog, sigma); - scalar Wetmp = We/WeCrit_; - - scalar y1 = p.dev() - Wetmp; - scalar y2 = p.ddev()*romega; - - scalar a = sqrt(y1*y1 + y2*y2); - - // scotty we may have break-up - if (a + Wetmp > 1.0) - { - scalar phic = y1/a; - - // constrain phic within -1 to 1 - phic = max(min(phic, 1), -1); - - scalar phit = acos(phic); - scalar phi = phit; - scalar quad = -y2/a; - if (quad < 0) - { - phi = constant::mathematical::twoPi - phit; - } - - scalar tb = 0; - - if (mag(p.dev()) < 1.0) - { - scalar theta = acos((1.0 - Wetmp)/a); - - if (theta < phi) - { - if (constant::mathematical::twoPi - theta >= phi) - { - theta = -theta; - } - theta += constant::mathematical::twoPi; - } - tb = (theta-phi)*romega; - - // breakup occurs - if (deltaT > tb) - { - p.dev() = 1.0; - p.ddev() = -a*omega*sin(omega*tb + phi); - } - } - - // update droplet size - if (deltaT > tb) - { - scalar sqrtWe = AWe_*pow4(We) + 1.0; - scalar Kbr = k1_*omega*sqrtWe; - - if (We > WeTransition_) - { - sqrtWe = sqrt(We); - Kbr = k2_*omega*sqrtWe; - } - - scalar rWetmp = 1.0/Wetmp; - scalar cosdtbu = max(-1.0, min(1.0, 1.0 - rWetmp)); - scalar dtbu = romega*acos(cosdtbu); - scalar decay = exp(-Kbr*dtbu); - - scalar rNew = decay*r; - if (rNew < r) - { - p.d() = 2*rNew; - p.dev() = 0; - p.ddev() = 0; - } - } - } - } - else - { - // reset droplet distortion parameters - p.dev() = 0; - p.ddev() = 0; - } -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.H b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.H deleted file mode 100644 index aa25ba203fc08f87cdd8423a98182e74ab8a8a5b..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/ETAB/ETAB.H +++ /dev/null @@ -1,127 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::ETAB - -Description - The Enhanced %TAB model. - - Described in the papers below. - \verbatim - F.X. Tanner - "Liquid Jet Atomization and Droplet Breakup Modeling of - Non-Evaporating Diesel Fuel Sprays" - SAE 970050, - SAE Transactions: Journal of Engines, Vol 106, Sec 3 pp 127-140 - - F.X. Tanner and G. Weisser - "Simulation of Liquid Jet Atomization for - Fuel Sprays by Means of Cascade Drop Breakup Model" - SAE 980808 - SAE Technical Paper Series - \endverbatim - -See Also - The TAB model - -SourceFiles - ETAB.C - -\*---------------------------------------------------------------------------*/ - -#ifndef ETAB_H -#define ETAB_H - -#include "breakupModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class ETAB Declaration -\*---------------------------------------------------------------------------*/ - -class ETAB -: - public breakupModel -{ -private: - - // Private data - - dictionary coeffsDict_; - - // model constants - - // Cmu_ and Comega_ are the same as in the TAB model - scalar Cmu_; - scalar Comega_; - - scalar k1_; - scalar k2_; - scalar WeCrit_; - scalar WeTransition_; - scalar AWe_; - - -public: - - - //- Runtime type information - TypeName("ETAB"); - - - // Constructors - - //- Construct from components - ETAB(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~ETAB(); - - - // Member Functions - - void breakupParcel - ( - parcel& parcel, - const scalar deltaT, - const vector& Ug, - const liquidMixtureProperties& fuels - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.C deleted file mode 100644 index e23e36a4807fc38760456b846bb6beb116c7676c..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.C +++ /dev/null @@ -1,262 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "SHF.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(SHF, 0); - - addToRunTimeSelectionTable - ( - breakupModel, - SHF, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::SHF::SHF -( - const dictionary& dict, - spray& sm -) -: - breakupModel(dict, sm), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - g_(sm.g()), - weCorrCoeff_(readScalar(coeffsDict_.lookup("weCorrCoeff"))), - weBuCrit_(readScalar(coeffsDict_.lookup("weBuCrit"))), - weBuBag_(readScalar(coeffsDict_.lookup("weBuBag"))), - weBuMM_(readScalar(coeffsDict_.lookup("weBuMM"))), - ohnCoeffCrit_(readScalar(coeffsDict_.lookup("ohnCoeffCrit"))), - ohnCoeffBag_(readScalar(coeffsDict_.lookup("ohnCoeffBag"))), - ohnCoeffMM_(readScalar(coeffsDict_.lookup("ohnCoeffMM"))), - ohnExpCrit_(readScalar(coeffsDict_.lookup("ohnExpCrit"))), - ohnExpBag_(readScalar(coeffsDict_.lookup("ohnExpBag"))), - ohnExpMM_(readScalar(coeffsDict_.lookup("ohnExpMM"))), - cInit_(readScalar(coeffsDict_.lookup("Cinit"))), - c1_(readScalar(coeffsDict_.lookup("C1"))), - c2_(readScalar(coeffsDict_.lookup("C2"))), - c3_(readScalar(coeffsDict_.lookup("C3"))), - cExp1_(readScalar(coeffsDict_.lookup("Cexp1"))), - cExp2_(readScalar(coeffsDict_.lookup("Cexp2"))), - cExp3_(readScalar(coeffsDict_.lookup("Cexp3"))), - weConst_(readScalar(coeffsDict_.lookup("Weconst"))), - weCrit1_(readScalar(coeffsDict_.lookup("Wecrit1"))), - weCrit2_(readScalar(coeffsDict_.lookup("Wecrit2"))), - coeffD_(readScalar(coeffsDict_.lookup("CoeffD"))), - onExpD_(readScalar(coeffsDict_.lookup("OnExpD"))), - weExpD_(readScalar(coeffsDict_.lookup("WeExpD"))), - mu_(readScalar(coeffsDict_.lookup("mu"))), - sigma_(readScalar(coeffsDict_.lookup("sigma"))), - d32Coeff_(readScalar(coeffsDict_.lookup("d32Coeff"))), - cDmaxBM_(readScalar(coeffsDict_.lookup("cDmaxBM"))), - cDmaxS_(readScalar(coeffsDict_.lookup("cDmaxS"))), - corePerc_(readScalar(coeffsDict_.lookup("corePerc"))) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::SHF::~SHF() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::SHF::breakupParcel -( - parcel& p, - const scalar deltaT, - const vector& vel, - const liquidMixtureProperties& fuels -) const -{ - label cellI = p.cell(); - scalar T = p.T(); - scalar pc = spray_.p()[cellI]; - - scalar sigma = fuels.sigma(pc, T, p.X()); - scalar rhoLiquid = fuels.rho(pc, T, p.X()); - scalar muLiquid = fuels.mu(pc, T, p.X()); - scalar rhoGas = spray_.rho()[cellI]; - - scalar weGas = p.We(vel, rhoGas, sigma); - scalar weLiquid = p.We(vel, rhoLiquid, sigma); - - // correct the Reynolds number. Reitz is using radius instead of diameter - - scalar reLiquid = p.Re(rhoLiquid, vel, muLiquid); - scalar ohnesorge = sqrt(weLiquid)/(reLiquid + VSMALL); - - vector vRel = p.Urel(vel); - - scalar weGasCorr = weGas/(1.0 + weCorrCoeff_*ohnesorge); - - // droplet deformation characteristic time - - scalar tChar = p.d()/mag(vRel)*sqrt(rhoLiquid/rhoGas); - - scalar tFirst = cInit_*tChar; - - scalar tSecond = 0; - scalar tCharSecond = 0; - - - // updating the droplet characteristic time - p.ct() += deltaT; - - if (weGas > weConst_) - { - if (weGas < weCrit1_) - { - tCharSecond = c1_*pow((weGas - weConst_),cExp1_); - } - else if (weGas >= weCrit1_ && weGas <= weCrit2_) - { - tCharSecond = c2_*pow((weGas - weConst_),cExp2_); - } - else - { - tCharSecond = c3_*pow((weGas - weConst_),cExp3_); - } - } - - scalar weC = weBuCrit_*(1.0+ohnCoeffCrit_*pow(ohnesorge, ohnExpCrit_)); - scalar weB = weBuBag_*(1.0+ohnCoeffBag_*pow(ohnesorge, ohnExpBag_)); - scalar weMM = weBuMM_*(1.0+ohnCoeffMM_*pow(ohnesorge, ohnExpMM_)); - - bool bag = (weGas > weC && weGas < weB); - - bool multimode = (weGas >= weB && weGas <= weMM); - - bool shear = (weGas > weMM); - - tSecond = tCharSecond*tChar; - - scalar tBreakUP = tFirst + tSecond; - if (p.ct() > tBreakUP) - { - - scalar d32 = - coeffD_*p.d()*pow(ohnesorge, onExpD_)*pow(weGasCorr, weExpD_); - - if (bag || multimode) - { - - scalar d05 = d32Coeff_*d32; - - scalar x = 0.0; - scalar y = 0.0; - scalar d = 0.0; - scalar px = 0.0; - - do - { - x = cDmaxBM_*rndGen_.sample01<scalar>(); - d = sqr(x)*d05; - y = rndGen_.sample01<scalar>(); - - px = - x - /(2.0*sqrt(constant::mathematical::twoPi)*sigma_) - *exp(-0.5*sqr((x-mu_)/sigma_)); - - } while (y >= px); - - p.d() = d; - p.ct() = 0.0; - } - - if (shear) - { - scalar dC = weConst_*sigma/(rhoGas*sqr(mag(vRel))); - scalar d32Red = 4.0*(d32*dC)/(5.0*dC - d32); - scalar initMass = p.m(); - - scalar d05 = d32Coeff_*d32Red; - - scalar x = 0.0; - scalar y = 0.0; - scalar d = 0.0; - scalar px = 0.0; - - do - { - - x = cDmaxS_*rndGen_.sample01<scalar>(); - d = sqr(x)*d05; - y = rndGen_.sample01<scalar>(); - - px = - x - /(2.0*sqrt(constant::mathematical::twoPi)*sigma_) - *exp(-0.5*sqr((x-mu_)/sigma_)); - } while (y >= px); - - p.d() = dC; - p.m() = corePerc_*initMass; - - spray_.addParticle - ( - new parcel - ( - p.mesh(), - p.position(), - p.cell(), - p.tetFace(), - p.tetPt(), - p.n(), - d, - p.T(), - (1.0 - corePerc_)*initMass, - 0.0, - 0.0, - 0.0, - -GREAT, - p.tTurb(), - 0.0, - scalar(p.injector()), - p.U(), - p.Uturb(), - p.X(), - p.fuelNames() - ) - ); - - p.ct() = 0.0; - } - } -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.H b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.H deleted file mode 100644 index 82592c870b8eb026030707f98216c72dcbc12721..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/SHF/SHF.H +++ /dev/null @@ -1,149 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::SHF - -Description - Secondary Breakup Model to take account of the different breakup regimes, - bag, molutimode, shear.... - - Accurate description in - \verbatim - R. Schmehl, G. Maier, S. Witting - "CFD Analysis of Fuel Atomization, Secondary Droplet Breakup and Spray - Dispersion in the Premix Duct of a LPP Combustor". - Eight International Conference on Liquid Atomization and Spray Systems, 2000 - \endverbatim - -\*---------------------------------------------------------------------------*/ - -#ifndef SHF_H -#define SHF_H - -#include "breakupModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class SHF Declaration -\*---------------------------------------------------------------------------*/ - -class SHF -: - public breakupModel -{ - -private: - - // Private data - - dictionary coeffsDict_; - - // reference to gravity - const vector& g_; - - // model constants - - scalar weCorrCoeff_; - - scalar weBuCrit_; - scalar weBuBag_; - scalar weBuMM_; - - scalar ohnCoeffCrit_; - scalar ohnCoeffBag_; - scalar ohnCoeffMM_; - - scalar ohnExpCrit_; - scalar ohnExpBag_; - scalar ohnExpMM_; - - scalar cInit_; - - scalar c1_; - scalar c2_; - scalar c3_; - - scalar cExp1_; - scalar cExp2_; - scalar cExp3_; - - scalar weConst_; - scalar weCrit1_; - scalar weCrit2_; - - scalar coeffD_; - scalar onExpD_; - scalar weExpD_; - - scalar mu_; - scalar sigma_; - - scalar d32Coeff_; - scalar cDmaxBM_; - scalar cDmaxS_; - - scalar corePerc_; - - -public: - - //- Runtime type information - TypeName("SHF"); - - - // Constructors - - //- Construct from components - SHF(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~SHF(); - - - // Member Operators - - void breakupParcel - ( - parcel& parcel, - const scalar deltaT, - const vector& vel, - const liquidMixtureProperties& fuels - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.C deleted file mode 100644 index 2102332c8415d8b216bbe2c36649cc2ef5453de4..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.C +++ /dev/null @@ -1,208 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "TAB.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(TAB, 0); - - addToRunTimeSelectionTable - ( - breakupModel, - TAB, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::TAB::TAB -( - const dictionary& dict, - spray& sm -) -: - breakupModel(dict, sm), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - Cmu_(readScalar(coeffsDict_.lookup("Cmu"))), - Comega_(readScalar(coeffsDict_.lookup("Comega"))), - WeCrit_(readScalar(coeffsDict_.lookup("WeCrit"))) -{ - - // calculate the inverse function of the Rossin-Rammler Distribution - const scalar xx0 = 12.0; - const scalar rrd100 = - 1.0/(1.0 - exp(-xx0)*(1 + xx0 + sqr(xx0)/2 + pow3(xx0)/6)); - - for (label n=0; n<100; n++) - { - scalar xx = 0.12*(n+1); - rrd_[n] = (1-exp(-xx)*(1 + xx + pow(xx, 2)/2 + pow(xx, 3)/6))*rrd100; - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::TAB::~TAB() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::TAB::breakupParcel -( - parcel& p, - const scalar deltaT, - const vector& Ug, - const liquidMixtureProperties& fuels -) const -{ - scalar T = p.T(); - scalar pc = spray_.p()[p.cell()]; - scalar r = 0.5*p.d(); - scalar r2 = r*r; - scalar r3 = r*r2; - - scalar rho = fuels.rho(pc, T, p.X()); - scalar sigma = fuels.sigma(pc, T, p.X()); - scalar mu = fuels.mu(pc, T, p.X()); - - // inverse of characteristic viscous damping time - scalar rtd = 0.5*Cmu_*mu/(rho*r2); - - // oscillation frequency (squared) - scalar omega2 = Comega_*sigma/(rho*r3) - rtd*rtd; - - if (omega2 > 0) - { - scalar omega = sqrt(omega2); - scalar rhog = spray_.rho()[p.cell()]; - scalar We = p.We(Ug, rhog, sigma); - scalar Wetmp = We/WeCrit_; - - scalar y1 = p.dev() - Wetmp; - scalar y2 = p.ddev()/omega; - - scalar a = sqrt(y1*y1 + y2*y2); - - // scotty we may have break-up - if (a + Wetmp > 1.0) - { - scalar phic = y1/a; - - // constrain phic within -1 to 1 - phic = max(min(phic, 1), -1); - - scalar phit = acos(phic); - scalar phi = phit; - scalar quad = -y2/a; - if (quad < 0) - { - phi = constant::mathematical::twoPi - phit; - } - - scalar tb = 0; - - if (mag(p.dev()) < 1.0) - { - scalar coste = 1.0; - if ((Wetmp - a < -1) && (p.ddev() < 0)) - { - coste = -1.0; - } - - scalar theta = acos((coste-Wetmp)/a); - - if (theta < phi) - { - if (constant::mathematical::twoPi - theta >= phi) - { - theta = -theta; - } - theta += constant::mathematical::twoPi; - } - tb = (theta - phi)/omega; - - // breakup occurs - if (deltaT > tb) - { - p.dev() = 1.0; - p.ddev() = -a*omega*sin(omega*tb + phi); - } - - } - - // update droplet size - if (deltaT > tb) - { - scalar rs = - r - /( - 1 - + (4.0/3.0)*sqr(p.dev()) - + rho*r3/(8*sigma)*sqr(p.ddev()) - ); - - label n = 0; - bool found = false; - scalar random = rndGen_.sample01<scalar>(); - while (!found && (n<99)) - { - if (rrd_[n] > random) - { - found = true; - } - n++; - - } - scalar rNew = 0.04*n*rs; - if (rNew < r) - { - p.d() = 2*rNew; - p.dev() = 0; - p.ddev() = 0; - } - } - } - - } - else - { - // reset droplet distortion parameters - p.dev() = 0; - p.ddev() = 0; - } -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.H b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.H deleted file mode 100644 index 807cdf4d1e9e92ecc9928d8417ad248c4264cfd4..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/TAB/TAB.H +++ /dev/null @@ -1,124 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::TAB - -Description - The TAB Method for Numerical Calculation of Spray Droplet Breakup. - - \verbatim - O'Rourke, P.J. and Amsden, A.A., - "The TAB Method for Numerical Calculation of Spray Droplet Breakup," - 1987 SAE International Fuels and Lubricants Meeting and Exposition, - Toronto, Ontario, November 2-5, 1987, - Los Alamos National Laboratory document LA-UR-87-2105; - SAE Technical Paper Series, Paper 872089. - \endverbatim - - This implementation follows the kiva version. - -See Also - The Enhanced %TAB model - ETAB - -SourceFiles - TABI.H - TAB.C - TABIO.C - -\*---------------------------------------------------------------------------*/ - -#ifndef TAB_H -#define TAB_H - -#include "breakupModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class TAB Declaration -\*---------------------------------------------------------------------------*/ - -class TAB -: - public breakupModel -{ -private: - - // Private data - - dictionary coeffsDict_; - - // inverse function approximation - // of the Rossin-Rammler Distribution - // used when calculating the droplet size after breakup - scalar rrd_[100]; - - // model constants - - scalar Cmu_; - scalar Comega_; - scalar WeCrit_; - - -public: - - - //- Runtime type information - TypeName("TAB"); - - - // Constructors - - //- Construct from components - TAB(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~TAB(); - - - // Member Functions - - void breakupParcel - ( - parcel& parcel, - const scalar deltaT, - const vector& Ug, - const liquidMixtureProperties& fuels - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModel.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModel.C deleted file mode 100644 index 443ad4e290366c6ecdf641432aecbf2dbb2b7451..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModel.C +++ /dev/null @@ -1,141 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" -#include "breakupModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(breakupModel, 0); - defineRunTimeSelectionTable(breakupModel, dictionary); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::breakupModel::breakupModel -( - const dictionary& dict, - spray& sm -) -: - dict_(dict), - spray_(sm), - rndGen_(sm.rndGen()), - includeOscillation_(dict_.lookup("includeOscillation")), - TABcoeffsDict_(dict.subDict("TABCoeffs")), - y0_(0.0), - yDot0_(0.0), - TABComega_(0.0), - TABCmu_(0.0), - TABWeCrit_(0.0) -{ - if (includeOscillation_) - { - y0_ = readScalar(TABcoeffsDict_.lookup("y0")); - yDot0_ = readScalar(TABcoeffsDict_.lookup("yDot0")); - TABComega_ = readScalar(TABcoeffsDict_.lookup("Comega")); - TABCmu_ = readScalar(TABcoeffsDict_.lookup("Cmu")); - TABWeCrit_ = readScalar(TABcoeffsDict_.lookup("WeCrit")); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // - -Foam::breakupModel::~breakupModel() -{} - - -// * * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * // - -void Foam::breakupModel::updateParcelProperties -( - parcel& p, - const scalar deltaT, - const vector& Ug, - const liquidMixtureProperties& fuels -) const -{ - if (includeOscillation_) - { - - scalar T = p.T(); - scalar pc = spray_.p()[p.cell()]; - scalar r = 0.5 * p.d(); - scalar r2 = r*r; - scalar r3 = r*r2; - - scalar rho = fuels.rho(pc, T, p.X()); - scalar sigma = fuels.sigma(pc, T, p.X()); - scalar mu = fuels.mu(pc, T, p.X()); - - // inverse of characteristic viscous damping time - scalar rtd = 0.5*TABCmu_*mu/(rho*r2); - - // oscillation frequency (squared) - scalar omega2 = TABComega_ * sigma /(rho*r3) - rtd*rtd; - - if (omega2 > 0) - { - - scalar omega = sqrt(omega2); - scalar rhog = spray_.rho()[p.cell()]; - scalar We = p.We(Ug, rhog, sigma); - scalar Wetmp = We/TABWeCrit_; - - scalar y1 = p.dev() - Wetmp; - scalar y2 = p.ddev()/omega; - - // update distortion parameters - scalar c = cos(omega*deltaT); - scalar s = sin(omega*deltaT); - scalar e = exp(-rtd*deltaT); - y2 = (p.ddev() + y1*rtd)/omega; - - p.dev() = Wetmp + e*(y1*c + y2*s); - if (p.dev() < 0) - { - p.dev() = 0.0; - p.ddev() = 0.0; - } - else - { - p.ddev() = (Wetmp-p.dev())*rtd + e*omega*(y2*c - y1*s); - } - } - else - { - // reset droplet distortion parameters - p.dev() = 0; - p.ddev() = 0; - } - } -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModel.H b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModel.H deleted file mode 100644 index e855985320b45b0dc9251e7249e1fa3adfd428ec..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModel.H +++ /dev/null @@ -1,151 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::breakupModel - -Description - Base class for selecting a breakup model - -\*---------------------------------------------------------------------------*/ - -#ifndef breakupModel_H -#define breakupModel_H - -#include "IOdictionary.H" -#include "spray.H" -#include "autoPtr.H" -#include "runTimeSelectionTables.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class breakupModel Declaration -\*---------------------------------------------------------------------------*/ - -class breakupModel -{ - -protected: - - // Protected data - - const dictionary& dict_; - - spray& spray_; - cachedRandom& rndGen_; - - Switch includeOscillation_; - - dictionary TABcoeffsDict_; - scalar y0_; - scalar yDot0_; - scalar TABComega_; - scalar TABCmu_; - scalar TABWeCrit_; - - -public: - - //- Runtime type information - TypeName("breakupModel"); - - // Declare runtime constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - breakupModel, - dictionary, - ( - const dictionary& dict, - spray& sm - ), - (dict, sm) - ); - - - // Constructors - - //- Construct from components - breakupModel(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~breakupModel(); - - - // Selector - - static autoPtr<breakupModel> New - ( - const dictionary& dict, - spray& sm - ); - - - // Member Functions - - //- Return the initial deviation from sphericity - inline scalar y0() const - { - return y0_; - } - - //- Return the initial rate of deviation from sphericity - inline scalar yDot0() const - { - return yDot0_; - } - - void updateParcelProperties - ( - parcel& p, - const scalar deltaT, - const vector& Ug, - const liquidMixtureProperties& fuels - ) const; - - virtual void breakupParcel - ( - parcel& parcel, - const scalar deltaT, - const vector& vel, - const liquidMixtureProperties& fuels - ) const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // - diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModelNew.C deleted file mode 100644 index afd7dac0029d6e6fa382116310e012a760ad6d9a..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/breakupModel/breakupModelNew.C +++ /dev/null @@ -1,61 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" -#include "breakupModel.H" -#include "noBreakup.H" -#include "reitzDiwakar.H" -#include "reitzKHRT.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::breakupModel> Foam::breakupModel::New -( - const dictionary& dict, - spray& sm -) -{ - const word modelType(dict.lookup("breakupModel")); - - Info<< "Selecting breakupModel " << modelType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn("breakupModel::New(const dictionary&, const spray&)") - << "Unknown breakupModel type " - << modelType << nl << nl - << "Valid breakupModel types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); - } - - return autoPtr<breakupModel>(cstrIter()(dict, sm)); -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/noBreakup/noBreakup.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/noBreakup/noBreakup.C deleted file mode 100644 index 9449c9864026ea27d74cb7d34e67dcd2d492fa60..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/noBreakup/noBreakup.C +++ /dev/null @@ -1,79 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "noBreakup.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(noBreakup, 0); - - addToRunTimeSelectionTable - ( - breakupModel, - noBreakup, - dictionary - ); -} - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::noBreakup::noBreakup -( - const dictionary& dict, - spray& sm -) -: - breakupModel(dict, sm) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::noBreakup::~noBreakup() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::noBreakup::breakupParcel -( - parcel&, - const scalar, - const vector&, - const liquidMixtureProperties& -) const -{ - // Do nothing -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/noBreakup/noBreakup.H b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/noBreakup/noBreakup.H deleted file mode 100644 index 2019b31fa59c230a032b702e193900f795d05607..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/noBreakup/noBreakup.H +++ /dev/null @@ -1,91 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::noBreakup - -Description - Spray breakup "off" - -SourceFiles - noBreakupI.H - noBreakup.C - -\*---------------------------------------------------------------------------*/ - -#ifndef noBreakup_H -#define noBreakup_H - -#include "breakupModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class noBreakup Declaration -\*---------------------------------------------------------------------------*/ - -class noBreakup -: - public breakupModel -{ - -public: - - //- Runtime type information - TypeName("off"); - - - // Constructors - - //- Construct from components - noBreakup(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~noBreakup(); - - - // Member Functions - - void breakupParcel - ( - parcel& parcel, - const scalar deltaT, - const vector& vel, - const liquidMixtureProperties& fuels - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.C deleted file mode 100644 index db664140b410c5e71791d7f311f8d4035bf5233f..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.C +++ /dev/null @@ -1,146 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "reitzDiwakar.H" -#include "addToRunTimeSelectionTable.H" -#include "basicMultiComponentMixture.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(reitzDiwakar, 0); - - addToRunTimeSelectionTable - ( - breakupModel, - reitzDiwakar, - dictionary - ); -} - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::reitzDiwakar::reitzDiwakar -( - const dictionary& dict, - spray& sm -) -: - breakupModel(dict, sm), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - Cbag_(readScalar(coeffsDict_.lookup("Cbag"))), - Cb_(readScalar(coeffsDict_.lookup("Cb"))), - Cstrip_(readScalar(coeffsDict_.lookup("Cstrip"))), - Cs_(readScalar(coeffsDict_.lookup("Cs"))) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::reitzDiwakar::~reitzDiwakar() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::reitzDiwakar::breakupParcel -( - parcel& p, - const scalar deltaT, - const vector& vel, - const liquidMixtureProperties& fuels -) const -{ - const PtrList<volScalarField>& Y = spray_.composition().Y(); - - label cellI = p.cell(); - scalar pressure = spray_.p()[cellI]; - scalar temperature = spray_.T()[cellI]; - scalar Taverage = p.T() + (temperature - p.T())/3.0; - - scalar muAverage = 0.0; - scalar Winv = 0.0; - forAll(Y, i) - { - Winv += Y[i][cellI]/spray_.gasProperties()[i].W(); - muAverage += Y[i][cellI]*spray_.gasProperties()[i].mu(Taverage); - } - scalar R = specie::RR*Winv; - - // ideal gas law to evaluate density - scalar rhoAverage = pressure/R/Taverage; - scalar nuAverage = muAverage/rhoAverage; - scalar sigma = fuels.sigma(pressure, p.T(), p.X()); - - - // The We and Re numbers are to be evaluated using the 1/3 rule. - - scalar WeberNumber = p.We(vel, rhoAverage, sigma); - scalar ReynoldsNumber = p.Re(vel, nuAverage); - - scalar sqRey = sqrt(ReynoldsNumber); - - if (WeberNumber > Cbag_) - { - if (WeberNumber > Cstrip_*sqRey) - { - scalar dStrip = - sqr(2.0*Cstrip_*sigma) - /( - rhoAverage - *pow3(mag(p.Urel(vel))) - *muAverage - ); - - scalar tauStrip = - Cs_*p.d() - *sqrt(fuels.rho(pressure, p.T(), p.X())/rhoAverage) - /mag(p.Urel(vel)); - - scalar fraction = deltaT/tauStrip; - - // new droplet diameter, implicit calculation - p.d() = (fraction*dStrip + p.d())/(1.0 + fraction); - } - else - { - scalar dBag = 2.0*Cbag_*sigma/(rhoAverage*sqr(mag(p.Urel(vel)))); - - scalar tauBag = - Cb_*p.d()*sqrt(fuels.rho(pressure, p.T(), p.X())*p.d()/sigma); - - scalar fraction = deltaT/tauBag; - - // new droplet diameter, implicit calculation - p.d() = (fraction*dBag + p.d())/(1.0 + fraction); - } - } -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.H b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.H deleted file mode 100644 index f28d1b405cfa0c14f11fc7fc34615c92c07fd597..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzDiwakar/reitzDiwakar.H +++ /dev/null @@ -1,103 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::reitzDiwakar - -Description - secondary breakup model for the spray - - Default model coefficients: - Cbag = 6.0; - Cb = 0.785; - Cstrip = 0.5; - Cs = 10.0; - -\*---------------------------------------------------------------------------*/ - -#ifndef reitzDiwakar_H -#define reitzDiwakar_H - -#include "breakupModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class reitzDiwakar Declaration -\*---------------------------------------------------------------------------*/ - -class reitzDiwakar -: - public breakupModel -{ -private: - - // Private data - - dictionary coeffsDict_; - scalar Cbag_; - scalar Cb_; - scalar Cstrip_; - scalar Cs_; - - -public: - - //- Runtime type information - TypeName("ReitzDiwakar"); - - - // Constructors - - //- Construct from components - reitzDiwakar(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~reitzDiwakar(); - - - // Member Operators - - void breakupParcel - ( - parcel& parcel, - const scalar deltaT, - const vector& vel, - const liquidMixtureProperties& fuels - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.C b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.C deleted file mode 100644 index 34aa785bdbcb0dc07cce162ad84a87e3d6e440bd..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.C +++ /dev/null @@ -1,229 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "reitzKHRT.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(reitzKHRT, 0); - - addToRunTimeSelectionTable - ( - breakupModel, - reitzKHRT, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::reitzKHRT::reitzKHRT -( - const dictionary& dict, - spray& sm -) -: - breakupModel(dict, sm), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - g_(sm.g()), - b0_(readScalar(coeffsDict_.lookup("B0"))), - b1_(readScalar(coeffsDict_.lookup("B1"))), - cTau_(readScalar(coeffsDict_.lookup("Ctau"))), - cRT_(readScalar(coeffsDict_.lookup("CRT"))), - msLimit_(readScalar(coeffsDict_.lookup("msLimit"))), - weberLimit_(readScalar(coeffsDict_.lookup("WeberLimit"))) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::reitzKHRT::~reitzKHRT() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::reitzKHRT::breakupParcel -( - parcel& p, - const scalar deltaT, - const vector& vel, - const liquidMixtureProperties& fuels -) const -{ - label cellI = p.cell(); - scalar T = p.T(); - scalar r = 0.5*p.d(); - scalar pc = spray_.p()[cellI]; - - scalar sigma = fuels.sigma(pc, T, p.X()); - scalar rhoLiquid = fuels.rho(pc, T, p.X()); - scalar muLiquid = fuels.mu(pc, T, p.X()); - scalar rhoGas = spray_.rho()[cellI]; - scalar Np = p.N(rhoLiquid); - scalar semiMass = Np*pow3(p.d()); - - scalar weGas = p.We(vel, rhoGas, sigma); - scalar weLiquid = p.We(vel, rhoLiquid, sigma); - // correct the Reynolds number. Reitz is using radius instead of diameter - scalar reLiquid = 0.5*p.Re(rhoLiquid, vel, muLiquid); - scalar ohnesorge = sqrt(weLiquid)/(reLiquid + VSMALL); - scalar taylor = ohnesorge*sqrt(weGas); - - vector acceleration = p.Urel(vel)/p.tMom(); - vector trajectory = p.U()/mag(p.U()); - scalar gt = (g_ + acceleration) & trajectory; - - // frequency of the fastest growing KH-wave - scalar omegaKH = - (0.34 + 0.38*pow(weGas, 1.5)) - /((1 + ohnesorge)*(1 + 1.4*pow(taylor, 0.6))) - *sqrt(sigma/(rhoLiquid*pow3(r))); - - // corresponding KH wave-length. - scalar lambdaKH = - 9.02 - *r - *(1.0 + 0.45*sqrt(ohnesorge)) - *(1.0 + 0.4*pow(taylor, 0.7)) - /pow(1.0 + 0.865*pow(weGas, 1.67), 0.6); - - // characteristic Kelvin-Helmholtz breakup time - scalar tauKH = 3.726*b1_*r/(omegaKH*lambdaKH); - - // stable KH diameter - scalar dc = 2.0*b0_*lambdaKH; - - // the frequency of the fastest growing RT wavelength. - scalar helpVariable = mag(gt*(rhoLiquid - rhoGas)); - scalar omegaRT = sqrt - ( - 2.0*pow(helpVariable, 1.5) - /(3.0*sqrt(3.0*sigma)*(rhoGas + rhoLiquid)) - ); - - // RT wave number - scalar KRT = sqrt(helpVariable/(3.0*sigma + VSMALL)); - - // wavelength of the fastest growing RT frequency - scalar lambdaRT = constant::mathematical::twoPi*cRT_/(KRT + VSMALL); - - // if lambdaRT < diameter, then RT waves are growing on the surface - // and we start to keep track of how long they have been growing - if ((p.ct() > 0) || (lambdaRT < p.d())) - { - p.ct() += deltaT; - } - - // characteristic RT breakup time - scalar tauRT = cTau_/(omegaRT + VSMALL); - - // check if we have RT breakup - if ((p.ct() > tauRT) && (lambdaRT < p.d())) - { - // the RT breakup creates diameter/lambdaRT new droplets - p.ct() = -GREAT; - scalar multiplier = p.d()/lambdaRT; - scalar nDrops = multiplier*Np; - p.d() = cbrt(semiMass/nDrops); - } - // otherwise check for KH breakup - else if (dc < p.d()) - { - // no breakup below Weber = 12 - if (weGas > weberLimit_) - { - label injector = label(p.injector()); - scalar fraction = deltaT/tauKH; - - // reduce the diameter according to the rate-equation - p.d() = (fraction*dc + p.d())/(1.0 + fraction); - - scalar ms = rhoLiquid*Np*pow3(dc)*constant::mathematical::pi/6.0; - p.ms() += ms; - - // Total number of parcels for the whole injection event - label nParcels = - spray_.injectors()[injector].properties()->nParcelsToInject - ( - spray_.injectors()[injector].properties()->tsoi(), - spray_.injectors()[injector].properties()->teoi() - ); - - scalar averageParcelMass = - spray_.injectors()[injector].properties()->mass()/nParcels; - - if (p.ms()/averageParcelMass > msLimit_) - { - // set the initial ms value to -GREAT. This prevents - // new droplets from being formed from the child droplet - // from the KH instability - - // mass of stripped child parcel - scalar mc = p.ms(); - // Prevent child parcel from taking too much mass - mc = min(mc, 0.5*p.m()); - - spray_.addParticle - ( - new parcel - ( - p.mesh(), - p.position(), - p.cell(), - p.tetFace(), - p.tetPt(), - p.n(), - dc, - p.T(), - mc, - 0.0, - 0.0, - 0.0, - -GREAT, - p.tTurb(), - 0.0, - p.injector(), - p.U(), - p.Uturb(), - p.X(), - p.fuelNames() - ) - ); - - p.m() -= mc; - p.ms() = 0.0; - } - } - } -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.H b/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.H deleted file mode 100644 index be82c520de6c271fc3368bf6a760aaa57e5c2f6f..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/breakupModel/reitzKHRT/reitzKHRT.H +++ /dev/null @@ -1,107 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::reitzKHRT - -Description - secondary breakup model which uses the Kelvin-Helmholtz - instability theory to predict the 'stripped' droplets... and - the Raleigh-Taylor instability as well. - -\*---------------------------------------------------------------------------*/ - -#ifndef reitzKHRT_H -#define reitzKHRT_H - -#include "breakupModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class reitzKHRT Declaration -\*---------------------------------------------------------------------------*/ - -class reitzKHRT -: - public breakupModel -{ - -private: - - // Private data - - dictionary coeffsDict_; - - // reference to gravity - const vector& g_; - - // model constants - scalar b0_; - scalar b1_; - scalar cTau_; - scalar cRT_; - scalar msLimit_; - scalar weberLimit_; - - -public: - - //- Runtime type information - TypeName("ReitzKHRT"); - - - // Constructors - - //- Construct from components - reitzKHRT(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~reitzKHRT(); - - - // Member Operators - - void breakupParcel - ( - parcel& parcel, - const scalar deltaT, - const vector& vel, - const liquidMixtureProperties& fuels - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/ORourkeCollisionModel.C b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/ORourkeCollisionModel.C deleted file mode 100644 index 8e965a7063117186851105b1d5d61e5ae321a421..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/ORourkeCollisionModel.C +++ /dev/null @@ -1,126 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "ORourkeCollisionModel.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(ORourkeCollisionModel, 0); - - addToRunTimeSelectionTable - ( - collisionModel, - ORourkeCollisionModel, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::ORourkeCollisionModel::ORourkeCollisionModel -( - const dictionary& dict, - spray& sm, - cachedRandom& rndGen -) -: - collisionModel(dict, sm, rndGen), - vols_(sm.mesh().V()), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - coalescence_(coeffsDict_.lookup("coalescence")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::ORourkeCollisionModel::~ORourkeCollisionModel() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::ORourkeCollisionModel::collideParcels(const scalar dt) const -{ - if (spray_.size() < 2) - { - return; - } - - spray::iterator secondParcel = spray_.begin(); - ++secondParcel; - spray::iterator p1 = secondParcel; - - while (p1 != spray_.end()) - { - label cell1 = p1().cell(); - - spray::iterator p2 = spray_.begin(); - - while (p2 != p1) - { - label cell2 = p2().cell(); - - // No collision if parcels are not in the same cell - if (cell1 == cell2) - { - #include "sameCell.H" - } - - // remove coalesced droplet - if (p2().m() < VSMALL) - { - spray::iterator tmpElmnt = p2; - ++tmpElmnt; - spray_.deleteParticle(p2()); - p2 = tmpElmnt; - } - else - { - ++p2; - } - } - - // remove coalesced droplet - if (p1().m() < VSMALL) - { - spray::iterator tmpElmnt = p1; - ++tmpElmnt; - spray_.deleteParticle(p1()); - p1 = tmpElmnt; - } - else - { - ++p1; - } - } -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/ORourkeCollisionModel.H b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/ORourkeCollisionModel.H deleted file mode 100644 index 6eef37be8cb050827587345d8f196157432689e0..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/ORourkeCollisionModel.H +++ /dev/null @@ -1,100 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::ORourkeCollisionModel - -Description - Collision model by P.J. O'Rourke. - - Implemented as described in the KIVA manual - -\*---------------------------------------------------------------------------*/ - -#ifndef ORourkeCollisionModel_H -#define ORourkeCollisionModel_H - -#include "collisionModel.H" - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class ORourkeCollisionModel Declaration -\*---------------------------------------------------------------------------*/ - -class ORourkeCollisionModel -: - public collisionModel -{ - -private: - - // Private data - - // Reference to the cell volumes - const scalarField& vols_; - - dictionary coeffsDict_; - Switch coalescence_; - - -public: - - //- Runtime type information - TypeName("ORourke"); - - - // Constructors - - //- Construct from components - ORourkeCollisionModel - ( - const dictionary& dict, - spray& sm, - cachedRandom& rndGen - ); - - - //- Destructor - virtual ~ORourkeCollisionModel(); - - - // Member Functions - - void collideParcels(const scalar dt) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/sameCell.H b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/sameCell.H deleted file mode 100644 index ed34a3fda00d3cce7b26105aa8968726fe0b4967..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/ORourke/sameCell.H +++ /dev/null @@ -1,160 +0,0 @@ -vector v1 = p1().U(); -vector v2 = p2().U(); - -vector vRel = v1 - v2; -scalar magVRel = mag(vRel); - -scalar sumD = p1().d() + p2().d(); -scalar pc = spray_.p()[p1().cell()]; - -spray::iterator pMin = p1; -spray::iterator pMax = p2; - -scalar dMin = pMin().d(); -scalar dMax = pMax().d(); - -if (dMin > dMax) -{ - dMin = pMax().d(); - dMax = pMin().d(); - pMin = p2; - pMax = p1; -} - -scalar rhoMax = spray_.fuels().rho(pc, pMax().T(), pMax().X()); -scalar rhoMin = spray_.fuels().rho(pc, pMin().T(), pMin().X()); -scalar mMax = pMax().m(); -scalar mMin = pMin().m(); -scalar mTot = mMax + mMin; - -scalar nMax = pMax().N(rhoMax); -scalar nMin = pMin().N(rhoMin); - -scalar mdMin = mMin/nMin; - -scalar nu0 = 0.25*constant::mathematical::pi*sqr(sumD)*magVRel*dt/vols_[cell1]; -scalar nu = nMin*nu0; -scalar collProb = exp(-nu); -scalar xx = rndGen_.sample01<scalar>(); - -if ((xx > collProb) && (mMin > VSMALL) && (mMax > VSMALL)) -{ - // collision occurs - - scalar gamma = dMax/max(dMin, 1.0e-12); - scalar f = gamma*gamma*gamma + 2.7*gamma - 2.4*gamma*gamma; - - vector momMax = mMax*pMax().U(); - vector momMin = mMin*pMin().U(); - - // use mass-averaged temperature to calculate We number - scalar averageTemp = (pMax().T()*mMax + pMin().T()*mMin)/mTot; - // and mass averaged mole fractions ... - scalarField Xav - ( - (pMax().m()*pMax().X()+pMin().m()*pMin().X()) - /(pMax().m() + pMin().m()) - ); - scalar sigma = spray_.fuels().sigma(pc, averageTemp, Xav); - sigma = max(1.0e-6, sigma); - scalar rho = spray_.fuels().rho(pc, averageTemp, Xav); - - scalar WeColl = max(1.0e-12, 0.5*rho*magVRel*magVRel*dMin/sigma); - - scalar coalesceProb = min(1.0, 2.4*f/WeColl); - scalar prob = rndGen_.sample01<scalar>(); - - // Coalescence - if (prob < coalesceProb && coalescence_) - { - // How 'many' of the droplets coalesce - // This is the kiva way ... which actually works best - - scalar zz = collProb; - scalar vnu = nu*collProb; - label n=2; - - // xx > collProb=zz - while ((zz < xx) && (n<1000)) - { - zz += vnu; - vnu *= nu/n; - n++; - } - scalar nProb = n - 1; - - // All droplets coalesce - if (nProb*nMax > nMin) - { - nProb = nMin/nMax; - } - - // Conservation of mass, momentum and energy - pMin().m() -= nProb*nMax*mdMin; - - scalar newMinMass = pMin().m(); - scalar newMaxMass = mMax + (mMin - newMinMass); - pMax().m() = newMaxMass; - - pMax().T() = (averageTemp*mTot - newMinMass*pMin().T())/newMaxMass; - rhoMax = spray_.fuels().rho(pc, pMax().T(), pMax().X()); - scalar d3 = pow3(dMax) + nProb*pow3(dMin); - pMax().d() = cbrt(d3); - pMax().U() = (momMax + (1.0-newMinMass/mMin)*momMin)/newMaxMass; - - // update the liquid molar fractions - scalarField Ymin(spray_.fuels().Y(pMin().X())); - scalarField Ymax(spray_.fuels().Y(pMax().X())); - scalarField Ynew(mMax*Ymax + (mMin - newMinMass)*Ymin); - scalar Wlinv = 0.0; - forAll(Ynew, i) - { - Wlinv += Ynew[i]/spray_.fuels().properties()[i].W(); - } - forAll(Ynew, i) - { - pMax().X()[i] = Ynew[i]/(spray_.fuels().properties()[i].W()*Wlinv); - } - } - else - { - // Grazing collision (no coalescence) - - scalar gf = sqrt(prob) - sqrt(coalesceProb); - scalar denom = 1.0 - sqrt(coalesceProb); - if (denom < 1.0e-5) - { - denom = 1.0; - } - gf /= denom; - - // if gf negative, this means that coalescence is turned off - // and these parcels should have coalesced - gf = max(0.0, gf); - - scalar rho1 = spray_.fuels().rho(pc, p1().T(), p1().X()); - scalar rho2 = spray_.fuels().rho(pc, p2().T(), p2().X()); - scalar m1 = p1().m(); - scalar m2 = p2().m(); - scalar n1 = p1().N(rho1); - scalar n2 = p2().N(rho2); - - // gf -> 1 => v1p -> p1().U() ... - // gf -> 0 => v1p -> momentum/(m1+m2) - vector mr = m1*v1 + m2*v2; - vector v1p = (mr + m2*gf*vRel)/(m1+m2); - vector v2p = (mr - m1*gf*vRel)/(m1+m2); - - if (n1 < n2) - { - p1().U() = v1p; - p2().U() = (n1*v2p + (n2-n1)*v2)/n2; - } - else - { - p1().U() = (n2*v1p + (n1-n2)*v1)/n1; - p2().U() = v2p; - } - } -} - diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/collisionModel.C b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/collisionModel.C deleted file mode 100644 index f850981631738c775cb4d3f8a3662ea25e39e7d1..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/collisionModel.C +++ /dev/null @@ -1,60 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" -#include "collisionModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(collisionModel, 0); - defineRunTimeSelectionTable(collisionModel, dictionary); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::collisionModel::collisionModel -( - const dictionary& dict, - spray& sm, - cachedRandom& rndGen -) -: - dict_(dict), - spray_(sm), - rndGen_(rndGen) - // coeffsDict_(dict.subDict(typeName + "Coeffs")) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::collisionModel::~collisionModel() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/collisionModel.H b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/collisionModel.H deleted file mode 100644 index 955a9baae4a305349d7c25827d2f6cece6bf4f2e..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/collisionModel.H +++ /dev/null @@ -1,124 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::collisionModel - -Description - Base case for selecting a collision model - -\*---------------------------------------------------------------------------*/ - -#ifndef collisionModel_H -#define collisionModel_H - -#include "IOdictionary.H" -#include "spray.H" -#include "cachedRandom.H" -#include "Switch.H" -#include "autoPtr.H" -#include "runTimeSelectionTables.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class collisionModel Declaration -\*---------------------------------------------------------------------------*/ - -class collisionModel -{ - -protected: - - // Protected data - const dictionary& dict_; - spray& spray_; - cachedRandom& rndGen_; - - //dictionary coeffsDict_; - - -public: - - //- Runtime type information - TypeName("collisionModel"); - - // Declare runtime constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - collisionModel, - dictionary, - ( - const dictionary& dict, - spray& sm, - cachedRandom& rndGen - ), - (dict, sm, rndGen) - ); - - - // Constructors - - //- Construct from components - collisionModel - ( - const dictionary& dict, - spray& sm, - cachedRandom& rndGen - ); - - - //- Destructor - virtual ~collisionModel(); - - - // Selector - - static autoPtr<collisionModel> New - ( - const dictionary& dict, - spray& sm, - cachedRandom& rndGen - ); - - - // Member Functions - - virtual void collideParcels(const scalar dt) const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/collisionModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/collisionModelNew.C deleted file mode 100644 index 00783505048a07166efdfd507ae470664f0c6d24..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/collisionModel/collisionModelNew.C +++ /dev/null @@ -1,66 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "collisionModel.H" -#include "noCollision.H" -#include "ORourkeCollisionModel.H" -#include "trajectoryModel.H" - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::collisionModel> Foam::collisionModel::New -( - const dictionary& dict, - spray& sm, - cachedRandom& rndGen -) -{ - const word modelType(dict.lookup("collisionModel")); - - Info<< "Selecting collisionModel " << modelType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn - ( - "collisionModel::New(const dictionary&, const spray&)" - ) << "Unknown collisionModel type " - << modelType << nl << nl - << "Valid collisionModel types are :" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); - } - - return autoPtr<collisionModel>(cstrIter()(dict, sm, rndGen)); -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/noCollision/noCollision.C b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/noCollision/noCollision.C deleted file mode 100644 index d0222bac1acf9de5677f260f7f71df8af939c4c8..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/noCollision/noCollision.C +++ /dev/null @@ -1,73 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "noCollision.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(noCollision, 0); - - addToRunTimeSelectionTable - ( - collisionModel, - noCollision, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::noCollision::noCollision -( - const dictionary& dict, - spray& sm, - cachedRandom& rndGen -) -: - collisionModel(dict, sm, rndGen) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::noCollision::~noCollision() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::noCollision::collideParcels(const scalar) const -{ - // Do nothing -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/noCollision/noCollision.H b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/noCollision/noCollision.H deleted file mode 100644 index c095d228bb2721be76ea2385b102acdf434136bd..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/noCollision/noCollision.H +++ /dev/null @@ -1,86 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::noCollision - -Description - No collisions between parcels - All parcels move independently of eachother - -\*---------------------------------------------------------------------------*/ - -#ifndef noCollision_H -#define noCollision_H - -#include "collisionModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class noCollision Declaration -\*---------------------------------------------------------------------------*/ - -class noCollision -: - public collisionModel -{ - -public: - - //- Runtime type information - TypeName("off"); - - - // Constructors - - //- Construct from components - noCollision - ( - const dictionary& dict, - spray& sm, - cachedRandom& rndGen - ); - - //- Destructor - virtual ~noCollision(); - - - // Member Functions - - void collideParcels(const scalar dt) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryCM.H b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryCM.H deleted file mode 100644 index 657e018e11e7e6936b7193ad5aa20a3c4ddc00cb..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryCM.H +++ /dev/null @@ -1,205 +0,0 @@ -vector v1 = p1().U(); -vector v2 = p2().U(); -scalar pc = spray_.p()[p1().cell()]; - -vector vRel = v1 - v2; -scalar magVRel = mag(vRel); - -vector p = p2().position() - p1().position(); -scalar dist = mag(p); - -scalar vAlign = vRel & (p/(dist+SMALL)); - -if (vAlign > 0) -{ - scalar sumD = p1().d() + p2().d(); - - if (vAlign*dt > dist - 0.5*sumD) - { - scalar v1Mag = mag(v1); - scalar v2Mag = mag(v2); - vector nv1 = v1/v1Mag; - vector nv2 = v2/v2Mag; - - scalar v1v2 = nv1 & nv2; - scalar v1p = nv1 & p; - scalar v2p = nv2 & p; - - scalar det = 1.0 - v1v2*v1v2; - - scalar alpha = 1.0e+20; - scalar beta = 1.0e+20; - - if (mag(det) > 1.0e-4) - { - beta = -(v2p - v1v2*v1p)/det; - alpha = v1p + v1v2*beta; - } - - alpha /= v1Mag*dt; - beta /= v2Mag*dt; - - // is collision possible within this timestep - if ((alpha>0) && (alpha<1.0) && (beta>0) && (beta<1.0)) - { - vector p1c = p1().position() + alpha*v1*dt; - vector p2c = p2().position() + beta*v2*dt; - - scalar closestDist = mag(p1c-p2c); - - scalar collProb = - pow(0.5*sumD/max(0.5*sumD, closestDist), cSpace_) - *exp(-cTime_*mag(alpha-beta)); - - scalar xx = rndGen_.sample01<scalar>(); - - spray::iterator pMin = p1; - spray::iterator pMax = p2; - - scalar dMin = pMin().d(); - scalar dMax = pMax().d(); - - if (dMin > dMax) - { - dMin = pMax().d(); - dMax = pMin().d(); - pMin = p2; - pMax = p1; - } - - scalar rhoMax = spray_.fuels().rho(pc, pMax().T(), pMax().X()); - scalar rhoMin = spray_.fuels().rho(pc, pMin().T(), pMin().X()); - scalar mMax = pMax().m(); - scalar mMin = pMin().m(); - scalar nMax = pMax().N(rhoMax); - scalar nMin = pMin().N(rhoMin); - - scalar mdMin = mMin/nMin; - - // collision occur - if ((xx < collProb) && (mMin > VSMALL) && (mMax > VSMALL)) - { - scalar mTot = mMax + mMin; - - scalar gamma = dMax/max(dMin, 1.0e-12); - scalar f = gamma*gamma*gamma + 2.7*gamma - 2.4*gamma*gamma; - - vector momMax = mMax*pMax().U(); - vector momMin = mMin*pMin().U(); - - // use mass-averaged temperature to calculate We number - scalar averageTemp = (pMax().T()*mMax + pMin().T()*mMin)/mTot; - // and mass averaged mole fractions ... - scalarField - Xav((pMax().m()*pMax().X()+pMin().m()*pMin().X()) - /(pMax().m() + pMin().m())); - - scalar sigma = spray_.fuels().sigma(pc, averageTemp, Xav); - sigma = max(1.0e-6, sigma); - scalar rho = spray_.fuels().rho(pc, averageTemp, Xav); - - scalar dMean = sqrt(dMin*dMax); - scalar WeColl = - max(1.0e-12, 0.5*rho*magVRel*magVRel*dMean/sigma); - - // coalescence only possible when parcels are close enoug - - scalar coalesceProb = min(1.0, 2.4*f/WeColl); - - scalar prob = rndGen_.sample01<scalar>(); - - // Coalescence - if ( prob < coalesceProb && coalescence_) - { - // How 'many' of the droplets coalesce - scalar nProb = prob*nMin/nMax; - - // Conservation of mass, momentum and energy - - pMin().m() -= nMax*nProb*mdMin; - - scalar newMinMass = pMin().m(); - scalar newMaxMass = mMax + (mMin - newMinMass); - pMax().m() = newMaxMass; - - pMax().T() = - (averageTemp*mTot - newMinMass*pMin().T())/newMaxMass; - rhoMax = spray_.fuels().rho(pc, pMax().T(), pMax().X()); - - pMax().d() = - pow - ( - 6.0 - *newMaxMass - /(rhoMax*constant::mathematical::pi*nMax), - 1.0/3.0 - ); - - pMax().U() = - (momMax + (1.0-newMinMass/mMin)*momMin)/newMaxMass; - - // update the liquid molar fractions - scalarField Ymin(spray_.fuels().Y(pMin().X())); - scalarField Ymax(spray_.fuels().Y(pMax().X())); - scalarField Ynew(mMax*Ymax + (mMin - newMinMass)*Ymin); - scalar Wlinv = 0.0; - forAll(Ynew, i) - { - Wlinv += Ynew[i]/spray_.fuels().properties()[i].W(); - } - forAll(Ynew, i) - { - pMax().X()[i] = - Ynew[i]/(spray_.fuels().properties()[i].W()*Wlinv); - } - - - } - // Grazing collision (no coalescence) - else - { - scalar gf = sqrt(prob) - sqrt(coalesceProb); - scalar denom = 1.0 - sqrt(coalesceProb); - if (denom < 1.0e-5) { - denom = 1.0; - } - gf /= denom; - - // if gf negative, this means that coalescence is turned off - // and these parcels should have coalesced - gf = max(0.0, gf); - - scalar rho1 = spray_.fuels().rho(pc, p1().T(), p1().X()); - scalar rho2 = spray_.fuels().rho(0.0, p2().T(), p2().X()); - scalar m1 = p1().m(); - scalar m2 = p2().m(); - scalar n1 = p1().N(rho1); - scalar n2 = p2().N(rho2); - - // gf -> 1 => v1p -> p1().U() ... - // gf -> 0 => v1p -> momentum/(m1+m2) - - vector mr = m1*v1 + m2*v2; - vector v1p = (mr + m2*gf*vRel)/(m1+m2); - vector v2p = (mr - m1*gf*vRel)/(m1+m2); - - if (n1 < n2) - { - p1().U() = v1p; - p2().U() = (n1*v2p + (n2-n1)*v2)/n2; - } - else - { - p1().U() = (n2*v1p + (n1-n2)*v1)/n1; - p2().U() = v2p; - } - - } // if - coalescence or not - - } // if - collision - - } // if - possible collision (alpha, beta) in timeinterval - - } // if - travelled distance is larger distance between parcels - -} // if - parcel travel towards eachother diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryModel.C b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryModel.C deleted file mode 100644 index 8aec7616bce9dcc730479fe4b1fc26deaa34841f..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryModel.C +++ /dev/null @@ -1,120 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "trajectoryModel.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(trajectoryCollisionModel, 0); - - addToRunTimeSelectionTable - ( - collisionModel, - trajectoryCollisionModel, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::trajectoryCollisionModel::trajectoryCollisionModel -( - const dictionary& dict, - spray& sm, - cachedRandom& rndGen -) -: - collisionModel(dict, sm, rndGen), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - cSpace_(readScalar(coeffsDict_.lookup("cSpace"))), - cTime_(readScalar(coeffsDict_.lookup("cTime"))), - coalescence_(coeffsDict_.lookup("coalescence")) - -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::trajectoryCollisionModel::~trajectoryCollisionModel() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::trajectoryCollisionModel::collideParcels(const scalar dt) const -{ - if (spray_.size() < 2) - { - return; - } - - spray::iterator secondParcel = spray_.begin(); - ++secondParcel; - spray::iterator p1 = secondParcel; - - while (p1 != spray_.end()) - { - spray::iterator p2 = spray_.begin(); - - while (p2 != p1) - { - #include "trajectoryCM.H" - - // remove coalesced droplets - if (p2().m() < VSMALL) - { - spray::iterator tmpElmnt = p2; - ++tmpElmnt; - spray_.deleteParticle(p2()); - p2 = tmpElmnt; - } - else - { - ++p2; - } - } - - // remove coalesced droplets - if (p1().m() < VSMALL) - { - spray::iterator tmpElmnt = p1; - ++tmpElmnt; - spray_.deleteParticle(p1()); - p1 = tmpElmnt; - } - else - { - ++p1; - } - } -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryModel.H b/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryModel.H deleted file mode 100644 index 064c5cf30177afb225bae0014d60bc3c89f653a0..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/collisionModel/trajectoryModel/trajectoryModel.H +++ /dev/null @@ -1,103 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::trajectoryCollisionModel - -Description - Collision model by P.J. O'Rourke. - Implemented as described in the KIVA manual - -SourceFiles - trajectoryModel.C - -\*---------------------------------------------------------------------------*/ - -#ifndef trajectoryCollisionModel_H -#define trajectoryCollisionModel_H - -#include "collisionModel.H" - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class trajectoryCollisionModel Declaration -\*---------------------------------------------------------------------------*/ - -class trajectoryCollisionModel -: - public collisionModel -{ - -private: - - // Private data - - // Reference to the cell volumes - dictionary coeffsDict_; - - scalar cSpace_; - scalar cTime_; - Switch coalescence_; - - -public: - - //- Runtime type information - TypeName("trajectory"); - - - // Constructors - - //- Construct from components - trajectoryCollisionModel - ( - const dictionary& dict, - spray& sm, - cachedRandom& rndGen - ); - - - //- Destructor - virtual ~trajectoryCollisionModel(); - - - // Member Functions - - void collideParcels(const scalar dt) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionLESModel/dispersionLESModel.C b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionLESModel/dispersionLESModel.C deleted file mode 100644 index d2bdcaaf7eeebe97911a2c5df5db26f7e786269e..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionLESModel/dispersionLESModel.C +++ /dev/null @@ -1,60 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "dispersionLESModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(dispersionLESModel, 0); -} - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::dispersionLESModel::dispersionLESModel -( - const dictionary& dict, - spray& sm -) -: - dispersionModel(dict, sm), - turbulence_ - ( - sm.mesh().lookupObject<compressible::LESModel> - ( - "LESProperties" - ) - ) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::dispersionLESModel::~dispersionLESModel() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionLESModel/dispersionLESModel.H b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionLESModel/dispersionLESModel.H deleted file mode 100644 index a2c9f2e8b0196b195bf4b4e4fef9c7fc01fc205b..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionLESModel/dispersionLESModel.H +++ /dev/null @@ -1,91 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::dispersionLESModel - -Description - Foam::dispersionLESModel - -\*---------------------------------------------------------------------------*/ - -#ifndef dispersionLESModel_H -#define dispersionLESModel_H - -#include "dispersionModel.H" -#include "LESModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class dispersionLESModel Declaration -\*---------------------------------------------------------------------------*/ - -class dispersionLESModel -: - public dispersionModel -{ - // Private data - - const compressible::LESModel& turbulence_; - - -public: - - //- Runtime type information - TypeName("dispersionLESModel"); - - - // Constructors - - //- Construct from components - dispersionLESModel(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~dispersionLESModel(); - - - // Member Functions - - const compressible::LESModel& turbulence() const - { - return turbulence_; - } - - virtual void disperseParcels() const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/dispersionModel.C b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/dispersionModel.C deleted file mode 100644 index e4fcfc3a50c8d200d97afc694819b4911086f471..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/dispersionModel.C +++ /dev/null @@ -1,58 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "dispersionModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(dispersionModel, 0); - defineRunTimeSelectionTable(dispersionModel, dictionary); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::dispersionModel::dispersionModel -( - const dictionary& dict, - spray& sm -) -: - dict_(dict), - spray_(sm) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::dispersionModel::~dispersionModel() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/dispersionModel.H b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/dispersionModel.H deleted file mode 100644 index ee98363a5ae83428dfcc9844e478abc6801723af..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/dispersionModel.H +++ /dev/null @@ -1,114 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::dispersionModel - -Description - Foam::dispersionModel - -\*---------------------------------------------------------------------------*/ - -#ifndef dispersionModel_H -#define dispersionModel_H - -#include "IOdictionary.H" -#include "spray.H" -#include "autoPtr.H" -#include "runTimeSelectionTables.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class dispersionModel Declaration -\*---------------------------------------------------------------------------*/ - -class dispersionModel -{ - -protected: - - // Protected data - - const dictionary& dict_; - spray& spray_; - - -public: - - //- Runtime type information - TypeName("dispersionModel"); - - - // Declare runtime constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - dispersionModel, - dictionary, - ( - const dictionary& dict, - spray& sm - ), - (dict, sm) - ); - - - // Constructors - - //- Construct from components - dispersionModel(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~dispersionModel(); - - - // Selector - - static autoPtr<dispersionModel> New - ( - const dictionary& dict, - spray& sm - ); - - - // Member Functions - - virtual void disperseParcels() const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/dispersionModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/dispersionModelNew.C deleted file mode 100644 index 2db15f5a4bea3aa1b2db1b2ff7889c93717511ab..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionModel/dispersionModelNew.C +++ /dev/null @@ -1,62 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "dispersionModel.H" -#include "noDispersion.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::dispersionModel> Foam::dispersionModel::New -( - const dictionary& dict, - spray& sm -) -{ - const word modelType(dict.lookup("dispersionModel")); - - Info<< "Selecting dispersionModel " << modelType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn - ( - "dispersionModel::New(const dictionary&, const spray&)" - ) << "Unknown dispersionModel type " - << modelType << nl << nl - << "Valid dispersionModel types are :" << endl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); - } - - return autoPtr<dispersionModel>(cstrIter()(dict, sm)); -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionRASModel/dispersionRASModel.C b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionRASModel/dispersionRASModel.C deleted file mode 100644 index 16050cdbfcbec5412bf995fab187fb0b04ef0655..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionRASModel/dispersionRASModel.C +++ /dev/null @@ -1,60 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "dispersionRASModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(dispersionRASModel, 0); -} - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::dispersionRASModel::dispersionRASModel -( - const dictionary& dict, - spray& sm -) -: - dispersionModel(dict, sm), - turbulence_ - ( - sm.mesh().lookupObject<compressible::RASModel> - ( - "RASProperties" - ) - ) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::dispersionRASModel::~dispersionRASModel() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionRASModel/dispersionRASModel.H b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionRASModel/dispersionRASModel.H deleted file mode 100644 index 91e7c9f88e48d26af370e32014a3ff1267b03b8d..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/dispersionRASModel/dispersionRASModel.H +++ /dev/null @@ -1,92 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::dispersionRASModel - -Description - dispersion RAS model - -\*---------------------------------------------------------------------------*/ - -#ifndef dispersionRASModel_H -#define dispersionRASModel_H - -#include "dispersionModel.H" -#include "RASModel.H" - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class dispersionRASModel Declaration -\*---------------------------------------------------------------------------*/ - -class dispersionRASModel -: - public dispersionModel -{ - // Private data - - const compressible::RASModel& turbulence_; - - -public: - - //- Runtime type information - TypeName("dispersionRASModel"); - - - // Constructors - - //- Construct from components - dispersionRASModel(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~dispersionRASModel(); - - - // Member Functions - - const compressible::RASModel& turbulence() const - { - return turbulence_; - } - - virtual void disperseParcels() const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/gradientDispersionRAS/gradientDispersionRAS.C b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/gradientDispersionRAS/gradientDispersionRAS.C deleted file mode 100644 index caab9bf2cf029521d93be5c83c470090865a846f..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/gradientDispersionRAS/gradientDispersionRAS.C +++ /dev/null @@ -1,137 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "gradientDispersionRAS.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(gradientDispersionRAS, 0); - - addToRunTimeSelectionTable - ( - dispersionModel, - gradientDispersionRAS, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::gradientDispersionRAS::gradientDispersionRAS -( - const dictionary& dict, - spray& sm -) -: - dispersionRASModel(dict, sm) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::gradientDispersionRAS::~gradientDispersionRAS() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::gradientDispersionRAS::disperseParcels() const -{ - - const scalar cps = 0.16432; - - scalar dt = spray_.runTime().deltaTValue(); - const volScalarField& k = turbulence().k(); - const volVectorField gradk(fvc::grad(k)); - const volScalarField& epsilon = turbulence().epsilon(); - const volVectorField& U = spray_.U(); - - forAllIter(spray, spray_, elmnt) - { - const label cellI = elmnt().cell(); - scalar UrelMag = mag(elmnt().U() - U[cellI] - elmnt().Uturb()); - - scalar Tturb = min - ( - k[cellI]/epsilon[cellI], - cps*pow(k[cellI], 1.5)/epsilon[cellI]/(UrelMag + SMALL) - ); - // parcel is perturbed by the turbulence - if (dt < Tturb) - { - elmnt().tTurb() += dt; - - if (elmnt().tTurb() > Tturb) - { - elmnt().tTurb() = 0.0; - - scalar sigma = sqrt(2.0*k[cellI]/3.0); - vector dir = -gradk[cellI]/(mag(gradk[cellI]) + SMALL); - - // numerical recipes... Ch. 7. Random Numbers... - scalar x1 = 0.0; - scalar x2 = 0.0; - scalar rsq = 10.0; - while ((rsq > 1.0) || (rsq == 0.0)) - { - x1 = 2.0*spray_.rndGen().sample01<scalar>() - 1.0; - x2 = 2.0*spray_.rndGen().sample01<scalar>() - 1.0; - rsq = x1*x1 + x2*x2; - } - - scalar fac = sqrt(-2.0*log(rsq)/rsq); - - // in 2D calculations the -grad(k) is always - // away from the axis of symmetry - // This creates a 'hole' in the spray and to - // prevent this we let x1 be both negative/positive - if (spray_.twoD()) - { - fac *= x1; - } - else - { - fac *= mag(x1); - } - - elmnt().Uturb() = sigma*fac*dir; - } - } - else - { - elmnt().tTurb() = GREAT; - elmnt().Uturb() = vector::zero; - } - } -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/gradientDispersionRAS/gradientDispersionRAS.H b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/gradientDispersionRAS/gradientDispersionRAS.H deleted file mode 100644 index 2ea38670d701e9d6603b17b92ede4152a01fc7c6..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/gradientDispersionRAS/gradientDispersionRAS.H +++ /dev/null @@ -1,83 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::gradientDispersionRAS - -Description - The velocity is perturbed in the direction of -grad(k), with a - Gaussian random number distribution with variance sigma. - where sigma is defined below - -\*---------------------------------------------------------------------------*/ - -#ifndef gradientDispersionRAS_H -#define gradientDispersionRAS_H - -#include "dispersionRASModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class gradientDispersionRAS Declaration -\*---------------------------------------------------------------------------*/ - -class gradientDispersionRAS -: - public dispersionRASModel -{ - -public: - - //- Runtime type information - TypeName("gradientDispersionRAS"); - - - // Constructors - - //- Construct from components - gradientDispersionRAS(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~gradientDispersionRAS(); - - - // Member Functions - - void disperseParcels() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/noDispersion/noDispersion.C b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/noDispersion/noDispersion.C deleted file mode 100644 index 67708493f2dd385abd9c859722921bc32340de5e..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/noDispersion/noDispersion.C +++ /dev/null @@ -1,68 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "noDispersion.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(noDispersion, 0); - - addToRunTimeSelectionTable - ( - dispersionModel, - noDispersion, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::noDispersion::noDispersion(const dictionary& dict, spray& sm) -: - dispersionModel(dict, sm) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::noDispersion::~noDispersion() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::noDispersion::disperseParcels() const -{ - // Do nothing -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/noDispersion/noDispersion.H b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/noDispersion/noDispersion.H deleted file mode 100644 index 23d744c82f73e2f5e629aad0c51c9b78ff38cbdc..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/noDispersion/noDispersion.H +++ /dev/null @@ -1,81 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::noDispersion - -Description - No turbulent dispersion of the parcels - -\*---------------------------------------------------------------------------*/ - -#ifndef noDispersion_H -#define noDispersion_H - -#include "dispersionModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class noDispersion Declaration -\*---------------------------------------------------------------------------*/ - -class noDispersion -: - public dispersionModel -{ - -public: - - //- Runtime type information - TypeName("off"); - - - // Constructors - - //- Construct from components - noDispersion(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~noDispersion(); - - - // Member Functions - - void disperseParcels() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/stochasticDispersionRAS/stochasticDispersionRAS.C b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/stochasticDispersionRAS/stochasticDispersionRAS.C deleted file mode 100644 index 1e42aabb816579eb2a58bc5f3e6ed647c93a1ace..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/stochasticDispersionRAS/stochasticDispersionRAS.C +++ /dev/null @@ -1,129 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "stochasticDispersionRAS.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(stochasticDispersionRAS, 0); - - addToRunTimeSelectionTable - ( - dispersionModel, - stochasticDispersionRAS, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::stochasticDispersionRAS::stochasticDispersionRAS -( - const dictionary& dict, - spray& sm -) -: - dispersionRASModel(dict, sm) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::stochasticDispersionRAS::~stochasticDispersionRAS() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::stochasticDispersionRAS::disperseParcels() const -{ - - const scalar cps = 0.16432; - const vector one(1.0, 1.0, 1.0); - - scalar dt = spray_.runTime().deltaTValue(); - const volScalarField& k = turbulence().k(); - // volVectorField gradk(fvc::grad(k)); - const volScalarField& epsilon = turbulence().epsilon(); - const volVectorField& U = spray_.U(); - - forAllIter(spray, spray_, elmnt) - { - const label cellI = elmnt().cell(); - scalar UrelMag = mag(elmnt().U() - U[cellI] - elmnt().Uturb()); - - scalar Tturb = min - ( - k[cellI]/epsilon[cellI], - cps*pow(k[cellI], 1.5)/epsilon[cellI]/(UrelMag + SMALL) - ); - - // parcel is perturbed by the turbulence - if (dt < Tturb) - { - elmnt().tTurb() += dt; - - if (elmnt().tTurb() > Tturb) - { - elmnt().tTurb() = 0.0; - - scalar sigma = sqrt(2.0*k[cellI]/3.0); - vector dir = 2.0*spray_.rndGen().sample01<vector>() - one; - dir /= mag(dir) + SMALL; - - // numerical recipes... Ch. 7. Random Numbers... - scalar x1,x2; - scalar rsq = 10.0; - while (rsq > 1.0 || rsq == 0.0) - { - x1 = 2.0*spray_.rndGen().sample01<scalar>() - 1.0; - x2 = 2.0*spray_.rndGen().sample01<scalar>() - 1.0; - rsq = x1*x1 + x2*x2; - } - - scalar fac = sqrt(-2.0*log(rsq)/rsq); - - fac *= mag(x1); - - elmnt().Uturb() = sigma*fac*dir; - - } - } - else - { - elmnt().tTurb() = GREAT; - elmnt().Uturb() = vector::zero; - } - } -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/stochasticDispersionRAS/stochasticDispersionRAS.H b/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/stochasticDispersionRAS/stochasticDispersionRAS.H deleted file mode 100644 index d2ca71da9154d239e9dc2a9381d4bf41fbdeea1e..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dispersionModel/stochasticDispersionRAS/stochasticDispersionRAS.H +++ /dev/null @@ -1,83 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::stochasticDispersionRAS - -Description - The velocity is perturbed in random direction, with a - Gaussian random number distribution with variance sigma. - where sigma is defined below - -\*---------------------------------------------------------------------------*/ - -#ifndef stochasticDispersionRAS_H -#define stochasticDispersionRAS_H - -#include "dispersionRASModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class stochasticDispersionRAS Declaration -\*---------------------------------------------------------------------------*/ - -class stochasticDispersionRAS -: - public dispersionRASModel -{ - -public: - - //- Runtime type information - TypeName("stochasticDispersionRAS"); - - - // Constructors - - //- Construct from components - stochasticDispersionRAS(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~stochasticDispersionRAS(); - - - // Member Functions - - void disperseParcels() const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/dragModel.C b/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/dragModel.C deleted file mode 100644 index c3570bb06307a94d695c715efd04f81f85c15185..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/dragModel.C +++ /dev/null @@ -1,54 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "dragModel.H" -#include "parcel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(dragModel, 0); - defineRunTimeSelectionTable(dragModel, dictionary); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::dragModel::dragModel(const dictionary& dict) -: - dict_(dict) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::dragModel::~dragModel() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/dragModel.H b/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/dragModel.H deleted file mode 100644 index 66122b5846ba1931a1794d4cc2f3ff044cf272de..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/dragModel.H +++ /dev/null @@ -1,124 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::dragModel - -Description - Foam::dragModel - -\*---------------------------------------------------------------------------*/ - -#ifndef dragModel_H -#define dragModel_H - -#include "IOdictionary.H" -#include "volFields.H" -#include "surfaceFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class dragModel Declaration -\*---------------------------------------------------------------------------*/ - -class dragModel -{ - -protected: - - // Protected data - - const dictionary& dict_; - -public: - - //- Runtime type information - TypeName("dragModel"); - - - // Declare runtime constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - dragModel, - dictionary, - ( - const dictionary& dict - ), - (dict) - ); - - - // Constructors - - //- Construct from components - dragModel(const dictionary& dict); - - - //- Destructor - virtual ~dragModel(); - - - // Selector - - static autoPtr<dragModel> New - ( - const dictionary& dict - ); - - - // Member Functions - - virtual scalar Cd - ( - const scalar ReynoldsNumber, - const scalar deviation - ) const = 0; - - virtual scalar relaxationTime - ( - const vector& URel, - const scalar diameter, - const scalar rho, - const scalar liquidDensity, - const scalar nu, - const scalar deviation - ) const = 0; - -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/dragModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/dragModelNew.C deleted file mode 100644 index 34c2eceaad4f862f5aa257fd823015cfa168fe9f..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dragModel/dragModel/dragModelNew.C +++ /dev/null @@ -1,56 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "dragModel.H" -#include "parcel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::dragModel> Foam::dragModel::New(const dictionary& dict) -{ - const word modelType(dict.lookup("dragModel")); - - Info<< "Selecting dragModel " << modelType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn("dragModel::New(const dictionary&)") - << "Unknown dragModel type " - << modelType << nl << nl - << "Valid dragModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); - } - - return autoPtr<dragModel>(cstrIter()(dict)); -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dragModel/noDragModel/noDragModel.C b/src/lagrangian/dieselSpray/spraySubModels/dragModel/noDragModel/noDragModel.C deleted file mode 100644 index 7a9e61b536f2669d0d3bfcdf2a4dba27cec3e7c0..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dragModel/noDragModel/noDragModel.C +++ /dev/null @@ -1,86 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "noDragModel.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(noDragModel, 0); - - addToRunTimeSelectionTable - ( - dragModel, - noDragModel, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::noDragModel::noDragModel(const dictionary& dict) -: - dragModel(dict) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::noDragModel::~noDragModel() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::scalar Foam::noDragModel::Cd -( - const scalar, - const scalar -) const -{ - return 0.0; -} - - -Foam::scalar Foam::noDragModel::relaxationTime -( - const vector&, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar -) const -{ - return GREAT; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dragModel/noDragModel/noDragModel.H b/src/lagrangian/dieselSpray/spraySubModels/dragModel/noDragModel/noDragModel.H deleted file mode 100644 index 38418b60f886f392e548a384ad04c0ca751fcce5..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dragModel/noDragModel/noDragModel.H +++ /dev/null @@ -1,94 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::noDragModel - -Description - standard drag law model with a lower limit on the Cd-value - -\*---------------------------------------------------------------------------*/ - -#ifndef noDragModel_H -#define noDragModel_H - -#include "dragModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class noDragModel Declaration -\*---------------------------------------------------------------------------*/ - -class noDragModel -: - public dragModel -{ - -public: - - //- Runtime type information - TypeName("noDragModel"); - - - // Constructors - - //- Construct from components - noDragModel(const dictionary& dict); - - - //- Destructor - virtual ~noDragModel(); - - - // Member Functions - - scalar Cd - ( - const scalar ReynoldsNumber, - const scalar deviation - ) const; - - scalar relaxationTime - ( - const vector& URel, - const scalar diameter, - const scalar rho, - const scalar liquidDensity, - const scalar nu, - const scalar deviation - ) const; -}; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dragModel/standardDragModel/standardDragModel.C b/src/lagrangian/dieselSpray/spraySubModels/dragModel/standardDragModel/standardDragModel.C deleted file mode 100644 index e532882e4d4caa602bb0bdb4e886569597eb2c97..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dragModel/standardDragModel/standardDragModel.C +++ /dev/null @@ -1,119 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "standardDragModel.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(standardDragModel, 0); - - addToRunTimeSelectionTable - ( - dragModel, - standardDragModel, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::standardDragModel::standardDragModel(const dictionary& dict) -: - dragModel(dict), - dragDict_(dict.subDict(typeName + "Coeffs")), - preReFactor_(readScalar(dragDict_.lookup("preReFactor"))), - ReExponent_(readScalar(dragDict_.lookup("ReExponent"))), - ReLimiter_(readScalar(dragDict_.lookup("ReLimiter"))), - CdLimiter_(readScalar(dragDict_.lookup("CdLimiter"))), - Cdistort_(readScalar(dragDict_.lookup("Cdistort"))) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::standardDragModel::~standardDragModel() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::scalar Foam::standardDragModel::Cd -( - const scalar Re, - const scalar dev -) const -{ - scalar drag = CdLimiter_; - - if (Re < ReLimiter_) - { - drag = 24.0*(1.0 + preReFactor_*pow(Re, ReExponent_))/Re; - } - - // correct for deviation from sphericity - drag *= (1.0 + Cdistort_*dev); - - return drag; -} - - -Foam::scalar Foam::standardDragModel::relaxationTime -( - const vector& URel, - const scalar diameter, - const scalar rho, - const scalar liquidDensity, - const scalar nu, - const scalar dev -) const -{ - scalar time = GREAT; - scalar Re = mag(URel)*diameter/nu; - - if (Re > 0.1) - { - time = 4.0*liquidDensity*diameter/(3.0*rho*Cd(Re, dev)*mag(URel)); - } - else - { - // for small Re number, the relative velocity is both in - // the nominator and denominator - // use Cd = 24/Re and remove the SMALL/SMALL - // expression for the velocities - time = - liquidDensity*diameter*diameter/(18*rho*nu*(1.0 + Cdistort_*dev)); - } - - return time; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/dragModel/standardDragModel/standardDragModel.H b/src/lagrangian/dieselSpray/spraySubModels/dragModel/standardDragModel/standardDragModel.H deleted file mode 100644 index f6fc354eb968c8422b7d8d92775eecdfacb60bf6..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/dragModel/standardDragModel/standardDragModel.H +++ /dev/null @@ -1,106 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::standardDragModel - -Description - standard drag law model with a lower limit on the Cd-value - -\*---------------------------------------------------------------------------*/ - -#ifndef standardDragModel_H -#define standardDragModel_H - -#include "dragModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class standardDragModel Declaration -\*---------------------------------------------------------------------------*/ - -class standardDragModel -: - public dragModel -{ - -private: - - // Private data - - dictionary dragDict_; - scalar preReFactor_; - scalar ReExponent_; - scalar ReLimiter_; - scalar CdLimiter_; - scalar Cdistort_; - - -public: - - //- Runtime type information - TypeName("standardDragModel"); - - - // Constructors - - //- Construct from components - standardDragModel(const dictionary& dict); - - - //- Destructor - virtual ~standardDragModel(); - - - // Member Functions - - scalar Cd - ( - const scalar ReynoldsNumber, - const scalar deviation - ) const; - - scalar relaxationTime - ( - const vector& URel, - const scalar diameter, - const scalar rho, - const scalar liquidDensity, - const scalar nu, - const scalar deviation - ) const; -}; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/RutlandFlashBoil/RutlandFlashBoil.C b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/RutlandFlashBoil/RutlandFlashBoil.C deleted file mode 100644 index 8579bfc3c3efb858e6bb94c2c6d117823cd2de58..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/RutlandFlashBoil/RutlandFlashBoil.C +++ /dev/null @@ -1,356 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "RutlandFlashBoil.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(RutlandFlashBoil, 0); - - addToRunTimeSelectionTable - ( - evaporationModel, - RutlandFlashBoil, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::RutlandFlashBoil::RutlandFlashBoil( const dictionary& dict) -: - evaporationModel(dict), - evapDict_(dict.subDict(typeName + "Coeffs")), - preReScFactor_(readScalar(evapDict_.lookup("preReScFactor"))), - ReExponent_(readScalar(evapDict_.lookup("ReExponent"))), - ScExponent_(readScalar(evapDict_.lookup("ScExponent"))), - evaporationScheme_(evapDict_.lookup("evaporationScheme")), - nEvapIter_(0) -{ - if (evaporationScheme_ == "implicit") - { - nEvapIter_ = 2; - } - else if (evaporationScheme_ == "explicit") - { - nEvapIter_ = 1; - } - else - { - FatalError - << "evaporationScheme type " << evaporationScheme_ - << " unknown. Use implicit or explicit." << nl - << abort(FatalError); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::RutlandFlashBoil::~RutlandFlashBoil() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::RutlandFlashBoil::evaporation() const -{ - return true; -} - - -// Correlation for the Sherwood Number -Foam::scalar Foam::RutlandFlashBoil::Sh -( - const scalar ReynoldsNumber, - const scalar SchmidtNumber -) const -{ - return - 2.0 - + preReScFactor_ - *pow(ReynoldsNumber, ReExponent_) - *pow(SchmidtNumber,ScExponent_); -} - - -Foam::scalar Foam::RutlandFlashBoil::relaxationTime -( - const scalar diameter, - const scalar liquidDensity, - const scalar rhoFuelVapor, - const scalar massDiffusionCoefficient, - const scalar ReynoldsNumber, - const scalar SchmidtNumber, - const scalar Xs, - const scalar Xf, - const scalar m0, - const scalar dm, - const scalar dt -) const -{ - scalar time = GREAT; - scalar lgExpr = 0.0; - - /* - (pressure - partialFuelVaporPressure)/ - (pressure - pressureAtSurface) - = 1 + Xratio - - if the pressure @ Surface > pressure - this lead to boiling - and Xratio -> infinity (as it should) - ... this is numerically nasty - - NB! - X_v,s = (p_v,s/p) X_v,d - where X_v,d = 1 for single component fuel - according to eq (3.136) - in D. Clerides Thesis - */ - - scalar Xratio = (Xs - Xf)/max(SMALL, 1.0 - Xs); - - if (Xratio > 0.0) - { - lgExpr = log(1.0 + Xratio); - } - - // From Equation (3.79) in C. Kralj's Thesis: - // Note that the 2.0 (instead of 6.0) below is correct, since evaporation - // is d(diameter)/dt and not d(mass)/dt - - scalar Sherwood = Sh(ReynoldsNumber, SchmidtNumber); - - scalar FbExp = 0.7; - - scalar logXratio = log(1.0 + Xratio); - scalar Fb = 1.0; - - if (logXratio > SMALL) - { - Fb = pow((1.0 + Xratio), FbExp)*log(1.0 + Xratio)/Xratio; - } - - // proposed correction to sherwood number, implemented - - Sherwood = 2.0 + (Sherwood - 2.0)/Fb; - - scalar denominator = - 6.0*massDiffusionCoefficient*Sherwood*rhoFuelVapor*lgExpr; - - if (denominator > SMALL) - { - time = max(VSMALL, liquidDensity*sqr(diameter)/denominator); - } - - return time; -} - - -Foam::scalar Foam::RutlandFlashBoil::boilingTime -( - const scalar liquidDensity, - const scalar cpFuel, - const scalar heatOfVapour, - const scalar kappa, - const scalar Nusselt, - const scalar deltaTemp, - const scalar diameter, - const scalar liquidCore, - const scalar ct, - const scalar tDrop, - const scalar tBoilingSurface, - const scalar vapourSurfaceEnthalpy, - const scalar vapourFarEnthalpy, - const scalar cpGas, - const scalar temperature, - const scalar kLiq -) const -{ - scalar time = GREAT; - - // the deltaTemperature is limited to not go below .5 deg K - // for numerical reasons. - // This is probably not important, since it results in an upper - // limit for the boiling time... which we have anyway. - - // k set to the k value at the droplet temperature, not as in the Rutland - // Paper - - if (liquidCore > 0.5) - { - if (tDrop > tBoilingSurface) - { - // Evaporation of the liquid sheet - - scalar psi = 2.72; - scalar kIncreased = psi*kLiq; - scalar alfa = psi*kIncreased/(liquidDensity*cpFuel); - scalar F = alfa*ct/sqr(0.5*diameter); - - scalar expSum = 0.0; - scalar expSumOld = expSum; - - label Niter = 200; - - for (label k=0; k < Niter; k++) - { - expSum += exp(sqr(-k*constant::mathematical::pi*sqrt(F)/2.0)); - if (mag(expSum-expSumOld)/expSum < 1.0e-3) - { - break; - } - expSumOld = expSum; - } - } - } - else - { - scalar dTLB = min(0.5, tDrop - tBoilingSurface); - scalar alfaS = 0.0; - - if (dTLB >= 0.0 && dTLB < 5.0) - { - alfaS = 0.76*pow(dTLB, 0.26); - } - if (dTLB >= 5.0 && dTLB < 25.0) - { - alfaS = 0.027*pow(dTLB, 2.33); - } - if (dTLB >= 25.0) - { - alfaS = 13.8*pow(dTLB, 0.39); - } - - scalar Gf = - 4.0*alfaS*dTLB - *constant::mathematical::pi*sqr(diameter/2.0) - /heatOfVapour; - - // calculation of the heat transfer vapourization at superheated - // conditions (temperature>tBoilingSurface) - scalar G = 0.0; - if (temperature > tBoilingSurface) - { - scalar NusseltCorr = Nusselt ; - scalar A = - mag((vapourFarEnthalpy-vapourSurfaceEnthalpy)/heatOfVapour); - - // 2.0? or 1.0? try 1! - scalar B = - 1.0*constant::mathematical::pi*kappa/cpGas*diameter*NusseltCorr; - scalar nPos = B*log(1.0 + A)/Gf + 1.0; - scalar nNeg = (1.0/A)*(exp(Gf/B) - 1.0 - A) + 1.0; - - scalar Gpos = Gf*nPos; - scalar Gneg = Gf/nNeg; - - //scalar FgPos = Gpos + Gf - B * log( 1.0 + ( 1.0 + Gf/Gpos )*A); - scalar FgNeg = Gneg + Gf - B*log(1.0 + (1.0 + Gf/Gneg )*A); - - if (FgNeg > 0.0) - { - for (label j = 0; j < 20; j++) - { - Gneg = Gneg/10.0; - Gneg = max(Gneg, VSMALL); - FgNeg = Gneg + Gf - B*log(1.0 + (1.0 + Gf/Gneg)*A); - if (FgNeg < 0.0) - { - break; - } - } - } - - FgNeg = Gneg + Gf - B*log( 1.0 + ( 1.0 + Gf/Gneg)*A); - - G = 0.5*(Gpos + Gneg); - scalar Gold = -100; - - label Niter = 200; - label k=0; - - if (FgNeg > 0.0) - { - Info<< "no convergence" << endl; - } - - - if (FgNeg < 0.0) - { - for (k=0; k<Niter; k++) - { - scalar Fg = G + Gf - B*log( 1.0 + ( 1.0 + Gf/G )*A); - - if (Fg > 0) - { - Gpos = G; - G = 0.5*(Gpos + Gneg); - } - else - { - Gneg = G; - G = 0.5*(Gpos + Gneg); - } - - Gold = G; - if (mag(G - Gold)/Gold < 1.0e-3) - { - break; - } - } - - if (k >= Niter - 1) - { - Info<< " No convergence for G " << endl; - } - } - else - { - G = 0.0; - } - } - - time = - (constant::mathematical::pi*pow3(diameter)/6.0) - *liquidDensity - /(G + Gf); - - time = max(VSMALL, time); - } - - return time; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/RutlandFlashBoil/RutlandFlashBoil.H b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/RutlandFlashBoil/RutlandFlashBoil.H deleted file mode 100644 index b45d423e998e9613889ddbe7dd1a72eb85f8a7b8..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/RutlandFlashBoil/RutlandFlashBoil.H +++ /dev/null @@ -1,153 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::RutlandFlashBoil - -Description - Evaporation model with flash boiling. - - Evaporation model that takes into account of: - - flash boiling of the liquid core and droplets - - superheated vaporization of a boiling droplet - - Accurated description in - \verbatim - B. Zuo, A.M. Gomes, C.J. Rutland - "Modeling Superheated Fuel Spray Vaporization" - Int. Journal of Engine Research, 2000. Vol. 1, pp. 321-326 - \endverbatim -\*---------------------------------------------------------------------------*/ - -#ifndef RutlandFlashBoil_H -#define RutlandFlashBoil_H - -#include "evaporationModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class RutlandFlashBoil Declaration -\*---------------------------------------------------------------------------*/ - -class RutlandFlashBoil -: - public evaporationModel -{ - -private: - - // Private data - - dictionary evapDict_; - scalar preReScFactor_; - scalar ReExponent_; - scalar ScExponent_; - - word evaporationScheme_; - label nEvapIter_; - - -public: - - //- Runtime type information - TypeName("RutlandFlashBoil"); - - - // Constructors - - //- Construct from dictionary - RutlandFlashBoil(const dictionary& dict); - - - //- Destructor - virtual ~RutlandFlashBoil(); - - - // Member Functions - - bool evaporation() const; - - //- Correlation for the Sherwood Number - scalar Sh - ( - const scalar ReynoldsNumber, - const scalar SchmidtNumber - ) const; - - //- Return the evaporation relaxation time - scalar relaxationTime - ( - const scalar diameter, - const scalar liquidDensity, - const scalar rhoFuelVapor, - const scalar massDiffusionCoefficient, - const scalar ReynoldsNumber, - const scalar SchmidtNumber, - const scalar Xs, - const scalar Xf, - const scalar m0, - const scalar dm, - const scalar dt - ) const; - - scalar boilingTime - ( - const scalar liquidDensity, - const scalar cpFuel, - const scalar heatOfVapour, - const scalar kappa, - const scalar Nusselt, - const scalar deltaTemp, - const scalar diameter, - const scalar liquidCore, - const scalar time, - const scalar tDrop, - const scalar tBoilingSurface, - const scalar vapourSurfaceEnthalpy, - const scalar vapourFarEnthalpy, - const scalar cpGas, - const scalar temperature, - const scalar kLiquid - ) const; - - inline label nEvapIter() const - { - return nEvapIter_; - } - -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/evaporationModel.C b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/evaporationModel.C deleted file mode 100644 index c7f53cb15463b512e496b0ffd33f9b3a1a2190ee..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/evaporationModel.C +++ /dev/null @@ -1,51 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "evaporationModel.H" -#include "runTimeSelectionTables.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(evaporationModel, 0); - defineRunTimeSelectionTable(evaporationModel, dictionary); -} - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::evaporationModel::evaporationModel(const dictionary& dict) -: - dict_(dict) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::evaporationModel::~evaporationModel() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/evaporationModel.H b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/evaporationModel.H deleted file mode 100644 index 087c4e62178f8cb6a88557a939155b4c1cf569f6..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/evaporationModel.H +++ /dev/null @@ -1,155 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::evaporationModel - -Description - Base class for selecting an evaporation model - -\*---------------------------------------------------------------------------*/ - -#ifndef evaporationModel_H -#define evaporationModel_H - -#include "IOdictionary.H" -#include "autoPtr.H" -#include "runTimeSelectionTables.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class evaporationModel Declaration -\*---------------------------------------------------------------------------*/ - -class evaporationModel -{ -protected: - - // Protected data - - const dictionary& dict_; - - -public: - - //- Runtime type information - TypeName("evaporationModel"); - - //- Evaluate the gaseous properties T and Y (implicit/explicit) - // word gasPropertyEvaluation_; - // label nEvapIter_; - - - // Declare runtime constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - evaporationModel, - dictionary, - ( - const dictionary& dict - ), - (dict) - ); - - - // Constructors - - //- Construct from components - evaporationModel(const dictionary&); - - - //- Destructor - virtual ~evaporationModel(); - - - // Selector - - static autoPtr<evaporationModel> New(const dictionary&); - - - // Member Functions - - //- evaporation on/off - virtual bool evaporation() const = 0; - - //- The Sherwood number - virtual scalar Sh - ( - const scalar ReynoldsNumber, - const scalar SchmidtNumber - ) const = 0; - - virtual scalar relaxationTime - ( - const scalar diameter, - const scalar liquidDensity, - const scalar rhoFuelVapor, - const scalar massDiffusionCoefficient, - const scalar ReynoldsNumber, - const scalar SchmidtNumber, - const scalar Xs, - const scalar Xf, - const scalar m0, - const scalar dm, - const scalar dt - ) const = 0; - - virtual scalar boilingTime - ( - const scalar liquidDensity, - const scalar cpFuel, - const scalar heatOfVapour, - const scalar kappa, - const scalar Nusselt, - const scalar deltaTemp, - const scalar diameter, - const scalar liquidCore, - const scalar time, - const scalar tDrop, - const scalar tBoilingSurface, - const scalar vapourSurfaceEnthalpy, - const scalar vapourFarEnthalpy, - const scalar cpGas, - const scalar temperature, - const scalar kLiq - ) const = 0; - - virtual label nEvapIter() const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/evaporationModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/evaporationModelNew.C deleted file mode 100644 index 1c5287632af5d770da955f1bc4bd78fee2f64b43..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/evaporationModel/evaporationModelNew.C +++ /dev/null @@ -1,59 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "evaporationModel.H" -#include "noEvaporation.H" -#include "standardEvaporationModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::evaporationModel> Foam::evaporationModel::New -( - const dictionary& dict -) -{ - const word modelType(dict.lookup("evaporationModel")); - - Info<< "Selecting evaporationModel " << modelType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn("evaporationModel::New(const dictionary&)") - << "Unknown evaporationModel type " - << modelType << nl << nl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); - } - - return autoPtr<evaporationModel>(cstrIter()(dict)); -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/noEvaporation/noEvaporation.C b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/noEvaporation/noEvaporation.C deleted file mode 100644 index acda2a855454c673f2dcb1b2bf65099eb0da5ba3..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/noEvaporation/noEvaporation.C +++ /dev/null @@ -1,121 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "noEvaporation.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(noEvaporation, 0); - - addToRunTimeSelectionTable - ( - evaporationModel, - noEvaporation, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::noEvaporation::noEvaporation( const dictionary& dict) -: - evaporationModel(dict) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::noEvaporation::~noEvaporation() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::noEvaporation::evaporation() const -{ - return false; -} - - -Foam::scalar Foam::noEvaporation::Sh -( - const scalar, - const scalar -) const -{ - return 0.0; -} - - -Foam::scalar Foam::noEvaporation::relaxationTime -( - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar -) const -{ - return GREAT; -} - - -Foam::scalar Foam::noEvaporation::boilingTime -( - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar -) const -{ - return GREAT; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/noEvaporation/noEvaporation.H b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/noEvaporation/noEvaporation.H deleted file mode 100644 index 48492ce5fae5334e5c8baa7715c1cf984c3c6bd0..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/noEvaporation/noEvaporation.H +++ /dev/null @@ -1,129 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::noEvaporation - -Description - set the relaxation-times to something negative. - this will disable evaporation - -\*---------------------------------------------------------------------------*/ - -#ifndef noEvaporation_H -#define noEvaporation_H - -#include "evaporationModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class noEvaporation Declaration -\*---------------------------------------------------------------------------*/ - -class noEvaporation -: - public evaporationModel -{ - -public: - - //- Runtime type information - TypeName("off"); - - - // Constructors - - //- Construct from dictionary - noEvaporation(const dictionary& dict); - - - //- Destructor - virtual ~noEvaporation(); - - - // Member Functions - - bool evaporation() const; - - scalar Sh - ( - const scalar ReynoldsNumber, - const scalar SchmidtNumber - ) const; - - scalar relaxationTime - ( - const scalar diameter, - const scalar liquidDensity, - const scalar rhoFuelVapor, - const scalar massDiffusionCoefficient, - const scalar ReynoldsNumber, - const scalar SchmidtNumber, - const scalar Xs, - const scalar Xf, - const scalar m0, - const scalar dm, - const scalar dt - ) const; - - scalar boilingTime - ( - const scalar liquidDensity, - const scalar cpFuel, - const scalar heatOfVapour, - const scalar kappa, - const scalar Nusselt, - const scalar deltaTemp, - const scalar diameter, - const scalar liquidCore, - const scalar time, - const scalar tDrop, - const scalar tBoilingSurface, - const scalar vapourSurfaceEnthalpy, - const scalar vapourFarEnthalpy, - const scalar cpGas, - const scalar temperature, - const scalar kLiq - ) const; - - inline label nEvapIter() const - { - return 0; - } - -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/saturateEvaporationModel/saturateEvaporationModel.C b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/saturateEvaporationModel/saturateEvaporationModel.C deleted file mode 100644 index 5632e95eacefd8a7a704d79e1360f243ed39ab6a..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/saturateEvaporationModel/saturateEvaporationModel.C +++ /dev/null @@ -1,141 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "saturateEvaporationModel.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(saturateEvaporationModel, 0); - - addToRunTimeSelectionTable - ( - evaporationModel, - saturateEvaporationModel, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::saturateEvaporationModel::saturateEvaporationModel -( - const dictionary& dict -) -: - evaporationModel(dict) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::saturateEvaporationModel::~saturateEvaporationModel() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::saturateEvaporationModel::evaporation() const -{ - return true; -} - - -// Correlation for the Sherwood Number -Foam::scalar Foam::saturateEvaporationModel::Sh -( - const scalar ReynoldsNumber, - const scalar SchmidtNumber -) const -{ - return 0.0; -} - - -Foam::scalar Foam::saturateEvaporationModel::relaxationTime -( - const scalar diameter, - const scalar liquidDensity, - const scalar rhoFuelVapor, - const scalar massDiffusionCoefficient, - const scalar ReynoldsNumber, - const scalar SchmidtNumber, - const scalar Xs, - const scalar Xf, - const scalar m0, - const scalar dm, - const scalar dt -) const -{ - return max(SMALL, dt*(m0/dm - 1.0)); -} - - -Foam::scalar Foam::saturateEvaporationModel::boilingTime -( - const scalar liquidDensity, - const scalar cpFuel, - const scalar heatOfVapour, - const scalar kappa, - const scalar Nusselt, - const scalar deltaTemp, - const scalar diameter, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar -) const -{ - scalar time = GREAT; - - // the deltaTemperature is limited to not go below .5 deg K - // for numerical reasons. - // This is probably not important, since it results in an upper - // limit for the boiling time... which we have anyway. - scalar deltaT = max(0.5, deltaTemp); - - time = - liquidDensity*cpFuel*sqr(diameter) - /( - 6.0*kappa*Nusselt*log(1.0 + cpFuel*deltaT/max(SMALL, heatOfVapour)) - ); - - time = max(VSMALL, time); - - return time; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/saturateEvaporationModel/saturateEvaporationModel.H b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/saturateEvaporationModel/saturateEvaporationModel.H deleted file mode 100644 index 59386d2513033391497a350ae481ebadfe5056df..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/saturateEvaporationModel/saturateEvaporationModel.H +++ /dev/null @@ -1,142 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::saturateEvaporationModel - -Description - saturate evaporation model. - Characteristic time is calculated to immediately saturate the cell - It should be mentioned that this is coupled with the (implicit) way - evaporation is done in parcel, since the evaporation time depends - on the integration step - -\*---------------------------------------------------------------------------*/ - -#ifndef saturateEvaporationModel_H -#define saturateEvaporationModel_H - -#include "evaporationModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class saturateEvaporationModel Declaration -\*---------------------------------------------------------------------------*/ - -class saturateEvaporationModel -: - public evaporationModel -{ - -private: - - // Private data - - dictionary evapDict_; - - -public: - - //- Runtime type information - TypeName("saturateEvaporationModel"); - - - // Constructors - - //- Construct from dictionary - saturateEvaporationModel(const dictionary& dict); - - - //- Destructor - virtual ~saturateEvaporationModel(); - - - // Member Functions - - bool evaporation() const; - - //- Correlation for the Sherwood Number - scalar Sh - ( - const scalar ReynoldsNumber, - const scalar SchmidtNumber - ) const; - - //- Return the evaporation relaxation time - scalar relaxationTime - ( - const scalar diameter, - const scalar liquidDensity, - const scalar rhoFuelVapor, - const scalar massDiffusionCoefficient, - const scalar ReynoldsNumber, - const scalar SchmidtNumber, - const scalar Xs, - const scalar Xf, - const scalar m0, - const scalar dm, - const scalar dt - ) const; - - scalar boilingTime - ( - const scalar liquidDensity, - const scalar cpFuel, - const scalar heatOfVapour, - const scalar kappa, - const scalar Nusselt, - const scalar deltaTemp, - const scalar diameter, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar - ) const; - - inline label nEvapIter() const - { - return 1; - } - - -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/standardEvaporationModel/standardEvaporationModel.C b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/standardEvaporationModel/standardEvaporationModel.C deleted file mode 100644 index ae0052bb779b55b99ba4f06a786866fcaa37b973..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/standardEvaporationModel/standardEvaporationModel.C +++ /dev/null @@ -1,206 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "standardEvaporationModel.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(standardEvaporationModel, 0); - - addToRunTimeSelectionTable - ( - evaporationModel, - standardEvaporationModel, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::standardEvaporationModel::standardEvaporationModel -( - const dictionary& dict -) -: - evaporationModel(dict), - evapDict_(dict.subDict(typeName + "Coeffs")), - preReScFactor_(readScalar(evapDict_.lookup("preReScFactor"))), - ReExponent_(readScalar(evapDict_.lookup("ReExponent"))), - ScExponent_(readScalar(evapDict_.lookup("ScExponent"))), - evaporationScheme_(evapDict_.lookup("evaporationScheme")), - nEvapIter_(0) -{ - if (evaporationScheme_ == "implicit") - { - nEvapIter_ = 2; - } - else if (evaporationScheme_ == "explicit") - { - nEvapIter_ = 1; - } - else - { - FatalError - << "evaporationScheme type " << evaporationScheme_ - << " unknown. Use implicit or explicit." << nl - << abort(FatalError); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::standardEvaporationModel::~standardEvaporationModel() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::standardEvaporationModel::evaporation() const -{ - return true; -} - - -// Correlation for the Sherwood Number -Foam::scalar Foam::standardEvaporationModel::Sh -( - const scalar ReynoldsNumber, - const scalar SchmidtNumber -) const -{ - return - 2.0 - + preReScFactor_ - *pow(ReynoldsNumber, ReExponent_) - *pow(SchmidtNumber, ScExponent_); -} - - -Foam::scalar Foam::standardEvaporationModel::relaxationTime -( - const scalar diameter, - const scalar liquidDensity, - const scalar rhoFuelVapor, - const scalar massDiffusionCoefficient, - const scalar ReynoldsNumber, - const scalar SchmidtNumber, - const scalar Xs, - const scalar Xf, - const scalar m0, - const scalar dm, - const scalar dt -) const -{ - scalar time = GREAT; - scalar lgExpr = 0.0; - - /* - (pressure - partialFuelVaporPressure)/ - (pressure - pressureAtSurface) - = 1 + Xratio - - if the pressure @ Surface > pressure - this lead to boiling - and Xratio -> infinity (as it should) - ... this is numerically nasty - - NB! - X_v,s = (p_v,s/p) X_v,d - where X_v,d = 1 for single component fuel - according to eq (3.136) - in D. Clerides Thesis - */ - - scalar Xratio = (Xs - Xf)/max(SMALL, 1.0 - Xs); - - if (Xratio > 0.0) - { - lgExpr = log(1.0 + Xratio); - } - - // From Equation (3.79) in C. Kralj's Thesis: - // Note that the 2.0 (instead of 6.0) below is correct, since evaporation - // is d(diameter)/dt and not d(mass)/dt - - scalar denominator = - 6.0*massDiffusionCoefficient - *Sh(ReynoldsNumber, SchmidtNumber) - *rhoFuelVapor*lgExpr; - - if (denominator > SMALL) - { - time = max(VSMALL, liquidDensity*sqr(diameter)/denominator); - } - - return time; -} - - -Foam::scalar Foam::standardEvaporationModel::boilingTime -( - const scalar liquidDensity, - const scalar cpFuel, - const scalar heatOfVapour, - const scalar kappa, - const scalar Nusselt, - const scalar deltaTemp, - const scalar diameter, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar -) const -{ - scalar time = GREAT; - - // the deltaTemperature is limited to not go below .5 deg K - // for numerical reasons. - // This is probably not important, since it results in an upper - // limit for the boiling time... which we have anyway. - scalar deltaT = max(0.5, deltaTemp); - - time = - liquidDensity*cpFuel*sqr(diameter) - /(6.0*kappa*Nusselt*log(1.0 + cpFuel*deltaT/max(SMALL, heatOfVapour))); - - time = max(VSMALL, time); - - return time; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/standardEvaporationModel/standardEvaporationModel.H b/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/standardEvaporationModel/standardEvaporationModel.H deleted file mode 100644 index 0b5dbd545fac3fa0649cf59c7767b0b64fb6495c..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/evaporationModel/standardEvaporationModel/standardEvaporationModel.H +++ /dev/null @@ -1,144 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::standardEvaporationModel - -Description - standard evaporation model based on the logarithmic expression - of the ration of pressure differences. - -\*---------------------------------------------------------------------------*/ - -#ifndef standardEvaporationModel_H -#define standardEvaporationModel_H - -#include "evaporationModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class standardEvaporationModel Declaration -\*---------------------------------------------------------------------------*/ - -class standardEvaporationModel -: - public evaporationModel -{ - -private: - - // Private data - - dictionary evapDict_; - scalar preReScFactor_; - scalar ReExponent_; - scalar ScExponent_; - - word evaporationScheme_; - label nEvapIter_; - - -public: - - //- Runtime type information - TypeName("standardEvaporationModel"); - - - // Constructors - - //- Construct from dictionary - standardEvaporationModel(const dictionary& dict); - - - //- Destructor - virtual ~standardEvaporationModel(); - - - // Member Functions - - bool evaporation() const; - - //- Correlation for the Sherwood Number - scalar Sh - ( - const scalar ReynoldsNumber, - const scalar SchmidtNumber - ) const; - - //- Return the evaporation relaxation time - scalar relaxationTime - ( - const scalar diameter, - const scalar liquidDensity, - const scalar rhoFuelVapor, - const scalar massDiffusionCoefficient, - const scalar ReynoldsNumber, - const scalar SchmidtNumber, - const scalar Xs, - const scalar Xf, - const scalar m0, - const scalar dm, - const scalar dt - ) const; - - scalar boilingTime - ( - const scalar liquidDensity, - const scalar cpFuel, - const scalar heatOfVapour, - const scalar kappa, - const scalar Nusselt, - const scalar deltaTemp, - const scalar diameter, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar - ) const; - - inline label nEvapIter() const - { - return nEvapIter_; - } - -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/RanzMarshall/RanzMarshall.C b/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/RanzMarshall/RanzMarshall.C deleted file mode 100644 index ec0d90be4a401989fcb9e956acdf245e564371ad..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/RanzMarshall/RanzMarshall.C +++ /dev/null @@ -1,132 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "RanzMarshall.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(RanzMarshall, 0); - - addToRunTimeSelectionTable - ( - heatTransferModel, - RanzMarshall, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::RanzMarshall::RanzMarshall(const dictionary& dict) -: - heatTransferModel(dict), - heatDict_(dict.subDict(typeName + "Coeffs")), - preRePrFactor_(readScalar(heatDict_.lookup("preRePrFactor"))), - ReExponent_(readScalar(heatDict_.lookup("ReExponent"))), - PrExponent_(readScalar(heatDict_.lookup("PrExponent"))) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::RanzMarshall::~RanzMarshall() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::RanzMarshall::heatTransfer() const -{ - return true; -} - - -Foam::scalar Foam::RanzMarshall::Nu -( - const scalar ReynoldsNumber, - const scalar PrandtlNumber -) const -{ - return - 2.0 - + preRePrFactor_ - *pow(ReynoldsNumber, ReExponent_) - *pow(PrandtlNumber, PrExponent_); -} - - -Foam::scalar Foam::RanzMarshall::relaxationTime -( - const scalar liquidDensity, - const scalar diameter, - const scalar liquidcL, - const scalar kappa, - const scalar ReynoldsNumber, - const scalar PrandtlNumber -) const -{ - scalar time = - liquidDensity - *sqr(diameter) - *liquidcL - /(6.0*kappa*Nu(ReynoldsNumber, PrandtlNumber)); - - time = max(SMALL, time); - - return time; -} - - -Foam::scalar Foam::RanzMarshall::fCorrection(const scalar z) const -{ - scalar correct; - if (z > 0.01) - { - if (z < 1.0e+5) - { - correct = z/(exp(z) - 1.0); - } - else - { - correct = SMALL; - } - } - else - { - // taylor-expansion of exp(z)... - correct = 1.0/(1+0.5*z); - } - - return correct; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/RanzMarshall/RanzMarshall.H b/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/RanzMarshall/RanzMarshall.H deleted file mode 100644 index 42cf773117f2a7434028ceb0b076bce095a9c4c9..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/RanzMarshall/RanzMarshall.H +++ /dev/null @@ -1,108 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::RanzMarshall - -Description - The Ranz-Marshal correlation for heat transfer - -\*---------------------------------------------------------------------------*/ - -#ifndef RanzMarshall_H -#define RanzMarshall_H - -#include "heatTransferModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -/*---------------------------------------------------------------------------*\ - Class RanzMarshall Declaration -\*---------------------------------------------------------------------------*/ - -class RanzMarshall -: - public heatTransferModel -{ -private: - - // Private data - - dictionary heatDict_; - scalar preRePrFactor_; - scalar ReExponent_; - scalar PrExponent_; - - -public: - - //- Runtime type information - TypeName("RanzMarshall"); - - - // Constructors - - //- Construct from dictionary - RanzMarshall(const dictionary& dict); - - - //- Destructor - virtual ~RanzMarshall(); - - - // Member Functions - - bool heatTransfer() const; - - //- Nusselt Number - scalar Nu - ( - const scalar ReynoldsNumber, - const scalar PrandtlNumber - ) const; - - scalar relaxationTime - ( - const scalar liquidDensity, - const scalar diameter, - const scalar liquidcL, - const scalar kappa, - const scalar ReynoldsNumber, - const scalar PrandtlNumber - ) const; - - scalar fCorrection(const scalar z) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/heatTransferModel.C b/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/heatTransferModel.C deleted file mode 100644 index c17cb9cebe9dca9a00aec5bc96370a142669f71f..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/heatTransferModel.C +++ /dev/null @@ -1,48 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "heatTransferModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(heatTransferModel, 0); - defineRunTimeSelectionTable(heatTransferModel, dictionary); -} - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::heatTransferModel::heatTransferModel(const dictionary& dict) -: - dict_(dict) -{} - - -Foam::heatTransferModel::~heatTransferModel() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/heatTransferModel.H b/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/heatTransferModel.H deleted file mode 100644 index d711c7ad61ff2cffff172cdac6f2fbbb7e32ae55..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/heatTransferModel.H +++ /dev/null @@ -1,132 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::heatTransferModel - -Description - Foam::heatTransferModel - -\*---------------------------------------------------------------------------*/ - -#ifndef heatTransferModel_H -#define heatTransferModel_H - -#include "IOdictionary.H" -#include "autoPtr.H" -#include "runTimeSelectionTables.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class heatTransferModel Declaration -\*---------------------------------------------------------------------------*/ - -class heatTransferModel -{ - -protected: - - // Protected data - - const dictionary& dict_; - - -public: - - //- Runtime type information - TypeName("heatTransferModel"); - - - // Declare runtime constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - heatTransferModel, - dictionary, - ( - const dictionary& dict - ), - (dict) - ); - - - // Constructors - - //- Construct from dictionary - heatTransferModel(const dictionary& dict); - - - //- Destructor - virtual ~heatTransferModel(); - - - // Selector - - static autoPtr<heatTransferModel> New - ( - const dictionary& dict - ); - - - // Member Functions - - //- heat transfer on/off - virtual bool heatTransfer() const = 0; - - //- Return Nusselt Number - virtual scalar Nu - ( - const scalar ReynoldsNumber, - const scalar PrandtlNumber - ) const = 0; - - //- Return the heat transfer relaxation time - virtual scalar relaxationTime - ( - const scalar liquidDensity, - const scalar diameter, - const scalar liquidcL, - const scalar kappa, - const scalar ReynoldsNumber, - const scalar PrandtlNumber - ) const = 0; - - //- Return the correction function f... - virtual scalar fCorrection(const scalar z) const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/heatTransferModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/heatTransferModelNew.C deleted file mode 100644 index 9c2146d27b2fa27fb3776587e38297f91a3a4f7e..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/heatTransferModel/heatTransferModelNew.C +++ /dev/null @@ -1,60 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "heatTransferModel.H" -#include "noHeatTransfer.H" - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New -( - const dictionary& dict -) -{ - const word modelType(dict.lookup("heatTransferModel")); - - Info<< "Selecting heatTransferModel " << modelType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn("heatTransferModel::New(const dictionary&)") - << "Unknown heatTransferModel type " - << modelType << nl << nl - << "Valid heatTransferModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); - } - - return autoPtr<heatTransferModel>(cstrIter()(dict)); -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/noHeatTransfer/noHeatTransfer.C b/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/noHeatTransfer/noHeatTransfer.C deleted file mode 100644 index 1d4654d53cef3df8b4a6e7aff743cfecc7e16c1a..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/noHeatTransfer/noHeatTransfer.C +++ /dev/null @@ -1,92 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "noHeatTransfer.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(noHeatTransfer, 0); - - addToRunTimeSelectionTable - ( - heatTransferModel, - noHeatTransfer, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::noHeatTransfer::noHeatTransfer(const dictionary& dict) -: - heatTransferModel(dict) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::noHeatTransfer::~noHeatTransfer() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::noHeatTransfer::heatTransfer() const -{ - return false; -} - - -Foam::scalar Foam::noHeatTransfer::Nu(const scalar, const scalar) const -{ - return 0.0; -} - - -Foam::scalar Foam::noHeatTransfer::relaxationTime -( - const scalar, - const scalar, - const scalar, - const scalar, - const scalar, - const scalar -) const -{ - return GREAT; -} - - -Foam::scalar Foam::noHeatTransfer::fCorrection(const scalar) const -{ - return 1.0; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/noHeatTransfer/noHeatTransfer.H b/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/noHeatTransfer/noHeatTransfer.H deleted file mode 100644 index 6042be45559c4970eba34223e9231601438e46af..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/heatTransferModel/noHeatTransfer/noHeatTransfer.H +++ /dev/null @@ -1,101 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::noHeatTransfer - -Description - no heat transfer. return a negative value to prevent - the liquid being heated up. - -\*---------------------------------------------------------------------------*/ - -#ifndef noHeatTransfer_H -#define noHeatTransfer_H - -#include "heatTransferModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class noHeatTransfer Declaration -\*---------------------------------------------------------------------------*/ - -class noHeatTransfer -: - public heatTransferModel -{ - -public: - - //- Runtime type information - TypeName("off"); - - - // Constructors - - //- Construct from dictionary - noHeatTransfer(const dictionary& dict); - - - //- Destructor - virtual ~noHeatTransfer(); - - - // Member Functions - - bool heatTransfer() const; - - //- Nusselt Number - scalar Nu - ( - const scalar ReynoldsNumber, - const scalar PrandtlNumber - ) const; - - scalar relaxationTime - ( - const scalar liquidDensity, - const scalar diameter, - const scalar liquidcL, - const scalar kappa, - const scalar ReynoldsNumber, - const scalar PrandtlNumber - ) const; - - scalar fCorrection(const scalar z) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C deleted file mode 100644 index f315ee5bd0fc5f0ae7147499a2e0f02e10cb529b..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.C +++ /dev/null @@ -1,197 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "Chomiak.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(ChomiakInjector, 0); - - addToRunTimeSelectionTable - ( - injectorModel, - ChomiakInjector, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::ChomiakInjector::ChomiakInjector -( - const dictionary& dict, - spray& sm -) -: - injectorModel(dict, sm), - ChomiakDict_(dict.subDict(typeName + "Coeffs")), - sizeDistribution_ - ( - distributionModels::distributionModel::New - ( - ChomiakDict_.subDict("sizeDistribution"), - sm.rndGen() - ) - ), - maxSprayAngle_(ChomiakDict_.lookup("maxSprayConeAngle")) -{ - - if (sm.injectors().size() != maxSprayAngle_.size()) - { - FatalError - << "ChomiakInjector::ChomiakInjector" - << "(const dictionary& dict, spray& sm)\n" - << "Wrong number of entries in maxSprayAngle" - << abort(FatalError); - } - - scalar referencePressure = sm.p().average().value(); - - // correct velocityProfile - forAll(sm.injectors(), i) - { - sm.injectors()[i].properties()->correctProfiles - ( - sm.fuels(), - referencePressure - ); - } - -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::ChomiakInjector::~ChomiakInjector() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::scalar Foam::ChomiakInjector::d0 -( - const label, - const scalar -) const -{ - return sizeDistribution_->sample(); -} - - -Foam::vector Foam::ChomiakInjector::direction -( - const label n, - const label hole, - const scalar time, - const scalar d -) const -{ - scalar dMin = sizeDistribution_->minValue(); - scalar dMax = sizeDistribution_->maxValue(); - - scalar angle = - (d - dMax)*maxSprayAngle_[n] - /(dMin - dMax) - *constant::mathematical::pi/360.0; - scalar alpha = sin(angle); - scalar dcorr = cos(angle); - - scalar beta = constant::mathematical::twoPi*rndGen_.sample01<scalar>(); - - // randomly distributed vector normal to the injection vector - vector normal = vector::zero; - - if (sm_.twoD()) - { - scalar reduce = 0.01; - // correct beta if this is a 2D run - // map it onto the 'angleOfWedge' - beta *= - (1.0-2.0*reduce)*0.5*sm_.angleOfWedge()/constant::mathematical::pi; - beta += reduce*sm_.angleOfWedge(); - - normal = - alpha - *( - sm_.axisOfWedge()*cos(beta) - + sm_.axisOfWedgeNormal()*sin(beta) - ); - - } - else - { - normal = - alpha - *( - injectors_[n].properties()->tan1(hole)*cos(beta) - + injectors_[n].properties()->tan2(hole)*sin(beta) - ); - } - - // set the direction of injection by adding the normal vector - vector dir = - dcorr*injectors_[n].properties()->direction(hole, time) + normal; - dir /= mag(dir); - - return dir; -} - - -Foam::scalar Foam::ChomiakInjector::velocity -( - const label i, - const scalar time -) const -{ - const injectorType& it = sm_.injectors()[i].properties(); - if (it.pressureIndependentVelocity()) - { - return it.getTableValue(it.velocityProfile(), time); - } - else - { - scalar Pref = sm_.ambientPressure(); - scalar Pinj = it.getTableValue(it.injectionPressureProfile(), time); - scalar rho = sm_.fuels().rho(Pinj, it.T(time), it.X()); - scalar dp = max(0.0, Pinj - Pref); - return sqrt(2.0*dp/rho); - } -} - - -Foam::scalar Foam::ChomiakInjector::averageVelocity(const label i) const -{ - const injectorType& it = sm_.injectors()[i].properties(); - scalar dt = it.teoi() - it.tsoi(); - return it.integrateTable(it.velocityProfile())/dt; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.H b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.H deleted file mode 100644 index 5b0ae3321e5eeedc5fc9dc411c6a5cc608d7bc54..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/Chomiak/Chomiak.H +++ /dev/null @@ -1,121 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::ChomiakInjector - -Description - Injector model based on an idea of Jerzy Chomiak. - - Given the initial droplet size distribution in an interval d = (d0, d1), - the spray angle phi = phi(d), such that - the largest droplets have zero spray angle - and the smallest droplets have maximum spray angle. - i.e. phi(d=d1) = 0, phi(d=d0) = phiMax, - where phiMax is a model parameter. - -\*---------------------------------------------------------------------------*/ - -#ifndef ChomiakInjector_H -#define ChomiakInjector_H - -#include "injectorModel.H" -#include "scalarList.H" -#include "distributionModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class ChomiakInjector Declaration -\*---------------------------------------------------------------------------*/ - -class ChomiakInjector -: - public injectorModel -{ - -private: - - // Private data - - dictionary ChomiakDict_; - - autoPtr<distributionModels::distributionModel> sizeDistribution_; - scalarList maxSprayAngle_; - - -public: - - //- Runtime type information - TypeName("ChomiakInjector"); - - - // Constructors - - //- Construct from components - ChomiakInjector(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~ChomiakInjector(); - - - // Member Functions - - //- Return the injected droplet diameter - scalar d0(const label injector, const scalar time) const; - - //- Return the spray angle of the injector - vector direction - ( - const label injector, - const label hole, - const scalar time, - const scalar d - ) const; - - scalar velocity - ( - const label i, - const scalar time - ) const; - - scalar averageVelocity - ( - const label i - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.C deleted file mode 100644 index 72cc08c6879bd4cc74379da52e53aeccf04436c2..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.C +++ /dev/null @@ -1,294 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "blobsSwirlInjector.H" -#include "addToRunTimeSelectionTable.H" -#include "unitConversion.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(blobsSwirlInjector, 0); - - addToRunTimeSelectionTable - ( - injectorModel, - blobsSwirlInjector, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::blobsSwirlInjector::blobsSwirlInjector -( - const dictionary& dict, - spray& sm -) -: - injectorModel(dict, sm), - blobsSwirlInjectorDict_(dict.subDict(typeName + "Coeffs")), - - coneAngle_(blobsSwirlInjectorDict_.lookup("ConeAngle")), - coneInterval_(blobsSwirlInjectorDict_.lookup("ConeInterval")), - - cD_(blobsSwirlInjectorDict_.lookup("cD")), - cTau_(blobsSwirlInjectorDict_.lookup("cTau")), - A_(blobsSwirlInjectorDict_.lookup("A")), - - angle_(0.0), - u_(0.0), - x_(0.0), - h_(0.0) -{ - - if (sm.injectors().size() != coneAngle_.size()) - { - FatalError - << "blobsSwirlInjector::blobsSwirlInjector" - << "(const dictionary& dict, spray& sm)\n" - << "Wrong number of entries in innerAngle" - << abort(FatalError); - } - - scalar referencePressure = sm.p().average().value(); - - // correct velocityProfile - forAll(sm.injectors(), i) - { - sm.injectors()[i].properties()->correctProfiles - ( - sm.fuels(), - referencePressure - ); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::blobsSwirlInjector::~blobsSwirlInjector() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::scalar Foam::blobsSwirlInjector::d0 -( - const label n, - const scalar t -) const -{ - const injectorType& it = injectors_[n].properties(); - - scalar c = rndGen_.sample01<scalar>(); - - angle_ = degToRad(coneAngle_[n]/2.0 + c*coneInterval_[n]); - - scalar injectedMassFlow = it.massFlowRate(t); - - scalar cosAngle = cos(angle_); - - scalar rhoFuel = sm_.fuels().rho(sm_.ambientPressure(), it.T(t), it.X()); - - scalar deltaPressure = deltaPressureInj(t,n); - - calculateHX(n, injectedMassFlow, deltaPressure, t); - - scalar kV = kv(n); - - scalar v = kV*sqrt(2.0*deltaPressure/rhoFuel); - - u_ = v*cosAngle; - - return h_; -} - - -Foam::vector Foam::blobsSwirlInjector::direction -( - const label n, - const label hole, - const scalar time, - const scalar d -) const -{ - scalar alpha = sin(angle_); - scalar dcorr = cos(angle_); - scalar beta = constant::mathematical::twoPi*rndGen_.sample01<scalar>(); - - // randomly distributed vector normal to the injection vector - vector normal = vector::zero; - - if (sm_.twoD()) - { - scalar reduce = 0.01; - // correct beta if this is a 2D run - // map it onto the 'angleOfWedge' - - beta *= - (1.0 - 2.0*reduce) - *sm_.angleOfWedge() - /(constant::mathematical::twoPi); - beta += reduce*sm_.angleOfWedge(); - normal = - alpha - *( - sm_.axisOfWedge()*cos(beta) - + sm_.axisOfWedgeNormal()*sin(beta) - ); - } - else - { - normal = - alpha - *( - injectors_[n].properties()->tan1(hole)*cos(beta) - + injectors_[n].properties()->tan2(hole)*sin(beta) - ); - } - - // set the direction of injection by adding the normal vector - vector dir = - dcorr*injectors_[n].properties()->direction(hole, time) - + normal; - dir /= mag(dir); - - return dir; -} - - -Foam::scalar Foam::blobsSwirlInjector::velocity -( - const label i, - const scalar time -) const -{ - return u_*sqrt(1.0 + pow(tan(angle_),2.0)); -} - - -Foam::scalar Foam::blobsSwirlInjector::averageVelocity(const label i) const -{ - const injectorType& it = sm_.injectors()[i].properties(); - - scalar dt = it.teoi() - it.tsoi(); - - - scalar injectionPressure = averagePressure(i); - - scalar Tav = it.integrateTable(it.T())/dt; - scalar rhoFuel = sm_.fuels().rho(sm_.ambientPressure(), Tav, it.X()); - - scalar kV = kv(i); - - return kV*sqrt(2.0*(injectionPressure-sm_.ambientPressure())/rhoFuel); -} - - -Foam::scalar Foam::blobsSwirlInjector::kv(const label inj) const -{ - return cD_[inj]/cos(angle_) * sqrt((1.0 - x_)/(1.0 + x_)); -} - - -void Foam::blobsSwirlInjector::calculateHX -( - const label inj, - const scalar massFlow, - const scalar dPressure, - const scalar time -) const -{ - const injectorType& it = injectors_[inj].properties(); - - scalar Tfuel = it.T(time); - scalar rhoFuel = sm_.fuels().rho(sm_.ambientPressure(), Tfuel, it.X()); - scalar muFuel = sm_.fuels().mu(sm_.ambientPressure(), Tfuel, it.X()); - scalar injectorDiameter = it.d(); - - x_ = 0.0; - - h_ = - sqrt - ( - (A_[inj]*cTau_[inj]*muFuel*massFlow*(1.0 + x_)) - /( - constant::mathematical::pi - *injectorDiameter - *rhoFuel - *dPressure - *sqr(1.0 - x_) - ) - ); - - label i; - - for (i=0; i<20; i++) - { - h_ = - sqrt - ( - (A_[inj]*cTau_[inj]*muFuel*massFlow*(1.0 + x_)) - /( - constant::mathematical::pi - *injectorDiameter - *rhoFuel - *dPressure - *sqr(1.0 - x_) - ) - ); - - x_ = sqr(1.0 - 2.0*h_/injectorDiameter); - } - - x_ = sqr(1.0 - 2.0*h_/injectorDiameter); -} - - -Foam::scalar Foam::blobsSwirlInjector::deltaPressureInj -( - const scalar time, - const label inj -) const -{ - return - injectors_[inj].properties()->injectionPressure(time) - - sm_.ambientPressure(); -} - - -Foam::scalar Foam::blobsSwirlInjector::averagePressure(const label inj) const -{ - const injectorType& it = sm_.injectors()[inj].properties(); - - scalar dt = it.teoi() - it.tsoi(); - return it.integrateTable(it.injectionPressureProfile())/dt; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.H b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.H deleted file mode 100644 index d693a14ec6f562bbd44bf956ee4b41b95dabfda2..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/blobsSwirl/blobsSwirlInjector.H +++ /dev/null @@ -1,160 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::blobsSwirlInjector - -Description - Model for parcels injection in pressure Swirl Atomizers. - - Accurate description in: - \verbatim - Z. Han, S. Parrish, P.V. Farrell, R.D. Reitz - "Modeling Atomization Processes Of Pressure - Swirl Hollow-Cone Fuel Sprays" - Atomization and Sprays, vol. 7, pp. 663-684, 1997 - \endverbatim - and - \verbatim - L. Allocca, G. Bella, A. De Vita, L. Di Angelo - "Experimental Validation of a GDI Spray Model" - SAE Technical Paper Series, 2002-01-1137 - \endverbatim - -\*---------------------------------------------------------------------------*/ - -#ifndef blobsSwirlInjector_H -#define blobsSwirlInjector_H - -#include "injectorModel.H" -#include "scalarList.H" - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class blobsSwirlInjector Declaration -\*---------------------------------------------------------------------------*/ - -class blobsSwirlInjector -: - public injectorModel -{ - -private: - - // Private data - - dictionary blobsSwirlInjectorDict_; - - scalarList coneAngle_; - scalarList coneInterval_; - - scalarList cD_; - scalarList cTau_; - scalarList A_; - - //- Initial spray angle for the parcels - mutable scalar angle_; - - //- Initial velocity for the parcels - mutable scalar u_; - - //- Orifice-air cone area ratio - mutable scalar x_; - - //- Initial sheet tickness - mutable scalar h_; - - - // Private Member Functions - - scalar kv(const label inj) const; - - scalar deltaPressureInj(const scalar time, const label inj) const; - scalar averagePressure(const label inj) const; - - void calculateHX - ( - const label inj, - const scalar massFlow, - const scalar dPressure, - const scalar time - ) const; - - -public: - - //- Runtime type information - TypeName("blobsSwirlInjector"); - - - // Constructors - - //- Construct from components - blobsSwirlInjector(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~blobsSwirlInjector(); - - - // Member Functions - - //- Return the injected droplet diameter - scalar d0(const label injector, const scalar time) const; - - //- Return the spray angle of the injector - vector direction - ( - const label injector, - const label hole, - const scalar time, - const scalar d - ) const; - - scalar velocity - ( - const label i, - const scalar time - ) const; - - scalar averageVelocity - ( - const label i - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/constant/constInjector.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/constant/constInjector.C deleted file mode 100644 index ce0a93150a42a68ed67e4350a4c72cf24736c301..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/constant/constInjector.C +++ /dev/null @@ -1,211 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "constInjector.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(constInjector, 0); - - addToRunTimeSelectionTable - ( - injectorModel, - constInjector, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::constInjector::constInjector -( - const dictionary& dict, - spray& sm -) -: - injectorModel(dict, sm), - specDict_(dict.subDict(typeName + "Coeffs")), - dropletNozzleDiameterRatio_(specDict_.lookup("dropletNozzleDiameterRatio")), - sprayAngle_(specDict_.lookup("sprayAngle")) -{ - if (sm.injectors().size() != dropletNozzleDiameterRatio_.size()) - { - FatalErrorIn - ( - "constInjector::constInjector(const dictionary& dict, spray& sm)" - ) << "Wrong number of entries in dropletNozzleDiameterRatio" << nl - << abort(FatalError); - } - - if (sm.injectors().size() != sprayAngle_.size()) - { - FatalErrorIn - ( - "constInjector::constInjector(const dictionary& dict, spray& sm)" - ) << "Wrong number of entries in sprayAngle" << nl - << abort(FatalError); - } - - scalar referencePressure = sm.p().average().value(); - - // correct velocity and pressure profiles - forAll(sm.injectors(), i) - { - sm.injectors()[i].properties()->correctProfiles - ( - sm.fuels(), - referencePressure - ); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::constInjector::~constInjector() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::scalar Foam::constInjector::d0 -( - const label n, - const scalar -) const -{ - return injectors_[n].properties()->d()*dropletNozzleDiameterRatio_[n]; -} - - -Foam::vector Foam::constInjector::direction -( - const label n, - const label hole, - const scalar time, - const scalar d -) const -{ - - /* - randomly distribute parcels in a solid cone - with angle = sprayAngle, - alpha = radius of the two normal vectors, - = maximum sin(sprayAngle/2) - beta = angle in the normal plane - - o / (beta) - |\ / - | \ /) - | \ o-----------> (x-axis) - | \ - v (alpha) - */ - - scalar angle = - rndGen_.sample01<scalar>()*sprayAngle_[n] - *constant::mathematical::pi/360.0; - scalar alpha = sin(angle); - scalar dcorr = cos(angle); - - scalar beta = constant::mathematical::twoPi*rndGen_.sample01<scalar>(); - - // randomly distributed vector normal to the injection vector - vector normal = vector::zero; - - if (sm_.twoD()) - { - scalar reduce = 0.01; - // correct beta if this is a 2D run - // map it onto the 'angleOfWedge' - beta *= - (1.0 - 2.0*reduce) - *0.5*sm_.angleOfWedge() - /constant::mathematical::pi; - beta += reduce*sm_.angleOfWedge(); - - normal = - alpha - *( - sm_.axisOfWedge()*cos(beta) - + sm_.axisOfWedgeNormal()*sin(beta) - ); - - } - else - { - normal = - alpha - *( - injectors_[n].properties()->tan1(hole)*cos(beta) - + injectors_[n].properties()->tan2(hole)*sin(beta) - ); - } - - // set the direction of injection by adding the normal vector - vector dir = dcorr*injectors_[n].properties()->direction(n, time) + normal; - dir /= mag(dir); - - return dir; -} - - -Foam::scalar Foam::constInjector::velocity -( - const label i, - const scalar time -) const -{ - const injectorType& it = sm_.injectors()[i].properties(); - if (it.pressureIndependentVelocity()) - { - return it.getTableValue(it.velocityProfile(), time); - } - else - { - scalar Pref = sm_.ambientPressure(); - scalar Pinj = it.getTableValue(it.injectionPressureProfile(), time); - scalar rho = sm_.fuels().rho(Pinj, it.T(time), it.X()); - scalar dp = max(0.0, Pinj - Pref); - return sqrt(2.0*dp/rho); - } -} - - -Foam::scalar Foam::constInjector::averageVelocity(const label i) const -{ - const injectorType& it = sm_.injectors()[i].properties(); - scalar dt = it.teoi() - it.tsoi(); - - return it.integrateTable(it.velocityProfile())/dt; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/constant/constInjector.H b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/constant/constInjector.H deleted file mode 100644 index 0c0ccef49523404343ae5f52bc759e35aed1ac26..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/constant/constInjector.H +++ /dev/null @@ -1,106 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::constInjector - -Description - Injector model with specified Constant values for the droplet diameter - and spray cone angle - -\*---------------------------------------------------------------------------*/ - -#ifndef constInjector_H -#define constInjector_H - -#include "injectorModel.H" -#include "scalarList.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -/*---------------------------------------------------------------------------*\ - Class constInjector Declaration -\*---------------------------------------------------------------------------*/ - -class constInjector -: - public injectorModel -{ - -private: - - // Private data - - dictionary specDict_; - - scalarList dropletNozzleDiameterRatio_; - scalarList sprayAngle_; - - -public: - - //- Runtime type information - TypeName("constInjector"); - - - // Constructors - - //- Construct from components - constInjector(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~constInjector(); - - - // Member Functions - - //- Return the injected droplet diameter - scalar d0(const label injector, const scalar time) const; - - //- Return the spray angle of the injector - vector direction - ( - const label injector, - const label hole, - const scalar time, - const scalar d - ) const; - - scalar velocity(const label i, const scalar time) const; - - scalar averageVelocity(const label i) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.C deleted file mode 100644 index 64cf6ce0ae3fb93184623560176b41946df22ecd..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.C +++ /dev/null @@ -1,237 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "definedHollowCone.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(definedHollowConeInjector, 0); - - addToRunTimeSelectionTable - ( - injectorModel, - definedHollowConeInjector, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::definedHollowConeInjector::definedHollowConeInjector -( - const dictionary& dict, - spray& sm -) -: - injectorModel(dict, sm), - definedHollowConeDict_(dict.subDict(typeName + "Coeffs")), - sizeDistribution_ - ( - distributionModels::distributionModel::New - ( - definedHollowConeDict_.subDict("sizeDistribution"), - sm.rndGen() - ) - ), - innerConeAngle_(definedHollowConeDict_.lookup("innerConeAngle")), - outerConeAngle_(definedHollowConeDict_.lookup("outerConeAngle")) -{ - // convert CA to real time - inner cone angle - forAll(innerConeAngle_, i) - { - innerConeAngle_[i][0] = - sm.runTime().userTimeToTime(innerConeAngle_[i][0]); - } - // convert CA to real time - outer cone angle - forAll(outerConeAngle_, i) - { - outerConeAngle_[i][0] = - sm.runTime().userTimeToTime(outerConeAngle_[i][0]); - } - - // check number of injectors - if (sm.injectors().size() != 1) - { - WarningIn - ( - "definedHollowConeInjector::definedHollowConeInjector" - "(const dictionary& dict, spray& sm)" - ) << "Same inner/outer cone angle profiles applied to each injector" - << endl; - } - - // check number of entries in innerConeAngle list - if (innerConeAngle_.empty()) - { - FatalErrorIn - ( - "definedHollowConeInjector::definedHollowConeInjector" - "(const dictionary& dict, spray& sm)" - ) << "Number of entries in innerConeAngle must be greater than zero" - << abort(FatalError); - } - - // check number of entries in outerConeAngle list - if (outerConeAngle_.empty()) - { - FatalErrorIn - ( - "definedHollowConeInjector::definedHollowConeInjector" - "(const dictionary& dict, spray& sm)" - ) << "Number of entries in outerConeAngle must be greater than zero" - << abort(FatalError); - } - - scalar referencePressure = sm.p().average().value(); - // correct pressureProfile - forAll(sm.injectors(), i) - { - sm.injectors()[i].properties()->correctProfiles - ( - sm.fuels(), - referencePressure - ); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::definedHollowConeInjector::~definedHollowConeInjector() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::scalar Foam::definedHollowConeInjector::d0 -( - const label n, - const scalar t -) const -{ - // swallow function arguments - not used - // return value sampled from distribution model - return sizeDistribution_->sample(); -} - - -Foam::vector Foam::definedHollowConeInjector::direction -( - const label n, - const label hole, - const scalar t, - const scalar d -) const -{ - const injectorType& it = injectors_[n].properties(); - - // interpolate to find inner and outer angles at time, t - scalar angleInner = it.getTableValue(innerConeAngle_, t); - scalar angleOuter = it.getTableValue(outerConeAngle_, t); - - // use random number to generate angle between inner/outer cone angles - scalar angle = rndGen_.position<scalar>(angleInner, angleOuter); - - scalar alpha = sin(angle*constant::mathematical::pi/360.0); - scalar dcorr = cos(angle*constant::mathematical::pi/360.0); - scalar beta = constant::mathematical::twoPi*rndGen_.sample01<scalar>(); - - // randomly distributed vector normal to the injection vector - vector normal = vector::zero; - - if (sm_.twoD()) - { - scalar reduce = 0.01; - // correct beta if this is a 2D run - // map it onto the 'angleOfWedge' - - beta *= - (1.0 - 2.0*reduce) - *sm_.angleOfWedge() - /(constant::mathematical::twoPi); - beta += reduce*sm_.angleOfWedge(); - normal = - alpha - *( - sm_.axisOfWedge()*cos(beta) - + sm_.axisOfWedgeNormal()*sin(beta) - ); - } - else - { - normal = - alpha - *( - injectors_[n].properties()->tan1(hole)*cos(beta) - + injectors_[n].properties()->tan2(hole)*sin(beta) - ); - } - - // set the direction of injection by adding the normal vector - vector dir = dcorr*injectors_[n].properties()->direction(hole, t) + normal; - // normailse direction vector - dir /= mag(dir); - - return dir; -} - - -Foam::scalar Foam::definedHollowConeInjector::velocity -( - const label i, - const scalar time -) const -{ - const injectorType& it = sm_.injectors()[i].properties(); - if (it.pressureIndependentVelocity()) - { - return it.getTableValue(it.velocityProfile(), time); - } - else - { - scalar Pref = sm_.ambientPressure(); - scalar Pinj = it.getTableValue(it.injectionPressureProfile(), time); - scalar rho = sm_.fuels().rho(Pinj, it.T(time), it.X()); - scalar dp = max(0.0, Pinj - Pref); - return sqrt(2.0*dp/rho); - } -} - - -Foam::scalar -Foam::definedHollowConeInjector::averageVelocity(const label i) const -{ - const injectorType& it = sm_.injectors()[i].properties(); - scalar dt = it.teoi() - it.tsoi(); - return it.integrateTable(it.velocityProfile())/dt; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.H b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.H deleted file mode 100644 index 0840eb1d4a1969a7856d0a6fe94bef835286e5a4..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedHollowCone/definedHollowCone.H +++ /dev/null @@ -1,115 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::definedHollowConeInjector - -Description - An injector model for hollow/solid cone injection - - - user defined: - - inner/outer cone angle vs. time - - droplet distribution model - -\*---------------------------------------------------------------------------*/ - -#ifndef definedHollowConeInjector_H -#define definedHollowConeInjector_H - -#include "injectorModel.H" -#include "vector.H" -#include "distributionModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -/*---------------------------------------------------------------------------*\ - Class definedHollowConeInjector Declaration -\*---------------------------------------------------------------------------*/ - -class definedHollowConeInjector -: - public injectorModel -{ - -private: - - // Private data - - typedef VectorSpace<Vector<scalar>, scalar, 2> pair; - - dictionary definedHollowConeDict_; - autoPtr<distributionModels::distributionModel> sizeDistribution_; - - // inner and outer cone angle time histories - // 2 column vectors = (time, coneAngle) - List<pair> innerConeAngle_; - List<pair> outerConeAngle_; - - -public: - - //- Runtime type information - TypeName("definedHollowConeInjector"); - - - // Constructors - - //- Construct from components - definedHollowConeInjector(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~definedHollowConeInjector(); - - - // Member Functions - - //- Return the injected droplet diameter - scalar d0(const label injector, const scalar time) const; - - //- Return the spray angle of the injector - vector direction - ( - const label injector, - const label hole, - const scalar time, - const scalar d - ) const; - - scalar velocity(const label i, const scalar time) const; - - scalar averageVelocity( const label i) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedPressureSwirl/definedPressureSwirl.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedPressureSwirl/definedPressureSwirl.C deleted file mode 100644 index 8662dbd3ce9ccdd79ba30352e1b5d46a9d0598e2..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedPressureSwirl/definedPressureSwirl.C +++ /dev/null @@ -1,343 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "definedPressureSwirl.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(definedPressureSwirlInjector, 0); - - addToRunTimeSelectionTable - ( - injectorModel, - definedPressureSwirlInjector, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::definedPressureSwirlInjector::definedPressureSwirlInjector -( - const dictionary& dict, - spray& sm -) -: - injectorModel(dict, sm), - definedPressureSwirlInjectorDict_(dict.subDict(typeName + "Coeffs")), - - coneAngle_(definedPressureSwirlInjectorDict_.lookup("ConeAngle")), - coneInterval_(definedPressureSwirlInjectorDict_.lookup("ConeInterval")), - maxKv_(definedPressureSwirlInjectorDict_.lookup("maxKv")), - - angle_(0.0) -{ - - scalar referencePressure = sm.p().average().value(); - - // correct velocityProfile - forAll(sm.injectors(), i) - { - sm.injectors()[i].properties()->correctProfiles - ( - sm.fuels(), - referencePressure - ); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::definedPressureSwirlInjector::~definedPressureSwirlInjector() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::scalar Foam::definedPressureSwirlInjector::d0 -( - const label n, - const scalar t -) const -{ - const injectorType& it = injectors_[n].properties(); - - scalar c = rndGen_.sample01<scalar>(); - scalar coneAngle = it.getTableValue(coneAngle_, t); - scalar coneInterval = it.getTableValue(coneInterval_, t); - angle_ = coneAngle ; - - // modifications to take account of flash boiling.... - - const liquidMixtureProperties& fuels = sm_.fuels(); - scalar chi = 0.0; - scalar Tinj = it.T(t); - label Nf = fuels.components().size(); - scalar temperature = sm_.ambientTemperature(); - scalar pressure = sm_.ambientPressure(); - - for (label i = 0; i < Nf ; i++) - { - - if - ( - fuels.properties()[i].pv(sm_.ambientPressure(), Tinj) - >= 0.999*sm_.ambientPressure() - ) - { -// The fuel is boiling..... -// Calculation of the boiling temperature - - scalar tBoilingSurface = Tinj ; - - label Niter = 200; - - for (label k=0; k< Niter ; k++) - { - scalar pBoil = - fuels.properties()[i].pv(pressure, tBoilingSurface); - - if (pBoil > pressure) - { - tBoilingSurface = - tBoilingSurface - (Tinj-temperature)/Niter; - } - else - { - break; - } - - } - - scalar hl = - fuels.properties()[i].hl - ( - sm_.ambientPressure(), - tBoilingSurface - ); - scalar iTp = - fuels.properties()[i].h(sm_.ambientPressure(), Tinj) - - sm_.ambientPressure() - /fuels.properties()[i].rho(sm_.ambientPressure(), Tinj); - scalar iTb = - fuels.properties()[i].h(sm_.ambientPressure(), tBoilingSurface) - - sm_.ambientPressure() - /fuels.properties()[i].rho - ( - sm_.ambientPressure(), - tBoilingSurface - ); - - chi += it.X()[i]*(iTp-iTb)/hl; - } - } - - // bounding chi - - chi = max(chi, 0.0); - chi = min(chi, 1.0); - - angle_ = - angle_ + (144.0 - angle_) * sqr(chi) + 2.0*coneInterval*(0.5 - c); - - // end modifications - - angle_ *= constant::mathematical::pi/360.0; - - scalar injectedMassFlow = it.massFlowRate(t); - - scalar cosAngle = cos(angle_); - - scalar rhoFuel = sm_.fuels().rho(sm_.ambientPressure(), it.T(t), it.X()); - scalar injectorDiameter = it.d(); - - scalar deltaPressure = deltaPressureInj(t,n); - - scalar kV = kv(n, injectedMassFlow, deltaPressure, t); - - scalar v = kV*sqrt(2.0*deltaPressure/rhoFuel); - - u_ = v*cosAngle; - - scalar A = injectedMassFlow/(constant::mathematical::pi*rhoFuel*u_); - - // Not using the authors definition for sheet thickness - // modified by multiplying the sheet tickness for the cone angle cosinus. - - scalar angleT = angle_; - return - (injectorDiameter - sqrt(sqr(injectorDiameter) - 4.0*A)) - *cos(angleT)/2.0; - - // original implementation - // return (injectorDiameter-sqrt(sqr(injectorDiameter) - 4.0*A))/2.0; -} - - -Foam::vector Foam::definedPressureSwirlInjector::direction -( - const label n, - const label hole, - const scalar time, - const scalar d -) const -{ - scalar alpha = sin(angle_); - scalar dcorr = cos(angle_); - scalar beta = constant::mathematical::twoPi*rndGen_.sample01<scalar>(); - - // randomly distributed vector normal to the injection vector - vector normal = vector::zero; - - if (sm_.twoD()) - { - scalar reduce = 0.01; - // correct beta if this is a 2D run - // map it onto the 'angleOfWedge' - - beta *= - (1.0 - 2.0*reduce) - *sm_.angleOfWedge() - /(constant::mathematical::twoPi); - beta += reduce*sm_.angleOfWedge(); - normal = - alpha - *( - sm_.axisOfWedge()*cos(beta) - + sm_.axisOfWedgeNormal()*sin(beta) - ); - } - else - { - normal = - alpha - *( - injectors_[n].properties()->tan1(hole)*cos(beta) - + injectors_[n].properties()->tan2(hole)*sin(beta) - ); - } - - // set the direction of injection by adding the normal vector - vector dir = - dcorr*injectors_[n].properties()->direction(hole, time) + normal; - dir /= mag(dir); - - return dir; -} - - -Foam::scalar Foam::definedPressureSwirlInjector::velocity -( - const label i, - const scalar time -) const -{ - return u_*sqrt(1.0 + pow(tan(angle_),2.0)); -} - - -Foam::scalar Foam::definedPressureSwirlInjector::averageVelocity -( - const label i -) const -{ - const injectorType& it = sm_.injectors()[i].properties(); - - scalar dt = it.teoi() - it.tsoi(); - - scalar injectedMassFlow = it.mass()/(it.teoi()-it.tsoi()); - - scalar injectionPressure = averagePressure(i); - - scalar Tav = it.integrateTable(it.T())/dt; - scalar rhoFuel = sm_.fuels().rho(sm_.ambientPressure(), Tav, it.X()); - - scalar kV = kv(i, injectedMassFlow, injectionPressure, 0); - - return kV*sqrt(2.0*(injectionPressure-sm_.ambientPressure())/rhoFuel); -} - - -Foam::scalar Foam::definedPressureSwirlInjector::kv -( - const label inj, - const scalar massFlow, - const scalar dPressure, - const scalar t -) const -{ - const injectorType& it = injectors_[inj].properties(); - - scalar coneAngle = it.getTableValue(coneAngle_, t); - - coneAngle *= constant::mathematical::pi/360.0; - - scalar cosAngle = cos(coneAngle); - scalar Tav = it.integrateTable(it.T())/(it.teoi() - it.tsoi()); - - scalar rhoFuel = sm_.fuels().rho(sm_.ambientPressure(), Tav, it.X()); - scalar injectorDiameter = it.d(); - - scalar kv = max - ( - it.getTableValue(maxKv_, t), - 4.0*massFlow - *sqrt(rhoFuel/2.0/dPressure) - /(constant::mathematical::pi*sqr(injectorDiameter)*rhoFuel*cosAngle) - ); - - return min(1.0, kv); -} - - -Foam::scalar Foam::definedPressureSwirlInjector::deltaPressureInj -( - const scalar time, - const label inj -) const -{ - return - injectors_[inj].properties()->injectionPressure(time) - - sm_.ambientPressure(); -} - - -Foam::scalar -Foam::definedPressureSwirlInjector::averagePressure(const label inj) const -{ - const injectorType& it = sm_.injectors()[inj].properties(); - - scalar dt = it.teoi() - it.tsoi(); - return it.integrateTable(it.injectionPressureProfile())/dt; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedPressureSwirl/definedPressureSwirl.H b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedPressureSwirl/definedPressureSwirl.H deleted file mode 100644 index cb481f996c38d74f2c2950aacf1117cb6768dd46..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/definedPressureSwirl/definedPressureSwirl.H +++ /dev/null @@ -1,132 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::definedPressureSwirlInjector - -Description - Pressure swirl injector model with user-defined - cone-angle/interval vs. time - -\*---------------------------------------------------------------------------*/ - -#ifndef definedPressureSwirlInjector_H -#define definedPressureSwirlInjector_H - -#include "injectorModel.H" -#include "scalarList.H" -#include "vector.H" - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -/*---------------------------------------------------------------------------*\ - Class definedPressureSwirlInjector Declaration -\*---------------------------------------------------------------------------*/ - -class definedPressureSwirlInjector -: - public injectorModel -{ - -private: - - // Private data - - typedef VectorSpace<Vector<scalar>, scalar, 2> pair; - - dictionary definedPressureSwirlInjectorDict_; - - List<pair> coneAngle_; - List<pair> coneInterval_; - - List<pair> maxKv_; - - //- Initial spray angle for the parcels - mutable scalar angle_; - - //- Initial velocity for the parcels - mutable scalar u_; - - - // Private Member Functions - - scalar kv - ( - const label inj, - const scalar massFlow, - const scalar dPressure, - const scalar t - ) const; - - scalar deltaPressureInj(const scalar time, const label inj) const; - scalar averagePressure(const label inj) const; - - -public: - - //- Runtime type information - TypeName("definedPressureSwirlInjector"); - - - // Constructors - - //- Construct from components - definedPressureSwirlInjector(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~definedPressureSwirlInjector(); - - - // Member Functions - - //- Return the injected droplet diameter - scalar d0(const label injector, const scalar time) const; - - //- Return the spray angle of the injector - vector direction - ( - const label injector, - const label hole, - const scalar time, - const scalar d - ) const; - - scalar velocity(const label i, const scalar time) const; - - scalar averageVelocity(const label i) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.C deleted file mode 100644 index 35bf09c98115d877acdb47ffbf927384acf15715..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.C +++ /dev/null @@ -1,202 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "hollowCone.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(hollowConeInjector, 0); - - addToRunTimeSelectionTable - ( - injectorModel, - hollowConeInjector, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::hollowConeInjector::hollowConeInjector -( - const dictionary& dict, - spray& sm -) -: - injectorModel(dict, sm), - hollowConeDict_(dict.subDict(typeName + "Coeffs")), - sizeDistribution_ - ( - distributionModels::distributionModel::New - ( - hollowConeDict_.subDict("sizeDistribution"), - sm.rndGen() - ) - ), - innerAngle_(hollowConeDict_.lookup("innerConeAngle")), - outerAngle_(hollowConeDict_.lookup("outerConeAngle")) -{ - - if (sm.injectors().size() != innerAngle_.size()) - { - FatalErrorIn - ( - "hollowConeInjector::hollowConeInjector" - "(const dictionary& dict, spray& sm)" - ) << "Wrong number of entries in innerAngle" - << abort(FatalError); - } - - if (sm.injectors().size() != outerAngle_.size()) - { - FatalErrorIn - ( - "hollowConeInjector::hollowConeInjector" - "(const dictionary& dict, spray& sm)" - ) << "Wrong number of entries in outerAngle" - << abort(FatalError); - } - - scalar referencePressure = sm.ambientPressure(); - - // correct velocityProfile - forAll(sm.injectors(), i) - { - sm.injectors()[i].properties()->correctProfiles - ( - sm.fuels(), - referencePressure - ); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::hollowConeInjector::~hollowConeInjector() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::scalar Foam::hollowConeInjector::d0 -( - const label, - const scalar -) const -{ - return sizeDistribution_->sample(); -} - - -Foam::vector Foam::hollowConeInjector::direction -( - const label n, - const label hole, - const scalar time, - const scalar d -) const -{ - scalar angle = rndGen_.position<scalar>(innerAngle_[n], outerAngle_[n]); - scalar alpha = sin(angle*constant::mathematical::pi/360.0); - scalar dcorr = cos(angle*constant::mathematical::pi/360.0); - scalar beta = constant::mathematical::twoPi*rndGen_.sample01<scalar>(); - - // randomly distributed vector normal to the injection vector - vector normal = vector::zero; - - if (sm_.twoD()) - { - scalar reduce = 0.01; - // correct beta if this is a 2D run - // map it onto the 'angleOfWedge' - - beta *= - (1.0 - 2.0*reduce) - *sm_.angleOfWedge() - /(constant::mathematical::twoPi); - beta += reduce*sm_.angleOfWedge(); - normal = - alpha - *( - sm_.axisOfWedge()*cos(beta) - + sm_.axisOfWedgeNormal()*sin(beta) - ); - } - else - { - normal = - alpha - *( - injectors_[n].properties()->tan1(hole)*cos(beta) - + injectors_[n].properties()->tan2(hole)*sin(beta) - ); - } - - // set the direction of injection by adding the normal vector - vector dir = - dcorr*injectors_[n].properties()->direction(hole, time) + normal; - dir /= mag(dir); - - return dir; -} - - -Foam::scalar Foam::hollowConeInjector::velocity -( - const label i, - const scalar time -) const -{ - const injectorType& it = sm_.injectors()[i].properties(); - if (it.pressureIndependentVelocity()) - { - return it.getTableValue(it.velocityProfile(), time); - } - else - { - scalar Pref = sm_.ambientPressure(); - scalar Pinj = it.getTableValue(it.injectionPressureProfile(), time); - scalar rho = sm_.fuels().rho(Pinj, it.T(time), it.X()); - scalar dp = max(0.0, Pinj - Pref); - return sqrt(2.0*dp/rho); - } -} - - -Foam::scalar Foam::hollowConeInjector::averageVelocity(const label i) const -{ - const injectorType& it = sm_.injectors()[i].properties(); - scalar dt = it.teoi() - it.tsoi(); - return it.integrateTable(it.velocityProfile())/dt; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.H b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.H deleted file mode 100644 index 9a277e2839fccfe9dc0ae680e5afc4ad1778d96c..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/hollowCone/hollowCone.H +++ /dev/null @@ -1,110 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::hollowConeInjector - -Description - A hollow cone injector with randomly distributed parcels between - the inner and outer cone angle. - - Set inner angle to zero for solid cone. - -\*---------------------------------------------------------------------------*/ - -#ifndef hollowConeInjector_H -#define hollowConeInjector_H - -#include "injectorModel.H" -#include "scalarList.H" -#include "distributionModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -/*---------------------------------------------------------------------------*\ - Class hollowConeInjector Declaration -\*---------------------------------------------------------------------------*/ - -class hollowConeInjector -: - public injectorModel -{ - -private: - - // Private data - - dictionary hollowConeDict_; - - autoPtr<distributionModels::distributionModel> sizeDistribution_; - scalarList innerAngle_; - scalarList outerAngle_; - - -public: - - //- Runtime type information - TypeName("hollowConeInjector"); - - - // Constructors - - //- Construct from components - hollowConeInjector(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~hollowConeInjector(); - - - // Member Functions - - //- Return the injected droplet diameter - scalar d0(const label injector, const scalar time) const; - - //- Return the spray angle of the injector - vector direction - ( - const label injector, - const label hole, - const scalar time, - const scalar d - ) const; - - scalar velocity(const label i, const scalar time) const; - - scalar averageVelocity(const label i) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModel.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModel.C deleted file mode 100644 index c6bb44c83c1067cb343f4118879ff3406cd84dd9..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModel.C +++ /dev/null @@ -1,61 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "injectorModel.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(injectorModel, 0); - defineRunTimeSelectionTable(injectorModel, dictionary); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::injectorModel::injectorModel -( - const dictionary& dict, - spray& sm -) -: - dict_(dict), - sm_(sm), - injectors_(sm.injectors()), - rndGen_(sm.rndGen()) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::injectorModel::~injectorModel() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModel.H b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModel.H deleted file mode 100644 index 7eb5d9773f475267c1dcc028cc38a2cfe1b6564c..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModel.H +++ /dev/null @@ -1,135 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::injectorModel - - -Description - The injectormodel is used to set initial droplet size and the - velocity direction - -\*---------------------------------------------------------------------------*/ - -#ifndef injectorModel_H -#define injectorModel_H - -#include "liquidProperties.H" -#include "injector.H" -#include "PtrList.H" -#include "IOdictionary.H" -#include "volFieldsFwd.H" -#include "autoPtr.H" -#include "spray.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class injectorModel Declaration -\*---------------------------------------------------------------------------*/ - -class injectorModel -{ - -protected: - - // Protected data - - const dictionary& dict_; - spray& sm_; - - const PtrList<injector>& injectors_; - cachedRandom& rndGen_; - - -public: - - //-Runtime type information - TypeName("injectorModel"); - - // Declare runtime constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - injectorModel, - dictionary, - ( - const dictionary& dict, - spray& sm - ), - (dict, sm) - ); - - - // Constructors - - //- Construct from components - injectorModel(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~injectorModel(); - - - // Selector - - static autoPtr<injectorModel> New - ( - const dictionary& dict, - spray& sm - ); - - - // Member Functions - - //- Return the initial droplet diameter - virtual scalar d0(const label injector, const scalar time) const = 0; - - //- Return the spray angle of the injector - virtual vector direction - ( - const label injector, - const label hole, - const scalar time, - const scalar d - ) const = 0; - - virtual scalar velocity(const label i, const scalar time) const = 0; - - virtual scalar averageVelocity(const label i) const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModelNew.C deleted file mode 100644 index 3780763c19d2b3e8ec39e2578d1a33c68dc7a7d3..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/injectorModel/injectorModelNew.C +++ /dev/null @@ -1,61 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "injectorModel.H" -#include "volFields.H" - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::injectorModel> Foam::injectorModel::New -( - const dictionary& dict, - spray& sm -) -{ - const word modelType(dict.lookup("injectorModel")); - - Info<< "Selecting injectorModel " << modelType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn("injectorModel::New(const dictionary&, spray&)") - << "Unknown injectorModel type " - << modelType << nl << nl - << "Valid injectorModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); - } - - return autoPtr<injectorModel>(cstrIter()(dict, sm)); -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/pressureSwirl/pressureSwirlInjector.C b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/pressureSwirl/pressureSwirlInjector.C deleted file mode 100644 index 3bae836f2cdde14708d001b858c4f118fba82376..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/pressureSwirl/pressureSwirlInjector.C +++ /dev/null @@ -1,261 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "pressureSwirlInjector.H" -#include "addToRunTimeSelectionTable.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(pressureSwirlInjector, 0); - - addToRunTimeSelectionTable - ( - injectorModel, - pressureSwirlInjector, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::pressureSwirlInjector::pressureSwirlInjector -( - const dictionary& dict, - spray& sm -) -: - injectorModel(dict, sm), - pressureSwirlInjectorDict_(dict.subDict(typeName + "Coeffs")), - - coneAngle_(pressureSwirlInjectorDict_.lookup("ConeAngle")), - coneInterval_(pressureSwirlInjectorDict_.lookup("ConeInterval")), - maxKv_(pressureSwirlInjectorDict_.lookup("maxKv")), - - angle_(0.0) -{ - - if (sm.injectors().size() != coneAngle_.size()) - { - FatalErrorIn - ( - "pressureSwirlInjector::pressureSwirlInjector" - "(const dictionary& dict, spray& sm)" - ) << "Wrong number of entries in innerAngle" << nl - << abort(FatalError); - } - - scalar referencePressure = sm.p().average().value(); - - // correct velocityProfile - forAll(sm.injectors(), i) - { - sm.injectors()[i].properties()->correctProfiles - ( - sm.fuels(), - referencePressure - ); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::pressureSwirlInjector::~pressureSwirlInjector() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::scalar Foam::pressureSwirlInjector::d0 -( - const label n, - const scalar t -) const -{ - const injectorType& it = injectors_[n].properties(); - - scalar c = rndGen_.sample01<scalar>(); - angle_ = coneAngle_[n] + 2.0*coneInterval_[n]*(0.5 - c); - - angle_ *= constant::mathematical::pi/360.0; - - scalar injectedMassFlow = it.massFlowRate(t); - - scalar cosAngle = cos(angle_); - - scalar rhoFuel = sm_.fuels().rho(sm_.ambientPressure(), it.T(t), it.X()); - scalar injectorDiameter = it.d(); - - scalar deltaPressure = deltaPressureInj(t,n); - scalar kV = kv(n, injectedMassFlow, deltaPressure); - scalar v = kV*sqrt(2.0*deltaPressure/rhoFuel); - - u_ = v*cosAngle; - - scalar A = injectedMassFlow/(constant::mathematical::pi*rhoFuel*u_); - - return (injectorDiameter-sqrt(pow(injectorDiameter,2)-4.0*A))/2.0; -} - - -Foam::vector Foam::pressureSwirlInjector::direction -( - const label n, - const label hole, - const scalar time, - const scalar d -) const -{ - scalar alpha = sin(angle_); - scalar dcorr = cos(angle_); - scalar beta = constant::mathematical::twoPi*rndGen_.sample01<scalar>(); - - // randomly distributed vector normal to the injection vector - vector normal = vector::zero; - - if (sm_.twoD()) - { - scalar reduce = 0.01; - // correct beta if this is a 2D run - // map it onto the 'angleOfWedge' - - beta *= - (1.0 - 2.0*reduce) - *sm_.angleOfWedge() - /(constant::mathematical::twoPi); - beta += reduce*sm_.angleOfWedge(); - normal = - alpha - *( - sm_.axisOfWedge()*cos(beta) - + sm_.axisOfWedgeNormal()*sin(beta) - ); - } - else - { - normal = - alpha - *( - injectors_[n].properties()->tan1(hole)*cos(beta) - + injectors_[n].properties()->tan2(hole)*sin(beta) - ); - } - - // set the direction of injection by adding the normal vector - vector dir = - dcorr*injectors_[n].properties()->direction(hole, time) + normal; - dir /= mag(dir); - - return dir; -} - - -Foam::scalar Foam::pressureSwirlInjector::velocity -( - const label i, - const scalar time -) const -{ - return u_*sqrt(1.0 + pow(tan(angle_),2.0)); -} - - -Foam::scalar Foam::pressureSwirlInjector::averageVelocity(const label i) const -{ - const injectorType& it = sm_.injectors()[i].properties(); - - scalar dt = it.teoi() - it.tsoi(); - - scalar injectedMassFlow = it.mass()/(it.teoi()-it.tsoi()); - - scalar injectionPressure = averagePressure(i); - - scalar Tav = it.integrateTable(it.T())/dt; - scalar rhoFuel = sm_.fuels().rho(sm_.ambientPressure(), Tav, it.X()); - - scalar kV = kv(i, injectedMassFlow, injectionPressure); - - return kV*sqrt(2.0*(injectionPressure-sm_.ambientPressure())/rhoFuel); -} - - -Foam::scalar Foam::pressureSwirlInjector::kv -( - const label inj, - const scalar massFlow, - const scalar dPressure -) const -{ - const injectorType& it = injectors_[inj].properties(); - - scalar coneAngle = coneAngle_[inj]; - - coneAngle *= constant::mathematical::pi/360.0; - - scalar cosAngle = cos(coneAngle); - scalar Tav = it.integrateTable(it.T())/(it.teoi()-it.tsoi()); - - scalar rhoFuel = sm_.fuels().rho(sm_.ambientPressure(), Tav, it.X()); - scalar injectorDiameter = it.d(); - - scalar kv = max - ( - maxKv_[inj], - 4.0*massFlow - *sqrt(rhoFuel/2.0/dPressure) - /(constant::mathematical::pi*sqr(injectorDiameter)*rhoFuel*cosAngle) - ); - - return min(1.0, kv); -} - - -Foam::scalar Foam::pressureSwirlInjector::deltaPressureInj -( - const scalar time, - const label inj -) const -{ - return - injectors_[inj].properties()->injectionPressure(time) - - sm_.ambientPressure(); -} - - -Foam::scalar Foam::pressureSwirlInjector::averagePressure(const label inj) const -{ - - const injectorType& it = sm_.injectors()[inj].properties(); - - scalar dt = it.teoi() - it.tsoi(); - return it.integrateTable(it.injectionPressureProfile())/dt; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/pressureSwirl/pressureSwirlInjector.H b/src/lagrangian/dieselSpray/spraySubModels/injectorModel/pressureSwirl/pressureSwirlInjector.H deleted file mode 100644 index edfcbce3edea0870e653a3420ef0f7a88ec57fad..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/injectorModel/pressureSwirl/pressureSwirlInjector.H +++ /dev/null @@ -1,128 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::pressureSwirlInjector - -Description - Randomly distribute the parcels between the inner and outer cone angle. - - Set inner angle to zero for solid cone. - -\*---------------------------------------------------------------------------*/ - -#ifndef pressureSwirlInjector_H -#define pressureSwirlInjector_H - -#include "injectorModel.H" -#include "scalarList.H" - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -/*---------------------------------------------------------------------------*\ - Class pressureSwirlInjector Declaration -\*---------------------------------------------------------------------------*/ - -class pressureSwirlInjector -: - public injectorModel -{ - -private: - - // Private data - - dictionary pressureSwirlInjectorDict_; - - scalarList coneAngle_; - scalarList coneInterval_; - scalarList maxKv_; - - //- Initial spray angle for the parcels - mutable scalar angle_; - - //- Initial velocity for the parcels - mutable scalar u_; - - - // Private Member Functions - - scalar kv - ( - const label inj, - const scalar massFlow, - const scalar dPressure - ) const; - - scalar deltaPressureInj(const scalar time, const label inj) const; - scalar averagePressure(const label inj) const; - - -public: - - //- Runtime type information - TypeName("pressureSwirlInjector"); - - - // Constructors - - //- Construct from components - pressureSwirlInjector(const dictionary& dict, spray& sm); - - - //- Destructor - virtual ~pressureSwirlInjector(); - - - // Member Functions - - //- Return the injected droplet diameter - scalar d0(const label injector, const scalar time) const; - - //- Return the spray angle of the injector - vector direction - ( - const label injector, - const label hole, - const scalar time, - const scalar d - ) const; - - scalar velocity(const label i, const scalar time) const; - - scalar averageVelocity(const label i) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/wallModel/reflectParcel/reflectParcel.C b/src/lagrangian/dieselSpray/spraySubModels/wallModel/reflectParcel/reflectParcel.C deleted file mode 100644 index b81117986e26e23565f80467a5615c870a198ac8..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/wallModel/reflectParcel/reflectParcel.C +++ /dev/null @@ -1,186 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "reflectParcel.H" -#include "addToRunTimeSelectionTable.H" -#include "wallPolyPatch.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(reflectParcel, 0); - - addToRunTimeSelectionTable - ( - wallModel, - reflectParcel, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::reflectParcel::reflectParcel -( - const dictionary& dict, - const volVectorField& U, - spray& sm -) -: - wallModel(dict, U, sm), - U_(U), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - elasticity_(readScalar(coeffsDict_.lookup("elasticity"))) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::reflectParcel::~reflectParcel() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -// Return 'keepParcel' -bool Foam::reflectParcel::wallTreatment -( - parcel& p, - const label globalFaceI -) const -{ - label patchI = p.patch(globalFaceI); - label faceI = p.patchFace(patchI, globalFaceI); - - const polyMesh& mesh = spray_.mesh(); - - if (isA<wallPolyPatch>(mesh_.boundaryMesh()[patchI])) - { - // wallNormal defined to point outwards of domain - vector Sf = mesh_.Sf().boundaryField()[patchI][faceI]; - Sf /= mag(Sf); - - if (!mesh.moving()) - { - // static mesh - scalar Un = p.U() & Sf; - - if (Un > 0) - { - p.U() -= (1.0 + elasticity_)*Un*Sf; - } - } - else - { - // moving mesh - vector Ub1 = U_.boundaryField()[patchI][faceI]; - vector Ub0 = U_.oldTime().boundaryField()[patchI][faceI]; - - scalar dt = spray_.runTime().deltaTValue(); - const vectorField& oldPoints = mesh.oldPoints(); - - const vector& Cf1 = mesh.faceCentres()[globalFaceI]; - - vector Cf0 = mesh.faces()[globalFaceI].centre(oldPoints); - vector Cf = Cf0 + p.stepFraction()*(Cf1 - Cf0); - vector Sf0 = mesh.faces()[globalFaceI].normal(oldPoints); - - // for layer addition Sf0 = vector::zero and we use Sf - if (mag(Sf0) > SMALL) - { - Sf0 /= mag(Sf0); - } - else - { - Sf0 = Sf; - } - - scalar magSfDiff = mag(Sf - Sf0); - - vector Ub = Ub0 + p.stepFraction()*(Ub1 - Ub0); - - if (magSfDiff > SMALL) - { - // rotation + translation - vector Sfp = Sf0 + p.stepFraction()*(Sf - Sf0); - - vector omega = Sf0 ^ Sf; - scalar magOmega = mag(omega); - omega /= magOmega+SMALL; - - scalar phiVel = ::asin(magOmega)/dt; - - scalar dist = (p.position() - Cf) & Sfp; - vector pos = p.position() - dist*Sfp; - vector vrot = phiVel*(omega ^ (pos - Cf)); - - vector v = Ub + vrot; - - scalar Un = ((p.U() - v) & Sfp); - - if (Un > 0.0) - { - p.U() -= (1.0 + elasticity_)*Un*Sfp; - } - } - else - { - // translation - vector Ur = p.U() - Ub; - scalar Urn = Ur & Sf; - /* - if (mag(Ub-v) > SMALL) - { - Info<< "reflectParcel:: v = " << v - << ", Ub = " << Ub - << ", faceI = " << faceI - << ", patchI = " << patchI - << ", globalFaceI = " << globalFaceI - << ", name = " << mesh_.boundaryMesh()[patchI].name() - << endl; - } - */ - if (Urn > 0.0) - { - p.U() -= (1.0 + elasticity_)*Urn*Sf; - } - } - } - - } - else - { - FatalErrorIn("bool reflectParcel::wallTreatment(parcel& parcel) const") - << " parcel has hit a boundary " << mesh_.boundary()[patchI].type() - << " which not yet has been implemented." << nl - << abort(FatalError); - } - return true; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/wallModel/reflectParcel/reflectParcel.H b/src/lagrangian/dieselSpray/spraySubModels/wallModel/reflectParcel/reflectParcel.H deleted file mode 100644 index a10764ae382dd849f2f2f0e832c6b48ebcdb48f0..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/wallModel/reflectParcel/reflectParcel.H +++ /dev/null @@ -1,102 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::reflectParcel - -Description - The parcels are reflected back from the wall in an inelastic collision. - -\*---------------------------------------------------------------------------*/ - -#ifndef reflectParcel_H -#define reflectParcel_H - -#include "wallModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class reflectParcel Declaration -\*---------------------------------------------------------------------------*/ - -class reflectParcel -: - public wallModel -{ - -private: - - // Private data - - const volVectorField& U_; - - dictionary coeffsDict_; - - // model constants - - //- Elasticity constant v^2_out = elasticity*v^2_in - scalar elasticity_; - - -public: - - //- Runtime type information - TypeName("reflect"); - - - // Constructors - - //- Construct from components - reflectParcel - ( - const dictionary& dict, - const volVectorField& U, - spray& sm - ); - - - //- Destructor - virtual ~reflectParcel(); - - - // Member Functions - - //- Return true if parcel is to be kept, and false if it is to be - // removed - bool wallTreatment(parcel& parcel, const label faceI) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/wallModel/removeParcel/removeParcel.C b/src/lagrangian/dieselSpray/spraySubModels/wallModel/removeParcel/removeParcel.C deleted file mode 100644 index be4f23c8ab2f75d943fd151c3edcb76302334103..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/wallModel/removeParcel/removeParcel.C +++ /dev/null @@ -1,75 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "removeParcel.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(removeParcel, 0); - - addToRunTimeSelectionTable - ( - wallModel, - removeParcel, - dictionary - ); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::removeParcel::removeParcel -( - const dictionary& dict, - const volVectorField& U, - spray& sm -) -: - wallModel(dict, U, sm) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::removeParcel::~removeParcel() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::removeParcel::wallTreatment -( - parcel&, - const label faceI -) const -{ - return false; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/wallModel/removeParcel/removeParcel.H b/src/lagrangian/dieselSpray/spraySubModels/wallModel/removeParcel/removeParcel.H deleted file mode 100644 index 7702a7f9bbe576552ad6626a7c135a0136488f1b..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/wallModel/removeParcel/removeParcel.H +++ /dev/null @@ -1,88 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::removeParcel - -Description - remove parcel, regardless of boundary type. - -\*---------------------------------------------------------------------------*/ - -#ifndef removeParcel_H -#define removeParcel_H - -#include "wallModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class removeParcel Declaration -\*---------------------------------------------------------------------------*/ - -class removeParcel -: - public wallModel -{ - -public: - - //- Runtime type information - TypeName("remove"); - - - // Constructors - - //- Construct from components - removeParcel - ( - const dictionary& dict, - const volVectorField& U, - spray& sm - ); - - - //- Destructor - virtual ~removeParcel(); - - - // Member Functions - - //- Return true if parcel is to be kept, and false if it is to be - // removed - bool wallTreatment(parcel& parcel, const label faceI) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/wallModel.C b/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/wallModel.C deleted file mode 100644 index ea1e03d9d9186031d18e978b5add31dcd7dd27e5..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/wallModel.C +++ /dev/null @@ -1,58 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "wallModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(wallModel, 0); - defineRunTimeSelectionTable(wallModel, dictionary); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::wallModel::wallModel -( - const dictionary& dict, - const volVectorField& U, - spray& sm -) -: - dict_(dict), - mesh_(U.mesh()), - spray_(sm) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::wallModel::~wallModel() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/wallModel.H b/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/wallModel.H deleted file mode 100644 index 09784b9eb70614cabf605cf9af3fb5b09b7002fb..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/wallModel.H +++ /dev/null @@ -1,134 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::wallModel - -Description - A wall interaction model - -SourceFiles - wallModelI.H - wallModel.C - wallModelIO.C - -\*---------------------------------------------------------------------------*/ - -#ifndef wallModel_H -#define wallModel_H - -#include "spray.H" -#include "IOdictionary.H" -#include "autoPtr.H" -#include "runTimeSelectionTables.H" - -#include "volFields.H" -#include "surfaceFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class wallModel Declaration -\*---------------------------------------------------------------------------*/ - -class wallModel -{ - -protected: - - // Protected data - - const dictionary& dict_; - const fvMesh& mesh_; - spray& spray_; - - -public: - - //- Runtime type information - TypeName("wallModel"); - - // Declare runtime constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - wallModel, - dictionary, - ( - const dictionary& dict, - const volVectorField& U, - spray& sm - ), - (dict, U, sm) - ); - - - // Constructors - - //- Construct from components - wallModel - ( - const dictionary&, - const volVectorField& U, - spray& - ); - - - //- Destructor - virtual ~wallModel(); - - - // Selector - - static autoPtr<wallModel> New - ( - const dictionary&, - const volVectorField& U, - spray& sm - ); - - - // Member Functions - - //- Return true if parcel is to be kept, false if it is to be removed - virtual bool wallTreatment - ( - parcel&, - const label faceI - ) const = 0; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/wallModelNew.C b/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/wallModelNew.C deleted file mode 100644 index c77b2aed40b74a8d0a860c0ad83df3d0992b86dd..0000000000000000000000000000000000000000 --- a/src/lagrangian/dieselSpray/spraySubModels/wallModel/wallModel/wallModelNew.C +++ /dev/null @@ -1,60 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "error.H" -#include "wallModel.H" -#include "removeParcel.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::autoPtr<Foam::wallModel> Foam::wallModel::New -( - const dictionary& dict, - const volVectorField& U, - spray& sm -) -{ - const word modelType(dict.lookup("wallModel")); - - Info<< "Selecting wallModel " << modelType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorIn("wallModel::New(const dictionary&, const spray&)") - << "Unknown wallModel type " - << modelType << nl << nl - << "Valid wallModel types are:" << nl - << dictionaryConstructorTablePtr_->sortedToc() - << abort(FatalError); - } - - return autoPtr<wallModel>(cstrIter()(dict, U, sm)); -} - - -// ************************************************************************* // diff --git a/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C b/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C index 953e1d4afa3cd4d11a346ff860a7c8ba72251bd3..fe21beb23a6d81b6b87c61bdf5dde474e66ac8f6 100644 --- a/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C +++ b/src/meshTools/AMIInterpolation/faceAreaIntersect/faceAreaIntersect.C @@ -53,9 +53,9 @@ void Foam::faceAreaIntersect::triSliceWithPlane if (mag(d[i]) < matchTol*len) { - d[i] = 0.0; nCoPlanar++; copI = i; + d[i] = 0.0; } else { @@ -71,19 +71,39 @@ void Foam::faceAreaIntersect::triSliceWithPlane } } + + // Determine triangle area contribution + if ( (nPos == 3) || ((nPos == 2) && (nCoPlanar == 1)) || ((nPos == 1) && (nCoPlanar == 2))) { - // all points above cutting plane - add triangle to list + /* + /\ _____ + / \ \ / /\ + /____\ \ / / \ + __________ ____v____ __/____\__ + + all points above cutting plane + - add complete triangle to list + */ + tris[nTris++] = tri; } else if ((nPos == 2) && (nCoPlanar == 0)) { - // 2 points above plane, 1 below - // resulting quad above plane split into 2 triangles + /* + ________ + \ / + --\----/-- + \ / + \/ + + 2 points above plane, 1 below + - resulting quad above plane split into 2 triangles + */ // point under the plane label i0 = negI; @@ -108,7 +128,15 @@ void Foam::faceAreaIntersect::triSliceWithPlane if (nCoPlanar == 0) { - // 1 point above plane, 2 below + /* + /\ + / \ + --/----\-- + /______\ + + 1 point above plane, 2 below + - keep triangle avove intersection plane + */ // indices of remaining points label i1 = d.fcIndex(i0); @@ -124,7 +152,19 @@ void Foam::faceAreaIntersect::triSliceWithPlane } else { - // 1 point above plane, 1 on plane, 1 below + /* + + |\ + | \ + __|__\__ + | / + | / + |/ + + + 1 point above plane, 1 on plane, 1 below + - keep triangle above intersection plane + */ // point indices label i1 = negI; @@ -146,7 +186,15 @@ void Foam::faceAreaIntersect::triSliceWithPlane } else { - // all points below cutting plane - forget + /* + _________ __________ ___________ + /\ \ / + /\ / \ \ / + / \ /____\ \/ + /____\ + + all points below cutting plane - forget + */ } } diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/N2 b/tutorials/combustion/dieselFoam/aachenBomb/0/N2 deleted file mode 100644 index d312f16988c6ec183fd97466bc183968e8d56058..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/N2 +++ /dev/null @@ -1,29 +0,0 @@ -/*--------------------------------*- 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; - object N2; -} -// ************************************************************************* // - -dimensions [ 0 0 0 0 0 0 0 ]; - -internalField uniform 0.766; - -boundaryField -{ - walls - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/O2 b/tutorials/combustion/dieselFoam/aachenBomb/0/O2 deleted file mode 100644 index e085980998ef70c221c2788387053ac5b88f3c49..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/O2 +++ /dev/null @@ -1,29 +0,0 @@ -/*--------------------------------*- 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; - object O2; -} -// ************************************************************************* // - -dimensions [ 0 0 0 0 0 0 0 ]; - -internalField uniform 0.234; - -boundaryField -{ - walls - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/T b/tutorials/combustion/dieselFoam/aachenBomb/0/T deleted file mode 100644 index da07d97019b0df00f9fa4df7c4ae0cc87a3804be..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/T +++ /dev/null @@ -1,29 +0,0 @@ -/*--------------------------------*- 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; - object T; -} -// ************************************************************************* // - -dimensions [ 0 0 0 1 0 0 0 ]; - -internalField uniform 800; - -boundaryField -{ - walls - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/U b/tutorials/combustion/dieselFoam/aachenBomb/0/U deleted file mode 100644 index 8abc3ee9fa3349a7594893030d23a21ccdaf1404..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/U +++ /dev/null @@ -1,30 +0,0 @@ -/*--------------------------------*- 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; - object U; -} -// ************************************************************************* // - -dimensions [ 0 1 -1 0 0 0 0 ]; - -internalField uniform ( 0 0 0 ); - -boundaryField -{ - walls - { - type fixedValue; - value uniform ( 0 0 0 ); - } -} - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/Ydefault b/tutorials/combustion/dieselFoam/aachenBomb/0/Ydefault deleted file mode 100644 index 97d3b3fc77c9f4146837bd518c6f20d8db592a85..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/Ydefault +++ /dev/null @@ -1,29 +0,0 @@ -/*--------------------------------*- 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; - object Ydefault; -} -// ************************************************************************* // - -dimensions [ 0 0 0 0 0 0 0 ]; - -internalField uniform 0; - -boundaryField -{ - walls - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/alphat b/tutorials/combustion/dieselFoam/aachenBomb/0/alphat deleted file mode 100644 index 0061bd68f0e0f2e7282b85e2067b14c4bd021396..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/alphat +++ /dev/null @@ -1,32 +0,0 @@ -/*--------------------------------*- 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 -{ - walls - { - type alphatWallFunction; - value uniform 0; - } -} - - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/epsilon b/tutorials/combustion/dieselFoam/aachenBomb/0/epsilon deleted file mode 100644 index 0903d63cb1ad7e4fd4b2f06f4043028e3af0341e..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/epsilon +++ /dev/null @@ -1,32 +0,0 @@ -/*--------------------------------*- 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 90; - -boundaryField -{ - walls - { - type compressible::epsilonWallFunction; - value uniform 90; - } -} - - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/k b/tutorials/combustion/dieselFoam/aachenBomb/0/k deleted file mode 100644 index 9e120643b28fea3d9c858f5f03a5ea8ea6f62656..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/k +++ /dev/null @@ -1,32 +0,0 @@ -/*--------------------------------*- 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 1; - -boundaryField -{ - walls - { - type compressible::kqRWallFunction; - value uniform 1; - } -} - - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/mut b/tutorials/combustion/dieselFoam/aachenBomb/0/mut deleted file mode 100644 index 4f3bc38c058e72c501da972062bce47bd1e2a06d..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/mut +++ /dev/null @@ -1,32 +0,0 @@ -/*--------------------------------*- 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 -{ - walls - { - type mutkWallFunction; - value uniform 0; - } -} - - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/p b/tutorials/combustion/dieselFoam/aachenBomb/0/p deleted file mode 100644 index c13a0c26af8ee72d161b813eeeb137d9f7238049..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/p +++ /dev/null @@ -1,29 +0,0 @@ -/*--------------------------------*- 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; - object p; -} -// ************************************************************************* // - -dimensions [ 1 -1 -2 0 0 0 0 ]; - -internalField uniform 5e+06; - -boundaryField -{ - walls - { - type zeroGradient; - } -} - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/chemkin/chem.inp b/tutorials/combustion/dieselFoam/aachenBomb/chemkin/chem.inp deleted file mode 100644 index 75a9521d3b2b1c206a1c0cbfdac4edf6363cd3bf..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/chemkin/chem.inp +++ /dev/null @@ -1,11 +0,0 @@ -ELEMENTS - H O C N AR -END -SPECIE -C7H16 O2 N2 CO2 H2O -END -REACTIONS - C7H16 + 11O2 => 7CO2 + 8H2O 5.00E+8 0.0 15780.0! 1 - FORD / C7H16 0.25 / - FORD / O2 1.5 / -END diff --git a/tutorials/combustion/dieselFoam/aachenBomb/chemkin/chem.inp.1 b/tutorials/combustion/dieselFoam/aachenBomb/chemkin/chem.inp.1 deleted file mode 100644 index 75a9521d3b2b1c206a1c0cbfdac4edf6363cd3bf..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/chemkin/chem.inp.1 +++ /dev/null @@ -1,11 +0,0 @@ -ELEMENTS - H O C N AR -END -SPECIE -C7H16 O2 N2 CO2 H2O -END -REACTIONS - C7H16 + 11O2 => 7CO2 + 8H2O 5.00E+8 0.0 15780.0! 1 - FORD / C7H16 0.25 / - FORD / O2 1.5 / -END diff --git a/tutorials/combustion/dieselFoam/aachenBomb/chemkin/chem.inp.full b/tutorials/combustion/dieselFoam/aachenBomb/chemkin/chem.inp.full deleted file mode 100644 index c757dde3123cce64e2e3f71d89c2c8ea9c91a0c4..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/chemkin/chem.inp.full +++ /dev/null @@ -1,370 +0,0 @@ -ELEMENTS - H O C N -END -SPECIE -C7H16 O2 N2 CO CO2 -H H2 O H2O OH -HO2 H2O2 CH4 CH3 CH3O -CH2 CH2O CH3O2 CH4O2 HCO HCCO CH2CO -C7H15-1 C7H15-2 C7H15O2 C7H14O2H C7H14O2HO2 -C7KET21 C6H12 C5H11CHO C5H11CO C5H11 -C4H9 C4H C4H2 C4H3 -C3H7 C3H6 C3H5 C3H4 C3H3 C3H2 -C2H C2H2 C2H3 C2H4 C2H5 C2H6 -N2O NO N -C3H8 CH2CHO CH3CHO CH3CO CH2OH -END -REACTIONS - C7H16 + O2 = C7H15-1 + HO2 2.500E+13 0.0 48810.0! 1 - C7H16 + O2 = C7H15-2 + HO2 2.800E+14 0.0 47180.0! 2 - C7H16 + H = C7H15-1 + H2 5.600E+07 2.0 7667.0! 3 - C7H16 + H = C7H15-2 + H2 4.380E+07 2.0 4750.0! 4 - C7H16 + OH = C7H15-1 + H2O 8.600E+09 1.10 1815.0! 5 - C7H16 + OH = C7H15-2 + H2O 4.800E+09 1.30 690.5! 6 - C7H16 + HO2 = C7H15-1 + H2O2 8.000E+12 0.0 19300.0! 7 - C7H16 + HO2 = C7H15-2 + H2O2 1.000E+13 0.0 16950.0! 8 - C7H16 + CH3 = C7H15-1 + CH4 1.300E+12 0.0 1.160E+4! 9 - C7H16 + CH3 = C7H15-2 + CH4 8.000E+11 0.0 9.500E+3! 10 - C7H16 = C7H15-1 + H 3.972E+19 -0.95 1.032E+5! 11 - C7H16 = C7H15-2 + H 1.248E+21 -1.34 1.007E+5! 12 - C7H16 = C4H9 + C3H7 2.000E+16 0.0 80710.0! 13 -! - C7H15-1 + O2 = C7H15O2 2.000E+12 0.0 0.0! 14 - C7H15-2 + O2 = C7H15O2 2.000E+12 0.0 0.0! 15 - C7H15O2 = C7H14O2H 6.000E+11 0.0 20380.0! 16 - C7H14O2H + O2 = C7H14O2HO2 2.340E+11 0.0 0.0! 17 - C7H14O2HO2 = C7KET21 + OH 2.965E+13 0.0 2.670E+4! 18 - C7KET21 = C5H11CO + CH2O + OH 1.000E+16 0.0 4.240E+4! 19 - C5H11CHO + O2 = C5H11CO + HO2 2.000E+13 0.5 4.220E+4! 20 - C5H11CHO + OH = C5H11CO + H2O 1.000E+13 0.0 0.000E+0! 21 - C5H11CHO + H = C5H11CO + H2 4.000E+13 0.0 4.200E+3! 22 - C5H11CHO + O = C5H11CO + OH 5.000E+12 0.0 1.790E+3! 23 - C5H11CHO + HO2 = C5H11CO + H2O2 2.800E+12 0.0 1.360E+4! 24 - C5H11CHO + CH3 = C5H11CO + CH4 1.700E+12 0.0 8.440E+3! 25 - C5H11CHO + CH3O2 = C5H11CO + CH4O2 1.000E+12 0.0 9.500E+3! 26 - C5H11CO = C5H11 + CO 1.000E+11 0.0 9.600E+3! 27 - C5H11 = C2H5 + C3H6 3.200E+13 0.0 28300.0! 28 - C7H15-1 = C2H4 + C5H11 2.500E+13 0.0 28810.0! 29 - C7H15-2 = CH3 + C6H12 3.000E+13 0.0 29800.0! 30 - C6H12 = C3H7 + C3H5 1.000E+16 0.0 68000.0! 31 - C7H15-2 = C4H9 + C3H6 1.200E+13 0.0 29600.0! 32 - C7H15-1 = C7H15-2 2.000E+11 0.0 18100.0! 33 - C4H9 = C3H6 + CH3 2.232E+17 -1.40 30830.0! 34 - C4H9 = C2H5 + C2H4 2.500E+13 0.0 28810.0! 35 - C3H7 = C2H4 + CH3 9.600E+13 0.0 30950.0! 36 - C3H7 = C3H6 + H 1.250E+14 0.0 36900.0! 37 - C3H7 + O2 = C3H6 + HO2 1.000E+12 0.0 4980.0! 38 - C3H6 = C2H3 + CH3 6.150E+15 0.0 85500.0! 39 ! 3.15 - C3H6 + H = C3H5 + H2 5.000E+12 0.0 1500.0! 40 - C3H6 + CH3 = C3H5 + CH4 9.000E+12 0.0 8480.0! 41 - C3H6 + O2 = C3H5 + HO2 4.000E+12 0.0 39900.0! 42 - C3H6 + OH = CH3CHO + CH3 3.500E+11 0.0 0.0! 43 - C3H5 = C3H4 + H 4.000E+13 0.0 69760.0! 44 - C3H5 + H = C3H4 + H2 1.000E+13 0.0 0.0! 45 - C3H5 + O2 = C3H4 + HO2 6.000E+11 0.0 10000.0! 46 - C3H4 + OH = C2H3 + CH2O 1.000E+12 0.0 0.0! 47 - C3H4 + OH = C2H4 + HCO 1.000E+12 0.0 0.0! 48 - C3H4 + O2 = C3H3 + HO2 4.000E+13 0.0 39160.0! 49 -! - C2H5 + O = CH3CHO + H 5.300E+13 0.0 0.0! 50 - C2H4 + HO2 = CH3CHO + OH 2.200E+13 0.0 17200.0! 51 - C2H4 + CH3O = CH3CHO + CH3 3.000E+13 0.0 14500.0! 52 - C2H4 + CH3O2 = CH3CHO + CH3O 7.000E+13 0.0 14500.0! 53 -!C2H3 + OH = CH3CHO 3.000E+13 0.0 0.0! - CH3CHO = CH3 + HCO 7.080E+15 0.00 81760. ! 54 -!CH3CHO = CH3CO + H 5.000E+14 0.00 87860. ! - CH3CO + M = CH3 + CO + M 1.800E+16 0.00 1.44E+4! 55 - CH3CHO + O2 = CH3CO + HO2 2.000E+13 0.50 42200. ! 56 - CH3CHO + H = CH3CO + H2 4.100E+13 0.00 4200. ! 57 - CH3CHO + OH = CH3CO + H2O 1.000E+13 0.00 0. ! 58 - CH3CHO + O = CH3CO + OH 5.800E+12 0.00 1790. ! 59 - CH3CHO + CH3 = CH3CO + CH4 1.700E+12 0.0 8440.0! 60 - CH3CHO + CH2 = CH3CO + CH3 1.660E+12 0.0 3510. ! 61 - CH3CHO + HO2 = CH3CO + H2O2 1.700E+12 0.00 10700. ! 62 - CH3CHO + CH3O2 = CH3CO + CH4O2 1.150E+11 0.0 10000.0! 63 - CH3CO + O = CH3 + CO2 1.000E+13 0.00 0. ! 64 - CH3CO + H = CH3 + HCO 1.000E+14 0.0 0. ! 65 - CH3CO + OH = CH3 + CO + OH 3.000E+13 0.0 0. ! 66 - CH3CO + HO2 = CH3 + CO2 + OH 3.000E+13 0.0 0. ! 67 - CH3CO + CH3 = C2H6 + CO 5.000E+13 0.00 0. ! 68 -! - CH3O + CO = CH3 + CO2 1.570E+14 0.00 11800. ! 69 - CH3O + H = CH2O + H2 2.000E+13 0.00 0. ! 70 - CH3O + OH = CH2O + H2O 1.000E+13 0.00 0. ! 71 - CH3O + O = CH2O + OH 1.000E+13 0.00 0. ! 72 - CH3O + O2 = CH2O + HO2 1.200E+11 0.00 2600. ! 73 - CH3O (+M) = CH2O + H (+M) 2.000E+13 0.00 27420.0! 74 - LOW /2.344E+25 -2.7 3.060E+04/ - CH3 + HO2 = CH3O + OH 4.300E+13 0.00 0. ! 75 - CH3 + O2 = CH3O + O 3.670E+13 0.00 30000. ! 76 - CH3 + O2 = CH2O + OH 4.800E+10 0.00 9000. ! 77 4.8 9000 - CH3 + O2 = CH3O2 3.020E+59 -15.0 17204. ! 78 3.02 -! - CH3O2 + HO2 = CH4O2 + O2 4.630E+11 0.0 -2583. ! 79 - CH3O2 + CH4 = CH4O2 + CH3 1.810E+11 0.0 18480. ! 80 - CH3O2 + CH3 = CH3O + CH3O 2.410E+13 0.0 0. ! 81 2.410E+13 - CH3O2 + O = CH3O + O2 3.610E+13 0.0 0. ! 82 - CH3O2 + H = CH3O + OH 9.640E+13 0.0 0. ! 83 - CH3O2 + CH2O = CH4O2 + HCO 1.000E+12 0.0 11665. ! 84 - CH3O2 + C2H6 = CH4O2 + C2H5 2.950E+11 0.0 14944. ! 85 - CH3O2 + CH3O2 = CH3O + CH3O + O2 2.800E+11 0.0 -780. ! 86 11 - CH3O2 + H2O2 = CH4O2 + HO2 2.400E+12 0.0 10000. ! 87 - CH4O2 = CH3O + OH 3.000E+16 0.0 42920. ! 88 6.000E+16 - CH3O2 + C2H4 = C2H3 + CH4O2 7.100E+11 0.0 17110. ! 89 - CH4O2 + OH = CH3O2 + H2O 1.000E+13 0.0 -258. ! 90 ! 8.2 - CH4O2 + O = CH3O2 + OH 2.000E+13 0.0 4750. ! 91 - CH3 + O = CH2O + H 8.000E+13 0.00 0. ! 92 - CH3 + OH = CH2 + H2O 7.500E+06 2.00 5000. ! 93 - CH3 + OH = CH2O + H2 4.000E+12 0.00 0. ! 94 - CH3O + H = CH3 + OH 1.000E+14 0.00 0. ! 95 - CO + O + M = CO2 + M 6.170E+14 0.00 3000. ! 96 - CO + OH = CO2 + H 3.510E+07 1.30 -758. ! 97 - CO + O2 = CO2 + O 1.600E+13 0.00 41000. ! 98 - HO2 + CO = CO2 + OH 5.800E+13 0.00 22930. ! 99 -! - H2 + O2 = OH + OH 1.700E+13 0.00 47780. !100 - H2 + OH = H2O + H 1.170E+09 1.30 3626. !101 - O + OH = O2 + H 4.000E+14 -0.50 0. !102 - O + H2 = OH + H 5.060E+04 2.67 6290. !103 - H + HO2 = O + H2O 3.100E+10 0.00 3590. !104 - O + OH + M = HO2 + M 1.000E+16 0.00 0. !105 - H2O/6.0/ CO2/5.0/ H2/3.3/ CO/2.0/ N2/0.70/ - H + O2 + M = HO2 + M 2.800E+18 -.86 0.0!106 - O2/ .00/ H2O/ .00/ CO/ .75/ CO2/1.50/ C2H6/1.50/ N2/0.0/ - H + O2 + O2 = HO2 + O2 2.080E+19 -1.24 0.0!107 - H + O2 + H2O = HO2 + H2O 11.26E+18 -.76 0.0!108 - H + O2 + N2 = HO2 + N2 2.600E+19 -1.24 0.0!109 - OH + HO2 = H2O + O2 7.500E+12 0.00 0. !110 - H + HO2 = OH + OH 1.700E+14 0.0 875. !111 - O + HO2 = O2 + OH 1.400E+13 0.00 1073. !112 - OH + OH = O + H2O 6.000E+08 1.30 0. !113 - H + H + M = H2 + M 1.000E+18 -1.00 0. !114 - H2/0./ H2O/0./ CO2/0./ - H + H + H2 = H2 + H2 9.200E+16 -0.60 0. !115 - H + H + H2O = H2 + H2O 6.000E+19 -1.25 0. !116 - H + H + CO2 = H2 + CO2 5.490E+20 -2.00 0. !117 - H + OH + M = H2O + M 1.600E+22 -2.00 0. !118 - H + O + M = OH + M 6.200E+16 -0.60 0. !119 - O + O + M = O2 + M 1.890E+13 0.00 -1788. !120 - H + HO2 = H2 + O2 1.250E+13 0.00 0. !121 - HO2 + HO2 = H2O2 + O2 2.000E+12 0.00 0. !122 - OH + OH (+M) = H2O2 (+M) 7.600E+13 -.37 0. !123 - LOW / 4.300E+18 -.900 -1700.00/ - TROE/ .7346 94.00 1756.00 5182.00 / - H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ N2/0.70/ - H2O2 + H = HO2 + H2 1.600E+12 0.00 3800. !124 - H2O2 + OH = H2O + HO2 1.000E+13 0.00 1800. !125 - H2O2 + H = H2O + OH 1.000E+13 0.00 3590. !126 - H2O2 + O = H2O + O2 8.400E+11 0.00 4260. !127 - H2O2 + O = OH + HO2 2.000E+13 0.00 5900. !128 - H2 + HO2 = H2O + OH 6.500E+11 0.00 18800. !129 -! - CO2 + N = NO + CO 1.900E+11 0.00 3400. !130 - N2O + O = N2 + O2 1.400E+12 0.00 10810. !131 - N2O + O = NO + NO 2.900E+13 0.00 23150. !132 - N2O + H = N2 + OH 4.400E+14 0.00 18880. !133 - N2O + OH = N2 + HO2 2.000E+12 0.00 21060. !134 - N2O + M = N2 + O + M 1.300E+11 0.00 59620. !135 - N + NO = N2 + O 3.270E+12 0.30 0. !136 - N + O2 = NO + O 6.400E+09 1.00 6280. !137 - N + OH = NO + H 7.333E+13 0.00 1120. !138 -! - CH2O + O2 = HCO + HO2 6.200E+13 0.00 39000. !139 - CH2O + O = HCO + OH 4.100E+11 0.57 2760. !140 4.1 - CH2O + H = HCO + H2 2.190E+08 1.80 3000. !141 - CH2O + OH = HCO + H2O 2.430E+10 1.18 -447. !142 - CH2O + HO2 = HCO + H2O2 3.000E+12 0.00 8000. !143 - CH2O + M = CO + H2 + M 6.250E+15 0.00 69540. !144 - CH2O + M = HCO + H + M 3.300E+16 0.00 81000. !145 -!H2 + CO = CH2O 4.300E+07 1.50 79600. ! - HCO + HCO = CH2O + CO 3.010E+13 0.00 0. !146 - HCO + OH = H2O + CO 1.000E+14 0.00 0. !147 - HCO + H = H2 + CO 1.190E+13 0.30 0. !148 - HCO + O = OH + CO 3.000E+13 0.00 0. !149 - HCO + O = H + CO2 3.000E+13 0.00 0. !150 - HCO + O2 = HO2 + CO 3.300E+13 -0.40 0. !151 - HCO + M = H + CO + M 1.870E+17 -1.00 17000. !152 -!HCO + H + M = CH2O + M 1.000E+12 0.48 -260. ! - HCO + HO2 = CO2 + OH + H 3.000E+13 0.00 0. !153 - CH4 + O2 = CH3 + HO2 7.900E+13 0.00 56000. !154 -!CH3 + HO2 = CH4 + O2 1.000E+12 0.00 0. ! - CH4 + H = CH3 + H2 6.600E+08 1.60 10840. !155 - CH4 + OH = CH3 + H2O 1.600E+06 2.10 2460. !156 - CH4 + O = CH3 + OH 1.020E+09 1.50 8604. !157 - CH4 + HO2 = CH3 + H2O2 1.000E+13 0.00 18700. !158 - CH4 + CH2 = CH3 + CH3 4.000E+12 0.00 -570. !159 - CH3 + CH2O = CH4 + HCO 5.500E+03 2.80 6000. !160 - CH3 + HCO = CH4 + CO 1.200E+14 0.00 0. !161 - CH3 + H = CH4 1.900E+36 -7.00 9050. !162 - CH3 + H = CH2 + H2 9.000E+13 0.00 15100. !163 - CH3 + CH3O = CH4 + CH2O 3.300E+14 0.00 0. !164 3.3 -!CH3 + CH3 = C2H6 2.700D+53 -12.0 19400. ! - CH3 + CH3 (+M) = C2H6 (+M) 2.120E+16 -0.97 620. !165 - LOW / 1.770E+50 -9.670 6220.00/ - TROE/ 0.5325 151.00 1038.00 4970.00 / - H2/2.0/ H2O/6.0/ CH4/2.0/ CO/1.5/ CO2/2.0/ C2H6/3.0/ N2/0.7/ - CH3 + CH3 = C2H5 + H 4.990E+12 .100 10600. !166 -!CH2 + H2 = CH3 + H 5.000E+05 2.00 7230. ! - CH2 + OH = CH2O + H 2.500E+13 0.00 0. !167 - CH2 + O2 = HCO + OH 4.300E+10 0.00 -500. !168 - CH2 + O2 = CO2 + H2 6.900E+11 0.00 500. !169 - CH2 + O2 = CO + H2O 2.000E+10 0.00 -1000. !170 - CH2 + O2 = CH2O + O 5.000E+13 0.00 9000. !171 - CH2 + O2 = CO2 + H + H 1.600E+12 0.00 1000. !172 - CH2 + O2 = CO + OH + H 8.600E+10 0.00 -500. !173 - CH2 + CH2 = C2H2 + H2 1.200E+13 0.0 800. !174 - CH2 + CH2 = C2H2 + H + H 1.200E+14 0.0 800. !175 - CH2 + CO2 = CH2O + CO 1.000E+11 0.00 1000. !176 - CH3 + HCO = CH2O + CH2 3.000E+13 0.00 0. !177 - CH3 + C2H4 = CH4 + C2H3 6.620E+00 3.70 9482. !178 - CH3 + CH3 = C2H4 + H2 1.000E+15 0.00 31000. !179 - CH3 + CH2 = C2H4 + H 3.000E+13 0.00 -570. !180 - C2H4 + H = C2H3 + H2 1.100E+14 0.00 8500. !181 - C2H4 + O = CH3 + HCO 1.600E+09 1.20 746. !182 - C2H4 + O = CH2O + CH2 3.000E+04 1.88 180. !183 - C2H4 + O = C2H3 + OH 1.510E+07 1.91 3790. !184 - C2H4 + OH = CH2O + CH3 6.000E+13 0.0 960. !185 ! 13 - C2H4 + HO2 = C2H3 + H2O2 7.100E+11 0.0 17110. !186 - C2H4 + OH = C2H3 + H2O 6.020E+13 0.00 5955. !187 ! 6.02 5955 - C2H4 + M = C2H2 + H2 + M 1.500E+15 0.00 55800. !188 - C2H4 + M = C2H3 + H + M 2.600E+17 0.0 96570. !189 - C2H4 + H = C2H5 2.600E+43 -9.25 52580. !190 - C2H6 + O2 = C2H5 + HO2 1.000E+13 0.00 48960. !191 - C2H5 + O2 = C2H4 + HO2 2.000E+10 0.0 -2200. !192 - C2H4 + O2 = C2H3 + HO2 4.200E+14 0.00 57590. !193 ! 14 - C2H4 + C2H4 = C2H5 + C2H3 5.000E+14 0.0 64700. !194 ! 14 - C2H5 + HO2 = C2H4 + H2O2 3.000E+11 0.00 0. !195 - C2H2 + O2 = HCO + HCO 4.000E+12 0.00 28000. !196 2.0 - C2H2 + O = CH2 + CO 1.020E+07 2.00 1900. !197 - C2H2 + H + M = C2H3 + M 5.540E+12 0.00 2410. !198 - C2H3 + H = C2H2 + H2 4.000E+13 0.00 0. !199 - C2H3 + O2 = CH2O + HCO 4.000E+12 0.00 -250. !200 - C2H3 + OH = C2H2 + H2O 3.000E+13 0.00 0. !201 - C2H3 + CH2 = C2H2 + CH3 3.000E+13 0.00 0. !202 - C2H3 + HCO = C2H4 + CO 6.034E+13 0.0 0. !203 - C2H3 + C2H3 = C2H2 + C2H4 1.450E+13 0.0 0. !204 - C2H3 + O = C2H2 + OH 1.000E+13 0.0 0. !205 - C2H2 + OH = CH3 + CO 4.830E-04 4.00 -2000. !206 - C2H2 + CH2 = C3H3 + H 1.200E+13 0.0 6620. !207 - C3H3 + OH = C3H2 + H2O 1.000E+13 0.0 0. !208 - C3H3 + O = CH2O + C2H 1.000E+13 0.0 0. !209 - C2H3 = C2H2 + H 4.600E+40 -8.80 46200. !210 -! - C2H2 = C2H + H 2.373E+32 -5.28 130688. !211 - C2H + O2 = HCO + CO 5.000E+13 0.00 1500. !212 - C2H + H2 = H + C2H2 4.900E+05 2.50 560.0 !213 - C2H2 + O = C2H + OH 4.600E+19 -1.41 28950.0 !214 - C2H2 + OH = C2H + H2O 3.370E+07 2.00 14000.0 !215 - C2H2 + C2H = C4H2 + H 9.600E+13 0.00 0.0 !216 - C3H4 + O = C2H3 + HCO 3.200E+12 0.00 2.01E+3!217 - C3H4 + O = C2H4 + CO 3.200E+12 0.00 2.01E+3!218 - C3H4 + O = HCCO + CH3 6.300E+12 0.00 2.01E+3!219 -! -! Reactions of C4H and C4H2 -! - C4H + H2 = H + C4H2 4.900E+05 2.5 560.0 !220 - C4H2 + OH = C4H + H2O 3.370E+07 2.0 14000.0 !221 - C4H2 + O = C3H2 + CO 2.700E+13 0.0 1720.0 !222 Wellman - C3H2 + O = C2H2 + CO 6.800E+13 0.0 0.0 !223 - C3H2 + OH = HCO + C2H2 6.800E+13 0.0 0.0 !224 - C2H2 + C2H = C4H3 4.500E+37 -7.68 7100.0 !225 - C3H2 + CH2 = C4H3 + H 5.000E+13 0.0 0.0 !226 - C4H2 + H = C4H3 1.100E+42 -8.72 15300.0 !227 - C4H3 + H = C2H2 + C2H2 6.300E+25 -3.34 10014.0 !228 - C4H3 + H = C4H2 + H2 1.500E+13 0.00 0.0 !229 - C4H3 + OH = C4H2 + H2O 2.500E+12 0.00 0.0 !230 -! - C2H2 + HCCO = C3H3 + CO 1.000E+11 0.000 3000.0 !231 Miller-Bowman - C3H2 + O2 = HCCO + CO + H 5.000E+13 0.000 0.0 !232 Miller-Melius - HCCO+O = H+CO+CO 1.000E+14 0.000 0.0 !233 - HCCO+O2 = OH+2CO 3.200E+12 0.000 854.0 !234 - HCCO+CH2 = C2H3+CO 3.000E+13 0.000 0.0 !235 - HCCO+HCCO = C2H2+CO+CO 1.000E+13 0.000 0.0 !236 - C2H+OH = H+HCCO 2.000E+13 0.000 0.0 !237 - CH2+CO(+M) = CH2CO(+M) 8.100E+11 0.500 4510.0 !238 - LOW / 2.690E+33 -5.110 7095.00/ - TROE/ 0.5907 275.00 1226.00 5185.00 / - H2/2.0/ H2O/6.0/ CH4/2.0/ CO/1.5/ CO2/2.0/ C2H6/3.0/ N2/0.7/ - C2H2+OH = CH2CO+H 2.180E-04 4.500 -1000.0 !239 - CH2CO+H = HCCO+H2 5.000E+13 0.000 8000.0 !240 - CH2CO+H = CH3+CO 1.130E+13 0.000 3428.0 !241 - CH2CO+O = HCCO+OH 5.000E+13 0.000 8000.0 !242 - CH2CO+O = CH2+CO2 1.750E+12 0.000 1350.0 !243 - CH2CO+OH = HCCO+H2O 7.500E+12 0.000 2000.0 !244 - C2H3+O = CH2CO+H 3.000E+13 0.000 0.0 !245 - C3H3 + O2 = CH2CO + HCO 3.000E+10 0.0 2878.0 !246 Gutman - C4H3 + O2 = HCCO + CH2CO 7.860E+16 -1.80 0.0 !247 Gutman -!C4H3 + C2H2 = A1- 1.900E+63 -15.25 30600.0 ! -!A1 + H = A1- + H2 2.500E+14 0.0 16000. ! Kiefer -!A1 + OH = A1- + H2O 1.600E+08 1.42 1450. ! CEC -!A1- + H (+M) = A1 (+M) 1.000E+14 0.00 0. ! RRKM -! LOW/ 6.6E+75 -16.30 7000. / -! TROE / 1.0 0.1 584.9 6113. / -! H2/2.0/ H2O/6.0/ CH4/2.0/ CO/1.5/ CO2/2.0/ C2H6/3.0/ -! soot formation -!C3H3 + C3H3 = A1 2.000E+10 0.0 0.0 ! -!A1 = 6C(S)+3H2 2.000E+10 0.0 0.0 ! -!C4H2 = 4C(S)+H2 2.000E+10 0.0 0.0 ! -!C(S)+C2H2=>3C(S)+H2 2.000E+10 0.0 0.0 ! -!C2H2 = 2C(S)+H2 2.000E+10 0.0 0.0 ! -! - O+CH2OH<=>OH+CH2O 1.000E+13 .000 .00!248 - H+CH2O(+M)<=>CH2OH(+M) 5.400E+11 .454 3600.00!249 - LOW / 1.270E+32 -4.820 6530.00/ - TROE/ .7187 103.00 1291.00 4160.00 / - H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ N2/0.7/ - H+CH2OH<=>H2+CH2O 2.000E+13 .000 .00!250 - H+CH2OH<=>OH+CH3 1.650E+11 .650 -284.00!251 - H+CH3O<=>H+CH2OH 4.150E+07 1.630 1924.00!252 - C2H3+O2<=>O+CH2CHO 3.030E+11 .290 11.00!253 - C2H3+O2<=>HO2+C2H2 1.337E+06 1.610 -384.00!254 - O+CH3CHO<=>OH+CH2CHO 2.920E+12 .000 1808.00!255 - O+CH3CHO=>OH+CH3+CO 2.920E+12 .000 1808.00!256 - O2+CH3CHO=>HO2+CH3+CO 3.010E+13 .000 39150.00!257 - H+CH3CHO<=>CH2CHO+H2 2.050E+09 1.160 2405.00!258 - H+CH3CHO=>CH3+H2+CO 2.050E+09 1.160 2405.00!259 - OH+CH3CHO=>CH3+H2O+CO 2.343E+10 0.730 -1113.00!260 - HO2+CH3CHO=>CH3+H2O2+CO 3.010E+12 .000 11923.00!261 - CH3+CH3CHO=>CH3+CH4+CO 2.720E+06 1.770 5920.00!262 - H+CH2CO(+M)<=>CH2CHO(+M) 4.865E+11 0.422 -1755.00!263 - LOW/ 1.012E+42 -7.63 3854.0/ - TROE/ 0.465 201.0 1773.0 5333.0 / - H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ N2/ .70/ - O+CH2CHO=>H+CH2+CO2 1.500E+14 .000 .00!264 - O2+CH2CHO=>OH+CO+CH2O 1.810E+10 .000 .00!265 - O2+CH2CHO=>OH+2HCO 2.350E+10 .000 .00!266 - H+CH2CHO<=>CH3+HCO 2.200E+13 .000 .00!267 - H+CH2CHO<=>CH2CO+H2 1.100E+13 .000 .00!268 - OH+CH2CHO<=>H2O+CH2CO 1.200E+13 .000 .00!269 - OH+CH2CHO<=>HCO+CH2OH 3.010E+13 .000 .00!270 -! - C3H8(+M)=C2H5+CH3(+M) 9.90E+22 -1.6 84429.0 !271 Tsang 1988 - LOW / 2.237E+27 -2.88 67448.0 / ! Al-Alami 1983 - TROE /1.0 1.0E-15 1500.0 1.0E+15/ - H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ N2/ .70/ C3H8/4.0/ - O+C3H8<=>OH+C3H7 1.930E+05 2.680 3716.00!272 - H+C3H8<=>C3H7+H2 1.020E+06 2.340 6756.00!273 - OH+C3H8<=>C3H7+H2O 3.160E+07 1.800 934.00!274 - C3H7+H2O2<=>HO2+C3H8 3.780E+02 2.720 1500.00!275 - CH3+C3H8<=>C3H7+CH4 0.903E+00 3.650 7154.00!276 - C3H8+C2H5=C3H7+C2H6 9.000E-01 3.650 9140.00!277 - C3H8+C2H3=C3H7+C2H4 6.000E+02 3.300 10502.00!278 - CH3+C2H4(+M)<=>C3H7(+M) 2.550E+06 1.600 5700.00!279 - LOW/ 3.00E+63 -14.6 18170./ - TROE/ .1894 277.0 8748.0 7891.0 / - H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ N2/0.70/ C3H8/4.0/ - O+C3H7<=>C2H5+CH2O 9.640E+13 .000 .00!280 - H+C3H7(+M)<=>C3H8(+M) 3.613E+13 .000 .00!281 - LOW/ 4.420E+61 -13.545 11357.0/ - TROE/ .315 369.0 3285.0 6667.0 / - H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ N2/0.70/ - H+C3H7<=>CH3+C2H5 4.060E+06 2.190 890.00!282 - CH2+C3H8=CH3+C3H7 1.500E+0 3.460 7470.00!283 - OH+C3H7<=>C2H5+CH2OH 2.410E+13 .000 .00!284 - HO2+C3H7<=>O2+C3H8 2.550E+10 0.255 -943.00!285 - HO2+C3H7=>OH+C2H5+CH2O 2.410E+13 .000 .00!286 - CH3+C3H7<=>2C2H5 1.927E+13 -0.320 .00!287 - C3H7+CH3 <=> CH4+C3H6 1.100E+13 0.000 0.0 !288 TS3 - C3H6+C2H5=C3H5+C2H6 2.230E+00 3.500 6640.0 !289 - C3H6+O = CH3+CH3CO 6.800E+04 2.560 -1.13E+3!290 -END diff --git a/tutorials/combustion/dieselFoam/aachenBomb/chemkin/chem.inp_15 b/tutorials/combustion/dieselFoam/aachenBomb/chemkin/chem.inp_15 deleted file mode 100644 index 2813f65f71a6bfc602319a5affb2a53ef9e4d61c..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/chemkin/chem.inp_15 +++ /dev/null @@ -1,60 +0,0 @@ -ELEMENTS - H O C N AR -END -SPECIE -C7H16 O2 N2 CO H2O -O CO2 OH H H2 -HO2 H2O2 N NO C -END -REACTIONS - C7H16 + 11O2 => 7CO2 + 8H2O 1.00E+8 0.0 15780.0! 1 - FORD / C7H16 0.25 / - FORD / O2 1.5 / - CO + O + M = CO2 + M 6.170E+14 0.00 3000. ! 96 - CO + OH = CO2 + H 3.510E+07 1.30 -758. ! 97 - CO + O2 = CO2 + O 1.600E+13 0.00 41000. ! 98 - HO2 + CO = CO2 + OH 5.800E+13 0.00 22930. ! 99 -! - H2 + O2 = OH + OH 1.700E+13 0.00 47780. !100 - H2 + OH = H2O + H 1.170E+09 1.30 3626. !101 - O + OH = O2 + H 4.000E+14 -0.50 0. !102 - O + H2 = OH + H 5.060E+04 2.67 6290. !103 - H + HO2 = O + H2O 3.100E+10 0.00 3590. !104 - O + OH + M = HO2 + M 1.000E+16 0.00 0. !105 - H2O/6.0/ CO2/5.0/ H2/3.3/ CO/2.0/ N2/0.70/ - H + O2 + M = HO2 + M 2.800E+18 -.86 0.0!106 - O2/0.00/ H2O/ .00/ CO/0.75/ CO2/1.50/ N2/0.0/ - H + O2 + O2 = HO2 + O2 2.080E+19 -1.24 0.0!107 - H + O2 + H2O = HO2 + H2O 11.26E+18 -.76 0.0!108 - H + O2 + N2 = HO2 + N2 2.600E+19 -1.24 0.0!109 - OH + HO2 = H2O + O2 7.500E+12 0.00 0. !110 - H + HO2 = OH + OH 1.700E+14 0.0 875. !111 - O + HO2 = O2 + OH 1.400E+13 0.00 1073. !112 - OH + OH = O + H2O 6.000E+08 1.30 0. !113 - H + H + M = H2 + M 1.000E+18 -1.00 0. !114 - H2/0./ H2O/0./ CO2/0./ - H + H + H2 = H2 + H2 9.200E+16 -0.60 0. !115 - H + H + H2O = H2 + H2O 6.000E+19 -1.25 0. !116 - H + H + CO2 = H2 + CO2 5.490E+20 -2.00 0. !117 - H + OH + M = H2O + M 1.600E+22 -2.00 0. !118 - H + O + M = OH + M 6.200E+16 -0.60 0. !119 - O + O + M = O2 + M 1.890E+13 0.00 -1788. !120 - H + HO2 = H2 + O2 1.250E+13 0.00 0. !121 - HO2 + HO2 = H2O2 + O2 2.000E+12 0.00 0. !122 - OH + OH (+M) = H2O2 (+M) 7.600E+13 -.37 0. !123 - LOW / 4.300E+18 -.900 -1700.00/ - TROE/ .7346 94.00 1756.00 5182.00 / - H2/2.00/ H2O/6.00/ CO/1.50/ CO2/2.00/ N2/0.70/ - H2O2 + H = HO2 + H2 1.600E+12 0.00 3800. !124 - H2O2 + OH = H2O + HO2 1.000E+13 0.00 1800. !125 - H2O2 + H = H2O + OH 1.000E+13 0.00 3590. !126 - H2O2 + O = H2O + O2 8.400E+11 0.00 4260. !127 - H2O2 + O = OH + HO2 2.000E+13 0.00 5900. !128 - H2 + HO2 = H2O + OH 6.500E+11 0.00 18800. !129 -! - CO2 + N = NO + CO 1.900E+11 0.00 3400. !130 - N + NO = N2 + O 3.270E+12 0.30 0. !136 - N + O2 = NO + O 6.400E+09 1.00 6280. !137 - N + OH = NO + H 7.333E+13 0.00 1120. !138 -! -END diff --git a/tutorials/combustion/dieselFoam/aachenBomb/constant/chemistryProperties b/tutorials/combustion/dieselFoam/aachenBomb/constant/chemistryProperties deleted file mode 100644 index 301b1cee986ba60964e01f817424224a94332b33..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/constant/chemistryProperties +++ /dev/null @@ -1,45 +0,0 @@ -/*--------------------------------*- 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 dictionary; - location "constant"; - object chemistryProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -psiChemistryModel ODEChemistryModel<gasThermoPhysics>; - -chemistry on; - -chemistrySolver ode; - -initialChemicalTimeStep 1e-07; - -sequentialCoeffs -{ - cTauChem 0.001; -} - -EulerImplicitCoeffs -{ - cTauChem 0.05; - equilibriumRateLimiter off; -} - -odeCoeffs -{ - solver SIBS; - eps 0.05; - scale 1; -} - - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/constant/injectorProperties b/tutorials/combustion/dieselFoam/aachenBomb/constant/injectorProperties deleted file mode 100644 index c48bd25d585724775c05bb6e7240ea8fc3f14253..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/constant/injectorProperties +++ /dev/null @@ -1,139 +0,0 @@ -/*--------------------------------*- 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 dictionary; - location "constant"; - object injectorProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -( - { - injectorType unitInjector; - - unitInjectorProps - { - position (0 0.0995 0); - direction (0 -1 0); - diameter 0.00019; - Cd 0.9; - mass 6e-06; - nParcels 5000; - - X - ( - 1.0 - ); - - massFlowRateProfile - ( - (0 0.1272) - (4.16667e-05 6.1634) - (8.33333e-05 9.4778) - (0.000125 9.5806) - (0.000166667 9.4184) - (0.000208333 9.0926) - (0.00025 8.7011) - (0.000291667 8.2239) - (0.000333333 8.0401) - (0.000375 8.845) - (0.000416667 8.9174) - (0.000458333 8.8688) - (0.0005 8.8882) - (0.000541667 8.6923) - (0.000583333 8.0014) - (0.000625 7.2582) - (0.000666667 7.2757) - (0.000708333 6.968) - (0.00075 6.7608) - (0.000791667 6.6502) - (0.000833333 6.7695) - (0.000875 5.5774) - (0.000916667 4.8649) - (0.000958333 5.0805) - (0.001 4.9547) - (0.00104167 4.5613) - (0.00108333 4.4536) - (0.001125 5.2651) - (0.00116667 5.256) - (0.00120833 5.1737) - (0.00125 3.9213) - ); - - temperatureProfile - ( - (0.0 320.0) - (0.00125 320.0) - ); - - - } - - commonRailInjectorProps - { - position (0 0.0995 0); - direction (0 -1 0); - diameter 0.00019; - mass 6e-06; - injectionPressure 200.0e+5; - temperature 320; - nParcels 5000; - - X - ( - 1.0 - ); - - massFlowRateProfile - ( - (0 0.1272) - (4.16667e-05 6.1634) - (8.33333e-05 9.4778) - (0.000125 9.5806) - (0.000166667 9.4184) - (0.000208333 9.0926) - (0.00025 8.7011) - (0.000291667 8.2239) - (0.000333333 8.0401) - (0.000375 8.845) - (0.000416667 8.9174) - (0.000458333 8.8688) - (0.0005 8.8882) - (0.000541667 8.6923) - (0.000583333 8.0014) - (0.000625 7.2582) - (0.000666667 7.2757) - (0.000708333 6.968) - (0.00075 6.7608) - (0.000791667 6.6502) - (0.000833333 6.7695) - (0.000875 5.5774) - (0.000916667 4.8649) - (0.000958333 5.0805) - (0.001 4.9547) - (0.00104167 4.5613) - (0.00108333 4.4536) - (0.001125 5.2651) - (0.00116667 5.256) - (0.00120833 5.1737) - (0.00125 3.9213) - ); - - injectionPressureProfile - ( - (0.0 1.0) - (0.00125 1.0) - ); - } - } -) - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/constant/polyMesh/blockMeshDict b/tutorials/combustion/dieselFoam/aachenBomb/constant/polyMesh/blockMeshDict deleted file mode 100644 index b0e0ab0c74bfd1bf54ff0effff14251dc06cc5c8..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/constant/polyMesh/blockMeshDict +++ /dev/null @@ -1,61 +0,0 @@ -/*--------------------------------*- 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 dictionary; - object blockMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -convertToMeters 0.001; - -vertices -( - (-10 0 -10) - (-10 0 10) - (10 0 10) - (10 0 -10) - (-10 100 -10) - (-10 100 10) - (10 100 10) - (10 100 -10) -); - -blocks -( - hex (0 1 2 3 4 5 6 7) (41 41 100) simpleGrading (1 1 1) -); - -edges -( -); - -boundary -( - walls - { - type wall; - faces - ( - (2 6 5 1) - (0 4 7 3) - (0 1 5 4) - (4 5 6 7) - (7 6 2 3) - (3 2 1 0) - ); - } -); - -mergePatchPairs -( -); - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/constant/polyMesh/boundary b/tutorials/combustion/dieselFoam/aachenBomb/constant/polyMesh/boundary deleted file mode 100644 index 5e28555623fa8687c821f1ff8ff76939fe33007a..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/constant/polyMesh/boundary +++ /dev/null @@ -1,28 +0,0 @@ -/*--------------------------------*- 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 binary; - class polyBoundaryMesh; - location "constant/polyMesh"; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -1 -( - walls - { - type wall; - nFaces 19762; - startFace 494419; - } -) - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/constant/sprayProperties b/tutorials/combustion/dieselFoam/aachenBomb/constant/sprayProperties deleted file mode 100644 index 17927e724bb2e8ad73297787b9939c8d71d73399..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/constant/sprayProperties +++ /dev/null @@ -1,152 +0,0 @@ -/*--------------------------------*- 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 dictionary; - location "constant"; - object sprayProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -interpolationSchemes -{ - U cellPoint; - rho cell; - p cell; - T cell; -} - -subCycles 2; - -atomizationModel off; - -includeOscillation yes; - -breakupModel ReitzKHRT; - -injectorModel hollowConeInjector; - -collisionModel off; - -evaporationModel standardEvaporationModel; - -heatTransferModel RanzMarshall; - -dispersionModel off; - -dragModel standardDragModel; - -wallModel reflect; - -specConstAtomizationCoeffs -{ - dropletNozzleDiameterRatio ( 0.4 ); - sprayAngle ( 10 ); -} - -TABCoeffs -{ - y0 0; - yDot0 0; - Cmu 10; - Comega 8; - WeCrit 12; -} - -ETABCoeffs -{ - Cmu 10; - Comega 8; - WeCrit 12; - k1 0.2; - k2 0.2; - WeTransition 100; -} - -ReitzDiwakarCoeffs -{ - Cbag 6; - Cb 0.785; - Cstrip 0.5; - Cs 10; -} - -ReitzKHRTCoeffs -{ - B0 0.61; - B1 40; - Ctau 1; - CRT 0.1; - msLimit 0.2; - WeberLimit 6; -} - -trajectoryCoeffs -{ - cSpace 1; - cTime 0.3; -} - -standardDragModelCoeffs -{ - preReFactor 0.166667; - ReExponent 0.666667; - ReLimiter 1000; - CdLimiter 0.44; - Cdistort 2.632; -} - -standardEvaporationModelCoeffs -{ - evaporationScheme explicit; - preReScFactor 0.6; - ReExponent 0.5; - ScExponent 0.333333; -} - -RanzMarshallCoeffs -{ - preRePrFactor 0.6; - ReExponent 0.5; - PrExponent 0.333333; -} - -hollowConeInjectorCoeffs -{ - sizeDistribution - { - type RosinRammler; - RosinRammlerDistribution - { - minValue 1e-06; - maxValue 0.00015; - d 0.00015; - n 3; - } - - exponentialDistribution - { - minValue 0.0001; - maxValue 0.001; - lambda ( 10000 ); - } - } - - innerConeAngle ( 0 ); - outerConeAngle ( 20 ); -} - -reflectCoeffs -{ - elasticity 0.9; -} - - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/constant/thermophysicalProperties b/tutorials/combustion/dieselFoam/aachenBomb/constant/thermophysicalProperties deleted file mode 100644 index ca864bbe3d9426c814fb76203ee0bea990eab57b..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/constant/thermophysicalProperties +++ /dev/null @@ -1,37 +0,0 @@ -/*--------------------------------*- 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 dictionary; - location "constant"; - object thermophysicalProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -thermoType hsPsiMixtureThermo<reactingMixture<gasThermoPhysics>>; - -CHEMKINFile "$FOAM_CASE/chemkin/chem.inp"; - -CHEMKINThermoFile "~OpenFOAM/thermoData/therm.dat"; - -inertSpecie N2; - -liquidComponents ( C7H16 ); - -liquidProperties -{ - C7H16 - { - defaultCoeffs yes; - } -} - - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/system/controlDict b/tutorials/combustion/dieselFoam/aachenBomb/system/controlDict deleted file mode 100644 index 5ec5b0478cc2d6679b004031b7b135db61f9b3f8..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/system/controlDict +++ /dev/null @@ -1,53 +0,0 @@ -/*--------------------------------*- 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 dictionary; - location "system"; - object controlDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -application dieselFoam; - -startFrom startTime; - -startTime 0; - -stopAt endTime; - -endTime 0.01; - -deltaT 2.5e-06; - -writeControl adjustableRunTime; - -writeInterval 5e-05; - -purgeWrite 0; - -writeFormat binary; - -writePrecision 6; - -writeCompression off; - -timeFormat general; - -timePrecision 6; - -adjustTimeStep yes; - -maxCo 0.1; - -runTimeModifiable true; - - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/system/fvSchemes b/tutorials/combustion/dieselFoam/aachenBomb/system/fvSchemes deleted file mode 100644 index 2947a501369f5e8da17ed978e51deeee19a93666..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/system/fvSchemes +++ /dev/null @@ -1,77 +0,0 @@ -/*--------------------------------*- 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 dictionary; - location "system"; - object fvSchemes; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -ddtSchemes -{ - default Euler; -} - -gradSchemes -{ - default Gauss linear; - grad(p) Gauss linear; -} - -divSchemes -{ - default none; - div(phi,rho) Gauss limitedLinear 1; - div(phi,U) Gauss limitedLinearV 1; - div(phiU,p) Gauss linear; - div(phi,k) Gauss limitedLinear 1; - div(phi,epsilon) Gauss limitedLinear 1; - div(phi,Yi_h) Gauss upwind; - div(phi,fu_ft_h) Gauss multivariateSelection - { - fu limitedLinear 1; - ft limitedLinear 1; - hs limitedLinear 1; - }; - div((muEff*dev2(T(grad(U))))) Gauss linear; -} - -laplacianSchemes -{ - default Gauss linear corrected; - laplacian(muEff,U) Gauss linear corrected; - laplacian(muEff,ft) Gauss linear corrected; - laplacian(muEff,fu) Gauss linear corrected; - laplacian(((alphah*mut)+alpha),hs) Gauss linear corrected; - laplacian((rho|A(U)),p) Gauss linear corrected; - laplacian(rhoD,k) Gauss linear corrected; - laplacian(rhoD,epsilon) Gauss linear corrected; -} - -interpolationSchemes -{ - default linear; - interpolate(HbyA) linear; -} - -snGradSchemes -{ - default corrected; -} - -fluxRequired -{ - default no; - p; -} - - -// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/system/fvSolution b/tutorials/combustion/dieselFoam/aachenBomb/system/fvSolution deleted file mode 100644 index 611541ade20ec84cc9e861b8bfaaea48a901d35e..0000000000000000000000000000000000000000 --- a/tutorials/combustion/dieselFoam/aachenBomb/system/fvSolution +++ /dev/null @@ -1,79 +0,0 @@ -/*--------------------------------*- 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 dictionary; - location "system"; - object fvSolution; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -solvers -{ - "(p|rho)" - { - solver PCG; - preconditioner DIC; - tolerance 1e-09; - relTol 0.1; - } - - "(p|rho)Final" - { - $p; - tolerance 1e-09; - relTol 0; - } - - "(k|epsilon)" - { - solver PBiCG; - preconditioner DILU; - tolerance 1e-06; - relTol 0.1; - } - - "(k|epsilon)Final" - { - $k; - tolerance 1e-06; - relTol 0; - } - - "(U|hs)" - { - solver PBiCG; - preconditioner DILU; - tolerance 1e-06; - relTol 0.1; - } - - "(U|hs)Final" - { - $U; - tolerance 1e-06; - relTol 0; - } - - Yi - { - $hsFinal; - } -} - -PIMPLE -{ - nOuterCorrectors 1; - nCorrectors 2; - nNonOrthogonalCorrectors 0; -} - - -// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/Allrun b/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/Allrun deleted file mode 100755 index ef3b6603482809bcb0987a0e11c4a37df13b78e2..0000000000000000000000000000000000000000 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/Allrun +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -. $WM_PROJECT_DIR/bin/tools/RunFunctions - -# Get application name -application=`getApplication` - -cp -r 0.org 0 -runApplication blockMesh - -runApplication setSet -batch baffle.setSet - -unset FOAM_SETNAN -unset FOAM_SIGFPE - -# Add the patches for the baffles -runApplication changeDictionary -literalRE -rm log.changeDictionary - -# Create first baffle -createBaffles baffleFaces '(baffle1Wall_0 baffle1Wall_1)' -overwrite > log.createBaffles 2>&1 -# Create second baffle -createBaffles baffleFaces2 '(baffle2Wall_0 baffle2Wall_1)' -overwrite > log.createBaffles 2>&1 - -# Reset proper values at the baffles -runApplication changeDictionary - -runApplication $application diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/baffle.setSet b/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/baffle.setSet deleted file mode 100644 index 89be31e65e3839d150cf49aad44b84408862fca3..0000000000000000000000000000000000000000 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/baffle.setSet +++ /dev/null @@ -1,6 +0,0 @@ -# Create face set -faceSet baffleFaces new boxToFace (0.29 0 0) (0.31 0.18 2) -faceZoneSet baffleFaces new setToFaceZone baffleFaces - -faceSet baffleFaces2 new boxToFace (0.59 0.0 0.0)(0.61 0.18 2.0) -faceZoneSet baffleFaces2 new setToFaceZone baffleFaces2 diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/constant/g b/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/constant/g deleted file mode 100644 index e0ac2653b5b370ad62f6770588121d30cac51627..0000000000000000000000000000000000000000 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/constant/g +++ /dev/null @@ -1,22 +0,0 @@ -/*--------------------------------*- 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 uniformDimensionedVectorField; - location "constant"; - object g; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -2 0 0 0 0]; -value ( 0 -9.81 0 ); - - -// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/T b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/T similarity index 95% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/T rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/T index 92fbe4aaac1a0b84bdf24d482a9f61a8a007b046..8fbb73eff0a77df2dfa7f1c74c43b77a3fc5c5b6 100644 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/T +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/T @@ -44,6 +44,10 @@ boundaryField { type empty; } + "baffle1Wall.*" + { + type calculated; + } } diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/U b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/U similarity index 95% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/U rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/U index 01f67a17395b676e7585bae74ae32f46b9d555a8..e24d69c2022ae1a42c3d805c4c58a86dd383b0cd 100644 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/U +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/U @@ -46,6 +46,10 @@ boundaryField { type empty; } + "baffle1Wall.*" + { + type calculated; + } } diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/alphat b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/alphat similarity index 95% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/alphat rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/alphat index 3bc99dd80842ce5c24663ff2f90700cf992ae00b..977203512af76a1a6b6069e46a79016ceed42041 100644 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/alphat +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/alphat @@ -45,6 +45,10 @@ boundaryField { type empty; } + "baffle1Wall.*" + { + type calculated; + } } diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/fu b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/baffleRegion/Q similarity index 90% rename from tutorials/combustion/dieselFoam/aachenBomb/0/fu rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/baffleRegion/Q index 67f573596d6ba477eb734462e242781fb889af1b..d5a2ba9cfd78def195cf153e7418fe8ae49b9989 100644 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/fu +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/baffleRegion/Q @@ -10,20 +10,21 @@ FoamFile version 2.0; format ascii; class volScalarField; - object fu; + object Q; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 0 0 0 0 0 0]; +dimensions [1 -1 -3 0 0 0 0]; -internalField uniform 0; +internalField uniform 17000; boundaryField { - fixedWalls + ".*" { type zeroGradient; } } + // ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/0/ft b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/baffleRegion/T similarity index 85% rename from tutorials/combustion/dieselFoam/aachenBomb/0/ft rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/baffleRegion/T index a9613f89fcc3be104d90e6677fc413c991778118..014bb7621ed9d675a3ccf2ac526e5c47c5eb36c0 100644 --- a/tutorials/combustion/dieselFoam/aachenBomb/0/ft +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/baffleRegion/T @@ -10,20 +10,18 @@ FoamFile version 2.0; format ascii; class volScalarField; - object ft; + location "0"; + object T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 0 0 0 0 0 0]; +dimensions [ 0 0 0 1 0 0 0 ]; -internalField uniform 0; +internalField uniform 300; boundaryField { - fixedWalls - { - type zeroGradient; - } } + // ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/epsilon b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/epsilon similarity index 95% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/epsilon rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/epsilon index 69f9ac68038d554c538eee00ace54ab86d56286d..21a6d42fa82dbd3969e667a7f6288a5454da2068 100644 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/epsilon +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/epsilon @@ -44,6 +44,10 @@ boundaryField { type empty; } + "baffle1Wall.*" + { + type calculated; + } } diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/k b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/k similarity index 95% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/k rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/k index 9ecfe3d9f81f3c09d5318f3d6ff78f6185e7f19a..5f4612566950433a4dea33c49bb15c141e422a22 100644 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/k +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/k @@ -44,6 +44,10 @@ boundaryField { type empty; } + "baffle1Wall.*" + { + type calculated; + } } diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/mut b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/mut similarity index 95% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/mut rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/mut index f83a004214fcb79130c0afe91bf098bb0afe6db9..41310b7ced3210d164ec057f293a1e61f2a184c8 100644 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/mut +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/mut @@ -45,6 +45,10 @@ boundaryField { type empty; } + "baffle1Wall.*" + { + type calculated; + } } diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/p b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/p similarity index 84% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/p rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/p index a4dbde342453af85286b8ec98bf1e4b2278869bb..8bbeb86853e72244e693f6d353a0f16019ac5ab1 100644 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/p +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/p @@ -24,27 +24,31 @@ boundaryField floor { type calculated; - value uniform 101325; + value $internalField; } ceiling { type calculated; - value uniform 101325; + value $internalField; } inlet { type calculated; - value uniform 101325; + value $internalField; } outlet { type calculated; - value uniform 101325; + value $internalField; } fixedWalls { type empty; } + "baffle1Wall.*" + { + type calculated; + } } diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/p_rgh b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/p_rgh similarity index 79% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/p_rgh rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/p_rgh index 320d9670ebc207b5098930ae8a6c5c357d73e2c6..94fc0bd9f339981c6d0bf17cb33f9f0a7183be4e 100644 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/0.org/p_rgh +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/0.org/p_rgh @@ -17,38 +17,38 @@ FoamFile dimensions [ 1 -1 -2 0 0 0 0 ]; -internalField uniform 0; +internalField uniform 101325; boundaryField { floor { type buoyantPressure; - gradient uniform 0; - value uniform 0; + value $internalField; } ceiling { type buoyantPressure; - gradient uniform 0; - value uniform 0; + value $internalField; } inlet { type buoyantPressure; - gradient uniform 0; - value uniform 0; + value $internalField; } outlet { type buoyantPressure; - gradient uniform 0; - value uniform 0; + value $internalField; } fixedWalls { type empty; } + "baffle1Wall.*" + { + type calculated; + } } diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/Allclean b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allclean similarity index 86% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/Allclean rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allclean index bbb2246df08410f7bb8f06844669078600886730..8bb8e3f1be4ecd3e416d9d61b8cf460ad9d70a74 100755 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/Allclean +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allclean @@ -5,6 +5,7 @@ cd ${0%/*} || exit 1 # run from this directory . $WM_PROJECT_DIR/bin/tools/CleanFunctions cleanCase +rm -rf constant/baffleRegion/polyMesh rm -rf sets 0 # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..6de4b18840f513923647e10ed3211e3520d17546 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun @@ -0,0 +1,32 @@ +#!/bin/sh +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Get application name +application=`getApplication` + +cp -r 0.org 0 +runApplication blockMesh + +runApplication topoSet + +unset FOAM_SETNAN +unset FOAM_SIGFPE + +# Create first baffle +createBaffles baffleFaces '(baffle1Wall_0 baffle1Wall_1)' -overwrite > log.createBaffles 2>&1 + +# Create region +runApplication extrudeToRegionMesh -overwrite + +# Set the BC's for the baffle +runApplication changeDictionary -dict system/changeDictionaryDict.baffle +rm log.changeDictionary + +# Set Bc's for the region baffle +runApplication changeDictionary -dict system/changeDictionaryDict.baffleRegion -literalRE +rm log.changeDictionary + +# Reset proper values at the region +runApplication changeDictionary -region baffleRegion -literalRE + +runApplication $application diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/constant/RASProperties b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/RASProperties similarity index 100% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/constant/RASProperties rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/RASProperties diff --git a/tutorials/combustion/dieselFoam/aachenBomb/constant/g b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/g similarity index 100% rename from tutorials/combustion/dieselFoam/aachenBomb/constant/g rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/g diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/constant/polyMesh/blockMeshDict b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/polyMesh/blockMeshDict similarity index 75% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/constant/polyMesh/blockMeshDict rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/polyMesh/blockMeshDict index 8f7aad9c7f2e6411061ee485c0e8680a1fa84816..dc9f8d9b4676f74b5a31681ad2c5c495ab58626b 100644 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/constant/polyMesh/blockMeshDict +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/polyMesh/blockMeshDict @@ -30,7 +30,7 @@ vertices blocks ( - hex (0 1 2 3 4 5 6 7) (40 20 1) simpleGrading (1 1 1) + hex (0 1 2 3 4 5 6 7) (50 40 1) simpleGrading (1 1 1) ); edges @@ -87,7 +87,7 @@ boundary baffle1Wall_0 { - type mappedWall; + type directMappedWall; sampleMode nearestPatchFace; sampleRegion region0; samplePatch baffle1Wall_1; @@ -98,7 +98,7 @@ boundary baffle1Wall_1 { - type mappedWall; + type directMappedWall; sampleMode nearestPatchFace; sampleRegion region0; samplePatch baffle1Wall_0; @@ -106,28 +106,6 @@ boundary offset (0 0 0); faces (); } - - baffle2Wall_0 - { - type mappedWall; - sampleMode nearestPatchFace; - sampleRegion region0; - samplePatch baffle2Wall_1; - offsetMode uniform; - offset (0 0 0); - faces (); - } - - baffle2Wall_1 - { - type mappedWall; - sampleMode nearestPatchFace; - sampleRegion region0; - samplePatch baffle2Wall_0; - offsetMode uniform; - offset (0 0 0); - faces (); - } ); mergePatchPairs diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/constant/polyMesh/boundary b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/polyMesh/boundary similarity index 58% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/constant/polyMesh/boundary rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/polyMesh/boundary index 34705fde36251e7ebaa9b3073ab8198b043d2355..058c08def36d93640ad3ebab96aff71302a74d33 100644 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/constant/polyMesh/boundary +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/polyMesh/boundary @@ -15,81 +15,61 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -9 +7 ( floor { type wall; - nFaces 40; - startFace 1526; + nFaces 50; + startFace 3896; } ceiling { type wall; - nFaces 40; - startFace 1566; + nFaces 50; + startFace 3946; } inlet { type patch; - nFaces 20; - startFace 1606; + nFaces 40; + startFace 3996; } outlet { type patch; - nFaces 20; - startFace 1626; + nFaces 40; + startFace 4036; } fixedWalls { type empty; - nFaces 1600; - startFace 1646; + nFaces 4000; + startFace 4076; } baffle1Wall_0 { - type mappedWall; - nFaces 7; - startFace 3246; + type directMappedWall; + nFaces 14; + startFace 8076; sampleMode nearestPatchFace; sampleRegion region0; samplePatch baffle1Wall_1; offsetMode uniform; - offset (0 0 0); + offset ( 0 0 0 ); + faces ( ); } baffle1Wall_1 { - type mappedWall; - nFaces 7; - startFace 3253; + type directMappedWall; + nFaces 14; + startFace 8090; sampleMode nearestPatchFace; sampleRegion region0; samplePatch baffle1Wall_0; offsetMode uniform; - offset (0 0 0); - } - baffle2Wall_0 - { - type mappedWall; - nFaces 7; - startFace 3260; - sampleMode nearestPatchFace; - sampleRegion region0; - samplePatch baffle2Wall_1; - offsetMode uniform; - offset (0 0 0); - } - baffle2Wall_1 - { - type mappedWall; - nFaces 7; - startFace 3267; - sampleMode nearestPatchFace; - sampleRegion region0; - samplePatch baffle2Wall_0; - offsetMode uniform; - offset (0 0 0); + offset ( 0 0 0 ); + faces ( ); } ) diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/constant/thermoBaffleProperties b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/thermoBaffleProperties similarity index 100% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/constant/thermoBaffleProperties rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/thermoBaffleProperties diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/thermophysicalProperties similarity index 100% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/constant/thermophysicalProperties rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/constant/thermophysicalProperties diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/baffleRegion/changeDictionaryDict b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/baffleRegion/changeDictionaryDict new file mode 100644 index 0000000000000000000000000000000000000000..6391270926844a1db3db341cc9de562c69b82335 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/baffleRegion/changeDictionaryDict @@ -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 dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictionaryReplacement +{ + T + { + boundaryField + { + "region0_to.*" + { + type compressible::temperatureThermoBaffle; + neighbourFieldName T; + K solidThermo; + KName none; + + value uniform 300; + } + baffleFaces2_side + { + type zeroGradient; + } + floor + { + type fixedValue; + value uniform 300; + } + fixedWalls + { + type empty; + } + } + } + + boundary + { + floor + { + type patch; + } + } +} + +// ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/constant/combustionProperties b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/baffleRegion/fvSchemes similarity index 73% rename from tutorials/combustion/dieselFoam/aachenBomb/constant/combustionProperties rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/baffleRegion/fvSchemes index 00c097dd7b3090c6b0f05c57e2ade838e1cf7446..3cf3fd7ea9f0524aceb07de61e051e4d843bf68c 100644 --- a/tutorials/combustion/dieselFoam/aachenBomb/constant/combustionProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/baffleRegion/fvSchemes @@ -10,21 +10,31 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; - object combustionProperties; + location "system/baffleRegion"; + object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -combustionModel PaSR<psiChemistryCombustionModel>; +ddtSchemes +{ + default steadyState; +} -active true; +divSchemes +{ + default none; +} -PaSRCoeffs +gradSchemes { - Cmix Cmix [ 0 0 0 0 0 0 0 ] 1; - turbulentReaction on; + default Gauss linear; } +laplacianSchemes +{ + default none; + laplacian(K,T) Gauss linear uncorrected; +} // ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/constant/RASProperties b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/baffleRegion/fvSolution similarity index 71% rename from tutorials/combustion/dieselFoam/aachenBomb/constant/RASProperties rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/baffleRegion/fvSolution index a4937b503a46850b2626f0d301e4a07b9f691507..2c233c4e2df4297cabd4c799169f62d9a5385952 100644 --- a/tutorials/combustion/dieselFoam/aachenBomb/constant/RASProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/baffleRegion/fvSolution @@ -10,16 +10,28 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; - object RASProperties; + location "system/baffleRegion"; + object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -RASModel kEpsilon; - -turbulence on; +solvers +{ + T + { + solver PCG; + smoother GaussSeidel; + preconditioner DIC; + tolerance 1e-06; + relTol 0; + } +} -printCoeffs on; +nNonOrthCorr 0; +relaxationFactors +{ + T 1; +} // ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/system/changeDictionaryDict b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/changeDictionaryDict similarity index 100% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/system/changeDictionaryDict rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/changeDictionaryDict diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/changeDictionaryDict.baffle b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/changeDictionaryDict.baffle new file mode 100644 index 0000000000000000000000000000000000000000..6b4a777a530d2ad349e5075ac4cc6ec6ef04c336 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/changeDictionaryDict.baffle @@ -0,0 +1,131 @@ +/*--------------------------------*- 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 dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictionaryReplacement +{ + alphat + { + boundaryField + { + "baffle1.*" + { + type alphatWallFunction; + value uniform 0; + } + } + } + epsilon + { + boundaryField + { + "baffle1.*" + { + type compressible::epsilonWallFunction; + value uniform 0.01; + } + } + } + k + { + boundaryField + { + "baffle1.*" + { + type compressible::kqRWallFunction; + value uniform 0.01; + } + } + } + mut + { + boundaryField + { + "baffle1.*" + { + type mutkWallFunction; + value uniform 0.0; + } + } + } + p + { + boundaryField + { + "baffle1.*" + { + type calculated; + value $internalField; + } + } + } + p_rgh + { + boundaryField + { + "baffle1.*" + { + type buoyantPressure; + value $internalField; + } + } + } + T + { + boundaryField + { + "baffle1Wall.*" + { + type compressible::temperatureThermoBaffle1D<constSolidThermoPhysics>; + baffleActivated yes; + thickness uniform 0.005; // thickness [m] + Qs uniform 300; // heat flux [W/m2] + transport + { + K 1.0; + } + radiation + { + sigmaS 0; + kappa 0; + emissivity 0; + } + thermodynamics + { + Hf 0; + Cp 10; + } + density + { + rho 10; + } + value uniform 300; + } + } + } + U + { + boundaryField + { + "baffle1.*" + { + type fixedValue; + value uniform (0 0 0); + } + } + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/changeDictionaryDict.baffleRegion b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/changeDictionaryDict.baffleRegion new file mode 100644 index 0000000000000000000000000000000000000000..8c6c66145c1034445aecba0b1866d5ca580ec1ed --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/changeDictionaryDict.baffleRegion @@ -0,0 +1,149 @@ +/*--------------------------------*- 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 dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictionaryReplacement +{ + alphat + { + boundaryField + { + "region0_to_.*" + { + type alphatWallFunction; + value uniform 0; + } + } + } + epsilon + { + boundaryField + { + "region0_to_.*" + { + type compressible::epsilonWallFunction; + value uniform 0.01; + } + } + } + k + { + boundaryField + { + "region0_to_.*" + { + type compressible::kqRWallFunction; + value uniform 0.01; + } + + } + } + mut + { + boundaryField + { + "region0_to_.*" + { + type mutkWallFunction; + value uniform 0.0; + } + } + } + p + { + boundaryField + { + "region0_to_.*" + { + type calculated; + value $internalField; + } + } + } + p_rgh + { + boundaryField + { + "region0_to_.*" + { + type buoyantPressure; + value $internalField; + } + + } + } + T + { + boundaryField + { + + "region0_to.*" + { + type compressible::temperatureThermoBaffle; + + // Coupled BC. + neighbourFieldName T; + K basicThermo; + KName none; + + + // Thermo baffle model + thermoBaffleModel thermoBaffle2D; + regionName baffleRegion; + infoOutput yes; + active yes; + thermoBaffle2DCoeffs + { + } + + + // Solid thermo + thermoType constSolidThermo; + + constSolidThermoCoeffs + { + //- thermo properties + rho rho [1 -3 0 0 0 0 0] 80; + Cp Cp [0 2 -2 -1 0 0 0] 15; + K K [1 1 -3 -1 0 0 0] 0.01; + + //- radiative properties + kappa kappa [0 -1 0 0 0 0 0] 0; + sigmaS sigmaS [0 -1 0 0 0 0 0] 0; + emissivity emissivity [0 0 0 0 0 0 0] 1; + + //- chemical properties + Hf Hf [0 2 -2 0 0 0 0] 0; + } + + value uniform 300; + } + } + } + U + { + boundaryField + { + "region0_to_.*" + { + type fixedValue; + value uniform (0 0 0); + } + + } + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/system/controlDict b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/controlDict similarity index 92% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/system/controlDict rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/controlDict index 19bdfee19ac1e0cb938e06db2da14f17bc587bea..bf43b31cf5738cb17bc70f5b3d5c7d30c80c1c12 100644 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/system/controlDict +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/controlDict @@ -14,9 +14,9 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application buoyantBaffleSimpleFoam; +application buoyantSimpleFoam; -startFrom latestTime; +startFrom startTime; startTime 0; @@ -44,5 +44,6 @@ timePrecision 6; runTimeModifiable true; +libs ("libthermoBaffleModels.so"); // ************************************************************************* // diff --git a/tutorials/combustion/dieselFoam/aachenBomb/constant/turbulenceProperties b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/extrudeToRegionMeshDict similarity index 63% rename from tutorials/combustion/dieselFoam/aachenBomb/constant/turbulenceProperties rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/extrudeToRegionMeshDict index 3721a46a2ead37eb2bf10434bcde59afa9fe9bf6..fd563a35d10e72d360ac3995ec147a01625d2a63 100644 --- a/tutorials/combustion/dieselFoam/aachenBomb/constant/turbulenceProperties +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/extrudeToRegionMeshDict @@ -10,12 +10,29 @@ FoamFile version 2.0; format ascii; class dictionary; - location "constant"; - object turbulenceProperties; + object extrudeToRegionMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -simulationType RASModel; +region baffleRegion; +faceZones (baffleFaces2); -// ************************************************************************* // +oneD false; + +extrudeModel linearNormal; + +nLayers 10; + +expansionRatio 1; + +adaptMesh yes; // apply directMapped to both regions + +sampleMode nearestPatchFace; + +linearNormalCoeffs +{ + thickness 0.02; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/fvSchemes similarity index 100% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/system/fvSchemes rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/fvSchemes diff --git a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/fvSolution similarity index 78% rename from tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/system/fvSolution rename to tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/fvSolution index d30cdf20b496e354128a273418811f504df1abed..ad42f98fc1a2ce425128185c2b41f13647d87c6b 100644 --- a/tutorials/heatTransfer/buoyantBaffleSimpleFoam/circuitBoardCooling/system/fvSolution +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/fvSolution @@ -35,42 +35,36 @@ solvers { solver PBiCG; preconditioner DILU; - tolerance 1e-8; - relTol 0.1; + tolerance 1e-7; + relTol 0.01; } } SIMPLE { - momentumPredictor yes; + momentumPredictor no; nNonOrthogonalCorrectors 0; pRefCell 0; pRefValue 0; residualControl { - p_rgh 1e-2; - U 1e-3; - h 1e-3; + p_rgh 5e-3; + U 3e-4; + h 3e-4; // possibly check turbulence fields - "(k|epsilon|omega)" 1e-3; + "(k|epsilon|omega)" 5e-3; } } relaxationFactors { - fields - { - rho 1.0; - p_rgh 0.7; - } - equations - { - U 0.3; - h 0.3; - "(k|epsilon|omega)" 0.7; - } + rho 1.0; + p_rgh 0.7; + U 0.7; + h 0.3; + "(k|epsilon|omega)" 0.3; } diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/topoSetDict b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/topoSetDict new file mode 100644 index 0000000000000000000000000000000000000000..36f5b003b9a063e8b8a3eeec043a6cf221388bf6 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/topoSetDict @@ -0,0 +1,89 @@ +/*--------------------------------*- 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 dictionary; + object topoSetDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + { + name baffleFaces; + type faceSet; + action new; + source boxToFace; + sourceInfo + { + box (0.296 0 0) (0.306 0.18 2); + } + } + + { + name baffleFacesSlaveCells; + type cellSet; + action new; + source boxToCell; + sourceInfo + { + box (0 0 0) (0.295 0.2 2); + } + } + + { + name baffleFaces; + type faceZoneSet; + action new; + source setsToFaceZone; + sourceInfo + { + faceSet baffleFaces; + cellSet baffleFacesSlaveCells; + } + } + + { + name baffleFaces2; + type faceSet; + action new; + source boxToFace; + sourceInfo + { + box (0.5944 0 0) (0.605 0.18 2); + } + } + + { + name baffleFacesSlaveCells2; + type cellSet; + action new; + source boxToCell; + sourceInfo + { + box (0 0 0) (0.594 0.2 2); + } + } + + { + name baffleFaces2; + type faceZoneSet; + action new; + source setsToFaceZone; + sourceInfo + { + faceSet baffleFaces2; + cellSet baffleFacesSlaveCells2; + } + } +); + +// ************************************************************************* //