diff --git a/applications/solvers/lagrangian/sprayFoam/Make/files b/applications/solvers/lagrangian/sprayFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..893038ce0aff2c7001c923ee5f32edae775311dc --- /dev/null +++ b/applications/solvers/lagrangian/sprayFoam/Make/files @@ -0,0 +1,3 @@ +sprayFoam.C + +EXE = $(FOAM_APPBIN)/sprayFoam diff --git a/applications/solvers/lagrangian/sprayFoam/Make/options b/applications/solvers/lagrangian/sprayFoam/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..db13329a12534ad86d01e558764ec88439db7c7f --- /dev/null +++ b/applications/solvers/lagrangian/sprayFoam/Make/options @@ -0,0 +1,50 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I${LIB_SRC}/meshTools/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ + -I$(LIB_SRC)/lagrangian/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/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/SLGThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ + -I$(LIB_SRC)/ODE/lnInclude \ + -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ + -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam + + +EXE_LIBS = \ + -lfiniteVolume \ + -lmeshTools \ + -lcompressibleTurbulenceModel \ + -lcompressibleRASModels \ + -lcompressibleLESModels \ + -llagrangian \ + -llagrangianIntermediate \ + -lspray \ + -lspecie \ + -lbasicThermophysicalModels \ + -lliquidProperties \ + -lliquidMixtureProperties \ + -lsolidProperties \ + -lsolidMixtureProperties \ + -lthermophysicalFunctions \ + -lreactionThermophysicalModels \ + -lSLGThermo \ + -lchemistryModel \ + -lradiationModels \ + -lODE \ + -lregionModels \ + -lsurfaceFilmModels \ + -lsampling diff --git a/applications/solvers/lagrangian/sprayFoam/chemistry.H b/applications/solvers/lagrangian/sprayFoam/chemistry.H new file mode 100644 index 0000000000000000000000000000000000000000..99f418af6f10ac69b44d08fc2271e2dd79c73fc4 --- /dev/null +++ b/applications/solvers/lagrangian/sprayFoam/chemistry.H @@ -0,0 +1,44 @@ +if (chemistry.chemistry()) +{ + Info<< "Solving chemistry" << endl; + + chemistry.solve + ( + runTime.value() - runTime.deltaTValue(), + runTime.deltaTValue() + ); + + // turbulent time scale + if (turbulentReaction) + { + tmp<volScalarField> tepsilon(turbulence->epsilon()); + const volScalarField& epsilon = tepsilon(); + tmp<volScalarField> tmuEff(turbulence->muEff()); + const volScalarField& muEff = tmuEff(); + tmp<volScalarField> ttc(chemistry.tc()); + const volScalarField& tc = ttc(); + + forAll(epsilon, i) + { + if (epsilon[i] > 0) + { + // Chalmers PaSR model + scalar tk = Cmix.value()*Foam::sqrt(muEff[i]/rho[i]/epsilon[i]); + kappa[i] = + (runTime.deltaTValue() + tc[i]) + /(runTime.deltaTValue() + tc[i] + tk); + } + else + { + // Return to laminar combustion + kappa[i] = 1.0; + } + } + } + else + { + kappa = 1.0; + } + + chemistrySh = kappa*chemistry.Sh()(); +} diff --git a/applications/solvers/lagrangian/sprayFoam/createClouds.H b/applications/solvers/lagrangian/sprayFoam/createClouds.H new file mode 100644 index 0000000000000000000000000000000000000000..ee0985ff709cf5a732882f424733dba62eded72b --- /dev/null +++ b/applications/solvers/lagrangian/sprayFoam/createClouds.H @@ -0,0 +1,9 @@ +Info<< "\nConstructing reacting cloud" << endl; +basicSprayCloud parcels +( + "sprayCloud", + rho, + U, + g, + slgThermo +); diff --git a/applications/solvers/lagrangian/sprayFoam/sprayFoam.C b/applications/solvers/lagrangian/sprayFoam/sprayFoam.C new file mode 100644 index 0000000000000000000000000000000000000000..5252fd3cf3905f471c46f62b1a22d6f55ef0f21d --- /dev/null +++ b/applications/solvers/lagrangian/sprayFoam/sprayFoam.C @@ -0,0 +1,119 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 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 + sprayFoam + +Description + Transient PIMPLE solver for compressible, laminar or turbulent flow with + spray parcels. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "hCombustionThermo.H" +#include "turbulenceModel.H" +#include "basicSprayCloud.H" +#include "psiChemistryModel.H" +#include "chemistrySolver.H" +#include "radiationModel.H" +#include "SLGThermo.H" +#include "pimpleControl.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + + #include "createTime.H" + #include "createMesh.H" + #include "readChemistryProperties.H" + #include "readGravitationalAcceleration.H" + #include "createFields.H" + #include "createClouds.H" + #include "createRadiationModel.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 "readTimeControls.H" + #include "compressibleCourantNo.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + parcels.evolve(); + + #include "chemistry.H" + #include "rhoEqn.H" + + // --- Pressure-velocity PIMPLE corrector loop + for (pimple.start(); pimple.loop(); pimple++) + { + #include "UEqn.H" + #include "YEqn.H" + #include "hsEqn.H" + + // --- PISO loop + for (int corr=0; corr<pimple.nCorr(); corr++) + { + #include "pEqn.H" + } + + if (pimple.turbCorr()) + { + turbulence->correct(); + } + } + + rho = thermo.rho(); + + if (runTime.write()) + { + chemistry.dQ()().write(); + } + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return(0); +} + + +// ************************************************************************* //