Merge remote branch 'OpenCFD/master' into olesenm

This commit is contained in:
Mark Olesen
2011-02-07 16:56:31 +01:00
282 changed files with 1886 additions and 1208 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -47,6 +47,8 @@ Description
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::noParallel();
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createSingleCellMesh.H" #include "createSingleCellMesh.H"

View File

@ -4,8 +4,8 @@ EXE_INC = \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \ -I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
@ -35,4 +35,4 @@ EXE_LIBS = \
-llaminarFlameSpeedModels \ -llaminarFlameSpeedModels \
-lchemistryModel \ -lchemistryModel \
-lODE \ -lODE \
-lpdf -ldistributionModels

View File

@ -5,8 +5,8 @@ EXE_INC = \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \ -I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
@ -32,5 +32,5 @@ EXE_LIBS = \
-llaminarFlameSpeedModels \ -llaminarFlameSpeedModels \
-lchemistryModel \ -lchemistryModel \
-lODE \ -lODE \
-lpdf \ -ldistributionModels \
-lfiniteVolume -lfiniteVolume

View File

@ -5,7 +5,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude
EXE_LIBS = \ EXE_LIBS = \
@ -17,4 +17,4 @@ EXE_LIBS = \
-lcompressibleTurbulenceModel \ -lcompressibleTurbulenceModel \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lradiation -lradiationModels

View File

@ -1,7 +1,7 @@
EXE_INC = \ EXE_INC = \
-I../buoyantSimpleFoam \ -I../buoyantSimpleFoam \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/turbulenceModels/RAS \ -I$(LIB_SRC)/turbulenceModels/RAS \
@ -11,7 +11,7 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lradiation \ -lradiationModels \
-lcompressibleTurbulenceModel \ -lcompressibleTurbulenceModel \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lfiniteVolume \ -lfiniteVolume \

View File

@ -5,18 +5,18 @@ EXE_INC = \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \ -I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \ -I$(LIB_SRC)/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude -I$(LIB_SRC)/ODE/lnInclude
@ -39,6 +39,6 @@ EXE_LIBS = \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lSLGThermo \ -lSLGThermo \
-lchemistryModel \ -lchemistryModel \
-lradiation \ -lradiationModels \
-lsurfaceFilmModels \ -lsurfaceFilmModels \
-lODE -lODE

View File

@ -4,7 +4,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
@ -21,7 +21,7 @@ EXE_LIBS = \
-lthermophysicalFunctions \ -lthermophysicalFunctions \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lradiation \ -lradiationModels \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \

View File

@ -4,7 +4,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
@ -18,7 +18,7 @@ EXE_LIBS = \
-lthermophysicalFunctions \ -lthermophysicalFunctions \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lradiation \ -lradiationModels \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \

View File

@ -5,18 +5,18 @@ EXE_INC = \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \ -I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude -I$(LIB_SRC)/surfaceFilmModels/lnInclude
@ -38,6 +38,6 @@ EXE_LIBS = \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lSLGThermo \ -lSLGThermo \
-lchemistryModel \ -lchemistryModel \
-lradiation \ -lradiationModels \
-lODE \ -lODE \
-lsurfaceFilmModels -lsurfaceFilmModels

View File

@ -2,18 +2,18 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I${LIB_SRC}/meshTools/lnInclude \ -I${LIB_SRC}/meshTools/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \ -I$(LIB_SRC)/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
@ -32,7 +32,7 @@ EXE_LIBS = \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lSLGThermo \ -lSLGThermo \
-lchemistryModel \ -lchemistryModel \
-lradiation \ -lradiationModels \
-lsurfaceFilmModels \ -lsurfaceFilmModels \
-llagrangianIntermediate \ -llagrangianIntermediate \
-lODE -lODE

View File

@ -4,18 +4,18 @@ EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude -I$(LIB_SRC)/surfaceFilmModels/lnInclude
@ -37,6 +37,6 @@ EXE_LIBS = \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lSLGThermo \ -lSLGThermo \
-lchemistryModel \ -lchemistryModel \
-lradiation \ -lradiationModels \
-lODE \ -lODE \
-lsurfaceFilmModels -lsurfaceFilmModels

View File

@ -5,18 +5,18 @@ EXE_INC = \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \ -I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \
-I$(LIB_SRC)/surfaceFilmModels/lnInclude -I$(LIB_SRC)/surfaceFilmModels/lnInclude
@ -38,6 +38,6 @@ EXE_LIBS = \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lSLGThermo \ -lSLGThermo \
-lchemistryModel \ -lchemistryModel \
-lradiation \ -lradiationModels \
-lODE \ -lODE \
-lsurfaceFilmModels -lsurfaceFilmModels

View File

@ -4,7 +4,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
@ -16,7 +16,7 @@ EXE_LIBS = \
-lthermophysicalFunctions \ -lthermophysicalFunctions \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lradiation \ -lradiationModels \
-lcompressibleTurbulenceModel \ -lcompressibleTurbulenceModel \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \

View File

