diff --git a/applications/solvers/combustion/reactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/createFields.H index 9e02c8de2e..21a7fac1e7 100644 --- a/applications/solvers/combustion/reactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/createFields.H @@ -1,16 +1,11 @@ Info<< "Creating reaction model\n" << endl; -autoPtr reaction +autoPtr reaction ( - combustionModels::psiChemistryCombustionModel::New - ( - mesh - ) + combustionModels::psiCombustionModel::New(mesh) ); -psiChemistryModel& chemistry = reaction->pChemistry(); - -psiReactionThermo& thermo = chemistry.thermo(); +psiReactionThermo& thermo = reaction->thermo(); basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); diff --git a/applications/solvers/combustion/reactingFoam/reactingFoam.C b/applications/solvers/combustion/reactingFoam/reactingFoam.C index 5344eea3be..f2517529e2 100644 --- a/applications/solvers/combustion/reactingFoam/reactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/reactingFoam.C @@ -31,7 +31,7 @@ Description #include "fvCFD.H" #include "turbulenceModel.H" -#include "psiChemistryCombustionModel.H" +#include "psiCombustionModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" diff --git a/applications/solvers/combustion/rhoReactingFoam/createFields.H b/applications/solvers/combustion/rhoReactingFoam/createFields.H index 5d71e0f075..f58e6e71bd 100644 --- a/applications/solvers/combustion/rhoReactingFoam/createFields.H +++ b/applications/solvers/combustion/rhoReactingFoam/createFields.H @@ -1,16 +1,11 @@ Info<< "Creating reaction model\n" << endl; -autoPtr reaction +autoPtr reaction ( - combustionModels::rhoChemistryCombustionModel::New - ( - mesh - ) + combustionModels::rhoCombustionModel::New(mesh) ); -rhoChemistryModel& chemistry = reaction->pChemistry(); - -rhoReactionThermo& thermo = chemistry.thermo(); +rhoReactionThermo& thermo = reaction->thermo(); basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); diff --git a/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C index aa8f1a5501..f3bab92f2f 100644 --- a/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C +++ b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,7 +31,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "rhoChemistryCombustionModel.H" +#include "rhoCombustionModel.H" #include "turbulenceModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C index 4c368e7cdd..6f41f328a3 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,7 @@ Description #include "fvCFD.H" #include "turbulenceModel.H" #include "basicReactingMultiphaseCloud.H" -#include "rhoChemistryCombustionModel.H" +#include "rhoCombustionModel.H" #include "radiationModel.H" #include "porousZones.H" #include "IObasicSourceList.H" diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/createFields.H index 25ceef7aa6..b78aeea132 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/createFields.H @@ -1,16 +1,11 @@ Info<< "Creating combustion model\n" << endl; - autoPtr combustion + autoPtr combustion ( - combustionModels::rhoChemistryCombustionModel::New - ( - mesh - ) + combustionModels::rhoCombustionModel::New(mesh) ); - rhoChemistryModel& chemistry = combustion->pChemistry(); - - rhoReactionThermo& thermo = chemistry.thermo(); + rhoReactionThermo& thermo = combustion->thermo(); SLGThermo slgThermo(mesh, thermo); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C index d6c61074e1..7b9dff602e 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C +++ b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,7 +39,7 @@ Description #include "turbulenceModel.H" #include "basicThermoCloud.H" #include "coalCloud.H" -#include "psiChemistryCombustionModel.H" +#include "psiCombustionModel.H" #include "IObasicSourceList.H" #include "radiationModel.H" #include "SLGThermo.H" diff --git a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H index 9a2b17f1af..22451ca108 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H @@ -1,16 +1,11 @@ Info<< "Creating combustion model\n" << endl; - autoPtr combustion + autoPtr combustion ( - combustionModels::psiChemistryCombustionModel::New - ( - mesh - ) + combustionModels::psiCombustionModel::New(mesh) ); - psiChemistryModel& chemistry = combustion->pChemistry(); - - psiReactionThermo& thermo = chemistry.thermo(); + psiReactionThermo& thermo = combustion->thermo(); SLGThermo slgThermo(mesh, thermo); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H index 52ed150808..1dfb6aa284 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H @@ -1,16 +1,11 @@ Info<< "Creating combustion model\n" << endl; - autoPtr combustion + autoPtr combustion ( - combustionModels::rhoChemistryCombustionModel::New - ( - mesh - ) + combustionModels::rhoCombustionModel::New(mesh) ); - rhoChemistryModel& chemistry = combustion->pChemistry(); - - rhoReactionThermo& thermo = chemistry.thermo(); + rhoReactionThermo& thermo = combustion->thermo(); SLGThermo slgThermo(mesh, thermo); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C index 8d97ec99ff..61533fcd6b 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,7 @@ Application porousExplicitSourceReactingParcelFoam Description - Transient PISO solver for compressible, laminar or turbulent flow with + Transient PIMPLE solver for compressible, laminar or turbulent flow with reacting multiphase Lagrangian parcels for porous media, including explicit sources for mass, momentum and energy @@ -42,7 +42,7 @@ Description #include "fvCFD.H" #include "turbulenceModel.H" #include "basicReactingMultiphaseCloud.H" -#include "rhoChemistryCombustionModel.H" +#include "rhoCombustionModel.H" #include "radiationModel.H" #include "porousZones.H" #include "IObasicSourceList.H" diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H index 433e3d0182..6b0dd8655f 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H @@ -1,16 +1,11 @@ Info<< "Creating combustion model\n" << endl; - autoPtr combustion + autoPtr combustion ( - combustionModels::psiChemistryCombustionModel::New - ( - mesh - ) + combustionModels::psiCombustionModel::New(mesh) ); - psiChemistryModel& chemistry = combustion->pChemistry(); - - psiReactionThermo& thermo = chemistry.thermo(); + psiReactionThermo& thermo = combustion->thermo(); SLGThermo slgThermo(mesh, thermo); diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C b/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C index 06ef5ddac3..9badba12b7 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,7 @@ Application reactingParcelFilmFoam Description - Transient PISO solver for compressible, laminar or turbulent flow with + Transient PIMPLE solver for compressible, laminar or turbulent flow with reacting Lagrangian parcels, and surface film modelling. \*---------------------------------------------------------------------------*/ @@ -34,7 +34,7 @@ Description #include "turbulenceModel.H" #include "basicReactingCloud.H" #include "surfaceFilmModel.H" -#include "psiChemistryCombustionModel.H" +#include "psiCombustionModel.H" #include "radiationModel.H" #include "SLGThermo.H" #include "pimpleControl.H" diff --git a/applications/solvers/lagrangian/reactingParcelFoam/Make/options b/applications/solvers/lagrangian/reactingParcelFoam/Make/options index d632e22f58..ba327a029f 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/Make/options +++ b/applications/solvers/lagrangian/reactingParcelFoam/Make/options @@ -1,6 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I${LIB_SRC}/meshTools/lnInclude \ + -I${LIB_SRC}/sampling/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ @@ -20,12 +21,14 @@ EXE_INC = \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ -I$(LIB_SRC)/combustionModels/lnInclude \ + -I$(LIB_SRC)/fieldSources/lnInclude \ -I$(FOAM_SOLVERS)/combustion/reactingFoam EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ + -lsampling \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ @@ -45,4 +48,5 @@ EXE_LIBS = \ -lODE \ -lregionModels \ -lsurfaceFilmModels \ + -lfieldSources \ -lcombustionModels diff --git a/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H index eac49bfc33..2ddaa2c301 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H @@ -10,8 +10,10 @@ UEqn.relax(); + sources.constrain(UEqn); + if (pimple.momentumPredictor()) { - solve(UEqn == -fvc::grad(p)); + solve(UEqn == -fvc::grad(p) + sources(rho, U)); K = 0.5*magSqr(U); } diff --git a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H index 78bbe14bbf..6cc645bde5 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H @@ -5,7 +5,7 @@ tmp > mvConvection mesh, fields, phi, - mesh.divScheme("div(phi,Yi_h)") + mesh.divScheme("div(phi,Yi_hs)") ) ); @@ -30,9 +30,13 @@ tmp > mvConvection == parcels.SYi(i, Yi) + combustion->R(Yi) + + sources(rho, Yi) ); YiEqn.relax(); + + sources.constrain(YiEqn); + YiEqn.solve(mesh.solver("Yi")); Yi.max(0.0); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H index 655510006d..3d27c50bc6 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H @@ -1,16 +1,11 @@ Info<< "Creating combustion model\n" << endl; - autoPtr combustion + autoPtr combustion ( - combustionModels::psiChemistryCombustionModel::New - ( - mesh - ) + combustionModels::psiCombustionModel::New(mesh) ); - psiChemistryModel& chemistry = combustion->pChemistry(); - - psiReactionThermo& thermo = chemistry.thermo(); + psiReactionThermo& thermo = combustion->thermo(); SLGThermo slgThermo(mesh, thermo); @@ -102,3 +97,6 @@ mesh, dimensionedScalar("dQ", dimEnergy/dimTime, 0.0) ); + + Info<< "Creating sources\n" << endl; + IObasicSourceList sources(mesh); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/hsEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/hsEqn.H index 9107df21c7..c7c1ec0957 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/hsEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/hsEqn.H @@ -1,5 +1,5 @@ { - fvScalarMatrix hEqn + fvScalarMatrix hsEqn ( fvm::ddt(rho, hs) + mvConvection->fvmDiv(phi, hs) @@ -10,11 +10,14 @@ + parcels.Sh(hs) + radiation->Sh(thermo) + combustion->Sh() + + sources(rho, hs) ); - hEqn.relax(); + hsEqn.relax(); - hEqn.solve(); + sources.constrain(hsEqn); + + hsEqn.solve(); thermo.correct(); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H index c504fdf2ea..511347cdce 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H @@ -2,7 +2,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn.H(); +HbyA = rAU*(UEqn == sources(rho, U))().H(); if (pimple.transonic()) { @@ -25,6 +25,7 @@ if (pimple.transonic()) - fvm::laplacian(rho*rAU, p) == parcels.Srho() + + sources(psi, p, rho.name()) ); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); @@ -56,6 +57,7 @@ else - fvm::laplacian(rho*rAU, p) == parcels.Srho() + + sources(psi, p, rho.name()) ); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); @@ -72,6 +74,7 @@ else U = HbyA - rAU*fvc::grad(p); U.correctBoundaryConditions(); +sources.correct(U); K = 0.5*magSqr(U); dpdt = fvc::ddt(p); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C index a46cb30f80..9b0ccc1963 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,7 @@ Application reactingParcelFoam Description - Transient PISO solver for compressible, laminar or turbulent flow with + Transient PIMPLE solver for compressible, laminar or turbulent flow with reacting Lagrangian parcels. \*---------------------------------------------------------------------------*/ @@ -33,10 +33,11 @@ Description #include "fvCFD.H" #include "turbulenceModel.H" #include "basicReactingCloud.H" -#include "psiChemistryCombustionModel.H" +#include "psiCombustionModel.H" #include "radiationModel.H" #include "SLGThermo.H" #include "pimpleControl.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/lagrangian/reactingParcelFoam/rhoEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/rhoEqn.H index 59e3edd7b3..b6293f2c1f 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/rhoEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/rhoEqn.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,13 +30,18 @@ Description \*---------------------------------------------------------------------------*/ { - solve + fvScalarMatrix rhoEqn ( fvm::ddt(rho) + fvc::div(phi) == parcels.Srho(rho) + + sources(rho) ); + + sources.constrain(rhoEqn); + + rhoEqn.solve(); } // ************************************************************************* // diff --git a/applications/solvers/lagrangian/sprayFoam/Make/options b/applications/solvers/lagrangian/sprayFoam/Make/options index 9d6d7d5398..647a53c1b4 100644 --- a/applications/solvers/lagrangian/sprayFoam/Make/options +++ b/applications/solvers/lagrangian/sprayFoam/Make/options @@ -2,6 +2,7 @@ EXE_INC = \ -I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I${LIB_SRC}/meshTools/lnInclude \ + -I${LIB_SRC}/sampling/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ @@ -21,12 +22,14 @@ EXE_INC = \ -I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ + -I$(LIB_SRC)/fieldSources/lnInclude \ -I$(LIB_SRC)/combustionModels/lnInclude EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ + -lsampling \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ @@ -47,4 +50,5 @@ EXE_LIBS = \ -lODE \ -lregionModels \ -lsurfaceFilmModels \ + -lfieldSources \ -lcombustionModels diff --git a/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/Make/options b/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/Make/options index 772d4099b0..f32b47478d 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/Make/options +++ b/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/Make/options @@ -3,6 +3,7 @@ EXE_INC = \ -I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I${LIB_SRC}/meshTools/lnInclude \ + -I${LIB_SRC}/sampling/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ @@ -23,12 +24,14 @@ EXE_INC = \ -I$(LIB_SRC)/engine/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ + -I$(LIB_SRC)/fieldSources/lnInclude \ -I$(LIB_SRC)/combustionModels/lnInclude EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ + -lsampling \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ @@ -50,4 +53,5 @@ EXE_LIBS = \ -lengine \ -lregionModels \ -lsurfaceFilmModels \ + -lfieldSources \ -lcombustionModels diff --git a/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/pEqn.H b/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/pEqn.H index 5c4fa0adc1..1bdc5cf996 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/pEqn.H +++ b/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/pEqn.H @@ -2,7 +2,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn.H(); +HbyA = rAU*(UEqn == sources(rho, U))().H(); if (pimple.transonic()) { @@ -25,6 +25,7 @@ if (pimple.transonic()) - fvm::laplacian(rho*rAU, p) == parcels.Srho() + + sources(psi, p, rho.name()) ); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); @@ -56,6 +57,7 @@ else - fvm::laplacian(rho*rAU, p) == parcels.Srho() + + sources(psi, p, rho.name()) ); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); @@ -72,6 +74,7 @@ else U = HbyA - rAU*fvc::grad(p); U.correctBoundaryConditions(); +sources.correct(U); K = 0.5*magSqr(U); dpdt = fvc::ddt(p); diff --git a/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/sprayEngineFoam.C b/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/sprayEngineFoam.C index a4ae147f51..baf1e40dc7 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/sprayEngineFoam.C +++ b/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/sprayEngineFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,10 +35,11 @@ Description #include "engineMesh.H" #include "turbulenceModel.H" #include "basicSprayCloud.H" -#include "psiChemistryCombustionModel.H" +#include "psiCombustionModel.H" #include "radiationModel.H" #include "SLGThermo.H" #include "pimpleControl.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -105,7 +106,7 @@ int main(int argc, char *argv[]) if (runTime.write()) { - chemistry.dQ()().write(); + combustion->dQ()().write(); } Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" diff --git a/applications/solvers/lagrangian/sprayFoam/sprayFoam.C b/applications/solvers/lagrangian/sprayFoam/sprayFoam.C index 50e24a70df..fce272d042 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayFoam.C +++ b/applications/solvers/lagrangian/sprayFoam/sprayFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,10 +33,11 @@ Description #include "fvCFD.H" #include "turbulenceModel.H" #include "basicSprayCloud.H" -#include "psiChemistryCombustionModel.H" +#include "psiCombustionModel.H" #include "radiationModel.H" #include "SLGThermo.H" #include "pimpleControl.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -98,7 +99,7 @@ int main(int argc, char *argv[]) if (runTime.write()) { - chemistry.dQ()().write(); + combustion->dQ()().write(); } Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H index 910732fa7a..bcdd163834 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/backgroundMeshDecomposition/backgroundMeshDecomposition.H @@ -78,10 +78,8 @@ SourceFiles namespace Foam { -typedef treeDataPrimitivePatch - treeDataBPatch; - typedef PrimitivePatch bPatch; +typedef treeDataPrimitivePatch treeDataBPatch; /*---------------------------------------------------------------------------*\ Class backgroundMeshDecomposition Declaration diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index 074d5b8ee3..25405d2ff3 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict @@ -154,6 +154,7 @@ castellatedMeshControls //faceZone sphere; //cellZone sphere; //cellZoneInside inside; //outside/insidePoint + //- Optional specification of what to do with faceZone faces: // internal : keep them as internal faces (default) // baffle : create baffles from them. This gives more diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C index 395ee77cbe..e64f6cb78f 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C +++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C @@ -1018,6 +1018,11 @@ int main(int argc, char *argv[]) // Update proc maps if (cellProcAddressing.headerOk()) + if + ( + cellProcAddressing.headerOk() + && cellProcAddressing.size() == mesh.nCells() + ) { Info<< "Renumbering processor cell decomposition map " << cellProcAddressing.name() << endl; @@ -1028,6 +1033,11 @@ int main(int argc, char *argv[]) ); } if (faceProcAddressing.headerOk()) + if + ( + faceProcAddressing.headerOk() + && faceProcAddressing.size() == mesh.nFaces() + ) { Info<< "Renumbering processor face decomposition map " << faceProcAddressing.name() << endl; @@ -1054,6 +1064,11 @@ int main(int argc, char *argv[]) } } if (pointProcAddressing.headerOk()) + if + ( + pointProcAddressing.headerOk() + && pointProcAddressing.size() == mesh.nPoints() + ) { Info<< "Renumbering processor point decomposition map " << pointProcAddressing.name() << endl; @@ -1173,21 +1188,41 @@ int main(int argc, char *argv[]) mesh.write(); if (cellProcAddressing.headerOk()) + if + ( + cellProcAddressing.headerOk() + && cellProcAddressing.size() == mesh.nCells() + ) { cellProcAddressing.instance() = mesh.facesInstance(); cellProcAddressing.write(); } if (faceProcAddressing.headerOk()) + if + ( + faceProcAddressing.headerOk() + && faceProcAddressing.size() == mesh.nFaces() + ) { faceProcAddressing.instance() = mesh.facesInstance(); faceProcAddressing.write(); } if (pointProcAddressing.headerOk()) + if + ( + pointProcAddressing.headerOk() + && pointProcAddressing.size() == mesh.nPoints() + ) { pointProcAddressing.instance() = mesh.facesInstance(); pointProcAddressing.write(); } if (boundaryProcAddressing.headerOk()) + if + ( + boundaryProcAddressing.headerOk() + && boundaryProcAddressing.size() == mesh.boundaryMesh().size() + ) { boundaryProcAddressing.instance() = mesh.facesInstance(); boundaryProcAddressing.write(); diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSetDict b/applications/utilities/mesh/manipulation/topoSet/topoSetDict index 4c2180f21d..1f58d59dde 100644 --- a/applications/utilities/mesh/manipulation/topoSet/topoSetDict +++ b/applications/utilities/mesh/manipulation/topoSet/topoSetDict @@ -238,6 +238,14 @@ FoamFile // cos 0.01; // Tolerance (max cos of angle) // } // +// // Walk on faces in faceSet, starting from face nearest given position +// source regionToFace; +// sourceInfo +// { +// set f0; +// nearPoint (0.1 0.1 0.005); +// } +// // // // pointSet diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C index 5a2e599a64..1e49db7505 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C @@ -811,7 +811,6 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show) } - void Foam::vtkPV3Foam::PrintSelf(ostream& os, vtkIndent indent) const { os << indent << "Number of nodes: " @@ -821,9 +820,10 @@ void Foam::vtkPV3Foam::PrintSelf(ostream& os, vtkIndent indent) const << (meshPtr_ ? meshPtr_->nCells() : 0) << "\n"; os << indent << "Number of available time steps: " - << (dbPtr_.valid() ? dbPtr_().times().size() : 0) << endl; + << (dbPtr_.valid() ? dbPtr_().times().size() : 0) << "\n"; os << indent << "mesh region: " << meshRegion_ << "\n"; } + // ************************************************************************* // diff --git a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C index 0bc6773518..d02da85df5 100644 --- a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C +++ b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,9 +41,9 @@ int main(int argc, char *argv[]) { timeSelector::addOptions(); #include "setRootCase.H" -# include "createTime.H" + #include "createTime.H" instantList timeDirs = timeSelector::select0(runTime, args); -# include "createMesh.H" + #include "createMesh.H" forAll(timeDirs, timeI) { @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) mesh ); -# include "createPhi.H" + #include "createPhi.H" singlePhaseTransportModel laminarTransport(U, phi); @@ -124,8 +124,8 @@ int main(int argc, char *argv[]) Info<< "Patch " << patchi << " named " << currPatch.name() - << " y+ : min: " << min(Yp) << " max: " << max(Yp) - << " average: " << average(Yp) << nl << endl; + << " y+ : min: " << gMin(Yp) << " max: " << gMax(Yp) + << " average: " << gAverage(Yp) << nl << endl; } } diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C index c8de884de9..7af0a901af 100644 --- a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C +++ b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C @@ -86,8 +86,8 @@ void calcIncompressibleYPlus Info<< "Patch " << patchi << " named " << nutPw.patch().name() - << " y+ : min: " << min(Yp) << " max: " << max(Yp) - << " average: " << average(Yp) << nl << endl; + << " y+ : min: " << gMin(Yp) << " max: " << gMax(Yp) + << " average: " << gAverage(Yp) << nl << endl; } } @@ -166,8 +166,8 @@ void calcCompressibleYPlus Info<< "Patch " << patchi << " named " << mutPw.patch().name() - << " y+ : min: " << min(Yp) << " max: " << max(Yp) - << " average: " << average(Yp) << nl << endl; + << " y+ : min: " << gMin(Yp) << " max: " << gMax(Yp) + << " average: " << gAverage(Yp) << nl << endl; } } diff --git a/applications/utilities/preProcessing/setFields/setFields.C b/applications/utilities/preProcessing/setFields/setFields.C index 7b690d46f2..41c09b6053 100644 --- a/applications/utilities/preProcessing/setFields/setFields.C +++ b/applications/utilities/preProcessing/setFields/setFields.C @@ -92,7 +92,15 @@ bool setCellFieldType field.boundaryField()[patchi].patchInternalField(); } - field.write(); + if (!field.write()) + { + FatalErrorIn + ( + "void setCellFieldType" + "(const fvMesh& mesh, const labelList& selectedCells," + "Istream& fieldValueStream)" + ) << "Failed writing field " << fieldName << endl; + } } else { @@ -102,6 +110,9 @@ bool setCellFieldType "(const fvMesh& mesh, const labelList& selectedCells," "Istream& fieldValueStream)" ) << "Field " << fieldName << " not found" << endl; + + // Consume value + (void)pTraits(fieldValueStream); } return true; @@ -260,7 +271,15 @@ bool setFaceFieldType } } - field.write(); + if (!field.write()) + { + FatalErrorIn + ( + "void setFaceFieldType" + "(const fvMesh& mesh, const labelList& selectedFaces," + "Istream& fieldValueStream)" + ) << "Failed writing field " << field.name() << exit(FatalError); + } } else { @@ -270,6 +289,9 @@ bool setFaceFieldType "(const fvMesh& mesh, const labelList& selectedFaces," "Istream& fieldValueStream)" ) << "Field " << fieldName << " not found" << endl; + + // Consume value + (void)pTraits(fieldValueStream); } return true; diff --git a/src/combustionModels/FSD/FSD.C b/src/combustionModels/FSD/FSD.C index c7b646d8bb..26f58505a7 100644 --- a/src/combustionModels/FSD/FSD.C +++ b/src/combustionModels/FSD/FSD.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,7 +36,8 @@ namespace combustionModels template FSD::FSD ( - const word& modelType, const fvMesh& mesh + const word& modelType, + const fvMesh& mesh ) : singleStepCombustion(modelType, mesh), @@ -62,14 +63,8 @@ FSD::FSD this->mesh(), dimensionedScalar("zero", dimless, 0.0) ), - YFuelFuelStream_ - ( - dimensionedScalar("YFuelStream", dimless, 1.0) - ), - YO2OxiStream_ - ( - dimensionedScalar("YOxiStream", dimless, 0.23) - ), + YFuelFuelStream_(dimensionedScalar("YFuelStream", dimless, 1.0)), + YO2OxiStream_(dimensionedScalar("YOxiStream", dimless, 0.23)), Cv_(readScalar(this->coeffs().lookup("Cv"))), C_(5.0), ftMin_(0.0), @@ -91,15 +86,15 @@ FSD::~FSD() template void FSD::calculateSourceNorm() { - this->singleMixture_.fresCorrect(); + this->singleMixturePtr_->fresCorrect(); - const label fuelI = this->singleMixture_.fuelIndex(); + const label fuelI = this->singleMixturePtr_->fuelIndex(); - const volScalarField& YFuel = this->thermo_->composition().Y()[fuelI]; + const volScalarField& YFuel = this->thermoPtr_->composition().Y()[fuelI]; - const volScalarField& YO2 = this->thermo_->composition().Y("O2"); + const volScalarField& YO2 = this->thermoPtr_->composition().Y("O2"); - const dimensionedScalar s = this->singleMixture_.s(); + const dimensionedScalar s = this->singleMixturePtr_->s(); ft_ = (s*YFuel - (YO2 - YO2OxiStream_))/(s*YFuelFuelStream_ + YO2OxiStream_); @@ -195,7 +190,7 @@ void FSD::calculateSourceNorm() volScalarField deltaF ( - lesModel.delta()/dimensionedScalar("flame",dimLength, 1.5e-3) + lesModel.delta()/dimensionedScalar("flame", dimLength, 1.5e-3) ); // Linear correlation between delta and flame thickness @@ -205,33 +200,33 @@ void FSD::calculateSourceNorm() forAll(ft_, cellI) { - if(ft_[cellI] > ftMin_ && ft_[cellI] < ftMax_) + if (ft_[cellI] > ftMin_ && ft_[cellI] < ftMax_) { scalar ftCell = ft_[cellI]; - if(ftVar[cellI] > ftVarMin_) //sub-grid beta pdf of ft_ + if (ftVar[cellI] > ftVarMin_) //sub-grid beta pdf of ft_ { scalar ftVarc = ftVar[cellI]; scalar a = max(ftCell*(ftCell*(1.0 - ftCell)/ftVarc - 1.0), 0.0); scalar b = max(a/ftCell - a, 0.0); - for(int i=1; i::calculateSourceNorm() else { omegaFuelBar[cellI] = - (omegaFuel[cellI]/omegaF[cellI]) - *exp - ( - -sqr(ftCell - ftStoich)/(2.0*sqr(0.01*omegaF[cellI])) - ); + omegaFuel[cellI]/omegaF[cellI] + *exp(-sqr(ftCell - ftStoich)/(2.0*sqr(0.01*omegaF[cellI]))); } - } else { - omegaFuelBar[cellI] = 0.0; + omegaFuelBar[cellI] = 0.0; } } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Combustion progress variable (c). -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // Combustion progress variable, c List