diff --git a/applications/solvers/lagrangian/simpleCoalParcelFoam/Make/files b/applications/solvers/lagrangian/simpleCoalParcelFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..963e828de6ae7d953bd0d1a71fb606fa9755358f --- /dev/null +++ b/applications/solvers/lagrangian/simpleCoalParcelFoam/Make/files @@ -0,0 +1,3 @@ +simpleCoalParcelFoam.C + +EXE = $(FOAM_APPBIN)/simpleCoalParcelFoam diff --git a/applications/solvers/lagrangian/simpleCoalParcelFoam/Make/options b/applications/solvers/lagrangian/simpleCoalParcelFoam/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..efdf721ee336c85b5334d6567df83a9a051c6ef0 --- /dev/null +++ b/applications/solvers/lagrangian/simpleCoalParcelFoam/Make/options @@ -0,0 +1,57 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I${LIB_SRC}/meshTools/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ + -I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \ + -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/transportModels/compressible/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/radiation/lnInclude \ + -I$(LIB_SRC)/ODE/lnInclude \ + -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ + -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ + -I$(LIB_SRC)/combustionModels/lnInclude \ + -I$(LIB_SRC)/fvOptions/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam/simpleReactingParcelFoam + + +EXE_LIBS = \ + -lfiniteVolume \ + -lmeshTools \ + -lturbulenceModels \ + -lcompressibleTurbulenceModels \ + -llagrangian \ + -llagrangianIntermediate \ + -llagrangianTurbulence \ + -lspecie \ + -lfluidThermophysicalModels \ + -lliquidProperties \ + -lliquidMixtureProperties \ + -lsolidProperties \ + -lsolidMixtureProperties \ + -lthermophysicalFunctions \ + -lreactionThermophysicalModels \ + -lSLGThermo \ + -lchemistryModel \ + -lradiationModels \ + -lODE \ + -lregionModels \ + -lsurfaceFilmModels \ + -lcombustionModels \ + -lfvOptions \ + -lsampling \ + -lcoalCombustion + diff --git a/applications/solvers/lagrangian/simpleCoalParcelFoam/createClouds.H b/applications/solvers/lagrangian/simpleCoalParcelFoam/createClouds.H new file mode 100644 index 0000000000000000000000000000000000000000..3a371a0f1026ee6ab72481eddf62a51d0db14e9f --- /dev/null +++ b/applications/solvers/lagrangian/simpleCoalParcelFoam/createClouds.H @@ -0,0 +1,9 @@ +Info<< "\nConstructing coal cloud" << endl; +coalCloud parcels +( + "reactingCloud1", + rho, + U, + g, + slgThermo +); diff --git a/applications/solvers/lagrangian/simpleCoalParcelFoam/simpleCoalParcelFoam.C b/applications/solvers/lagrangian/simpleCoalParcelFoam/simpleCoalParcelFoam.C new file mode 100644 index 0000000000000000000000000000000000000000..5db8e7ede50284a3cbcb7b0462fa635e503499af --- /dev/null +++ b/applications/solvers/lagrangian/simpleCoalParcelFoam/simpleCoalParcelFoam.C @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2015 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 + simpleReactingParcelFoam + +Description + Steady state SIMPLE solver for laminar or turbulent flow with coal + Lagrangian parcels. + + Note: + - including run-time selectable finite volume options,e.g. sources, + constraints + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "turbulentFluidThermoModel.H" +#include "coalCloud.H" +#include "rhoCombustionModel.H" +#include "radiationModel.H" +#include "IOporosityModelList.H" +#include "fvOptions.H" +#include "SLGThermo.H" +#include "simpleControl.H" + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + + #include "createTime.H" + #include "createMesh.H" + #include "readGravitationalAcceleration.H" + + simpleControl simple(mesh); + + #include "createFields.H" + #include "createRadiationModel.H" + #include "createClouds.H" + #include "createMRF.H" + #include "createFvOptions.H" + #include "initContinuityErrs.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (simple.loop()) + { + Info<< "Time = " << runTime.timeName() << nl << endl; + + parcels.evolve(); + + // --- Pressure-velocity SIMPLE corrector loop + { + #include "UEqn.H" + #include "YEqn.H" + #include "EEqn.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/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index 2f050e26ae5f2fa35dddde19d3290b070aaae51a..5516e7c9476bf3f946865b0fd0f9aef62b678572 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -175,7 +175,6 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc const CompositionModel<reactingCloudType>& composition = td.cloud().composition(); - // Define local properties at beginning of timestep // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -291,7 +290,6 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc Cs ); - // Surface reactions // ~~~~~~~~~~~~~~~~~ @@ -324,27 +322,14 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc dhsTrans ); - // 2. Update the parcel properties due to change in mass // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ scalarField dMassGas(dMassDV + dMassSRGas); scalarField dMassLiquid(dMassPC + dMassSRLiquid); scalarField dMassSolid(dMassSRSolid); - scalar mass1 = - updateMassFractions(mass0, dMassGas, dMassLiquid, dMassSolid); - this->Cp_ = CpEff(td, pc, T0, idG, idL, idS); - - // Update particle density or diameter - if (td.cloud().constProps().constantVolume()) - { - this->rho_ = mass1/this->volume(); - } - else - { - this->d_ = cbrt(mass1/this->rho_*6.0/pi); - } + scalar mass1 = mass0 - sum(dMassGas) - sum(dMassLiquid) - sum(dMassSolid); // Remove the particle when mass falls below minimum threshold if (np0*mass1 < td.cloud().constProps().minParcelMass()) @@ -386,6 +371,18 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc return; } + (void)updateMassFractions(mass0, dMassGas, dMassLiquid, dMassSolid); + + // Update particle density or diameter + if (td.cloud().constProps().constantVolume()) + { + this->rho_ = mass1/this->volume(); + } + else + { + this->d_ = cbrt(mass1/this->rho_*6.0/pi); + } + // Correct surface values due to emitted species this->correctSurfaceValues(td, cellI, Ts, Cs, rhos, mus, Prs, kappas); Res = this->Re(U0, this->d_, rhos, mus); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C index 0d070691f01d851aef6cee897c64493957ab5494..6e52a06dba25d9a62aad70715e60a9aecc04ce95 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C @@ -215,8 +215,20 @@ void Foam::patchInjectionBase::setPositionAndCell // first face of the cell as the tetFace and the first point after // the base point on the face as the tetPt. The tracking will pick // the cell consistent with the motion in the first tracking step - tetFaceI = mesh.cells()[cellOwner][0]; - tetPtI = 1; + //tetFaceI = mesh.cells()[cellOwner][0]; + //tetPtI = 1; + + //SAF: temporary fix for patchInjection. + // This function finds both cellOwner and tetFaceI. The particle + // was injected in a non-boundary cell and the tracking function + // could not find the cellOwner + mesh.findCellFacePt + ( + position, + cellOwner, + tetFaceI, + tetPtI + ); } else {