@ -1,11 +1,11 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-llagrangianIntermediate \ -llagrangianIntermediate \
-lradiation \ -lradiationModels \
-lthermophysicalFunctions -lthermophysicalFunctions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -130,6 +130,7 @@ void testPackedList(const polyMesh& mesh, Random& rndGen)
{ {
FatalErrorIn("testPackedList()") FatalErrorIn("testPackedList()")
<< "point:" << i << "point:" << i
<< " at:" << mesh.points()[i]
<< " minlabel:" << pointValues[i] << " minlabel:" << pointValues[i]
<< " minbits:" << bits.get(i) << " minbits:" << bits.get(i)
<< " maxLabel:" << maxPointValues[i] << " maxLabel:" << maxPointValues[i]
@ -186,6 +187,10 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
{ {
Info<< nl << "Testing Map synchronisation." << endl; Info<< nl << "Testing Map synchronisation." << endl;
WarningIn("testSparseData()")
<< "Position test of sparse data only correct for cases without cyclics"
<< " with shared points." << endl;
primitivePatch allBoundary primitivePatch allBoundary
( (
SubList<face> SubList<face>
@ -204,7 +209,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
{ {
// Create some data. Use slightly perturbed positions. // Create some data. Use slightly perturbed positions.
Map<vector> sparseData; Map<point> sparseData;
pointField fullData(mesh.nPoints(), point::max); pointField fullData(mesh.nPoints(), point::max);
forAll(localPoints, i) forAll(localPoints, i)
@ -223,14 +228,14 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
( (
mesh, mesh,
sparseData, sparseData,
minEqOp<vector>() minMagSqrEqOp<point>()
// true // apply separation // true // apply separation
); );
syncTools::syncPointList syncTools::syncPointList
( (
mesh, mesh,
fullData, fullData,
minEqOp<vector>(), minMagSqrEqOp<point>(),
point::max point::max
// true // apply separation // true // apply separation
); );
@ -257,7 +262,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
} }
// 2. Does sparseData contain more? // 2. Does sparseData contain more?
forAllConstIter(Map<vector>, sparseData, iter) forAllConstIter(Map<point>, sparseData, iter)
{ {
const point& sparsePt = iter(); const point& sparsePt = iter();
label meshPointI = iter.key(); label meshPointI = iter.key();
@ -374,16 +379,12 @@ void testPointSync(const polyMesh& mesh, Random& rndGen)
// Test position. // Test position.
{ {
WarningIn("testPointSync()")
<< "Position test only correct for cases without cyclics"
<< " with shared points." << endl;
pointField syncedPoints(mesh.points()); pointField syncedPoints(mesh.points());
syncTools::syncPointList syncTools::syncPointPositions
( (
mesh, mesh,
syncedPoints, syncedPoints,
minEqOp<point>(), minMagSqrEqOp<point>(),
point::max point::max
); );
@ -450,20 +451,16 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen)
// Test position. // Test position.
{ {
WarningIn("testEdgeSync()")
<< "Position test only correct for cases without cyclics"
<< " with shared edges." << endl;
pointField syncedMids(edges.size()); pointField syncedMids(edges.size());
forAll(syncedMids, edgeI) forAll(syncedMids, edgeI)
{ {
syncedMids[edgeI] = edges[edgeI].centre(mesh.points()); syncedMids[edgeI] = edges[edgeI].centre(mesh.points());
} }
syncTools::syncEdgeList syncTools::syncEdgePositions
( (
mesh, mesh,
syncedMids, syncedMids,
minEqOp<point>(), minMagSqrEqOp<point>(),
point::max point::max
); );
@ -509,10 +506,11 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen)
{ {
if (nMasters[edgeI] != 1) if (nMasters[edgeI] != 1)
{ {
const edge& e = edges[edgeI];
//FatalErrorIn("testEdgeSync()") //FatalErrorIn("testEdgeSync()")
WarningIn("testEdgeSync()") WarningIn("testEdgeSync()")
<< "Edge " << edgeI << "Edge " << edgeI
<< " midpoint " << edges[edgeI].centre(mesh.points()) << " at:" << mesh.points()[e[0]] << mesh.points()[e[1]]
<< " has " << nMasters[edgeI] << " has " << nMasters[edgeI]
<< " masters." << " masters."
//<< exit(FatalError); //<< exit(FatalError);
@ -532,11 +530,11 @@ void testFaceSync(const polyMesh& mesh, Random& rndGen)
{ {
pointField syncedFc(mesh.faceCentres()); pointField syncedFc(mesh.faceCentres());
syncTools::syncFaceList syncTools::syncFacePositions
( (
mesh, mesh,
syncedFc, syncedFc,
maxEqOp<point>() maxMagSqrEqOp<point>()
); );
forAll(syncedFc, faceI) forAll(syncedFc, faceI)

View File

@ -34,22 +34,22 @@ EXE_LIBS = \
-llaminarFlameSpeedModels \ -llaminarFlameSpeedModels \
-lLESdeltas \ -lLESdeltas \
-lLESfilters \ -lLESfilters \
-lliquidMixture \ -lliquidMixtureProperties \
-lliquids \ -lliquidProperties \
-lmeshTools \ -lmeshTools \
-lmolecularMeasurements \ -lmolecularMeasurements \
-lmolecule \ -lmolecule \
-lODE \ -lODE \
-lOpenFOAM \ -lOpenFOAM \
-lpdf \ -ldistributionModels \
-lpotential \ -lpotential \
-lradiation \ -lradiationModels \
-lrandomProcesses \ -lrandomProcesses \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lsampling \ -lsampling \
-lpointSolidMixture \ -lsolidMixtureProperties \
-lsolidParticle \ -lsolidParticle \
-lpointSolids \ -lsolidProperties \
-lspecie \ -lspecie \
-lsurfMesh \ -lsurfMesh \
-lsystemCall \ -lsystemCall \

View File

@ -1,8 +1,8 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude -I$(LIB_SRC)/sampling/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lpdf \ -ldistributionModels \
-lsampling -lsampling

View File

@ -22,7 +22,14 @@
cachedRandom rndGen(label(0), -1); cachedRandom rndGen(label(0), -1);
autoPtr<pdfs::pdf> p(pdfs::pdf::New(pdfDictionary, rndGen)); autoPtr<distributionModels::distributionModel> p
(
distributionModels::distributionModel::New
(
pdfDictionary,
rndGen
)
);
const scalar xMin = p->minValue(); const scalar xMin = p->minValue();
const scalar xMax = p->maxValue(); const scalar xMax = p->maxValue();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -27,7 +27,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "pdf.H" #include "distributionModel.H"
#include "makeGraph.H" #include "makeGraph.H"
#include "OFstream.H" #include "OFstream.H"

View File

@ -300,19 +300,23 @@ void rewriteField
Info<< "Looking for entry for patch " << patchName << endl; Info<< "Looking for entry for patch " << patchName << endl;
if (boundaryField.found(patchName) && !boundaryField.found(newName)) // Find old patch name either direct or through wildcards
// Find new patch name direct only
if
(
boundaryField.found(patchName)
&& !boundaryField.found(newName, false, false)
)
{ {
Info<< " Changing entry " << patchName << " to " << newName Info<< " Changing entry " << patchName << " to " << newName
<< endl; << endl;
dictionary patchDict(boundaryField.subDict(patchName)); dictionary& patchDict = boundaryField.subDict(patchName);
if (patchDict.found("value")) if (patchDict.found("value"))
{ {
IOWarningIn("rewriteField(..)", patchDict) // Remove any value field since wrong size.
<< "Cyclic patch " << patchName
<< " has value entry. This will be removed."
<< endl;
patchDict.remove("value"); patchDict.remove("value");
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,7 +39,8 @@ template<class Type>
void MapConsistentVolFields void MapConsistentVolFields
( (
const IOobjectList& objects, const IOobjectList& objects,
const meshToMesh& meshToMeshInterp const meshToMesh& meshToMeshInterp,
const meshToMesh::order& mapOrder
) )
{ {
const fvMesh& meshSource = meshToMeshInterp.fromMesh(); const fvMesh& meshSource = meshToMeshInterp.fromMesh();
@ -83,12 +84,7 @@ void MapConsistentVolFields
); );
// Interpolate field // Interpolate field
meshToMeshInterp.interpolate meshToMeshInterp.interpolate(fieldTarget, fieldSource, mapOrder);
(
fieldTarget,
fieldSource,
meshToMesh::INTERPOLATE
);
// Write field // Write field
fieldTarget.write(); fieldTarget.write();
@ -101,11 +97,7 @@ void MapConsistentVolFields
GeometricField<Type, fvPatchField, volMesh> fieldTarget GeometricField<Type, fvPatchField, volMesh> fieldTarget
( (
fieldTargetIOobject, fieldTargetIOobject,
meshToMeshInterp.interpolate meshToMeshInterp.interpolate(fieldSource, mapOrder)
(
fieldSource,
meshToMesh::INTERPOLATE
)
); );
// Write field // Write field

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,7 +39,8 @@ template<class Type>
void MapVolFields void MapVolFields
( (
const IOobjectList& objects, const IOobjectList& objects,
const meshToMesh& meshToMeshInterp const meshToMesh& meshToMeshInterp,
const meshToMesh::order& mapOrder
) )
{ {
const fvMesh& meshSource = meshToMeshInterp.fromMesh(); const fvMesh& meshSource = meshToMeshInterp.fromMesh();
@ -83,12 +84,7 @@ void MapVolFields
); );
// Interpolate field // Interpolate field
meshToMeshInterp.interpolate meshToMeshInterp.interpolate(fieldTarget, fieldSource, mapOrder);
(
fieldTarget,
fieldSource,
meshToMesh::INTERPOLATE
);
// Write field // Write field
fieldTarget.write(); fieldTarget.write();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -45,7 +45,8 @@ Description
void mapConsistentMesh void mapConsistentMesh
( (
const fvMesh& meshSource, const fvMesh& meshSource,
const fvMesh& meshTarget const fvMesh& meshTarget,
const meshToMesh::order& mapOrder
) )
{ {
// Create the interpolation scheme // Create the interpolation scheme
@ -61,11 +62,16 @@ void mapConsistentMesh
// Map volFields // Map volFields
// ~~~~~~~~~~~~~ // ~~~~~~~~~~~~~
MapConsistentVolFields<scalar>(objects, meshToMeshInterp); MapConsistentVolFields<scalar>(objects, meshToMeshInterp, mapOrder);
MapConsistentVolFields<vector>(objects, meshToMeshInterp); MapConsistentVolFields<vector>(objects, meshToMeshInterp, mapOrder);
MapConsistentVolFields<sphericalTensor>(objects, meshToMeshInterp); MapConsistentVolFields<sphericalTensor>
MapConsistentVolFields<symmTensor>(objects, meshToMeshInterp); (
MapConsistentVolFields<tensor>(objects, meshToMeshInterp); objects,
meshToMeshInterp,
mapOrder
);
MapConsistentVolFields<symmTensor>(objects, meshToMeshInterp, mapOrder);
MapConsistentVolFields<tensor>(objects, meshToMeshInterp, mapOrder);
} }
{ {
@ -98,7 +104,8 @@ void mapSubMesh
const fvMesh& meshSource, const fvMesh& meshSource,
const fvMesh& meshTarget, const fvMesh& meshTarget,
const HashTable<word>& patchMap, const HashTable<word>& patchMap,
const wordList& cuttingPatches const wordList& cuttingPatches,
const meshToMesh::order& mapOrder
) )
{ {
// Create the interpolation scheme // Create the interpolation scheme
@ -120,11 +127,11 @@ void mapSubMesh
// Map volFields // Map volFields
// ~~~~~~~~~~~~~ // ~~~~~~~~~~~~~
MapVolFields<scalar>(objects, meshToMeshInterp); MapVolFields<scalar>(objects, meshToMeshInterp, mapOrder);
MapVolFields<vector>(objects, meshToMeshInterp); MapVolFields<vector>(objects, meshToMeshInterp, mapOrder);
MapVolFields<sphericalTensor>(objects, meshToMeshInterp); MapVolFields<sphericalTensor>(objects, meshToMeshInterp, mapOrder);
MapVolFields<symmTensor>(objects, meshToMeshInterp); MapVolFields<symmTensor>(objects, meshToMeshInterp, mapOrder);
MapVolFields<tensor>(objects, meshToMeshInterp); MapVolFields<tensor>(objects, meshToMeshInterp, mapOrder);
} }
{ {
@ -155,7 +162,8 @@ void mapSubMesh
void mapConsistentSubMesh void mapConsistentSubMesh
( (
const fvMesh& meshSource, const fvMesh& meshSource,
const fvMesh& meshTarget const fvMesh& meshTarget,
const meshToMesh::order& mapOrder
) )
{ {
HashTable<word> patchMap; HashTable<word> patchMap;
@ -181,7 +189,14 @@ void mapConsistentSubMesh
} }
} }
mapSubMesh(meshSource, meshTarget, patchMap, cuttingPatchTable.toc()); mapSubMesh
(
meshSource,
meshTarget,
patchMap,
cuttingPatchTable.toc(),
mapOrder
);
} }
@ -240,6 +255,18 @@ int main(int argc, char *argv[])
"scalar", "scalar",
"specify the source time" "specify the source time"
); );
argList::addOption
(
"sourceRegion",
"word",
"specify the source region"
);
argList::addOption
(
"targetRegion",
"word",
"specify the target region"
);
argList::addBoolOption argList::addBoolOption
( (
"parallelSource", "parallelSource",
@ -255,6 +282,12 @@ int main(int argc, char *argv[])
"consistent", "consistent",
"source and target geometry and boundary conditions identical" "source and target geometry and boundary conditions identical"
); );
argList::addOption
(
"mapMethod",
"word",
"specify the mapping method"
);
argList args(argc, argv); argList args(argc, argv);
@ -270,13 +303,53 @@ int main(int argc, char *argv[])
const fileName rootDirSource = casePath.path(); const fileName rootDirSource = casePath.path();
const fileName caseDirSource = casePath.name(); const fileName caseDirSource = casePath.name();
Info<< "Source: " << rootDirSource << " " << caseDirSource << nl Info<< "Source: " << rootDirSource << " " << caseDirSource << endl;
<< "Target: " << rootDirTarget << " " << caseDirTarget << endl; word sourceRegion = fvMesh::defaultRegion;
if (args.optionFound("sourceRegion"))
{
sourceRegion = args["sourceRegion"];
Info<< "Source region: " << sourceRegion << endl;
}
Info<< "Target: " << rootDirTarget << " " << caseDirTarget << endl;
word targetRegion = fvMesh::defaultRegion;
if (args.optionFound("targetRegion"))
{
targetRegion = args["targetRegion"];
Info<< "Target region: " << targetRegion << endl;
}
const bool parallelSource = args.optionFound("parallelSource"); const bool parallelSource = args.optionFound("parallelSource");
const bool parallelTarget = args.optionFound("parallelTarget"); const bool parallelTarget = args.optionFound("parallelTarget");
const bool consistent = args.optionFound("consistent"); const bool consistent = args.optionFound("consistent");
meshToMesh::order mapOrder = meshToMesh::INTERPOLATE;
if (args.optionFound("mapMethod"))
{
const word mapMethod(args["mapMethod"]);
if (mapMethod == "mapNearest")
{
mapOrder = meshToMesh::MAP;
}
else if (mapMethod == "interpolate")
{
mapOrder = meshToMesh::INTERPOLATE;
}
else if (mapMethod == "cellPointInterpolate")
{
mapOrder = meshToMesh::CELL_POINT_INTERPOLATE;
}
else
{
FatalErrorIn(args.executable())
<< "Unknown mapMethod " << mapMethod << ". Valid options are: "
<< "mapNearest, interpolate and cellPointInterpolate"
<< exit(FatalError);
}
Info<< "Mapping method: " << mapMethod << endl;
}
#include "createTimes.H" #include "createTimes.H"
HashTable<word> patchMap; HashTable<word> patchMap;
@ -323,7 +396,7 @@ int main(int argc, char *argv[])
( (
IOobject IOobject
( (
fvMesh::defaultRegion, targetRegion,
runTimeTarget.timeName(), runTimeTarget.timeName(),
runTimeTarget runTimeTarget
) )
@ -348,7 +421,7 @@ int main(int argc, char *argv[])
( (
IOobject IOobject
( (
fvMesh::defaultRegion, sourceRegion,
runTimeSource.timeName(), runTimeSource.timeName(),
runTimeSource runTimeSource
) )
@ -358,11 +431,18 @@ int main(int argc, char *argv[])
if (consistent) if (consistent)
{ {
mapConsistentSubMesh(meshSource, meshTarget); mapConsistentSubMesh(meshSource, meshTarget, mapOrder);
} }
else else
{ {
mapSubMesh(meshSource, meshTarget, patchMap, cuttingPatches); mapSubMesh
(
meshSource,
meshTarget,
patchMap,
cuttingPatches,
mapOrder
);
} }
} }
} }
@ -390,7 +470,7 @@ int main(int argc, char *argv[])
( (
IOobject IOobject
( (
fvMesh::defaultRegion, sourceRegion,
runTimeSource.timeName(), runTimeSource.timeName(),
runTimeSource runTimeSource
) )
@ -413,7 +493,7 @@ int main(int argc, char *argv[])
( (
IOobject IOobject
( (
fvMesh::defaultRegion, targetRegion,
runTimeTarget.timeName(), runTimeTarget.timeName(),
runTimeTarget runTimeTarget
) )
@ -423,7 +503,7 @@ int main(int argc, char *argv[])
if (consistent) if (consistent)
{ {
mapConsistentSubMesh(meshSource, meshTarget); mapConsistentSubMesh(meshSource, meshTarget, mapOrder);
} }
else else
{ {
@ -432,7 +512,8 @@ int main(int argc, char *argv[])
meshSource, meshSource,
meshTarget, meshTarget,
patchMap, patchMap,
addProcessorPatches(meshTarget, cuttingPatches) addProcessorPatches(meshTarget, cuttingPatches),
mapOrder
); );
} }
} }
@ -494,7 +575,7 @@ int main(int argc, char *argv[])
( (
IOobject IOobject
( (
fvMesh::defaultRegion, sourceRegion,
runTimeSource.timeName(), runTimeSource.timeName(),
runTimeSource runTimeSource
) )
@ -529,7 +610,7 @@ int main(int argc, char *argv[])
( (
IOobject IOobject
( (
fvMesh::defaultRegion, targetRegion,
runTimeTarget.timeName(), runTimeTarget.timeName(),
runTimeTarget runTimeTarget
) )
@ -544,7 +625,12 @@ int main(int argc, char *argv[])
{ {
if (consistent) if (consistent)
{ {
mapConsistentSubMesh(meshSource, meshTarget); mapConsistentSubMesh
(
meshSource,
meshTarget,
mapOrder
);
} }
else else
{ {
@ -553,7 +639,8 @@ int main(int argc, char *argv[])
meshSource, meshSource,
meshTarget, meshTarget,
patchMap, patchMap,
addProcessorPatches(meshTarget, cuttingPatches) addProcessorPatches(meshTarget, cuttingPatches),
mapOrder
); );
} }
} }
@ -571,7 +658,7 @@ int main(int argc, char *argv[])
( (
IOobject IOobject
( (
fvMesh::defaultRegion, sourceRegion,
runTimeSource.timeName(), runTimeSource.timeName(),
runTimeSource runTimeSource
) )
@ -581,7 +668,7 @@ int main(int argc, char *argv[])
( (
IOobject IOobject
( (
fvMesh::defaultRegion, targetRegion,
runTimeTarget.timeName(), runTimeTarget.timeName(),
runTimeTarget runTimeTarget
) )
@ -592,11 +679,18 @@ int main(int argc, char *argv[])
if (consistent) if (consistent)
{ {
mapConsistentMesh(meshSource, meshTarget); mapConsistentMesh(meshSource, meshTarget, mapOrder);
} }
else else
{ {
mapSubMesh(meshSource, meshTarget, patchMap, cuttingPatches); mapSubMesh
(
meshSource,
meshTarget,
patchMap,
cuttingPatches,
mapOrder
);
} }
} }

View File

@ -0,0 +1,35 @@
http://www.openfoam.com
Copyright (c) 2011 OpenCFD Ltd.
Static linkage:
- compile libraries as static objects:
src; ./Allwmake libo
- in the desired application (e.g. interFoam) adapt Make/options
to link all indirect and direct dependencies as .o files:
sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
sinclude $(RULES)/mplib$(WM_MPLIB)
EXE_LIBS = \
-lz $(PLIBS) \
$(FOAM_LIBBIN)/$(FOAM_MPI)/libPstream.o \
$(FOAM_LIBBIN)/libOSspecific.o \
$(FOAM_LIBBIN)/libtwoPhaseInterfaceProperties.o \
$(FOAM_LIBBIN)/libinterfaceProperties.o \
$(FOAM_LIBBIN)/libincompressibleTransportModels.o \
$(FOAM_LIBBIN)/libincompressibleTurbulenceModel.o \
$(FOAM_LIBBIN)/libincompressibleRASModels.o \
$(FOAM_LIBBIN)/libincompressibleLESModels.o \
$(FOAM_LIBBIN)/libLESdeltas.o \
$(FOAM_LIBBIN)/libLESfilters.o \
$(FOAM_LIBBIN)/libfiniteVolume.o \
$(FOAM_LIBBIN)/libmeshTools.o \
$(FOAM_LIBBIN)/libtriSurface.o \
$(FOAM_LIBBIN)/libfileFormats.o \
$(FOAM_LIBBIN)/libOpenFOAM.o \
- in Make/files add
SEXE = $(FOAM_USER_APPBIN)/interFoam-static
- wmake exe
- check with ldd

View File

@ -149,7 +149,7 @@ pyr
(0 1) (0 1)
(1 2) (1 2)
(2 3) (2 3)
(3 4) (0 3)
(0 4) (0 4)
(1 4) (1 4)
(2 4) (2 4)

View File

@ -90,7 +90,7 @@ unsetenv MPFR_ARCH_PATH
# Location of compiler installation # Location of compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( ! $?foamCompiler ) then if ( ! $?foamCompiler ) then
foamCompiler=system set foamCompiler=system
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:" echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
echo " foamCompiler not set, using '$foamCompiler'" echo " foamCompiler not set, using '$foamCompiler'"
endif endif

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -260,7 +260,12 @@ Foam::SHA1Digest Foam::dictionary::digest() const
} }
bool Foam::dictionary::found(const word& keyword, bool recursive) const bool Foam::dictionary::found
(
const word& keyword,
bool recursive,
bool patternMatch
) const
{ {
if (hashedEntries_.found(keyword)) if (hashedEntries_.found(keyword))
{ {
@ -268,7 +273,7 @@ bool Foam::dictionary::found(const word& keyword, bool recursive) const
} }
else else
{ {
if (patternEntries_.size()) if (patternMatch && patternEntries_.size())
{ {
DLList<entry*>::const_iterator wcLink = DLList<entry*>::const_iterator wcLink =
patternEntries_.begin(); patternEntries_.begin();
@ -276,7 +281,7 @@ bool Foam::dictionary::found(const word& keyword, bool recursive) const
patternRegexps_.begin(); patternRegexps_.begin();
// Find in patterns using regular expressions only // Find in patterns using regular expressions only
if (findInPatterns(true, keyword, wcLink, reLink)) if (findInPatterns(patternMatch, keyword, wcLink, reLink))
{ {
return true; return true;
} }
@ -284,7 +289,7 @@ bool Foam::dictionary::found(const word& keyword, bool recursive) const
if (recursive && &parent_ != &dictionary::null) if (recursive && &parent_ != &dictionary::null)
{ {
return parent_.found(keyword, recursive); return parent_.found(keyword, recursive, patternMatch);
} }
else else
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -264,7 +264,13 @@ public:
//- Search dictionary for given keyword //- Search dictionary for given keyword
// If recursive, search parent dictionaries // If recursive, search parent dictionaries
bool found(const word&, bool recursive=false) const; // If patternMatch, use regular expressions
bool found
(
const word&,
bool recursive=false,
bool patternMatch = true
) const;
//- Find and return an entry data stream pointer if present //- Find and return an entry data stream pointer if present
// otherwise return NULL. // otherwise return NULL.

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -61,11 +61,26 @@ bool Foam::mergePoints
return false; return false;
} }
// We're comparing distance squared to origin first.
// Say if starting from two close points:
// x, y, z
// x+mergeTol, y+mergeTol, z+mergeTol
// Then the magSqr of both will be
// x^2+y^2+z^2
// x^2+y^2+z^2 + 2*mergeTol*(x+z+y) + mergeTol^2*...
// so the difference will be 2*mergeTol*(x+y+z)
const scalar mergeTolSqr = sqr(mergeTol); const scalar mergeTolSqr = sqr(mergeTol);
// Sort points by magSqr // Sort points by magSqr
SortableList<scalar> sortedMagSqr(magSqr(points - compareOrigin)); const pointField d(points - compareOrigin);
SortableList<scalar> sortedMagSqr(magSqr(d));
scalarField sortedTol(points.size());
forAll(sortedMagSqr.indices(), sortI)
{
const point& pt = d[sortedMagSqr.indices()[sortI]];
sortedTol[sortI] = 2*mergeTol*(mag(pt.x())+mag(pt.y())+mag(pt.z()));
}
bool hasMerged = false; bool hasMerged = false;
@ -94,7 +109,7 @@ bool Foam::mergePoints
( (
sortedMagSqr[prevSortI] sortedMagSqr[prevSortI]
- sortedMagSqr[sortI] - sortedMagSqr[sortI]
) <= mergeTolSqr; ) <= sortedTol[sortI];
prevSortI-- prevSortI--
) )
{ {

View File

@ -552,25 +552,102 @@ void Foam::globalMeshData::calcGlobalPointSlaves() const
} }
void Foam::globalMeshData::calcGlobalEdgeSlaves() const void Foam::globalMeshData::calcPointConnectivity
(
List<labelPairList>& allPointConnectivity
) const
{ {
if (debug) const globalIndexAndTransform& transforms = globalTransforms();
const labelListList& slaves = globalPointSlaves();
const labelListList& transformedSlaves = globalPointTransformedSlaves();
// Create field with my local data
labelPairList myData(globalPointSlavesMap().constructSize());
forAll(slaves, pointI)
{ {
Pout<< "globalMeshData::calcGlobalEdgeSlaves() :" myData[pointI] = globalIndexAndTransform::encode
<< " calculating coupled master to slave edge addressing." << endl; (
Pstream::myProcNo(),
pointI,
transforms.nullTransformIndex()
);
}
// Send over.
globalPointSlavesMap().distribute(myData);
// String of connected points with their transform
allPointConnectivity.setSize(globalPointSlavesMap().constructSize());
forAll(slaves, pointI)
{
// Reconstruct string of connected points
const labelList& pSlaves = slaves[pointI];
const labelList& pTransformSlaves = transformedSlaves[pointI];
labelPairList& pConnectivity = allPointConnectivity[pointI];
pConnectivity.setSize(1+pSlaves.size()+pTransformSlaves.size());
label connI = 0;
// Add myself
pConnectivity[connI++] = myData[pointI];
// Add untransformed points
forAll(pSlaves, i)
{
pConnectivity[connI++] = myData[pSlaves[i]];
}
// Add transformed points.
forAll(pTransformSlaves, i)
{
// Get transform from index
label transformI = globalPointSlavesMap().whichTransform
(
pTransformSlaves[i]
);
// Add transform to connectivity
const labelPair& n = myData[pTransformSlaves[i]];
label procI = globalIndexAndTransform::processor(n);
label index = globalIndexAndTransform::index(n);
pConnectivity[connI++] = globalIndexAndTransform::encode
(
procI,
index,
transformI
);
} }
// - Send across connected edges (in global edge addressing) // Put back in slots
// - Check on receiving side whether edge has same slave edge forAll(pSlaves, i)
// on both endpoints. {
allPointConnectivity[pSlaves[i]] = pConnectivity;
}
forAll(pTransformSlaves, i)
{
allPointConnectivity[pTransformSlaves[i]] = pConnectivity;
}
}
globalPointSlavesMap().reverseDistribute
(
allPointConnectivity.size(),
allPointConnectivity
);
}
// Coupled point to global coupled edges. void Foam::globalMeshData::calcGlobalPointEdges
labelListList globalPointEdges(globalPointSlavesMap().constructSize()); (
labelListList& globalPointEdges,
// Create local version List<labelPairList>& globalPointPoints
) const
{
const edgeList& edges = coupledPatch().edges();
const labelListList& pointEdges = coupledPatch().pointEdges(); const labelListList& pointEdges = coupledPatch().pointEdges();
const globalIndex& globalEdgeNumbers = globalEdgeNumbering(); const globalIndex& globalEdgeNumbers = globalEdgeNumbering();
const labelListList& slaves = globalPointSlaves();
const labelListList& transformedSlaves = globalPointTransformedSlaves();
// Create local version
globalPointEdges.setSize(globalPointSlavesMap().constructSize());
globalPointPoints.setSize(globalPointSlavesMap().constructSize());
forAll(pointEdges, pointI) forAll(pointEdges, pointI)
{ {
const labelList& pEdges = pointEdges[pointI]; const labelList& pEdges = pointEdges[pointI];
@ -580,154 +657,377 @@ void Foam::globalMeshData::calcGlobalEdgeSlaves() const
{ {
globalPEdges[i] = globalEdgeNumbers.toGlobal(pEdges[i]); globalPEdges[i] = globalEdgeNumbers.toGlobal(pEdges[i]);
} }
labelPairList& globalPPoints = globalPointPoints[pointI];
globalPPoints.setSize(pEdges.size());
forAll(pEdges, i)
{
label otherPointI = edges[pEdges[i]].otherVertex(pointI);
globalPPoints[i] = globalIndexAndTransform::encode
(
Pstream::myProcNo(),
otherPointI,
globalTransforms().nullTransformIndex()
);
}
} }
// Pull slave data to master. Dummy transform. // Pull slave data to master. Dummy transform.
globalPointSlavesMap().distribute(globalPointEdges); globalPointSlavesMap().distribute(globalPointEdges);
globalPointSlavesMap().distribute(globalPointPoints);
// Add all pointEdges
forAll(slaves, pointI)
{
const labelList& pSlaves = slaves[pointI];
const labelList& pTransformSlaves = transformedSlaves[pointI];
label n = 0;
forAll(pSlaves, i)
{
n += globalPointEdges[pSlaves[i]].size();
}
forAll(pTransformSlaves, i)
{
n += globalPointEdges[pTransformSlaves[i]].size();
}
// Add all the point edges of the slaves to those of the (master) point
{
labelList& globalPEdges = globalPointEdges[pointI];
label sz = globalPEdges.size();
globalPEdges.setSize(sz+n);
forAll(pSlaves, i)
{
const labelList& otherData = globalPointEdges[pSlaves[i]];
forAll(otherData, j)
{
globalPEdges[sz++] = otherData[j];
}
}
forAll(pTransformSlaves, i)
{
const labelList& otherData =
globalPointEdges[pTransformSlaves[i]];
forAll(otherData, j)
{
globalPEdges[sz++] = otherData[j];
}
}
// Put back in slots
forAll(pSlaves, i)
{
globalPointEdges[pSlaves[i]] = globalPEdges;
}
forAll(pTransformSlaves, i)
{
globalPointEdges[pTransformSlaves[i]] = globalPEdges;
}
}
// Now check on master if any of my edges are also on slave. // Same for corresponding pointPoints
// This assumes that if slaves have a coupled edge it is also on {
// the master (otherwise the mesh would be illegal anyway) labelPairList& globalPPoints = globalPointPoints[pointI];
label sz = globalPPoints.size();
globalPPoints.setSize(sz + n);
// From global edge to slot in distributed data. // Add untransformed points
Map<label> pointEdgeSet; forAll(pSlaves, i)
{
const labelPairList& otherData = globalPointPoints[pSlaves[i]];
forAll(otherData, j)
{
globalPPoints[sz++] = otherData[j];
}
}
// Add transformed points.
forAll(pTransformSlaves, i)
{
// Get transform from index
label transformI = globalPointSlavesMap().whichTransform
(
pTransformSlaves[i]
);
const labelPairList& otherData =
globalPointPoints[pTransformSlaves[i]];
forAll(otherData, j)
{
// Add transform to connectivity
const labelPair& n = otherData[j];
label procI = globalIndexAndTransform::processor(n);
label index = globalIndexAndTransform::index(n);
globalPPoints[sz++] = globalIndexAndTransform::encode
(
procI,
index,
transformI
);
}
}
// Put back in slots
forAll(pSlaves, i)
{
globalPointPoints[pSlaves[i]] = globalPPoints;
}
forAll(pTransformSlaves, i)
{
globalPointPoints[pTransformSlaves[i]] = globalPPoints;
}
}
}
// Push back
globalPointSlavesMap().reverseDistribute
(
globalPointEdges.size(),
globalPointEdges
);
// Push back
globalPointSlavesMap().reverseDistribute
(
globalPointPoints.size(),
globalPointPoints
);
}
// Find transformation to take remotePoint to localPoint. Use info to find
// the transforms.
Foam::label Foam::globalMeshData::findTransform
(
const labelPairList& info,
const labelPair& remotePoint,
const label localPoint
) const
{
const label remoteProcI = globalIndexAndTransform::processor(remotePoint);
const label remoteIndex = globalIndexAndTransform::index(remotePoint);
label remoteTransformI = -1;
label localTransformI = -1;
forAll(info, i)
{
label procI = globalIndexAndTransform::processor(info[i]);
label pointI = globalIndexAndTransform::index(info[i]);
label transformI = globalIndexAndTransform::transformIndex(info[i]);
if (procI == Pstream::myProcNo() && pointI == localPoint)
{
localTransformI = transformI;
//Pout<< "For local :" << localPoint
// << " found transform:" << localTransformI
// << endl;
}
if (procI == remoteProcI && pointI == remoteIndex)
{
remoteTransformI = transformI;
//Pout<< "For remote:" << remotePoint
// << " found transform:" << remoteTransformI
// << " at index:" << i
// << endl;
}
}
if (remoteTransformI == -1 || localTransformI == -1)
{
FatalErrorIn("globalMeshData::findTransform(..)")
<< "Problem. Cannot find " << remotePoint
<< " or " << localPoint << " in " << info
<< endl
<< "remoteTransformI:" << remoteTransformI << endl
<< "localTransformI:" << localTransformI
<< abort(FatalError);
}
return globalTransforms().subtractTransformIndex
(
remoteTransformI,
localTransformI
);
}
void Foam::globalMeshData::calcGlobalEdgeSlaves() const
{
if (debug)
{
Pout<< "globalMeshData::calcGlobalEdgeSlaves() :"
<< " calculating coupled master to slave edge addressing." << endl;
}
const edgeList& edges = coupledPatch().edges(); const edgeList& edges = coupledPatch().edges();
const labelListList& slaves = globalPointSlaves(); const globalIndex& globalEdgeNumbers = globalEdgeNumbering();
const labelListList& transformedSlaves = globalPointTransformedSlaves();
// Create master to slave addressing. Empty for slave edges.
// - labelListList to store untransformed elements // The whole problem with deducting edge-connectivity from
// - List<labelPair> to store transformed elements // point-connectivity is that one of the the endpoints might be
globalEdgeSlavesPtr_.reset(new labelListList(edges.size())); // a local master but the other endpoint might not. So we first
labelListList& globalEdgeSlaves = globalEdgeSlavesPtr_(); // need to make sure that all points know about connectivity and
List<labelPairList> transformedEdges(edges.size()); // the transformations.
// 1. collect point connectivity - basically recreating globalPoints ouput.
// All points will now have a string of points. The transforms are
// in respect to the master.
List<labelPairList> allPointConnectivity;
calcPointConnectivity(allPointConnectivity);
// 2. Get all pointEdges and pointPoints
// Coupled point to global coupled edges and corresponding endpoint.
labelListList globalPointEdges;
List<labelPairList> globalPointPoints;
calcGlobalPointEdges(globalPointEdges, globalPointPoints);
// 3. Now all points have
// - all the connected points with original transform
// - all the connected global edges
// Now all we need to do is go through all the edges and check
// both endpoints. If there is a edge between the two which is
// produced by transforming both points in the same way it is a shared
// edge.
// Collect strings of connected edges.
List<labelPairList> allEdgeConnectivity(edges.size());
forAll(edges, edgeI) forAll(edges, edgeI)
{ {
const edge& e = edges[edgeI]; const edge& e = edges[edgeI];
const labelList& pEdges0 = globalPointEdges[e[0]];
const labelPairList& pPoints0 = globalPointPoints[e[0]];
const labelList& pEdges1 = globalPointEdges[e[1]];
const labelPairList& pPoints1 = globalPointPoints[e[1]];
// For this edge check get the pointEdges of the connected points // Most edges will be size 2
// Any edge in both pointEdges must be connected to this edge. DynamicList<labelPair> eEdges(2);
// Append myself.
// Untransformed eEdges.append
// ~~~~~~~~~~~~~
{
const labelList& slaves0 = slaves[e[0]];
const labelList& slaves1 = slaves[e[1]];
// Check for edges that are in both slaves0 and slaves1.
pointEdgeSet.clear();
forAll(slaves0, i)
{
const labelList& connectedEdges = globalPointEdges[slaves0[i]];
// Store edges (data on Map not used)
forAll(connectedEdges, j)
{
pointEdgeSet.insert(connectedEdges[j], slaves0[i]);
}
}
forAll(slaves1, i)
{
const labelList& connectedEdges = globalPointEdges[slaves1[i]];
forAll(connectedEdges, j)
{
label globalEdgeI = connectedEdges[j];
if (pointEdgeSet.found(globalEdgeI))
{
// Found slave edge.
label sz = globalEdgeSlaves[edgeI].size();
globalEdgeSlaves[edgeI].setSize(sz+1);
globalEdgeSlaves[edgeI][sz] = globalEdgeI;
}
}
}
}
// Transformed
// ~~~~~~~~~~~
{
// We look at the slots which hold transformed points
// So now when we find the edge we can look at which slot
// it came from and work out the transform
const labelList& slaves0 = transformedSlaves[e[0]];
const labelList& slaves1 = transformedSlaves[e[1]];
// Check for edges that are in both slaves0 and slaves1 (and get
// to master through the same transform?)
pointEdgeSet.clear();
forAll(slaves0, i)
{
const labelList& connected = globalPointEdges[slaves0[i]];
forAll(connected, j)
{
pointEdgeSet.insert(connected[j], slaves0[i]);
}
}
forAll(slaves1, i)
{
const labelList& connected = globalPointEdges[slaves1[i]];
forAll(connected, j)
{
label globalEdgeI = connected[j];
Map<label>::const_iterator iter = pointEdgeSet.find
( (
globalEdgeI globalIndexAndTransform::encode
);
if (iter != pointEdgeSet.end())
{
// Found slave edge. Compare both transforms.
// Get the transform by looking at where the point
// slots came from.
label transform0 = findLower
( (
globalPointSlavesMap().transformStart(), Pstream::myProcNo(),
iter()+1 edgeI,
); globalTransforms().nullTransformIndex()
label transform1 = findLower )
(
globalPointSlavesMap().transformStart(),
slaves1[i]+1
);
label mergedTransform =
globalIndexAndTransform::minimumTransformIndex
(
transform0,
transform1
); );
// Reencode originating edge index and processor forAll(pEdges0, i)
// with new transform. {
label procI = globalEdgeNumbers.whichProcID forAll(pEdges1, j)
{
if
( (
globalEdgeI pEdges0[i] == pEdges1[j]
&& pEdges0[i] != globalEdgeNumbers.toGlobal(edgeI)
)
{
// Found a shared edge. Now check if the endpoints
// go through the same transformation.
// Local: e[0] remote:pPoints1[j]
// Local: e[1] remote:pPoints0[i]
// Find difference in transforms to go from point on remote
// edge (pPoints1[j]) to this point.
label transform0 = findTransform
(
allPointConnectivity[e[0]],
pPoints1[j],
e[0]
);
label transform1 = findTransform
(
allPointConnectivity[e[1]],
pPoints0[i],
e[1]
); );
labelPair edgeInfo if (transform0 == transform1)
{
label procI = globalEdgeNumbers.whichProcID(pEdges0[i]);
eEdges.append
( (
globalIndexAndTransform::encode globalIndexAndTransform::encode
( (
procI, procI,
globalEdgeNumbers.toLocal globalEdgeNumbers.toLocal(procI, pEdges0[i]),
( transform0
procI,
globalEdgeI
),
mergedTransform
) )
); );
}
}
}
}
label sz = transformedEdges[edgeI].size(); allEdgeConnectivity[edgeI].transfer(eEdges);
transformedEdges[edgeI].setSize(sz+1); sort(allEdgeConnectivity[edgeI], globalIndexAndTransform::less());
transformedEdges[edgeI][sz] = edgeInfo; }
// We now have - in allEdgeConnectivity - a list of edges which are shared
// between multiple processors. Filter into non-transformed and transformed
// connections.
globalEdgeSlavesPtr_.reset(new labelListList(edges.size()));
labelListList& globalEdgeSlaves = globalEdgeSlavesPtr_();
List<labelPairList> transformedEdges(edges.size());
forAll(allEdgeConnectivity, edgeI)
{
const labelPairList& edgeInfo = allEdgeConnectivity[edgeI];
if (edgeInfo.size() >= 2)
{
const labelPair& masterInfo = edgeInfo[0];
// Check if master edge (= first element (since sorted)) is me.
if
(
(
globalIndexAndTransform::processor(masterInfo)
== Pstream::myProcNo()
)
&& (globalIndexAndTransform::index(masterInfo) == edgeI)
)
{
// Sort into transformed and untransformed
labelList& eEdges = globalEdgeSlaves[edgeI];
eEdges.setSize(edgeInfo.size()-1);
labelPairList& trafoEEdges = transformedEdges[edgeI];
trafoEEdges.setSize(edgeInfo.size()-1);
label nonTransformI = 0;
label transformI = 0;
for (label i = 1; i < edgeInfo.size(); i++)
{
const labelPair& info = edgeInfo[i];
label procI = globalIndexAndTransform::processor(info);
label index = globalIndexAndTransform::index(info);
label transform = globalIndexAndTransform::transformIndex
(
info
);
if (transform == globalTransforms().nullTransformIndex())
{
eEdges[nonTransformI++] = globalEdgeNumbers.toGlobal
(
procI,
index
);
}
else
{
trafoEEdges[transformI++] = info;
} }
} }
eEdges.setSize(nonTransformI);
trafoEEdges.setSize(transformI);
} }
} }
} }

View File

@ -263,6 +263,27 @@ class globalMeshData
//- Calculate global point addressing. //- Calculate global point addressing.
void calcGlobalPointSlaves() const; void calcGlobalPointSlaves() const;
// Global edge addressing
//- Calculate connected points
void calcPointConnectivity(List<labelPairList>&) const;
//- Calculate pointEdges and pointPoints addressing
void calcGlobalPointEdges
(
labelListList& globalPointEdges,
List<labelPairList>& globalPointPoints
) const;
//- Look up remote and local point and find using info the
// transforms to go from remotePoint to localPoint
label findTransform
(
const labelPairList& info,
const labelPair& remotePoint,
const label localPoint
) const;
//- Calculate global edge addressing. //- Calculate global edge addressing.
void calcGlobalEdgeSlaves() const; void calcGlobalEdgeSlaves() const;
@ -282,7 +303,7 @@ public:
// Static data members // Static data members
//- Geomteric tolerance (fraction of bounding box) //- Geometric tolerance (fraction of bounding box)
static const Foam::scalar matchTol_; static const Foam::scalar matchTol_;
@ -449,6 +470,17 @@ public:
const bool isPosition const bool isPosition
); );
//- Helper: synchronise data without transforms
template<class Type, class CombineOp>
static void syncData
(
List<Type>& pointData,
const labelListList& slaves,
const labelListList& transformedSlaves,
const mapDistribute& slavesMap,
const CombineOp& cop
);
// Coupled point to coupled points. Coupled points are // Coupled point to coupled points. Coupled points are
// points on any coupled patch. // points on any coupled patch.

View File

@ -90,6 +90,59 @@ void Foam::globalMeshData::syncData
} }
template<class Type, class CombineOp>
void Foam::globalMeshData::syncData
(
List<Type>& elems,
const labelListList& slaves,
const labelListList& transformedSlaves,
const mapDistribute& slavesMap,
const CombineOp& cop
)
{
// Pull slave data onto master
slavesMap.distribute(elems);
// Combine master data with slave data
forAll(slaves, i)
{
Type& elem = elems[i];
const labelList& slavePoints = slaves[i];
const labelList& transformSlavePoints = transformedSlaves[i];
if (slavePoints.size()+transformSlavePoints.size() > 0)
{
// Combine master with untransformed slave data
forAll(slavePoints, j)
{
cop(elem, elems[slavePoints[j]]);
}
// Combine master with transformed slave data
forAll(transformSlavePoints, j)
{
cop(elem, elems[transformSlavePoints[j]]);
}
// Copy result back to slave slots
forAll(slavePoints, j)
{
elems[slavePoints[j]] = elem;
}
forAll(transformSlavePoints, j)
{
elems[transformSlavePoints[j]] = elem;
}
}
}
// Push slave-slot data back to slaves
slavesMap.reverseDistribute(elems.size(), elems);
}
template<class Type, class CombineOp> template<class Type, class CombineOp>
void Foam::globalMeshData::syncPointData void Foam::globalMeshData::syncPointData
( (

View File

@ -125,7 +125,7 @@ bool Foam::globalPoints::mergeInfo
const labelPairList& nbrInfo, const labelPairList& nbrInfo,
const label localPointI, const label localPointI,
labelPairList& myInfo labelPairList& myInfo
) ) const
{ {
bool anyChanged = false; bool anyChanged = false;
@ -167,7 +167,7 @@ bool Foam::globalPoints::mergeInfo
); );
// Combine mine and nbr transform // Combine mine and nbr transform
label t = globalIndexAndTransform::mergeTransformIndex label t = globalTransforms_.mergeTransformIndex
( (
nbrTransform, nbrTransform,
myTransform myTransform
@ -315,27 +315,6 @@ bool Foam::globalPoints::storeInitialInfo
} }
Foam::FixedList<Foam::label, 3> Foam::globalPoints::transformBits
(
const label transformIndex
) const
{
label t = transformIndex;
// Decode permutation as 3 integers
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Note: FixedList for speed reasons.
FixedList<label, 3> permutation;
permutation[0] = (t%3)-1;
t /= 3;
permutation[1] = (t%3)-1;
t /= 3;
permutation[2] = (t%3)-1;
return permutation;
}
void Foam::globalPoints::printProcPoints void Foam::globalPoints::printProcPoints
( (
const labelList& patchToMeshPoint, const labelList& patchToMeshPoint,
@ -352,7 +331,8 @@ void Foam::globalPoints::printProcPoints
Pout<< " localpoint:"; Pout<< " localpoint:";
Pout<< index; Pout<< index;
Pout<< " through transform:" Pout<< " through transform:"
<< trafoI << " bits:" << transformBits(trafoI); << trafoI << " bits:"
<< globalTransforms_.decodeTransformIndex(trafoI);
if (procI == Pstream::myProcNo()) if (procI == Pstream::myProcNo())
{ {
@ -850,49 +830,6 @@ Foam::labelList Foam::globalPoints::reverseMeshPoints
} }
bool Foam::globalPoints::globalIndexAndTransformLessThan::operator()
(
const labelPair& a,
const labelPair& b
)
{
label procA = globalIndexAndTransform::processor(a);
label procB = globalIndexAndTransform::processor(b);
if (procA < procB)
{
return true;
}
else if (procA > procB)
{
return false;
}
else
{
// Equal proc.
label indexA = globalIndexAndTransform::index(a);
label indexB = globalIndexAndTransform::index(b);
if (indexA < indexB)
{
return true;
}
else if (indexA > indexB)
{
return false;
}
else
{
// Equal index
label transformA = globalIndexAndTransform::transformIndex(a);
label transformB = globalIndexAndTransform::transformIndex(b);
return transformA < transformB;
}
}
}
void Foam::globalPoints::calculateSharedPoints void Foam::globalPoints::calculateSharedPoints
( (
const Map<label>& meshToPatchPoint, // from mesh point to local numbering const Map<label>& meshToPatchPoint, // from mesh point to local numbering
@ -1027,7 +964,7 @@ void Foam::globalPoints::calculateSharedPoints
forAllConstIter(Map<label>, meshToProcPoint_, iter) forAllConstIter(Map<label>, meshToProcPoint_, iter)
{ {
labelPairList& pointInfo = procPoints_[iter()]; labelPairList& pointInfo = procPoints_[iter()];
sort(pointInfo, globalIndexAndTransformLessThan()); sort(pointInfo, globalIndexAndTransform::less());
} }
@ -1066,7 +1003,7 @@ void Foam::globalPoints::calculateSharedPoints
for (label i = 1; i < pointInfo.size(); i++) for (label i = 1; i < pointInfo.size(); i++)
{ {
labelPair info = pointInfo[i]; const labelPair& info = pointInfo[i];
label procI = globalIndexAndTransform::processor(info); label procI = globalIndexAndTransform::processor(info);
label index = globalIndexAndTransform::index(info); label index = globalIndexAndTransform::index(info);
label transform = globalIndexAndTransform::transformIndex label transform = globalIndexAndTransform::transformIndex

View File

@ -139,18 +139,6 @@ class globalPoints
// Private Member Functions // Private Member Functions
//- Helper function to sort according minimum proc, minimum index,
// minimum transform
class globalIndexAndTransformLessThan
{
public:
bool operator()
(
const labelPair& a,
const labelPair& b
);
};
//- Count all points on processorPatches. Is all points for which //- Count all points on processorPatches. Is all points for which
// information is collected. // information is collected.
static label countPatchPoints(const polyBoundaryMesh&); static label countPatchPoints(const polyBoundaryMesh&);
@ -174,12 +162,12 @@ class globalPoints
) const; ) const;
//- Merge info from neighbour into my data //- Merge info from neighbour into my data
static bool mergeInfo bool mergeInfo
( (
const labelPairList& nbrInfo, const labelPairList& nbrInfo,
const label localPointI, const label localPointI,
labelPairList& myInfo labelPairList& myInfo
); ) const;
//- From mesh point to 'local point'. Is the mesh point itself //- From mesh point to 'local point'. Is the mesh point itself
// if meshToPatchPoint is empty. // if meshToPatchPoint is empty.
@ -210,9 +198,7 @@ class globalPoints
const label localPointI const label localPointI
); );
//- Get the signs for the individual transforms //- Debug printing
FixedList<label, 3> transformBits(const label transformIndex) const;
void printProcPoints void printProcPoints
( (
const labelList& patchToMeshPoint, const labelList& patchToMeshPoint,

View File

@ -91,6 +91,43 @@ void Foam::syncTools::syncPointMap
{ {
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();
// Synchronize multiple shared points.
const globalMeshData& pd = mesh.globalData();
// Values on shared points. Keyed on global shared index.
Map<T> sharedPointValues(0);
if (pd.nGlobalPoints() > 0)
{
// meshPoint per local index
const labelList& sharedPtLabels = pd.sharedPointLabels();
// global shared index per local index
const labelList& sharedPtAddr = pd.sharedPointAddr();
sharedPointValues.resize(sharedPtAddr.size());
// Fill my entries in the shared points
forAll(sharedPtLabels, i)
{
label meshPointI = sharedPtLabels[i];
typename Map<T>::const_iterator fnd =
pointValues.find(meshPointI);
if (fnd != pointValues.end())
{
combine
(
sharedPointValues,
cop,
sharedPtAddr[i], // index
fnd() // value
);
}
}
}
if (Pstream::parRun()) if (Pstream::parRun())
{ {
PstreamBuffers pBufs(Pstream::nonBlocking); PstreamBuffers pBufs(Pstream::nonBlocking);
@ -254,8 +291,6 @@ void Foam::syncTools::syncPointMap
} }
// Synchronize multiple shared points. // Synchronize multiple shared points.
const globalMeshData& pd = mesh.globalData();
if (pd.nGlobalPoints() > 0) if (pd.nGlobalPoints() > 0)
{ {
// meshPoint per local index // meshPoint per local index
@ -263,30 +298,6 @@ void Foam::syncTools::syncPointMap
// global shared index per local index // global shared index per local index
const labelList& sharedPtAddr = pd.sharedPointAddr(); const labelList& sharedPtAddr = pd.sharedPointAddr();
// Values on shared points. Keyed on global shared index.
Map<T> sharedPointValues(sharedPtAddr.size());
// Fill my entries in the shared points
forAll(sharedPtLabels, i)
{
label meshPointI = sharedPtLabels[i];
typename Map<T>::const_iterator fnd =
pointValues.find(meshPointI);
if (fnd != pointValues.end())
{
combine
(
sharedPointValues,
cop,
sharedPtAddr[i], // index
fnd() // value
);
}
}
// Reduce on master. // Reduce on master.
if (Pstream::parRun()) if (Pstream::parRun())
@ -367,13 +378,7 @@ void Foam::syncTools::syncPointMap
if (sharedFnd != sharedPointValues.end()) if (sharedFnd != sharedPointValues.end())
{ {
combine pointValues.set(iter(), sharedFnd());
(
pointValues,
cop,
iter(), // index
sharedFnd() // value
);
} }
} }
} }
@ -779,6 +784,23 @@ void Foam::syncTools::syncEdgeMap
// //
// const polyBoundaryMesh& patches = mesh.boundaryMesh(); // const polyBoundaryMesh& patches = mesh.boundaryMesh();
// //
// // Synchronize multiple shared points.
// const globalMeshData& pd = mesh.globalData();
//
// // Values on shared points.
// Field<T> sharedPts(0);
// if (pd.nGlobalPoints() > 0)
// {
// // Values on shared points.
// sharedPts.setSize(pd.nGlobalPoints(), nullValue);
//
// forAll(pd.sharedPointLabels(), i)
// {
// label meshPointI = pd.sharedPointLabels()[i];
// // Fill my entries in the shared points
// sharedPts[pd.sharedPointAddr()[i]] = pointValues[meshPointI];
// }
// }
// //
// if (Pstream::parRun()) // if (Pstream::parRun())
// { // {
@ -899,16 +921,6 @@ void Foam::syncTools::syncEdgeMap
// //
// if (pd.nGlobalPoints() > 0) // if (pd.nGlobalPoints() > 0)
// { // {
// // Values on shared points.
// Field<T> sharedPts(pd.nGlobalPoints(), nullValue);
//
// forAll(pd.sharedPointLabels(), i)
// {
// label meshPointI = pd.sharedPointLabels()[i];
// // Fill my entries in the shared points
// sharedPts[pd.sharedPointAddr()[i]] = pointValues[meshPointI];
// }
//
// // Combine on master. // // Combine on master.
// Pstream::listCombineGather(sharedPts, cop); // Pstream::listCombineGather(sharedPts, cop);
// Pstream::listCombineScatter(sharedPts); // Pstream::listCombineScatter(sharedPts);
@ -1208,6 +1220,8 @@ void Foam::syncTools::syncEdgePositions
const globalMeshData& gd = mesh.globalData(); const globalMeshData& gd = mesh.globalData();
const labelList& meshEdges = gd.coupledPatchMeshEdges(); const labelList& meshEdges = gd.coupledPatchMeshEdges();
const globalIndexAndTransform& git = gd.globalTransforms();
const mapDistribute& map = gd.globalEdgeSlavesMap();
List<point> cppFld(UIndirectList<point>(edgeValues, meshEdges)); List<point> cppFld(UIndirectList<point>(edgeValues, meshEdges));
@ -1216,8 +1230,8 @@ void Foam::syncTools::syncEdgePositions
cppFld, cppFld,
gd.globalEdgeSlaves(), gd.globalEdgeSlaves(),
gd.globalEdgeTransformedSlaves(), gd.globalEdgeTransformedSlaves(),
gd.globalEdgeSlavesMap(), map,
gd.globalTransforms(), git,
cop, cop,
true //position? true //position?
); );
@ -1505,140 +1519,28 @@ void Foam::syncTools::syncPointList
<< mesh.nPoints() << abort(FatalError); << mesh.nPoints() << abort(FatalError);
} }
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const globalMeshData& gd = mesh.globalData();
const labelList& meshPoints = gd.coupledPatch().meshPoints();
if (Pstream::parRun()) List<unsigned int> cppFld(gd.globalPointSlavesMap().constructSize());
forAll(meshPoints, i)
{ {
PstreamBuffers pBufs(Pstream::nonBlocking); cppFld[i] = pointValues[meshPoints[i]];
}
// Send globalMeshData::syncData
forAll(patches, patchI)
{
if
( (
isA<processorPolyPatch>(patches[patchI]) cppFld,
&& patches[patchI].nPoints() > 0 gd.globalPointSlaves(),
) gd.globalPointTransformedSlaves(),
gd.globalPointSlavesMap(),
cop
);
// Extract back to mesh
forAll(meshPoints, i)
{ {
const processorPolyPatch& procPatch = pointValues[meshPoints[i]] = cppFld[i];
refCast<const processorPolyPatch>(patches[patchI]);
List<unsigned int> patchInfo(procPatch.nPoints());
const labelList& meshPts = procPatch.meshPoints();
const labelList& nbrPts = procPatch.neighbPoints();
forAll(nbrPts, pointI)
{
label nbrPointI = nbrPts[pointI];
patchInfo[nbrPointI] = pointValues[meshPts[pointI]];
}
UOPstream toNbr(procPatch.neighbProcNo(), pBufs);
toNbr << patchInfo;
}
}
pBufs.finishedSends();
// Receive and combine.
forAll(patches, patchI)
{
if
(
isA<processorPolyPatch>(patches[patchI])
&& patches[patchI].nPoints() > 0
)
{
const processorPolyPatch& procPatch =
refCast<const processorPolyPatch>(patches[patchI]);
List<unsigned int> nbrPatchInfo(procPatch.nPoints());
{
// We do not know the number of points on the other side
// so cannot use Pstream::read.
UIPstream fromNbr(procPatch.neighbProcNo(), pBufs);
fromNbr >> nbrPatchInfo;
}
const labelList& meshPts = procPatch.meshPoints();
forAll(meshPts, pointI)
{
label meshPointI = meshPts[pointI];
unsigned int pointVal = pointValues[meshPointI];
cop(pointVal, nbrPatchInfo[pointI]);
pointValues[meshPointI] = pointVal;
}
}
}
}
// Do the cyclics.
forAll(patches, patchI)
{
if (isA<cyclicPolyPatch>(patches[patchI]))
{
const cyclicPolyPatch& cycPatch =
refCast<const cyclicPolyPatch>(patches[patchI]);
if (cycPatch.owner())
{
// Owner does all.
const edgeList& coupledPoints = cycPatch.coupledPoints();
const labelList& meshPts = cycPatch.meshPoints();
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
const labelList& nbrMeshPts = nbrPatch.meshPoints();
forAll(coupledPoints, i)
{
const edge& e = coupledPoints[i];
label meshPoint0 = meshPts[e[0]];
label meshPoint1 = nbrMeshPts[e[1]];
unsigned int val0 = pointValues[meshPoint0];
unsigned int val1 = pointValues[meshPoint1];
unsigned int t = val0;
cop(val0, val1);
pointValues[meshPoint0] = val0;
cop(val1, t);
pointValues[meshPoint1] = val1;
}
}
}
}
// Synchronize multiple shared points.
const globalMeshData& pd = mesh.globalData();
if (pd.nGlobalPoints() > 0)
{
// Values on shared points. Use unpacked storage for ease!
List<unsigned int> sharedPts(pd.nGlobalPoints(), nullValue);
forAll(pd.sharedPointLabels(), i)
{
label meshPointI = pd.sharedPointLabels()[i];
// Fill my entries in the shared points
sharedPts[pd.sharedPointAddr()[i]] = pointValues[meshPointI];
}
// Combine on master.
Pstream::listCombineGather(sharedPts, cop);
Pstream::listCombineScatter(sharedPts);
// Now we will all have the same information. Merge it back with
// my local information.
forAll(pd.sharedPointLabels(), i)
{
label meshPointI = pd.sharedPointLabels()[i];
pointValues[meshPointI] = sharedPts[pd.sharedPointAddr()[i]];
}
} }
} }
@ -1664,140 +1566,28 @@ void Foam::syncTools::syncEdgeList
<< mesh.nEdges() << abort(FatalError); << mesh.nEdges() << abort(FatalError);
} }
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const globalMeshData& gd = mesh.globalData();
const labelList& meshEdges = gd.coupledPatchMeshEdges();
if (Pstream::parRun()) List<unsigned int> cppFld(gd.globalEdgeSlavesMap().constructSize());
forAll(meshEdges, i)
{ {
PstreamBuffers pBufs(Pstream::nonBlocking); cppFld[i] = edgeValues[meshEdges[i]];
}
// Send globalMeshData::syncData
forAll(patches, patchI)
{
if
( (
isA<processorPolyPatch>(patches[patchI]) cppFld,
&& patches[patchI].nEdges() > 0 gd.globalEdgeSlaves(),
) gd.globalEdgeTransformedSlaves(),
gd.globalEdgeSlavesMap(),
cop
);
// Extract back to mesh
forAll(meshEdges, i)
{ {
const processorPolyPatch& procPatch = edgeValues[meshEdges[i]] = cppFld[i];
refCast<const processorPolyPatch>(patches[patchI]);
List<unsigned int> patchInfo(procPatch.nEdges());
const labelList& meshEdges = procPatch.meshEdges();
const labelList& neighbEdges = procPatch.neighbEdges();
forAll(neighbEdges, edgeI)
{
label nbrEdgeI = neighbEdges[edgeI];
patchInfo[nbrEdgeI] = edgeValues[meshEdges[edgeI]];
}
UOPstream toNbr(procPatch.neighbProcNo(), pBufs);
toNbr << patchInfo;
}
}
pBufs.finishedSends();
// Receive and combine.
forAll(patches, patchI)
{
if
(
isA<processorPolyPatch>(patches[patchI])
&& patches[patchI].nEdges() > 0
)
{
const processorPolyPatch& procPatch =
refCast<const processorPolyPatch>(patches[patchI]);
// Receive from neighbour.
List<unsigned int> nbrPatchInfo(procPatch.nEdges());
{
UIPstream fromNeighb(procPatch.neighbProcNo(), pBufs);
fromNeighb >> nbrPatchInfo;
}
const labelList& meshEdges = procPatch.meshEdges();
forAll(meshEdges, edgeI)
{
unsigned int patchVal = nbrPatchInfo[edgeI];
label meshEdgeI = meshEdges[edgeI];
unsigned int edgeVal = edgeValues[meshEdgeI];
cop(edgeVal, patchVal);
edgeValues[meshEdgeI] = edgeVal;
}
}
}
}
// Do the cyclics.
forAll(patches, patchI)
{
if (isA<cyclicPolyPatch>(patches[patchI]))
{
const cyclicPolyPatch& cycPatch =
refCast<const cyclicPolyPatch>(patches[patchI]);
if (cycPatch.owner())
{
// Owner does all.
const edgeList& coupledEdges = cycPatch.coupledEdges();
const labelList& meshEdges = cycPatch.meshEdges();
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
const labelList& nbrMeshEdges = nbrPatch.meshEdges();
forAll(coupledEdges, i)
{
const edge& e = coupledEdges[i];
label edge0 = meshEdges[e[0]];
label edge1 = nbrMeshEdges[e[1]];
unsigned int val0 = edgeValues[edge0];
unsigned int t = val0;
unsigned int val1 = edgeValues[edge1];
cop(t, val1);
edgeValues[edge0] = t;
cop(val1, val0);
edgeValues[edge1] = val1;
}
}
}
}
// Synchronize multiple shared edges.
const globalMeshData& pd = mesh.globalData();
if (pd.nGlobalEdges() > 0)
{
// Values on shared edges. Use unpacked storage for ease!
List<unsigned int> sharedPts(pd.nGlobalEdges(), nullValue);
forAll(pd.sharedEdgeLabels(), i)
{
label meshEdgeI = pd.sharedEdgeLabels()[i];
// Fill my entries in the shared edges
sharedPts[pd.sharedEdgeAddr()[i]] = edgeValues[meshEdgeI];
}
// Combine on master.
Pstream::listCombineGather(sharedPts, cop);
Pstream::listCombineScatter(sharedPts);
// Now we will all have the same information. Merge it back with
// my local information.
forAll(pd.sharedEdgeLabels(), i)
{
label meshEdgeI = pd.sharedEdgeLabels()[i];
edgeValues[meshEdgeI] = sharedPts[pd.sharedEdgeAddr()[i]];
}
} }
} }

View File

@ -37,13 +37,33 @@ namespace Foam
Foam::polynomial::polynomial(const word& entryName, Istream& is) Foam::polynomial::polynomial(const word& entryName, Istream& is)
: :
DataEntry<scalar>(entryName), DataEntry<scalar>(entryName),
coeffs_(is) coeffs_(is),
canIntegrate_(true)
{ {
if (!coeffs_.size()) if (!coeffs_.size())
{ {
FatalErrorIn("Foam::polynomial::polynomial(const word&, Istream&)") FatalErrorIn("Foam::polynomial::polynomial(const word&, Istream&)")
<< "polynomial coefficients for entry " << this->name_ << "polynomial coefficients for entry " << this->name_
<< " is invalid (empty)" << nl << exit(FatalError); << " are invalid (empty)" << nl << exit(FatalError);
}
forAll(coeffs_, i)
{
if (mag(coeffs_[i].second() + 1) < ROOTVSMALL)
{
canIntegrate_ = false;
break;
}
}
if (debug)
{
if (!canIntegrate_)
{
WarningIn("Foam::polynomial::polynomial(const word&, Istream&)")
<< "Polynomial " << this->name_ << " cannot be integrated"
<< endl;
}
} }
} }
@ -51,7 +71,8 @@ Foam::polynomial::polynomial(const word& entryName, Istream& is)
Foam::polynomial::polynomial(const polynomial& poly) Foam::polynomial::polynomial(const polynomial& poly)
: :
DataEntry<scalar>(poly), DataEntry<scalar>(poly),
coeffs_(poly.coeffs_) coeffs_(poly.coeffs_),
canIntegrate_(poly.canIntegrate_)
{} {}
@ -65,13 +86,10 @@ Foam::polynomial::~polynomial()
Foam::scalar Foam::polynomial::value(const scalar x) const Foam::scalar Foam::polynomial::value(const scalar x) const
{ {
scalar y = coeffs_[0].first(); scalar y = 0.0;
scalar powX = x; forAll(coeffs_, i)
for (label i = 1; i < coeffs_.size(); i++)
{ {
y += coeffs_[i].first()*powX; y += coeffs_[i].first()*pow(x, coeffs_[i].second());
powX *= x;
} }
return y; return y;
@ -82,6 +100,8 @@ Foam::scalar Foam::polynomial::integrate(const scalar x1, const scalar x2) const
{ {
scalar intx = 0.0; scalar intx = 0.0;
if (canIntegrate_)
{
forAll(coeffs_, i) forAll(coeffs_, i)
{ {
intx += intx +=
@ -91,6 +111,7 @@ Foam::scalar Foam::polynomial::integrate(const scalar x1, const scalar x2) const
- pow(x1, coeffs_[i].second() + 1) - pow(x1, coeffs_[i].second() + 1)
); );
} }
}
return intx; return intx;
} }

View File

@ -76,6 +76,9 @@ class polynomial
//- Polynomial coefficients - list of prefactor, exponent //- Polynomial coefficients - list of prefactor, exponent
List<Tuple2<scalar, scalar> > coeffs_; List<Tuple2<scalar, scalar> > coeffs_;
//- Flag to indicate whether poly can be integrated
bool canIntegrate_;
// Private Member Functions // Private Member Functions

View File

@ -60,6 +60,24 @@ class polyMesh;
class globalIndexAndTransform class globalIndexAndTransform
{ {
public:
// Public classes
//- Less function class used in sorting encoded transforms and indices
// - minimum processor
// - minimum local index
// - minimum transform
class less
{
public:
inline bool operator()(const labelPair&, const labelPair&) const;
};
private:
// Private data // Private data
//- Reference to mesh //- Reference to mesh
@ -120,11 +138,17 @@ class globalIndexAndTransform
bool checkBothSigns bool checkBothSigns
) const; ) const;
//- Encode transform index. Hardcoded to 3 independent transforms max.
inline label encodeTransformIndex
(
const FixedList<Foam::label, 3>& permutationIndices
) const;
//- Decode transform index. Hardcoded to 3 independent transforms max. //- Decode transform index. Hardcoded to 3 independent transforms max.
inline static FixedList<label, 3> decodeTransformIndex inline FixedList<label, 3> decodeTransformIndex
( (
const label transformIndex const label transformIndex
); ) const;
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
globalIndexAndTransform(const globalIndexAndTransform&); globalIndexAndTransform(const globalIndexAndTransform&);
@ -135,6 +159,10 @@ class globalIndexAndTransform
public: public:
//- Declare friendship with the entry class for IO
friend class globalPoints;
// Constructors // Constructors
//- Construct from components //- Construct from components
@ -166,18 +194,25 @@ public:
) const; ) const;
//- Combine two transformIndices //- Combine two transformIndices
static inline label mergeTransformIndex inline label mergeTransformIndex
( (
const label transformIndex0, const label transformIndex0,
const label transformIndex1 const label transformIndex1
); ) const;
//- Combine two transformIndices //- Combine two transformIndices
static inline label minimumTransformIndex inline label minimumTransformIndex
( (
const label transformIndex0, const label transformIndex0,
const label transformIndex1 const label transformIndex1
); ) const;
//- Subtract two transformIndices
inline label subtractTransformIndex
(
const label transformIndex0,
const label transformIndex1
) const;
//- Encode index and bare index as components on own processor //- Encode index and bare index as components on own processor
inline static labelPair encode inline static labelPair encode

View File

@ -27,6 +27,49 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::globalIndexAndTransform::less::operator()
(
const labelPair& a,
const labelPair& b
) const
{
label procA = globalIndexAndTransform::processor(a);
label procB = globalIndexAndTransform::processor(b);
if (procA < procB)
{
return true;
}
else if (procA > procB)
{
return false;
}
else
{
// Equal proc.
label indexA = globalIndexAndTransform::index(a);
label indexB = globalIndexAndTransform::index(b);
if (indexA < indexB)
{
return true;
}
else if (indexA > indexB)
{
return false;
}
else
{
// Equal index
label transformA = globalIndexAndTransform::transformIndex(a);
label transformB = globalIndexAndTransform::transformIndex(b);
return transformA < transformB;
}
}
}
Foam::label Foam::globalIndexAndTransform::encodeTransformIndex Foam::label Foam::globalIndexAndTransform::encodeTransformIndex
( (
const List<label>& permutationIndices const List<label>& permutationIndices
@ -75,20 +118,56 @@ Foam::label Foam::globalIndexAndTransform::encodeTransformIndex
} }
Foam::label Foam::globalIndexAndTransform::encodeTransformIndex
(
const FixedList<Foam::label, 3>& permutation
) const
{
if (nIndependentTransforms() == 0)
{
return 0;
}
if (nIndependentTransforms() == 1)
{
return permutation[0]+1;
}
else if (nIndependentTransforms() == 2)
{
return (permutation[1]+1)*3 + (permutation[0]+1);
}
else
{
return
(permutation[2]+1)*9
+ (permutation[1]+1)*3
+ (permutation[0]+1);
}
}
Foam::FixedList<Foam::label, 3> Foam::FixedList<Foam::label, 3>
Foam::globalIndexAndTransform::decodeTransformIndex Foam::globalIndexAndTransform::decodeTransformIndex
( (
const label transformIndex const label transformIndex
) ) const
{ {
FixedList<label, 3> permutation; FixedList<label, 3> permutation(0);
label t = transformIndex; label t = transformIndex;
if (nIndependentTransforms() > 0)
{
permutation[0] = (t%3)-1; permutation[0] = (t%3)-1;
if (nIndependentTransforms() > 1)
{
t /= 3; t /= 3;
permutation[1] = (t%3)-1; permutation[1] = (t%3)-1;
if (nIndependentTransforms() > 2)
{
t /= 3; t /= 3;
permutation[2] = (t%3)-1; permutation[2] = (t%3)-1;
}
}
}
# ifdef FULLDEBUG # ifdef FULLDEBUG
t /= 3; t /= 3;
@ -179,10 +258,7 @@ Foam::label Foam::globalIndexAndTransform::addToTransformIndex
// Re-encode permutation // Re-encode permutation
// ~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~
return return encodeTransformIndex(permutation);
(permutation[2]+1)*9
+ (permutation[1]+1)*3
+ (permutation[0]+1);
} }
else else
{ {
@ -195,7 +271,7 @@ Foam::label Foam::globalIndexAndTransform::mergeTransformIndex
( (
const label transformIndex0, const label transformIndex0,
const label transformIndex1 const label transformIndex1
) ) const
{ {
FixedList<label, 3> permutation0 = decodeTransformIndex(transformIndex0); FixedList<label, 3> permutation0 = decodeTransformIndex(transformIndex0);
FixedList<label, 3> permutation1 = decodeTransformIndex(transformIndex1); FixedList<label, 3> permutation1 = decodeTransformIndex(transformIndex1);
@ -226,10 +302,7 @@ Foam::label Foam::globalIndexAndTransform::mergeTransformIndex
<< exit(FatalError); << exit(FatalError);
} }
} }
return return encodeTransformIndex(permutation0);
(permutation0[2]+1)*9
+ (permutation0[1]+1)*3
+ (permutation0[0]+1);
} }
@ -237,7 +310,7 @@ Foam::label Foam::globalIndexAndTransform::minimumTransformIndex
( (
const label transformIndex0, const label transformIndex0,
const label transformIndex1 const label transformIndex1
) ) const
{ {
FixedList<label, 3> permutation0 = decodeTransformIndex(transformIndex0); FixedList<label, 3> permutation0 = decodeTransformIndex(transformIndex0);
FixedList<label, 3> permutation1 = decodeTransformIndex(transformIndex1); FixedList<label, 3> permutation1 = decodeTransformIndex(transformIndex1);
@ -272,10 +345,25 @@ Foam::label Foam::globalIndexAndTransform::minimumTransformIndex
<< exit(FatalError); << exit(FatalError);
} }
} }
return return encodeTransformIndex(permutation0);
(permutation0[2]+1)*9 }
+ (permutation0[1]+1)*3
+ (permutation0[0]+1);
Foam::label Foam::globalIndexAndTransform::subtractTransformIndex
(
const label transformIndex0,
const label transformIndex1
) const
{
FixedList<label, 3> permutation0 = decodeTransformIndex(transformIndex0);
FixedList<label, 3> permutation1 = decodeTransformIndex(transformIndex1);
forAll(permutation0, i)
{
permutation0[i] -= permutation1[i];
}
return encodeTransformIndex(permutation0);
} }

View File

@ -243,13 +243,14 @@ $(schemes)/cubicUpwindFit/cubicUpwindFit.C
$(schemes)/quadraticLinearPureUpwindFit/quadraticLinearPureUpwindFit.C $(schemes)/quadraticLinearPureUpwindFit/quadraticLinearPureUpwindFit.C
*/ */
$(schemes)/linearPureUpwindFit/linearPureUpwindFit.C $(schemes)/linearPureUpwindFit/linearPureUpwindFit.C
$(schemes)/linearUpwind/linearUpwind.C
$(schemes)/linearUpwind/linearUpwindV.C
$(schemes)/quadraticUpwind/quadraticUpwind.C
limitedSchemes = $(surfaceInterpolation)/limitedSchemes limitedSchemes = $(surfaceInterpolation)/limitedSchemes
$(limitedSchemes)/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationSchemes.C $(limitedSchemes)/limitedSurfaceInterpolationScheme/limitedSurfaceInterpolationSchemes.C
$(limitedSchemes)/upwind/upwind.C $(limitedSchemes)/upwind/upwind.C
$(limitedSchemes)/blended/blended.C $(limitedSchemes)/blended/blended.C
$(limitedSchemes)/linearUpwind/linearUpwind.C
$(limitedSchemes)/linearUpwind/linearUpwindV.C
$(limitedSchemes)/Gamma/Gamma.C $(limitedSchemes)/Gamma/Gamma.C
$(limitedSchemes)/SFCD/SFCD.C $(limitedSchemes)/SFCD/SFCD.C
$(limitedSchemes)/Minmod/Minmod.C $(limitedSchemes)/Minmod/Minmod.C

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,6 @@ License
#include "linearUpwind.H" #include "linearUpwind.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "zeroGradientFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -85,16 +84,8 @@ Foam::linearUpwind<Type>::correction
forAll(faceFlux, facei) forAll(faceFlux, facei)
{ {
if (faceFlux[facei] > 0) label celli = (faceFlux[facei] > 0) ? owner[facei] : neighbour[facei];
{ sfCorr[facei] = (Cf[facei] - C[celli]) & gradVf[celli];
label own = owner[facei];
sfCorr[facei] = (Cf[facei] - C[own]) & gradVf[own];
}
else
{
label nei = neighbour[facei];
sfCorr[facei] = (Cf[facei] - C[nei]) & gradVf[nei];
}
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,7 +26,8 @@ Class
Description Description
linearUpwind interpolation scheme class derived from upwind and returns linearUpwind interpolation scheme class derived from upwind and returns
upwind weighting factors but also applies an explicit correction. upwind weighting factors and also applies a gradient-based explicit
correction.
SourceFiles SourceFiles
linearUpwind.C linearUpwind.C

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -0,0 +1,38 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-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 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "quadraticUpwind.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
//makeSurfaceInterpolationScheme(quadraticUpwind);
makeSurfaceInterpolationTypeScheme(quadraticUpwind, scalar);
makeSurfaceInterpolationTypeScheme(quadraticUpwind, vector);
}
// ************************************************************************* //

View File

@ -0,0 +1,134 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-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/>.
Class
quadraticUpwind
Description
quadraticUpwind interpolation scheme class derived from linearUpwind and
returns blended linear/upwind weighting factors and also applies a explicit
gradient-based correction obtained from the linearUpwind scheme.
SourceFiles
quadraticUpwind.C
\*---------------------------------------------------------------------------*/
#ifndef quadraticUpwind_H
#define quadraticUpwind_H
#include "linearUpwind.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class quadraticUpwind Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class quadraticUpwind
:
public linearUpwind<Type>
{
// Private Member Functions
//- Disallow default bitwise copy construct
quadraticUpwind(const quadraticUpwind&);
//- Disallow default bitwise assignment
void operator=(const quadraticUpwind&);
public:
//- Runtime type information
TypeName("quadraticUpwind");
// Constructors
//- Construct from mesh and Istream
quadraticUpwind
(
const fvMesh& mesh,
Istream& schemeData
)
:
linearUpwind<Type>(mesh, schemeData)
{}
//- Construct from mesh, faceFlux and Istream
quadraticUpwind
(
const fvMesh& mesh,
const surfaceScalarField& faceFlux,
Istream& schemeData
)
:
linearUpwind<Type>(mesh, faceFlux, schemeData)
{}
// Member Functions
//- Return the interpolation weighting factors
virtual tmp<surfaceScalarField> weights
(
const GeometricField<Type, fvPatchField, volMesh>&
) const
{
return
0.75*this->mesh().surfaceInterpolation::weights()
+ 0.25*linearUpwind<Type>::weights();
}
//- Return true if this scheme uses an explicit correction
virtual bool corrected() const
{
return true;
}
//- Return the explicit correction to the face-interpolate
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
correction
(
const GeometricField<Type, fvPatchField, volMesh>& vf
) const
{
return 0.25*linearUpwind<Type>::correction(vf);
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -3,6 +3,11 @@ cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso [ $# -ge 1 ] && makeOption=$1 || makeOption=libso
set -x set -x
export ParMGridGen=$WM_THIRD_PARTY_DIR/ParMGridGen-1.0
if [ -d "$ParMGridGen/MGridGen/Lib" ]
then
wmake $makeOption MGridGenGamgAgglomeration wmake $makeOption MGridGenGamgAgglomeration
fi
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -1,4 +1,4 @@
ParMGridGen = $(WM_THIRD_PARTY_DIR)/ParMGridGen-1.0 /* Needs ParMGridGen environment variable set. (see Allwmake script) */
TYPE_REAL= TYPE_REAL=
#if defined(WM_SP) #if defined(WM_SP)

View File

@ -3,6 +3,7 @@ cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso [ $# -ge 1 ] && makeOption=$1 || makeOption=libso
set -x set -x
wmake $makeOption distributionModels
wmake $makeOption basic wmake $makeOption basic
wmake $makeOption solidParticle wmake $makeOption solidParticle
wmake $makeOption intermediate wmake $makeOption intermediate

View File

@ -3,16 +3,16 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
@ -25,7 +25,7 @@ LIB_LIBS = \
-lmeshTools \ -lmeshTools \
-llagrangian \ -llagrangian \
-llagrangianIntermediate \ -llagrangianIntermediate \
-lpdf \ -ldistributionModels \
-lspecie \ -lspecie \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lliquidProperties \ -lliquidProperties \

View File

@ -8,12 +8,12 @@ EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude
LIB_LIBS = \ LIB_LIBS = \
-llagrangian \ -llagrangian \
@ -26,4 +26,4 @@ LIB_LIBS = \
-lliquidMixtureProperties \ -lliquidMixtureProperties \
-lthermophysicalFunctions \ -lthermophysicalFunctions \
-lspecie \ -lspecie \
-lpdf -ldistributionModels

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -52,11 +52,11 @@ Foam::ChomiakInjector::ChomiakInjector
: :
injectorModel(dict, sm), injectorModel(dict, sm),
ChomiakDict_(dict.subDict(typeName + "Coeffs")), ChomiakDict_(dict.subDict(typeName + "Coeffs")),
dropletPDF_ sizeDistribution_
( (
pdfs::pdf::New distributionModels::distributionModel::New
( (
ChomiakDict_.subDict("dropletPDF"), ChomiakDict_.subDict("sizeDistribution"),
sm.rndGen() sm.rndGen()
) )
), ),
@ -101,7 +101,7 @@ Foam::scalar Foam::ChomiakInjector::d0
const scalar const scalar
) const ) const
{ {
return dropletPDF_->sample(); return sizeDistribution_->sample();
} }
@ -113,8 +113,8 @@ Foam::vector Foam::ChomiakInjector::direction
const scalar d const scalar d
) const ) const
{ {
scalar dMin = dropletPDF_->minValue(); scalar dMin = sizeDistribution_->minValue();
scalar dMax = dropletPDF_->maxValue(); scalar dMax = sizeDistribution_->maxValue();
scalar angle = scalar angle =
(d - dMax)*maxSprayAngle_[n] (d - dMax)*maxSprayAngle_[n]

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -27,7 +27,7 @@ Class
Description Description
Injector model based on an idea of Jerzy Chomiak. Injector model based on an idea of Jerzy Chomiak.
Given the initial droplet size pdf in an interval d = (d0, d1), Given the initial droplet size distribution in an interval d = (d0, d1),
the spray angle phi = phi(d), such that the spray angle phi = phi(d), such that
the largest droplets have zero spray angle the largest droplets have zero spray angle
and the smallest droplets have maximum spray angle. and the smallest droplets have maximum spray angle.
@ -41,7 +41,7 @@ Description
#include "injectorModel.H" #include "injectorModel.H"
#include "scalarList.H" #include "scalarList.H"
#include "pdf.H" #include "distributionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -63,7 +63,7 @@ private:
dictionary ChomiakDict_; dictionary ChomiakDict_;
autoPtr<pdfs::pdf> dropletPDF_; autoPtr<distributionModels::distributionModel> sizeDistribution_;
scalarList maxSprayAngle_; scalarList maxSprayAngle_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -52,11 +52,11 @@ Foam::definedHollowConeInjector::definedHollowConeInjector
: :
injectorModel(dict, sm), injectorModel(dict, sm),
definedHollowConeDict_(dict.subDict(typeName + "Coeffs")), definedHollowConeDict_(dict.subDict(typeName + "Coeffs")),
dropletPDF_ sizeDistribution_
( (
pdfs::pdf::New distributionModels::distributionModel::New
( (
definedHollowConeDict_.subDict("dropletPDF"), definedHollowConeDict_.subDict("sizeDistribution"),
sm.rndGen() sm.rndGen()
) )
), ),
@ -137,8 +137,8 @@ Foam::scalar Foam::definedHollowConeInjector::d0
) const ) const
{ {
// swallow function arguments - not used // swallow function arguments - not used
// return value sampled from PDF // return value sampled from distribution model
return dropletPDF_->sample(); return sizeDistribution_->sample();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -29,7 +29,7 @@ Description
- user defined: - user defined:
- inner/outer cone angle vs. time - inner/outer cone angle vs. time
- droplet PDF - droplet distribution model
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -38,7 +38,7 @@ Description
#include "injectorModel.H" #include "injectorModel.H"
#include "vector.H" #include "vector.H"
#include "pdf.H" #include "distributionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -60,7 +60,7 @@ private:
typedef VectorSpace<Vector<scalar>, scalar, 2> pair; typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
dictionary definedHollowConeDict_; dictionary definedHollowConeDict_;
autoPtr<pdfs::pdf> dropletPDF_; autoPtr<distributionModels::distributionModel> sizeDistribution_;
// inner and outer cone angle time histories // inner and outer cone angle time histories
// 2 column vectors = (time, coneAngle) // 2 column vectors = (time, coneAngle)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -52,11 +52,11 @@ Foam::hollowConeInjector::hollowConeInjector
: :
injectorModel(dict, sm), injectorModel(dict, sm),
hollowConeDict_(dict.subDict(typeName + "Coeffs")), hollowConeDict_(dict.subDict(typeName + "Coeffs")),
dropletPDF_ sizeDistribution_
( (
pdfs::pdf::New distributionModels::distributionModel::New
( (
hollowConeDict_.subDict("dropletPDF"), hollowConeDict_.subDict("sizeDistribution"),
sm.rndGen() sm.rndGen()
) )
), ),
@ -112,7 +112,7 @@ Foam::scalar Foam::hollowConeInjector::d0
const scalar const scalar
) const ) const
{ {
return dropletPDF_->sample(); return sizeDistribution_->sample();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -37,7 +37,7 @@ Description
#include "injectorModel.H" #include "injectorModel.H"
#include "scalarList.H" #include "scalarList.H"
#include "pdf.H" #include "distributionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -58,7 +58,7 @@ private:
dictionary hollowConeDict_; dictionary hollowConeDict_;
autoPtr<pdfs::pdf> dropletPDF_; autoPtr<distributionModels::distributionModel> sizeDistribution_;
scalarList innerAngle_; scalarList innerAngle_;
scalarList outerAngle_; scalarList outerAngle_;

View File

@ -1,5 +1,5 @@
pdf/pdf.C distributionModel/distributionModel.C
pdf/pdfNew.C distributionModel/distributionModelNew.C
exponential/exponential.C exponential/exponential.C
fixedValue/fixedValue.C fixedValue/fixedValue.C
@ -9,4 +9,4 @@ normal/normal.C
RosinRammler/RosinRammler.C RosinRammler/RosinRammler.C
uniform/uniform.C uniform/uniform.C
LIB = $(FOAM_LIBBIN)/libpdf LIB = $(FOAM_LIBBIN)/libdistributionModels

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,34 +30,34 @@ License
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
defineTypeNameAndDebug(RosinRammler, 0); defineTypeNameAndDebug(RosinRammler, 0);
addToRunTimeSelectionTable(pdf, RosinRammler, dictionary); addToRunTimeSelectionTable(distributionModel, RosinRammler, dictionary);
} }
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pdfs::RosinRammler::RosinRammler Foam::distributionModels::RosinRammler::RosinRammler
( (
const dictionary& dict, const dictionary& dict,
cachedRandom& rndGen cachedRandom& rndGen
) )
: :
pdf(typeName, dict, rndGen), distributionModel(typeName, dict, rndGen),
minValue_(readScalar(pdfDict_.lookup("minValue"))), minValue_(readScalar(distributionModelDict_.lookup("minValue"))),
maxValue_(readScalar(pdfDict_.lookup("maxValue"))), maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))),
d_(readScalar(pdfDict_.lookup("d"))), d_(readScalar(distributionModelDict_.lookup("d"))),
n_(readScalar(pdfDict_.lookup("n"))) n_(readScalar(distributionModelDict_.lookup("n")))
{ {
check(); check();
} }
Foam::pdfs::RosinRammler::RosinRammler(const RosinRammler& p) Foam::distributionModels::RosinRammler::RosinRammler(const RosinRammler& p)
: :
pdf(p), distributionModel(p),
minValue_(p.minValue_), minValue_(p.minValue_),
maxValue_(p.maxValue_), maxValue_(p.maxValue_),
d_(p.d_), d_(p.d_),
@ -67,13 +67,13 @@ Foam::pdfs::RosinRammler::RosinRammler(const RosinRammler& p)
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::pdfs::RosinRammler::~RosinRammler() Foam::distributionModels::RosinRammler::~RosinRammler()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::pdfs::RosinRammler::sample() const Foam::scalar Foam::distributionModels::RosinRammler::sample() const
{ {
scalar K = 1.0 - exp(-pow((maxValue_ - minValue_)/d_, n_)); scalar K = 1.0 - exp(-pow((maxValue_ - minValue_)/d_, n_));
scalar y = rndGen_.sample01<scalar>(); scalar y = rndGen_.sample01<scalar>();
@ -82,13 +82,13 @@ Foam::scalar Foam::pdfs::RosinRammler::sample() const
} }
Foam::scalar Foam::pdfs::RosinRammler::minValue() const Foam::scalar Foam::distributionModels::RosinRammler::minValue() const
{ {
return minValue_; return minValue_;
} }
Foam::scalar Foam::pdfs::RosinRammler::maxValue() const Foam::scalar Foam::distributionModels::RosinRammler::maxValue() const
{ {
return maxValue_; return maxValue_;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,10 +25,10 @@ Class
Foam::RosinRammler Foam::RosinRammler
Description Description
Rosin-Rammler pdf Rosin-Rammler distributionModel
@f[ @f[
cumulative pdf = cumulative model =
(1.0 - exp( -(( x - d0)/d)^n ) (1.0 - exp( -(( x - d0)/d)^n )
/ (1.0 - exp( -((d1 - d0)/d)^n ) / (1.0 - exp( -((d1 - d0)/d)^n )
@f] @f]
@ -42,13 +42,13 @@ SourceFiles
#ifndef RosinRammler_H #ifndef RosinRammler_H
#define RosinRammler_H #define RosinRammler_H
#include "pdf.H" #include "distributionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -57,7 +57,7 @@ namespace pdfs
class RosinRammler class RosinRammler
: :
public pdf public distributionModel
{ {
// Private data // Private data
@ -88,9 +88,9 @@ public:
RosinRammler(const RosinRammler& p); RosinRammler(const RosinRammler& p);
//- Construct and return a clone //- Construct and return a clone
virtual autoPtr<pdf> clone() const virtual autoPtr<distributionModel> clone() const
{ {
return autoPtr<pdf>(new RosinRammler(*this)); return autoPtr<distributionModel>(new RosinRammler(*this));
} }
@ -100,7 +100,7 @@ public:
// Member Functions // Member Functions
//- Sample the pdf //- Sample the distributionModel
virtual scalar sample() const; virtual scalar sample() const;
//- Return the minimum value //- Return the minimum value
@ -113,7 +113,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace pdfs } // End namespace distributionModels
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,36 +23,36 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "pdf.H" #include "distributionModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
defineTypeNameAndDebug(pdf, 0); defineTypeNameAndDebug(distributionModel, 0);
defineRunTimeSelectionTable(pdf, dictionary); defineRunTimeSelectionTable(distributionModel, dictionary);
} }
} }
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
void Foam::pdfs::pdf::check() const void Foam::distributionModels::distributionModel::check() const
{ {
if (minValue() < 0) if (minValue() < 0)
{ {
FatalErrorIn("pdfs::pdf::check() const") FatalErrorIn("distributionModels::distributionModel::check() const")
<< type() << "PDF: Minimum value must be greater than zero." << nl << type() << "distribution: Minimum value must be greater than "
<< "Supplied minValue = " << minValue() << "zero." << nl << "Supplied minValue = " << minValue()
<< abort(FatalError); << abort(FatalError);
} }
if (maxValue() < minValue()) if (maxValue() < minValue())
{ {
FatalErrorIn("pdfs::pdf::check() const") FatalErrorIn("distributionModels::distributionModel::check() const")
<< type() << "PDF: Maximum value is smaller than the minimum value:" << type() << "distribution: Maximum value is smaller than the "
<< nl << " maxValue = " << maxValue() << "minimum value:" << nl << " maxValue = " << maxValue()
<< ", minValue = " << minValue() << ", minValue = " << minValue()
<< abort(FatalError); << abort(FatalError);
} }
@ -61,50 +61,65 @@ void Foam::pdfs::pdf::check() const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pdfs::pdf::pdf Foam::distributionModels::distributionModel::distributionModel
( (
const word& name, const word& name,
const dictionary& dict, const dictionary& dict,
cachedRandom& rndGen cachedRandom& rndGen
) )
: :
pdfDict_(dict.subDict(name + "PDF")), distributionModelDict_(dict.subDict(name + "Distribution")),
rndGen_(rndGen) rndGen_(rndGen)
{} {}
Foam::pdfs::pdf::pdf(const pdf& p) Foam::distributionModels::distributionModel::distributionModel
(
const distributionModel& p
)
: :
pdfDict_(p.pdfDict_), distributionModelDict_(p.distributionModelDict_),
rndGen_(p.rndGen_) rndGen_(p.rndGen_)
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::pdfs::pdf::~pdf() Foam::distributionModels::distributionModel::~distributionModel()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::pdfs::pdf::sample() const Foam::scalar Foam::distributionModels::distributionModel::sample() const
{ {
notImplemented("Foam::scalar Foam::pdfs::pdf::sample() const"); notImplemented
(
"Foam::scalar "
"Foam::distributionModels::distributionModel::sample() const"
);
return 0.0; return 0.0;
} }
Foam::scalar Foam::pdfs::pdf::minValue() const Foam::scalar Foam::distributionModels::distributionModel::minValue() const
{ {
notImplemented("Foam::scalar Foam::pdfs::pdf::minValue() const"); notImplemented
(
"Foam::scalar "
"Foam::distributionModels::distributionModel::minValue() const"
);
return 0.0; return 0.0;
} }
Foam::scalar Foam::pdfs::pdf::maxValue() const Foam::scalar Foam::distributionModels::distributionModel::maxValue() const
{ {
notImplemented("Foam::scalar Foam::pdfs::pdf::maxValue() const"); notImplemented
(
"Foam::scalar "
"Foam::distributionModels::distributionModel::maxValue() const"
);
return 0.0; return 0.0;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,14 +22,14 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::pdf Foam::distributionModel
Description Description
A library of runtime-selectable PDF's. A library of runtime-selectable distribution models.
Returns a sampled value given the expectation (nu) and variance (sigma^2) Returns a sampled value given the expectation (nu) and variance (sigma^2)
Current PDF's include: Current distribution models include:
- exponential - exponential
- fixedValue - fixedValue
- general - general
@ -38,19 +38,19 @@ Description
- Rosin-Rammler - Rosin-Rammler
- uniform - uniform
The pdf is tabulated in equidistant nPoints, in an interval. The distributionModel is tabulated in equidistant nPoints, in an interval.
These values are integrated to obtain the cumulated PDF, These values are integrated to obtain the cumulated distribution model,
which is then used to change the distribution from unifrom to which is then used to change the distribution from unifrom to
the actual pdf. the actual distributionModel.
SourceFiles SourceFiles
pdf.C distributionModel.C
pdfNew.C distributionModelNew.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef pdf_H #ifndef distributionModel_H
#define pdf_H #define distributionModel_H
#include "IOdictionary.H" #include "IOdictionary.H"
#include "autoPtr.H" #include "autoPtr.H"
@ -60,14 +60,14 @@ SourceFiles
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class pdf Declaration Class distributionModel Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class pdf class distributionModel
{ {
protected: protected:
@ -75,7 +75,7 @@ protected:
// Protected data // Protected data
//- Coefficients dictionary //- Coefficients dictionary
const dictionary pdfDict_; const dictionary distributionModelDict_;
//- Reference to the random number generator //- Reference to the random number generator
cachedRandom& rndGen_; cachedRandom& rndGen_;
@ -83,21 +83,21 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Check that the PDF is valid //- Check that the distribution model is valid
virtual void check() const; virtual void check() const;
public: public:
//-Runtime type information //-Runtime type information
TypeName("pdf"); TypeName("distributionModel");
//- Declare runtime constructor selection table //- Declare runtime constructor selection table
declareRunTimeSelectionTable declareRunTimeSelectionTable
( (
autoPtr, autoPtr,
pdf, distributionModel,
dictionary, dictionary,
( (
const dictionary& dict, const dictionary& dict,
@ -110,29 +110,38 @@ public:
// Constructors // Constructors
//- Construct from dictionary //- Construct from dictionary
pdf(const word& name, const dictionary& dict, cachedRandom& rndGen); distributionModel
(
const word& name,
const dictionary& dict,
cachedRandom& rndGen
);
//- Construct copy //- Construct copy
pdf(const pdf& p); distributionModel(const distributionModel& p);
//- Construct and return a clone //- Construct and return a clone
virtual autoPtr<pdf> clone() const virtual autoPtr<distributionModel> clone() const
{ {
return autoPtr<pdf>(new pdf(*this)); return autoPtr<distributionModel>(new distributionModel(*this));
} }
//- Selector //- Selector
static autoPtr<pdf> New(const dictionary& dict, cachedRandom& rndGen); static autoPtr<distributionModel> New
(
const dictionary& dict,
cachedRandom& rndGen
);
//- Destructor //- Destructor
virtual ~pdf(); virtual ~distributionModel();
// Member Functions // Member Functions
//- Sample the pdf //- Sample the distributionModel
virtual scalar sample() const; virtual scalar sample() const;
//- Return the minimum value //- Return the minimum value
@ -145,7 +154,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace pdfs } // End namespace distributionModels
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,33 +23,41 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "pdf.H" #include "distributionModel.H"
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::pdfs::pdf> Foam::pdfs::pdf::New Foam::autoPtr<Foam::distributionModels::distributionModel>
Foam::distributionModels::distributionModel::New
( (
const dictionary& dict, const dictionary& dict,
cachedRandom& rndGen cachedRandom& rndGen
) )
{ {
const word modelType(dict.lookup("pdfType")); const word modelType(dict.lookup("distributionModelType"));
Info<< "Selecting pdfType " << modelType << endl; Info<< "Selecting distributionModelType " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType); dictionaryConstructorTablePtr_->find(modelType);
if (cstrIter == dictionaryConstructorTablePtr_->end()) if (cstrIter == dictionaryConstructorTablePtr_->end())
{ {
FatalErrorIn("pdfs::pdf::New(const dictionary&, cachedRandom&)") FatalErrorIn
<< "Unknown pdf type " << modelType << nl << nl (
<< "Valid pdf types are:" << nl "distributionModels::distributionModel::New"
"("
"const dictionary&, "
"cachedRandom&"
")"
)
<< "Unknown distributionModel type " << modelType << nl << nl
<< "Valid distributionModel types are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc() << dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError); << exit(FatalError);
} }
return autoPtr<pdf>(cstrIter()(dict, rndGen)); return autoPtr<distributionModel>(cstrIter()(dict, rndGen));
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,33 +30,33 @@ License
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
defineTypeNameAndDebug(exponential, 0); defineTypeNameAndDebug(exponential, 0);
addToRunTimeSelectionTable(pdf, exponential, dictionary); addToRunTimeSelectionTable(distributionModel, exponential, dictionary);
} }
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pdfs::exponential::exponential Foam::distributionModels::exponential::exponential
( (
const dictionary& dict, const dictionary& dict,
cachedRandom& rndGen cachedRandom& rndGen
) )
: :
pdf(typeName, dict, rndGen), distributionModel(typeName, dict, rndGen),
minValue_(readScalar(pdfDict_.lookup("minValue"))), minValue_(readScalar(distributionModelDict_.lookup("minValue"))),
maxValue_(readScalar(pdfDict_.lookup("maxValue"))), maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))),
lambda_(readScalar(pdfDict_.lookup("lambda"))) lambda_(readScalar(distributionModelDict_.lookup("lambda")))
{ {
check(); check();
} }
Foam::pdfs::exponential::exponential(const exponential& p) Foam::distributionModels::exponential::exponential(const exponential& p)
: :
pdf(p), distributionModel(p),
minValue_(p.minValue_), minValue_(p.minValue_),
maxValue_(p.maxValue_), maxValue_(p.maxValue_),
lambda_(p.lambda_) lambda_(p.lambda_)
@ -65,13 +65,13 @@ Foam::pdfs::exponential::exponential(const exponential& p)
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::pdfs::exponential::~exponential() Foam::distributionModels::exponential::~exponential()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::pdfs::exponential::sample() const Foam::scalar Foam::distributionModels::exponential::sample() const
{ {
scalar y = rndGen_.sample01<scalar>(); scalar y = rndGen_.sample01<scalar>();
scalar K = exp(-lambda_*maxValue_) - exp(-lambda_*minValue_); scalar K = exp(-lambda_*maxValue_) - exp(-lambda_*minValue_);
@ -79,13 +79,13 @@ Foam::scalar Foam::pdfs::exponential::sample() const
} }
Foam::scalar Foam::pdfs::exponential::minValue() const Foam::scalar Foam::distributionModels::exponential::minValue() const
{ {
return minValue_; return minValue_;
} }
Foam::scalar Foam::pdfs::exponential::maxValue() const Foam::scalar Foam::distributionModels::exponential::maxValue() const
{ {
return maxValue_; return maxValue_;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,7 @@ Class
Foam::exponential Foam::exponential
Description Description
exponential pdf exponential distribution model
SourceFiles SourceFiles
exponential.C exponential.C
@ -35,13 +35,13 @@ SourceFiles
#ifndef exponential_H #ifndef exponential_H
#define exponential_H #define exponential_H
#include "pdf.H" #include "distributionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -50,7 +50,7 @@ namespace pdfs
class exponential class exponential
: :
public pdf public distributionModel
{ {
// Private data // Private data
@ -81,9 +81,9 @@ public:
exponential(const exponential& p); exponential(const exponential& p);
//- Construct and return a clone //- Construct and return a clone
virtual autoPtr<pdf> clone() const virtual autoPtr<distributionModel> clone() const
{ {
return autoPtr<pdf>(new exponential(*this)); return autoPtr<distributionModel>(new exponential(*this));
} }
@ -93,7 +93,7 @@ public:
// Member Functions // Member Functions
//- Sample the pdf //- Sample the distributionModel
virtual scalar sample() const; virtual scalar sample() const;
//- Return the minimum value //- Return the minimum value
@ -106,7 +106,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace pdfs } // End namespace distributionModels
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,50 +30,54 @@ License
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
defineTypeNameAndDebug(fixedValue, 0); defineTypeNameAndDebug(fixedValue, 0);
addToRunTimeSelectionTable(pdf, fixedValue, dictionary); addToRunTimeSelectionTable(distributionModel, fixedValue, dictionary);
} }
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pdfs::fixedValue::fixedValue(const dictionary& dict, cachedRandom& rndGen) Foam::distributionModels::fixedValue::fixedValue
(
const dictionary& dict,
cachedRandom& rndGen
)
: :
pdf(typeName, dict, rndGen), distributionModel(typeName, dict, rndGen),
value_(readScalar(pdfDict_.lookup("value"))) value_(readScalar(distributionModelDict_.lookup("value")))
{} {}
Foam::pdfs::fixedValue::fixedValue(const fixedValue& p) Foam::distributionModels::fixedValue::fixedValue(const fixedValue& p)
: :
pdf(p), distributionModel(p),
value_(p.value_) value_(p.value_)
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::pdfs::fixedValue::~fixedValue() Foam::distributionModels::fixedValue::~fixedValue()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::pdfs::fixedValue::fixedValue::sample() const Foam::scalar Foam::distributionModels::fixedValue::fixedValue::sample() const
{ {
return value_; return value_;
} }
Foam::scalar Foam::pdfs::fixedValue::fixedValue::minValue() const Foam::scalar Foam::distributionModels::fixedValue::fixedValue::minValue() const
{ {
return value_; return value_;
} }
Foam::scalar Foam::pdfs::fixedValue::fixedValue::maxValue() const Foam::scalar Foam::distributionModels::fixedValue::fixedValue::maxValue() const
{ {
return value_; return value_;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -32,16 +32,16 @@ SourceFiles
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef pdfFixedValue_H #ifndef distributionModelFixedValue_H
#define pdfFixedValue_H #define distributionModelFixedValue_H
#include "pdf.H" #include "distributionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class fixedValue Declaration Class fixedValue Declaration
@ -49,7 +49,7 @@ namespace pdfs
class fixedValue class fixedValue
: :
public pdf public distributionModel
{ {
// Private data // Private data
@ -72,9 +72,9 @@ public:
fixedValue(const fixedValue& p); fixedValue(const fixedValue& p);
//- Construct and return a clone //- Construct and return a clone
virtual autoPtr<pdf> clone() const virtual autoPtr<distributionModel> clone() const
{ {
return autoPtr<pdf>(new fixedValue(*this)); return autoPtr<distributionModel>(new fixedValue(*this));
} }
@ -84,7 +84,7 @@ public:
// Member Functions // Member Functions
//- Sample the pdf //- Sample the distributionModel
virtual scalar sample() const; virtual scalar sample() const;
//- Return the minimum value //- Return the minimum value
@ -97,7 +97,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace pdfs } // End namespace distributionModels
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,19 +30,23 @@ License
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
defineTypeNameAndDebug(general, 0); defineTypeNameAndDebug(general, 0);
addToRunTimeSelectionTable(pdf, general, dictionary); addToRunTimeSelectionTable(distributionModel, general, dictionary);
} }
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pdfs::general::general(const dictionary& dict, cachedRandom& rndGen) Foam::distributionModels::general::general
(
const dictionary& dict,
cachedRandom& rndGen
)
: :
pdf(typeName, dict, rndGen), distributionModel(typeName, dict, rndGen),
xy_(pdfDict_.lookup("distribution")), xy_(distributionModelDict_.lookup("distribution")),
nEntries_(xy_.size()), nEntries_(xy_.size()),
minValue_(xy_[0][0]), minValue_(xy_[0][0]),
maxValue_(xy_[nEntries_-1][0]), maxValue_(xy_[nEntries_-1][0]),
@ -50,7 +54,7 @@ Foam::pdfs::general::general(const dictionary& dict, cachedRandom& rndGen)
{ {
check(); check();
// normalize the cumulative pdf // normalize the cumulative distributionModel
integral_[0] = 0.0; integral_[0] = 0.0;
for (label i=1; i<nEntries_; i++) for (label i=1; i<nEntries_; i++)
@ -74,9 +78,9 @@ Foam::pdfs::general::general(const dictionary& dict, cachedRandom& rndGen)
} }
Foam::pdfs::general::general(const general& p) Foam::distributionModels::general::general(const general& p)
: :
pdf(p), distributionModel(p),
xy_(p.xy_), xy_(p.xy_),
nEntries_(p.nEntries_), nEntries_(p.nEntries_),
minValue_(p.minValue_), minValue_(p.minValue_),
@ -87,13 +91,13 @@ Foam::pdfs::general::general(const general& p)
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::pdfs::general::~general() Foam::distributionModels::general::~general()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::pdfs::general::sample() const Foam::scalar Foam::distributionModels::general::sample() const
{ {
scalar y = rndGen_.sample01<scalar>(); scalar y = rndGen_.sample01<scalar>();
@ -137,13 +141,13 @@ Foam::scalar Foam::pdfs::general::sample() const
} }
Foam::scalar Foam::pdfs::general::minValue() const Foam::scalar Foam::distributionModels::general::minValue() const
{ {
return minValue_; return minValue_;
} }
Foam::scalar Foam::pdfs::general::maxValue() const Foam::scalar Foam::distributionModels::general::maxValue() const
{ {
return maxValue_; return maxValue_;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,7 @@ Class
Foam::general Foam::general
Description Description
general pdf general distribution model
SourceFiles SourceFiles
general.C general.C
@ -35,7 +35,7 @@ SourceFiles
#ifndef general_H #ifndef general_H
#define general_H #define general_H
#include "pdf.H" #include "distributionModel.H"
#include "Vector.H" #include "Vector.H"
#include "VectorSpace.H" #include "VectorSpace.H"
@ -43,7 +43,7 @@ SourceFiles
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -52,7 +52,7 @@ namespace pdfs
class general class general
: :
public pdf public distributionModel
{ {
// Private data // Private data
@ -84,9 +84,9 @@ public:
general(const general& p); general(const general& p);
//- Construct and return a clone //- Construct and return a clone
virtual autoPtr<pdf> clone() const virtual autoPtr<distributionModel> clone() const
{ {
return autoPtr<pdf>(new general(*this)); return autoPtr<distributionModel>(new general(*this));
} }
@ -96,7 +96,7 @@ public:
// Member Functions // Member Functions
//- Sample the pdf //- Sample the distributionModel
virtual scalar sample() const; virtual scalar sample() const;
//- Return the minimum value //- Return the minimum value
@ -109,7 +109,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace pdfs } // End namespace distributionModels
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,28 +30,28 @@ License
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
defineTypeNameAndDebug(multiNormal, 0); defineTypeNameAndDebug(multiNormal, 0);
addToRunTimeSelectionTable(pdf, multiNormal, dictionary); addToRunTimeSelectionTable(distributionModel, multiNormal, dictionary);
} }
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pdfs::multiNormal::multiNormal Foam::distributionModels::multiNormal::multiNormal
( (
const dictionary& dict, const dictionary& dict,
cachedRandom& rndGen cachedRandom& rndGen
) )
: :
pdf(typeName, dict, rndGen), distributionModel(typeName, dict, rndGen),
minValue_(readScalar(pdfDict_.lookup("minValue"))), minValue_(readScalar(distributionModelDict_.lookup("minValue"))),
maxValue_(readScalar(pdfDict_.lookup("maxValue"))), maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))),
range_(maxValue_ - minValue_), range_(maxValue_ - minValue_),
expectation_(pdfDict_.lookup("expectation")), expectation_(distributionModelDict_.lookup("expectation")),
variance_(pdfDict_.lookup("variance")), variance_(distributionModelDict_.lookup("variance")),
strength_(pdfDict_.lookup("strength")) strength_(distributionModelDict_.lookup("strength"))
{ {
check(); check();
@ -81,9 +81,9 @@ Foam::pdfs::multiNormal::multiNormal
} }
Foam::pdfs::multiNormal::multiNormal(const multiNormal& p) Foam::distributionModels::multiNormal::multiNormal(const multiNormal& p)
: :
pdf(p), distributionModel(p),
minValue_(p.minValue_), minValue_(p.minValue_),
maxValue_(p.maxValue_), maxValue_(p.maxValue_),
range_(p.range_), range_(p.range_),
@ -95,13 +95,13 @@ Foam::pdfs::multiNormal::multiNormal(const multiNormal& p)
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::pdfs::multiNormal::~multiNormal() Foam::distributionModels::multiNormal::~multiNormal()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::pdfs::multiNormal::sample() const Foam::scalar Foam::distributionModels::multiNormal::sample() const
{ {
scalar y = 0; scalar y = 0;
scalar x = 0; scalar x = 0;
@ -133,13 +133,13 @@ Foam::scalar Foam::pdfs::multiNormal::sample() const
} }
Foam::scalar Foam::pdfs::multiNormal::minValue() const Foam::scalar Foam::distributionModels::multiNormal::minValue() const
{ {
return minValue_; return minValue_;
} }
Foam::scalar Foam::pdfs::multiNormal::maxValue() const Foam::scalar Foam::distributionModels::multiNormal::maxValue() const
{ {
return maxValue_; return maxValue_;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,10 +25,10 @@ Class
Foam::multiNormal Foam::multiNormal
Description Description
A multiNormal pdf A multiNormal distribution model
@verbatim @verbatim
pdf = sum_i strength_i * exp(-0.5*((x - expectation_i)/variance_i)^2 ) model = sum_i strength_i * exp(-0.5*((x - expectation_i)/variance_i)^2 )
@endverbatim @endverbatim
@ -40,13 +40,13 @@ SourceFiles
#ifndef multiNormal_H #ifndef multiNormal_H
#define multiNormal_H #define multiNormal_H
#include "pdf.H" #include "distributionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -55,7 +55,7 @@ namespace pdfs
class multiNormal class multiNormal
: :
public pdf public distributionModel
{ {
// Private data // Private data
@ -91,9 +91,9 @@ public:
multiNormal(const multiNormal& p); multiNormal(const multiNormal& p);
//- Construct and return a clone //- Construct and return a clone
virtual autoPtr<pdf> clone() const virtual autoPtr<distributionModel> clone() const
{ {
return autoPtr<pdf>(new multiNormal(*this)); return autoPtr<distributionModel>(new multiNormal(*this));
} }
@ -103,7 +103,7 @@ public:
// Member Functions // Member Functions
//- Sample the pdf //- Sample the distributionModel
virtual scalar sample() const; virtual scalar sample() const;
//- Return the minimum value //- Return the minimum value
@ -116,7 +116,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace pdfs } // End namespace distributionModels
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -31,22 +31,26 @@ License
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
defineTypeNameAndDebug(normal, 0); defineTypeNameAndDebug(normal, 0);
addToRunTimeSelectionTable(pdf, normal, dictionary); addToRunTimeSelectionTable(distributionModel, normal, dictionary);
} }
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pdfs::normal::normal(const dictionary& dict, cachedRandom& rndGen) Foam::distributionModels::normal::normal
(
const dictionary& dict,
cachedRandom& rndGen
)
: :
pdf(typeName, dict, rndGen), distributionModel(typeName, dict, rndGen),
minValue_(readScalar(pdfDict_.lookup("minValue"))), minValue_(readScalar(distributionModelDict_.lookup("minValue"))),
maxValue_(readScalar(pdfDict_.lookup("maxValue"))), maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))),
expectation_(readScalar(pdfDict_.lookup("expectation"))), expectation_(readScalar(distributionModelDict_.lookup("expectation"))),
variance_(readScalar(pdfDict_.lookup("variance"))), variance_(readScalar(distributionModelDict_.lookup("variance"))),
a_(0.147) a_(0.147)
{ {
if (minValue_ < 0) if (minValue_ < 0)
@ -67,9 +71,9 @@ Foam::pdfs::normal::normal(const dictionary& dict, cachedRandom& rndGen)
} }
Foam::pdfs::normal::normal(const normal& p) Foam::distributionModels::normal::normal(const normal& p)
: :
pdf(p), distributionModel(p),
minValue_(p.minValue_), minValue_(p.minValue_),
maxValue_(p.maxValue_), maxValue_(p.maxValue_),
expectation_(p.expectation_), expectation_(p.expectation_),
@ -80,13 +84,13 @@ Foam::pdfs::normal::normal(const normal& p)
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::pdfs::normal::~normal() Foam::distributionModels::normal::~normal()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::pdfs::normal::sample() const Foam::scalar Foam::distributionModels::normal::sample() const
{ {
scalar a = erf((minValue_ - expectation_)/variance_); scalar a = erf((minValue_ - expectation_)/variance_);
@ -104,19 +108,19 @@ Foam::scalar Foam::pdfs::normal::sample() const
} }
Foam::scalar Foam::pdfs::normal::minValue() const Foam::scalar Foam::distributionModels::normal::minValue() const
{ {
return minValue_; return minValue_;
} }
Foam::scalar Foam::pdfs::normal::maxValue() const Foam::scalar Foam::distributionModels::normal::maxValue() const
{ {
return maxValue_; return maxValue_;
} }
Foam::scalar Foam::pdfs::normal::erfInv(const scalar y) const Foam::scalar Foam::distributionModels::normal::erfInv(const scalar y) const
{ {
scalar k = 2.0/(constant::mathematical::pi*a_) + 0.5*log(1.0 - y*y); scalar k = 2.0/(constant::mathematical::pi*a_) + 0.5*log(1.0 - y*y);
scalar h = log(1.0 - y*y)/a_; scalar h = log(1.0 - y*y)/a_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,13 +25,13 @@ Class
Foam::normal Foam::normal
Description Description
A normal pdf A normal distribution model
@verbatim @verbatim
pdf = strength * exp(-0.5*((x - expectation)/variance)^2 ) model = strength * exp(-0.5*((x - expectation)/variance)^2 )
@endverbatim @endverbatim
strength only has meaning if there's more than one pdf strength only has meaning if there's more than one distribution model
SourceFiles SourceFiles
normal.C normal.C
@ -41,13 +41,13 @@ SourceFiles
#ifndef normal_H #ifndef normal_H
#define normal_H #define normal_H
#include "pdf.H" #include "distributionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -56,7 +56,7 @@ namespace pdfs
class normal class normal
: :
public pdf public distributionModel
{ {
// Private data // Private data
@ -91,9 +91,9 @@ public:
normal(const normal& p); normal(const normal& p);
//- Construct and return a clone //- Construct and return a clone
virtual autoPtr<pdf> clone() const virtual autoPtr<distributionModel> clone() const
{ {
return autoPtr<pdf>(new normal(*this)); return autoPtr<distributionModel>(new normal(*this));
} }
@ -103,7 +103,7 @@ public:
// Member Functions // Member Functions
//- Sample the pdf //- Sample the distributionModel
virtual scalar sample() const; virtual scalar sample() const;
//- Return the minimum value //- Return the minimum value
@ -118,7 +118,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace pdfs } // End namespace distributionModels
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,29 +30,33 @@ License
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
defineTypeNameAndDebug(uniform, 0); defineTypeNameAndDebug(uniform, 0);
addToRunTimeSelectionTable(pdf, uniform, dictionary); addToRunTimeSelectionTable(distributionModel, uniform, dictionary);
} }
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pdfs::uniform::uniform(const dictionary& dict, cachedRandom& rndGen) Foam::distributionModels::uniform::uniform
(
const dictionary& dict,
cachedRandom& rndGen
)
: :
pdf(typeName, dict, rndGen), distributionModel(typeName, dict, rndGen),
minValue_(readScalar(pdfDict_.lookup("minValue"))), minValue_(readScalar(distributionModelDict_.lookup("minValue"))),
maxValue_(readScalar(pdfDict_.lookup("maxValue"))), maxValue_(readScalar(distributionModelDict_.lookup("maxValue"))),
range_(maxValue_ - minValue_) range_(maxValue_ - minValue_)
{ {
check(); check();
} }
Foam::pdfs::uniform::uniform(const uniform& p) Foam::distributionModels::uniform::uniform(const uniform& p)
: :
pdf(p), distributionModel(p),
minValue_(p.minValue_), minValue_(p.minValue_),
maxValue_(p.maxValue_) maxValue_(p.maxValue_)
{} {}
@ -60,25 +64,25 @@ Foam::pdfs::uniform::uniform(const uniform& p)
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::pdfs::uniform::~uniform() Foam::distributionModels::uniform::~uniform()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::pdfs::uniform::sample() const Foam::scalar Foam::distributionModels::uniform::sample() const
{ {
return rndGen_.position<scalar>(minValue_, maxValue_); return rndGen_.position<scalar>(minValue_, maxValue_);
} }
Foam::scalar Foam::pdfs::uniform::minValue() const Foam::scalar Foam::distributionModels::uniform::minValue() const
{ {
return minValue_; return minValue_;
} }
Foam::scalar Foam::pdfs::uniform::maxValue() const Foam::scalar Foam::distributionModels::uniform::maxValue() const
{ {
return maxValue_; return maxValue_;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,7 @@ Class
Foam::uniform Foam::uniform
Description Description
uniform pdf Uniform/equally-weighted distribution model
SourceFiles SourceFiles
uniform.C uniform.C
@ -35,13 +35,13 @@ SourceFiles
#ifndef uniform_H #ifndef uniform_H
#define uniform_H #define uniform_H
#include "pdf.H" #include "distributionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
namespace pdfs namespace distributionModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
@ -50,7 +50,7 @@ namespace pdfs
class uniform class uniform
: :
public pdf public distributionModel
{ {
// Private data // Private data
@ -79,9 +79,9 @@ public:
uniform(const uniform& p); uniform(const uniform& p);
//- Construct and return a clone //- Construct and return a clone
virtual autoPtr<pdf> clone() const virtual autoPtr<distributionModel> clone() const
{ {
return autoPtr<pdf>(new uniform(*this)); return autoPtr<distributionModel>(new uniform(*this));
} }
@ -91,7 +91,7 @@ public:
// Member Functions // Member Functions
//- Sample the pdf //- Sample the distributionModel
virtual scalar sample() const; virtual scalar sample() const;
//- Return the minimum value //- Return the minimum value
@ -104,7 +104,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace pdfs } // End namespace distributionModels
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,16 +2,16 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
@ -24,7 +24,7 @@ LIB_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-llagrangian \ -llagrangian \
-lpdf \ -ldistributionModels \
-lliquidProperties \ -lliquidProperties \
-lliquidMixtureProperties \ -lliquidMixtureProperties \
-lsolidProperties \ -lsolidProperties \
@ -34,7 +34,7 @@ LIB_LIBS = \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lSLGThermo \ -lSLGThermo \
-lchemistryModel \ -lchemistryModel \
-lradiation \ -lradiationModels \
-lODE \ -lODE \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -95,9 +95,12 @@ Foam::ConeInjection<CloudType>::ConeInjection
Umag_(DataEntry<scalar>::New("Umag", this->coeffDict())), Umag_(DataEntry<scalar>::New("Umag", this->coeffDict())),
thetaInner_(DataEntry<scalar>::New("thetaInner", this->coeffDict())), thetaInner_(DataEntry<scalar>::New("thetaInner", this->coeffDict())),
thetaOuter_(DataEntry<scalar>::New("thetaOuter", this->coeffDict())), thetaOuter_(DataEntry<scalar>::New("thetaOuter", this->coeffDict())),
parcelPDF_ sizeDistribution_
( (
pdfs::pdf::New(this->coeffDict().subDict("parcelPDF"), owner.rndGen()) distributionModels::distributionModel::New
(
this->coeffDict().subDict("sizeDistribution"), owner.rndGen()
)
), ),
tanVec1_(vector::zero), tanVec1_(vector::zero),
tanVec2_(vector::zero) tanVec2_(vector::zero)
@ -153,7 +156,7 @@ Foam::ConeInjection<CloudType>::ConeInjection
Umag_(im.Umag_().clone().ptr()), Umag_(im.Umag_().clone().ptr()),
thetaInner_(im.thetaInner_().clone().ptr()), thetaInner_(im.thetaInner_().clone().ptr()),
thetaOuter_(im.thetaOuter_().clone().ptr()), thetaOuter_(im.thetaOuter_().clone().ptr()),
parcelPDF_(im.parcelPDF_().clone().ptr()), sizeDistribution_(im.sizeDistribution_().clone().ptr()),
tanVec1_(im.tanVec1_), tanVec1_(im.tanVec1_),
tanVec2_(im.tanVec2_) tanVec2_(im.tanVec2_)
{} {}
@ -222,7 +225,7 @@ void Foam::ConeInjection<CloudType>::setProperties
parcel.U() = Umag_().value(t)*dirVec; parcel.U() = Umag_().value(t)*dirVec;
// set particle diameter // set particle diameter
parcel.d() = parcelPDF_().sample(); parcel.d() = sizeDistribution_().sample();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -34,7 +34,7 @@ Description
- parcel flow rate - parcel flow rate
- parcel velocity - parcel velocity
- inner and outer cone angles - inner and outer cone angles
- Parcel diameters obtained by PDF model - Parcel diameters obtained by distribution model model
SourceFiles SourceFiles
ConeInjection.C ConeInjection.C
@ -45,7 +45,7 @@ SourceFiles
#define ConeInjection_H #define ConeInjection_H
#include "InjectionModel.H" #include "InjectionModel.H"
#include "pdf.H" #include "distributionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -101,8 +101,8 @@ class ConeInjection
//- Outer cone angle relative to SOI [deg] //- Outer cone angle relative to SOI [deg]
const autoPtr<DataEntry<scalar> > thetaOuter_; const autoPtr<DataEntry<scalar> > thetaOuter_;
//- Parcel size PDF model //- Parcel size distribution model model
const autoPtr<pdfs::pdf> parcelPDF_; const autoPtr<distributionModels::distributionModel> sizeDistribution_;
// Tangential vectors to the direction vector // Tangential vectors to the direction vector

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -126,9 +126,12 @@ Foam::ConeInjectionMP<CloudType>::ConeInjectionMP
Umag_(DataEntry<scalar>::New("Umag", this->coeffDict())), Umag_(DataEntry<scalar>::New("Umag", this->coeffDict())),
thetaInner_(DataEntry<scalar>::New("thetaInner", this->coeffDict())), thetaInner_(DataEntry<scalar>::New("thetaInner", this->coeffDict())),
thetaOuter_(DataEntry<scalar>::New("thetaOuter", this->coeffDict())), thetaOuter_(DataEntry<scalar>::New("thetaOuter", this->coeffDict())),
parcelPDF_ sizeDistribution_
( (
pdfs::pdf::New(this->coeffDict().subDict("parcelPDF"), owner.rndGen()) distributionModels::distributionModel::New
(
this->coeffDict().subDict("sizeDistribution"), owner.rndGen()
)
), ),
nInjected_(this->parcelsAddedTotal()), nInjected_(this->parcelsAddedTotal()),
tanVec1_(positions_.size()), tanVec1_(positions_.size()),
@ -193,7 +196,7 @@ Foam::ConeInjectionMP<CloudType>::ConeInjectionMP
Umag_(im.Umag_().clone().ptr()), Umag_(im.Umag_().clone().ptr()),
thetaInner_(im.thetaInner_().clone().ptr()), thetaInner_(im.thetaInner_().clone().ptr()),
thetaOuter_(im.thetaOuter_().clone().ptr()), thetaOuter_(im.thetaOuter_().clone().ptr()),
parcelPDF_(im.parcelPDF_().clone().ptr()), sizeDistribution_(im.sizeDistribution_().clone().ptr()),
nInjected_(im.nInjected_), nInjected_(im.nInjected_),
tanVec1_(im.tanVec1_), tanVec1_(im.tanVec1_),
tanVec2_(im.tanVec2_) tanVec2_(im.tanVec2_)
@ -268,7 +271,7 @@ void Foam::ConeInjectionMP<CloudType>::setProperties
parcel.U() = Umag_().value(t)*dirVec; parcel.U() = Umag_().value(t)*dirVec;
// set particle diameter // set particle diameter
parcel.d() = parcelPDF_().sample(); parcel.d() = sizeDistribution_().sample();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -34,7 +34,7 @@ Description
- parcel flow rate - parcel flow rate
- parcel velocities - parcel velocities
- inner and outer cone angles - inner and outer cone angles
- Parcel diameters obtained by PDF model - Parcel diameters obtained by distribution model model
SourceFiles SourceFiles
ConeInjectionMP.C ConeInjectionMP.C
@ -45,7 +45,7 @@ SourceFiles
#define ConeInjectionMP_H #define ConeInjectionMP_H
#include "InjectionModel.H" #include "InjectionModel.H"
#include "pdf.H" #include "distributionModel.H"
#include "vectorList.H" #include "vectorList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -108,8 +108,8 @@ class ConeInjectionMP
//- Outer cone angle relative to SOI [deg] //- Outer cone angle relative to SOI [deg]
const autoPtr<DataEntry<scalar> > thetaOuter_; const autoPtr<DataEntry<scalar> > thetaOuter_;
//- Parcel size PDF model //- Parcel size distribution model model
const autoPtr<pdfs::pdf> parcelPDF_; const autoPtr<distributionModels::distributionModel> sizeDistribution_;
//- Number of parcels per injector already injected //- Number of parcels per injector already injected
mutable label nInjected_; mutable label nInjected_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -114,11 +114,11 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection
nParcelsInjected_(positions_.size(), 0), nParcelsInjected_(positions_.size(), 0),
U0_(this->coeffDict().lookup("U0")), U0_(this->coeffDict().lookup("U0")),
diameters_(positions_.size()), diameters_(positions_.size()),
parcelPDF_ sizeDistribution_
( (
pdfs::pdf::New distributionModels::distributionModel::New
( (
this->coeffDict().subDict("parcelPDF"), this->coeffDict().subDict("sizeDistribution"),
owner.rndGen() owner.rndGen()
) )
) )
@ -126,7 +126,7 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection
// Construct parcel diameters - one per injector cell // Construct parcel diameters - one per injector cell
forAll(diameters_, i) forAll(diameters_, i)
{ {
diameters_[i] = parcelPDF_->sample(); diameters_[i] = sizeDistribution_->sample();
} }
// Determine total volume of particles to inject // Determine total volume of particles to inject
@ -166,7 +166,7 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection
nParcelsInjected_(im.nParcelsInjected_), nParcelsInjected_(im.nParcelsInjected_),
U0_(im.U0_), U0_(im.U0_),
diameters_(im.diameters_), diameters_(im.diameters_),
parcelPDF_(im.parcelPDF_().clone().ptr()) sizeDistribution_(im.sizeDistribution_().clone().ptr())
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -47,7 +47,7 @@ SourceFiles
#define FieldActivatedInjection_H #define FieldActivatedInjection_H
#include "InjectionModel.H" #include "InjectionModel.H"
#include "pdf.H" #include "distributionModel.H"
#include "volFieldsFwd.H" #include "volFieldsFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -110,8 +110,9 @@ class FieldActivatedInjection
//- List of parcel diameters //- List of parcel diameters
scalarList diameters_; scalarList diameters_;
//- Parcel size PDF model //- Parcel size distribution model model
const autoPtr<pdfs::pdf> parcelPDF_; const autoPtr<distributionModels::distributionModel>
sizeDistribution_;
protected: protected:

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -90,7 +90,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
( (
1, 1,
(10*volumeAccumulator_) (10*volumeAccumulator_)
/CloudType::parcelType::volume(parcelPDF_().minValue()) /CloudType::parcelType::volume(sizeDistribution_().minValue())
); );
label iterationNo = 0; label iterationNo = 0;
@ -128,7 +128,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
{ {
if (selfSeed_ && !cellCentresUsed.found(cI)) if (selfSeed_ && !cellCentresUsed.found(cI))
{ {
scalar dNew = parcelPDF_().sample(); scalar dNew = sizeDistribution_().sample();
newParticles_.append newParticles_.append
( (
@ -191,7 +191,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
scalar R = sqrt(3.0)*a/(2.0*sqrt(2.0)); scalar R = sqrt(3.0)*a/(2.0*sqrt(2.0));
scalar d = a/(2.0*sqrt(3.0)); scalar d = a/(2.0*sqrt(3.0));
scalar dNew = parcelPDF_().sample(); scalar dNew = sizeDistribution_().sample();
scalar volNew = CloudType::parcelType::volume(dNew); scalar volNew = CloudType::parcelType::volume(dNew);
newParticles_.append newParticles_.append
@ -204,7 +204,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
); );
volumeAccumulator_ -= volNew; volumeAccumulator_ -= volNew;
dNew = parcelPDF_().sample(); dNew = sizeDistribution_().sample();
newParticles_.append newParticles_.append
( (
vectorPairScalarPair vectorPairScalarPair
@ -215,7 +215,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
); );
volumeAccumulator_ -= volNew; volumeAccumulator_ -= volNew;
dNew = parcelPDF_().sample(); dNew = sizeDistribution_().sample();
newParticles_.append newParticles_.append
( (
vectorPairScalarPair vectorPairScalarPair
@ -226,7 +226,7 @@ Foam::label Foam::InflationInjection<CloudType>::parcelsToInject
); );
volumeAccumulator_ -= volNew; volumeAccumulator_ -= volNew;
dNew = parcelPDF_().sample(); dNew = sizeDistribution_().sample();
newParticles_.append newParticles_.append
( (
vectorPairScalarPair vectorPairScalarPair
@ -341,11 +341,11 @@ Foam::InflationInjection<CloudType>::InflationInjection
fraction_(1.0), fraction_(1.0),
selfSeed_(this->coeffDict().lookupOrDefault("selfSeed", false)), selfSeed_(this->coeffDict().lookupOrDefault("selfSeed", false)),
dSeed_(SMALL), dSeed_(SMALL),
parcelPDF_ sizeDistribution_
( (
pdfs::pdf::New distributionModels::distributionModel::New
( (
this->coeffDict().subDict("parcelPDF"), this->coeffDict().subDict("sizeDistribution"),
owner.rndGen() owner.rndGen()
) )
) )
@ -409,7 +409,7 @@ Foam::InflationInjection<CloudType>::InflationInjection
fraction_(im.fraction_), fraction_(im.fraction_),
selfSeed_(im.selfSeed_), selfSeed_(im.selfSeed_),
dSeed_(im.dSeed_), dSeed_(im.dSeed_),
parcelPDF_(im.parcelPDF_().clone().ptr()) sizeDistribution_(im.sizeDistribution_().clone().ptr())
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,7 +39,7 @@ SourceFiles
#define InflationInjection_H #define InflationInjection_H
#include "InjectionModel.H" #include "InjectionModel.H"
#include "pdf.H" #include "distributionModel.H"
#include "Switch.H" #include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -107,8 +107,8 @@ class InflationInjection
//- Diameter with which to create new seed particles //- Diameter with which to create new seed particles
scalar dSeed_; scalar dSeed_;
//- Parcel size PDF model //- Parcel size distribution model model
const autoPtr<pdfs::pdf> parcelPDF_; const autoPtr<distributionModels::distributionModel> sizeDistribution_;
protected: protected:

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -96,11 +96,11 @@ Foam::ManualInjection<CloudType>::ManualInjection
injectorTetFaces_(positions_.size(), -1), injectorTetFaces_(positions_.size(), -1),
injectorTetPts_(positions_.size(), -1), injectorTetPts_(positions_.size(), -1),
U0_(this->coeffDict().lookup("U0")), U0_(this->coeffDict().lookup("U0")),
parcelPDF_ sizeDistribution_
( (
pdfs::pdf::New distributionModels::distributionModel::New
( (
this->coeffDict().subDict("parcelPDF"), this->coeffDict().subDict("sizeDistribution"),
owner.rndGen() owner.rndGen()
) )
) )
@ -149,7 +149,7 @@ Foam::ManualInjection<CloudType>::ManualInjection
// Construct parcel diameters // Construct parcel diameters
forAll(diameters_, i) forAll(diameters_, i)
{ {
diameters_[i] = parcelPDF_->sample(); diameters_[i] = sizeDistribution_->sample();
} }
// Determine volume of particles to inject // Determine volume of particles to inject
@ -171,7 +171,7 @@ Foam::ManualInjection<CloudType>::ManualInjection
injectorTetFaces_(im.injectorTetFaces_), injectorTetFaces_(im.injectorTetFaces_),
injectorTetPts_(im.injectorTetPts_), injectorTetPts_(im.injectorTetPts_),
U0_(im.U0_), U0_(im.U0_),
parcelPDF_(im.parcelPDF_().clone().ptr()) sizeDistribution_(im.sizeDistribution_().clone().ptr())
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -31,7 +31,7 @@ Description
- Total mass to inject - Total mass to inject
- Parcel positions in file @c positionsFile - Parcel positions in file @c positionsFile
- Initial parcel velocity - Initial parcel velocity
- Parcel diameters obtained by PDF model - Parcel diameters obtained by distribution model model
- All parcels introduced at SOI - All parcels introduced at SOI
SourceFiles SourceFiles
@ -43,7 +43,7 @@ SourceFiles
#define ManualInjection_H #define ManualInjection_H
#include "InjectionModel.H" #include "InjectionModel.H"
#include "pdf.H" #include "distributionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -82,8 +82,8 @@ class ManualInjection
//- Initial parcel velocity //- Initial parcel velocity
const vector U0_; const vector U0_;
//- Parcel size PDF model //- Parcel size distribution model model
const autoPtr<pdfs::pdf> parcelPDF_; const autoPtr<distributionModels::distributionModel> sizeDistribution_;
protected: protected:

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,7 @@ License
#include "PatchInjection.H" #include "PatchInjection.H"
#include "DataEntry.H" #include "DataEntry.H"
#include "pdf.H" #include "distributionModel.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -104,9 +104,13 @@ Foam::PatchInjection<CloudType>::PatchInjection
( (
DataEntry<scalar>::New("flowRateProfile", this->coeffDict()) DataEntry<scalar>::New("flowRateProfile", this->coeffDict())
), ),
parcelPDF_ sizeDistribution_
( (
pdfs::pdf::New(this->coeffDict().subDict("parcelPDF"), owner.rndGen()) distributionModels::distributionModel::New
(
this->coeffDict().subDict("sizeDistribution"),
owner.rndGen()
)
), ),
cellOwners_(), cellOwners_(),
fraction_(1.0) fraction_(1.0)
@ -153,7 +157,7 @@ Foam::PatchInjection<CloudType>::PatchInjection
parcelsPerSecond_(im.parcelsPerSecond_), parcelsPerSecond_(im.parcelsPerSecond_),
U0_(im.U0_), U0_(im.U0_),
flowRateProfile_(im.flowRateProfile_().clone().ptr()), flowRateProfile_(im.flowRateProfile_().clone().ptr()),
parcelPDF_(im.parcelPDF_().clone().ptr()), sizeDistribution_(im.sizeDistribution_().clone().ptr()),
cellOwners_(im.cellOwners_), cellOwners_(im.cellOwners_),
fraction_(im.fraction_) fraction_(im.fraction_)
{} {}
@ -236,7 +240,7 @@ void Foam::PatchInjection<CloudType>::setProperties
parcel.U() = U0_; parcel.U() = U0_;
// set particle diameter // set particle diameter
parcel.d() = parcelPDF_->sample(); parcel.d() = sizeDistribution_->sample();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,7 +33,7 @@ Description
- Injection duration - Injection duration
- Initial parcel velocity - Initial parcel velocity
- Injection volume flow rate - Injection volume flow rate
- Parcel diameters obtained by PDF model - Parcel diameters obtained by distribution model model
- Parcels injected at cell centres adjacent to patch - Parcels injected at cell centres adjacent to patch
SourceFiles SourceFiles
@ -54,7 +54,7 @@ namespace Foam
template<class Type> template<class Type>
class DataEntry; class DataEntry;
class pdf; class distributionModel;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class PatchInjection Declaration Class PatchInjection Declaration
@ -85,8 +85,8 @@ class PatchInjection
//- Flow rate profile relative to SOI [] //- Flow rate profile relative to SOI []
const autoPtr<DataEntry<scalar> > flowRateProfile_; const autoPtr<DataEntry<scalar> > flowRateProfile_;
//- Parcel size PDF model //- Parcel size distribution model model
const autoPtr<pdfs::pdf> parcelPDF_; const autoPtr<distributionModels::distributionModel> sizeDistribution_;
//- List of cell labels corresponding to injector positions //- List of cell labels corresponding to injector positions
labelList cellOwners_; labelList cellOwners_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -122,7 +122,22 @@ void Foam::fieldValues::cellSource::initialise(const dictionary& dict)
{ {
setCellZoneCells(); setCellZoneCells();
Info<< type() << " " << name_ << ":" << nl if (nCells_ == 0)
{
WarningIn
(
"Foam::fieldValues::cellSource::initialise(const dictionary&)"
)
<< type() << " " << name_ << ": "
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl
<< " Source has no cells - deactivating" << endl;
active_ = false;
return;
}
Info<< type() << " " << name_ << ":"
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl
<< " total cells = " << nCells_ << nl << " total cells = " << nCells_ << nl
<< " total volume = " << gSum(filterField(mesh().V())) << " total volume = " << gSum(filterField(mesh().V()))
<< nl << endl; << nl << endl;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -249,6 +249,20 @@ void Foam::fieldValues::faceSource::initialise(const dictionary& dict)
} }
} }
if (nFaces_ == 0)
{
WarningIn
(
"Foam::fieldValues::faceSource::initialise(const dictionary&)"
)
<< type() << " " << name_ << ": "
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl
<< " Source has no faces - deactivating" << endl;
active_ = false;
return;
}
scalar totalArea; scalar totalArea;
if (surfacePtr_.valid()) if (surfacePtr_.valid())

View File

@ -3,13 +3,13 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude
@ -18,6 +18,6 @@ EXE_LIBS = \
-lSLGThermo \ -lSLGThermo \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-lpdf \ -ldistributionModels \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels -lcompressibleLESModels

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -53,12 +53,19 @@ Foam::surfaceFilmModels::cloudInjection::cloudInjection
injectionModel(type(), owner, dict), injectionModel(type(), owner, dict),
particlesPerParcel_(readScalar(coeffs_.lookup("particlesPerParcel"))), particlesPerParcel_(readScalar(coeffs_.lookup("particlesPerParcel"))),
rndGen_(label(0), -1), rndGen_(label(0), -1),
parcelPDF_(pdfs::pdf::New(coeffs_.subDict("parcelPDF"), rndGen_)), parcelDistribution_
(
distributionModels::distributionModel::New
(
coeffs_.subDict("parcelDistribution"),
rndGen_
)
),
diameter_(owner.film().nCells(), 0.0) diameter_(owner.film().nCells(), 0.0)
{ {
forAll(diameter_, faceI) forAll(diameter_, faceI)
{ {
diameter_[faceI] = parcelPDF_->sample(); diameter_[faceI] = parcelDistribution_->sample();
} }
} }
@ -95,7 +102,7 @@ void Foam::surfaceFilmModels::cloudInjection::inject
diameterToInject[cellI] = diameter_[cellI]; diameterToInject[cellI] = diameter_[cellI];
// Retrieve new particle diameter sample // Retrieve new particle diameter sample
diameter_[cellI] = parcelPDF_->sample(); diameter_[cellI] = parcelDistribution_->sample();
} }
else else
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -36,7 +36,7 @@ SourceFiles
#define cloudInjection_H #define cloudInjection_H
#include "injectionModel.H" #include "injectionModel.H"
#include "pdf.H" #include "distributionModel.H"
#include "cachedRandom.H" #include "cachedRandom.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -76,7 +76,8 @@ protected:
cachedRandom rndGen_; cachedRandom rndGen_;
//- Parcel size PDF model //- Parcel size PDF model
const autoPtr<pdfs::pdf> parcelPDF_; const autoPtr<distributionModels::distributionModel>
parcelDistribution_;
//- Diameters of particles to inject into the cloud //- Diameters of particles to inject into the cloud
scalarList diameter_; scalarList diameter_;

View File

@ -6,17 +6,13 @@ set -x
wmake $makeOption specie wmake $makeOption specie
wmake $makeOption solid wmake $makeOption solid
wmake $makeOption thermophysicalFunctions wmake $makeOption thermophysicalFunctions
wmake $makeOption liquidProperties ./properties/Allwmake $*
wmake $makeOption liquidMixtureProperties
wmake $makeOption solidProperties
wmake $makeOption solidMixtureProperties
wmake $makeOption basic wmake $makeOption basic
wmake $makeOption reactionThermo wmake $makeOption reactionThermo
wmake $makeOption laminarFlameSpeed wmake $makeOption laminarFlameSpeed
wmake $makeOption chemistryModel wmake $makeOption chemistryModel
wmake $makeOption pdfs wmake $makeOption radiationModels
wmake $makeOption radiation
wmake $makeOption barotropicCompressibilityModel wmake $makeOption barotropicCompressibilityModel
wmake $makeOption thermalPorousZone wmake $makeOption thermalPorousZone

View File

@ -2,10 +2,10 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixtureProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude
LIB_LIBS = \ LIB_LIBS = \

View File

@ -0,0 +1,12 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso
set -x
wmake $makeOption liquidProperties
wmake $makeOption liquidMixtureProperties
wmake $makeOption solidProperties
wmake $makeOption solidMixtureProperties
# ----------------------------------------------------------------- end-of-file

View File

@ -1,7 +1,7 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude

Some files were not shown because too many files have changed in this diff Show More