GIT: conflict resolution

This commit is contained in:
andy
2011-03-11 14:34:17 +00:00
1621 changed files with 107144 additions and 321537 deletions

1
.gitignore vendored
View File

@ -42,6 +42,7 @@ linuxming*/
SiCortex*Gcc*/ SiCortex*Gcc*/
solaris*Gcc*/ solaris*Gcc*/
SunOS*Gcc*/ SunOS*Gcc*/
platforms/
# reinstate wmake/rules that might look like build folders # reinstate wmake/rules that might look like build folders
!wmake/rules/*/ !wmake/rules/*/

View File

@ -35,14 +35,14 @@
*** Core library *** Core library
+ Large number of code refinements and consistency improvements to support + Large number of code refinements and consistency improvements to support
other developments. other developments.
Parallel : using non-blocking communications wherever possible. This will + Parallel : using non-blocking communications wherever possible. This will
lead to lower requirements for MPI_BUFFER_SIZE and possibly better lead to lower requirements for MPI_BUFFER_SIZE and possibly better
start-up performance on larger numbers of processors. start-up performance on larger numbers of processors.
*** Turbulence modelling *** Turbulence modelling
*** *Updated* thermophysical libraries *** *Updated* thermophysical libraries
+ Now use the more descriptive dictionary input format, e.g. for a single + Now use the more descriptive dictionary input format, e.g. for a single
component mixture: component mixture:
#+BEGIN_SRC c++
thermoType hPsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>; thermoType hPsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>;
mixture mixture
@ -54,24 +54,25 @@
As 1.4792e-06; As 1.4792e-06;
Ts 116; Ts 116;
} }
#+END_SRC
*** Lagrangian intermediate library *** Lagrangian intermediate library
Extensively updated + Extensively updated
*Updated* input format + *Updated* input format
Extended to include steady cloud tracking + Extended to include steady cloud tracking
*New* collision modelling + *New* collision modelling
*Coupled* to new surface film modelling library + *Coupled* to new surface film modelling library
*New* sub-models + *New* sub-models
+ NonSphereDrag: drag model to account for non-spherical particles + NonSphereDrag: drag model to account for non-spherical particles
+ ParticleTracks: post-processing model to generate track data, typically + ParticleTracks: post-processing model to generate track data, typically
during steady calculations during steady calculations
*Updated* sub-models + *Updated* sub-models
+ Devolatilisation models: now act on a per-specie basis + Devolatilisation models: now act on a per-specie basis
*** DSMC *** DSMC
*** Dynamic Mesh *** Dynamic Mesh
*** Numerics *** Numerics
*** *Updated* command line help, e.g. `snappyHexMesh -help' now gives: *** *Updated* command line help, e.g. `snappyHexMesh -help' now gives:
#+BEGIN_SRC c++
Usage: snappyHexMesh [OPTIONS] Usage: snappyHexMesh [OPTIONS]
options: options:
-case <dir> specify alternate case directory, default is the cwd -case <dir> specify alternate case directory, default is the cwd
@ -80,12 +81,13 @@
-srcDoc display source code in browser -srcDoc display source code in browser
-doc display application documentation in browser -doc display application documentation in browser
-help print the usage -help print the usage
#+END_SRC
*** *New* basicSolidThermo solids thermophysical library *** *New* basicSolidThermo solids thermophysical library
+ Used in all conjugate heat transfer solvers + Used in all conjugate heat transfer solvers
+ constant properties + constant properties
+ temperature dependent properties + temperature dependent properties
+ temperature and direction (in local coordinate system) dependent properties + temperature and direction (in local coordinate system) dependent
properties
*** *New* Surface film library *** *New* Surface film library
+ Creation of films by particle addition, or initial film distribution + Creation of films by particle addition, or initial film distribution
+ Coupled with the lagrangian/intermediate cloud hierarchy library + Coupled with the lagrangian/intermediate cloud hierarchy library
@ -104,17 +106,25 @@
taking film into account taking film into account
+ Parallel aware + Parallel aware
*** *New* ptscotch decomposition method *** *New* ptscotch decomposition method
*** *Updated* scotch decomposition method to run in parallel by doing
decomposition on the master. Unfortunately scotch and ptscotch cannot
be linked in to the same executable.
*** *Updated* simple decomposition method to run in parallel by doing
decomposition on the master.
*** *Updated* decomposePar maps polyPatches instead of recreating them so *** *Updated* decomposePar maps polyPatches instead of recreating them so
polyPatches holding data can map the data. polyPatches holding data can map the data.
*** *Updated* particle tracking algorithm *** *Updated* particle tracking algorithm
+ uses non-blocking parallel transfers + uses non-blocking parallel transfers
+ does 'minimum-tet' decomposition of face to work with warped faces (snappyHexMesh!) + does 'minimum-tet' decomposition of face to work with warped faces
(snappyHexMesh!)
+ reuses tracking state in interpolation - improves consistency and speed + reuses tracking state in interpolation - improves consistency and speed
*** *Updated* split cyclics into two separate patches. See doc/changed/splitCyclics.txt *** *Updated* split cyclics into two separate patches.
See [[./doc/changes/splitCyclic.txt]]
* *Updated* interpolation (volPointInterpolation) now works without the * *Updated* interpolation (volPointInterpolation) now works without the
globalPointPatch. Moving mesh cases can now be run non-parallel and globalPointPatch. Moving mesh cases can now be run non-parallel and
continued in parallel and reconstructed without any limitation. continued in parallel and reconstructed without any limitation.
*** *New* compact binary I/O for faces and cells. This speeds up reading/writing meshes in binary. *** *New* compact binary I/O for faces and cells.
This speeds up reading/writing meshes in binary.
*** *Updated* runTimeModifiable *** *Updated* runTimeModifiable
+ user selectable model to use for checking run-time modifiable + user selectable model to use for checking run-time modifiable
dictionaries (see also doc/changes/inotify.txt): dictionaries (see also doc/changes/inotify.txt):
@ -124,11 +134,34 @@
contents from master. contents from master.
+ inotifyMaster : only master checks and reads file. Slaves get file + inotifyMaster : only master checks and reads file. Slaves get file
contents from master. contents from master.
+ on linux optionally uses inotify instead of time stamps - more efficient for large + on linux optionally uses inotify instead of time stamps - more efficient
numbers of monitored files. No more fileModificationSkew needed. for large numbers of monitored files. No more fileModificationSkew needed.
+ single integer reduction instead of one reduction per monitored file. + single integer reduction instead of one reduction per monitored file.
+ only files that can be re-read are being checked. Drastic reduction of + only files that can be re-read are being checked. Drastic reduction of
number of files to check. number of files to check.
*** *New* #codeStream dictionary entry
Uses dynamic compilation of OpenFOAM C++ code to construct dictionary.
E.g. in blockMeshDict:
#+BEGIN_SRC c++
convertToMeters 0.001;
vertices #codeStream
{
code
#{
label nVerts =
readLabel(dict.lookup("nx"))
*readLabel(dict.lookup("ny"))
*readLabel(dict.lookup("nz"));
pointField verts(nVerts);
// Now fill verts here
// ..
os << verts;
#};
}
#+END_SRC
See also ./[[doc/changes/dynamicCode.org]]
* Solvers * Solvers
A number of new solvers have been developed for a range of engineering A number of new solvers have been developed for a range of engineering
applications. There has been a set of improvements to certain classes of applications. There has been a set of improvements to certain classes of
@ -158,6 +191,23 @@
+ takes optional fieldName to sample + takes optional fieldName to sample
+ directMapped patch added 'normal' method to calculate sample points + directMapped patch added 'normal' method to calculate sample points
to e.g. sample fields just above wall (e.g. for streaklines) to e.g. sample fields just above wall (e.g. for streaklines)
+ *New* codedFixedValue: Uses the dynamic code compilation from #codeStream
to provide an in-line fixedValueFvPatchScalarField. E.g.
#+BEGIN_SRC c++
outlet
{
type codedFixedValue<scalar>;
value uniform 0;
redirectType fixedValue10;
code
#{
operator==(min(10, 0.1*this->db().time().value()));
#};
}
#+END_SRC
See also [[./doc/changes/dynamicCode.org]]
* Utilities * Utilities
There have been some utilities added and updated in this release. There have been some utilities added and updated in this release.
*** *New* utilities *** *New* utilities
@ -177,17 +227,31 @@
+ =topoSet=: replacement of cellSet,faceSet,pointSet utilities. + =topoSet=: replacement of cellSet,faceSet,pointSet utilities.
Comparable to a dictionary driven =setSet= utility. Comparable to a dictionary driven =setSet= utility.
*** Updated utilities *** Updated utilities
+ =setFields=: optionally use faceSets to set patch values (see e.g. hotRoom tutorial). + =setFields=: optionally use faceSets to set patch values (see
e.g. =hotRoom= tutorial).
+ =blockMesh=: specify patches via dictionary instead of type only. This + =blockMesh=: specify patches via dictionary instead of type only. This
makes rereading the boundary file superfluous. see makes rereading the boundary file superfluous. see
e.g. pitzDailyDirectMapped tutorial. e.g. pitzDailyDirectMapped tutorial.
+ =setSet=: allows time range (e.g. 0:100) in combination with -batch argument + =setSet=: allows time range (e.g. 0:100) in combination with -batch
to execute the commands for multiple times. argument to execute the commands for multiple times.
+ =extrudeMesh=:
- option to add extrusion to existing mesh.
- works in parallel
+ =snappyHexMesh=:
+ extrude across multi-processor boundaries
+ preserve faceZones during layering
+ *Warning*:
- minMedianAxisAngle angle fixed w.r.t. 17x. Set to
90 to get same behaviour as 130 in 17x.
- nGrow did not work in 17x. Set to 0
to get same behaviour as 130 in 17x.
- new minTetQuality setting (see tracking). Disable for 17x
compatibility.
* Post-processing * Post-processing
+ =paraFoam=, =foamToVTK=: full support for polyhedral cell type in recent + =paraFoam=, =foamToVTK=: full support for polyhedral cell type in recent
Paraview versions. Paraview versions.
+ =foamToEnsight=: parallel continuous data. new =-nodeValues= option to generate and output nodal + =foamToEnsight=: parallel continuous data. new =-nodeValues= option to
field data. generate and output nodal field data.
+ =singleCellMesh=: new utility to convert mesh and fields to a single cell + =singleCellMesh=: new utility to convert mesh and fields to a single cell
mesh. Great for postprocessing. mesh. Great for postprocessing.
+ =steadyParticleTracks=: Generates VTK tracks from the output of the cloud + =steadyParticleTracks=: Generates VTK tracks from the output of the cloud
@ -221,3 +285,7 @@
+ multipleBoxes, hotBoxes, panel, evaporationTest + multipleBoxes, hotBoxes, panel, evaporationTest
+ =interDyMFoam= tutorials: + =interDyMFoam= tutorials:
+ testTubeMixer: showcases =solidBodyMotionFunction= + testTubeMixer: showcases =solidBodyMotionFunction=
* Other
+ compilable with =clang=
In your prefs.sh set the WM_COMPILER to Clang

View File

@ -27,7 +27,7 @@ PDRModels/XiGModels/basicXiSubG/basicXiSubG.C
laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C
/* PDRFoamAutoRefine.C */ /*PDRFoamAutoRefine.C*/
PDRFoam.C PDRFoam.C
EXE = $(FOAM_APPBIN)/PDRFoam EXE = $(FOAM_APPBIN)/PDRFoam

View File

@ -9,13 +9,14 @@ 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)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lengine \ -lengine \

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
@ -78,7 +78,7 @@ int main(int argc, char *argv[])
#include "createFields.H" #include "createFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
#include "readTimeControls.H" #include "readTimeControls.H"
#include "CourantNo.H" #include "compressibleCourantNo.H"
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
scalar StCoNum = 0.0; scalar StCoNum = 0.0;
@ -91,11 +91,10 @@ int main(int argc, char *argv[])
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPISOControls.H" #include "readPISOControls.H"
#include "CourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
runTime++; runTime++;
Info<< "\n\nTime = " << runTime.timeName() << endl; Info<< "\n\nTime = " << runTime.timeName() << endl;
#include "rhoEqn.H" #include "rhoEqn.H"

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
@ -80,7 +80,7 @@ int main(int argc, char *argv[])
#include "createFields.H" #include "createFields.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
#include "readTimeControls.H" #include "readTimeControls.H"
#include "CourantNo.H" #include "compressibleCourantNo.H"
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
scalar StCoNum = 0.0; scalar StCoNum = 0.0;
@ -89,17 +89,15 @@ int main(int argc, char *argv[])
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
bool hasChanged = false;
while (runTime.run()) while (runTime.run())
{ {
#include "readTimeControls.H" #include "readTimeControls.H"
#include "readPISOControls.H" #include "readPISOControls.H"
#include "CourantNo.H" #include "compressibleCourantNo.H"
#include "setDeltaT.H" #include "setDeltaT.H"
runTime++;
Info<< "\n\nTime = " << runTime.timeName() << endl;
// Indicators for refinement. Note: before runTime++ // Indicators for refinement. Note: before runTime++
// only for postprocessing reasons. // only for postprocessing reasons.
tmp<volScalarField> tmagGradP = mag(fvc::grad(p)); tmp<volScalarField> tmagGradP = mag(fvc::grad(p));
@ -111,7 +109,10 @@ int main(int argc, char *argv[])
normalisedGradP.writeOpt() = IOobject::AUTO_WRITE; normalisedGradP.writeOpt() = IOobject::AUTO_WRITE;
tmagGradP.clear(); tmagGradP.clear();
bool meshChanged = false; runTime++;
Info<< "\n\nTime = " << runTime.timeName() << endl;
{ {
// Make the fluxes absolute // Make the fluxes absolute
fvc::makeAbsolute(phi, rho, U); fvc::makeAbsolute(phi, rho, U);
@ -134,29 +135,27 @@ int main(int argc, char *argv[])
} }
} }
//volScalarField pIndicator("pIndicator",
// p*(fvc::laplacian(p))
// / (
// magSqr(fvc::grad(p))
// + dimensionedScalar
// (
// "smallish",
// sqr(p.dimensions()/dimLength),
// 1E-6
// )
// ));
//pIndicator.writeOpt() = IOobject::AUTO_WRITE;
// Flux estimate for introduced faces. // Flux estimate for introduced faces.
volVectorField rhoU("rhoU", rho*U); volVectorField rhoU("rhoU", rho*U);
// Do any mesh changes // Do any mesh changes
meshChanged = mesh.update(); bool meshChanged = mesh.update();
// if (mesh.moving() || meshChanged)
// { if (meshChanged)
// #include "correctPhi.H" {
// } hasChanged = true;
}
if (runTime.write() && hasChanged)
{
betav.write();
Lobs.write();
CT.write();
drag->writeFields();
flameWrinkling->writeFields();
hasChanged = false;
}
// Make the fluxes relative to the mesh motion // Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, rho, U); fvc::makeRelative(phi, rho, U);

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
@ -50,55 +50,12 @@ Foam::XiEqModels::basicSubGrid::basicSubGrid
: :
XiEqModel(XiEqProperties, thermo, turbulence, Su), XiEqModel(XiEqProperties, thermo, turbulence, Su),
N_
(
IOobject
(
"N",
Su.mesh().time().findInstance(polyMesh::meshSubDir, "N"),
polyMesh::meshSubDir,
Su.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
Su.mesh()
),
ns_
(
IOobject
(
"ns",
Su.mesh().time().findInstance(polyMesh::meshSubDir, "ns"),
polyMesh::meshSubDir,
Su.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
Su.mesh()
),
B_ B_
( (
IOobject IOobject
( (
"B", "B",
Su.mesh().time().findInstance(polyMesh::meshSubDir, "B"), Su.mesh().facesInstance(),
polyMesh::meshSubDir,
Su.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
Su.mesh()
),
Lobs_
(
IOobject
(
"Lobs",
Su.mesh().time().findInstance(polyMesh::meshSubDir, "Lobs"),
polyMesh::meshSubDir,
Su.mesh(), Su.mesh(),
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
@ -120,8 +77,12 @@ Foam::XiEqModels::basicSubGrid::~basicSubGrid()
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
{ {
const objectRegistry& db = Su_.db(); const fvMesh& mesh = Su_.mesh();
const volVectorField& U = db.lookupObject<volVectorField>("U"); const volVectorField& U = mesh.lookupObject<volVectorField>("U");
const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv");
const volSymmTensorField& nsv =
mesh.lookupObject<volSymmTensorField>("nsv");
volScalarField magU(mag(U)); volScalarField magU(mag(U));
volVectorField Uhat volVectorField Uhat
@ -129,20 +90,71 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4)) U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4))
); );
volScalarField n(max(N_ - (Uhat & ns_ & Uhat), scalar(1e-4))); const scalarField Cw = pow(mesh.V(), 2.0/3.0);
volScalarField b((Uhat & B_ & Uhat)/n); tmp<volScalarField> tN
(
new volScalarField
(
IOobject
(
"tN",
mesh.time().constant(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("zero", Nv.dimensions(), 0.0),
zeroGradientFvPatchVectorField::typeName
)
);
volScalarField& N = tN();
N.internalField() = Nv.internalField()*Cw;
tmp<volSymmTensorField> tns
(
new volSymmTensorField
(
IOobject
(
"tns",
U.mesh().time().timeName(),
U.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
U.mesh(),
dimensionedSymmTensor
(
"zero",
nsv.dimensions(),
pTraits<symmTensor>::zero
),
zeroGradientFvPatchSymmTensorField::typeName
)
);
volSymmTensorField& ns = tns();
ns.internalField() = nsv.internalField()*Cw;
volScalarField n(max(N - (Uhat & ns & Uhat), scalar(1e-4)));
volScalarField b((Uhat & B_ & Uhat)/sqrt(n));
volScalarField up(sqrt((2.0/3.0)*turbulence_.k())); volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
volScalarField XiSubEq volScalarField XiSubEq
( (
scalar(1) scalar(1)
+ max(2.2*sqrt(b), min(0.34*magU/up, scalar(1.6))) + max(2.2*sqrt(b), min(0.34*magU/up*sqrt(b), scalar(1.6)))
*min(0.25*n, scalar(1)) * min(n, scalar(1))
); );
return XiSubEq*XiEqModel_->XiEq(); return (XiSubEq*XiEqModel_->XiEq());
} }

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
@ -85,18 +85,9 @@ class basicSubGrid
{ {
// Private data // Private data
//- Count
volScalarField N_;
//- Sub-count
volSymmTensorField ns_;
//- tblock //- tblock
volSymmTensorField B_; volSymmTensorField B_;
//- Typical obstacle diameters per cell
volScalarField Lobs_;
//- Equilibrium Xi model due to turbulence //- Equilibrium Xi model due to turbulence
autoPtr<XiEqModel> XiEqModel_; autoPtr<XiEqModel> XiEqModel_;

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,8 +34,8 @@ namespace XiGModels
{ {
defineTypeNameAndDebug(basicSubGrid, 0); defineTypeNameAndDebug(basicSubGrid, 0);
addToRunTimeSelectionTable(XiGModel, basicSubGrid, dictionary); addToRunTimeSelectionTable(XiGModel, basicSubGrid, dictionary);
} };
} };
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -66,12 +66,37 @@ Foam::tmp<Foam::volScalarField> Foam::XiGModels::basicSubGrid::G() const
{ {
const objectRegistry& db = Su_.db(); const objectRegistry& db = Su_.db();
const volVectorField& U = db.lookupObject<volVectorField>("U"); const volVectorField& U = db.lookupObject<volVectorField>("U");
const volScalarField& N = db.lookupObject<volScalarField>("N"); const volScalarField& Nv = db.lookupObject<volScalarField>("Nv");
const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs"); const volScalarField& Lobs = db.lookupObject<volScalarField>("Lobs");
tmp<volScalarField> tGtot = XiGModel_->G(); tmp<volScalarField> tGtot = XiGModel_->G();
volScalarField& Gtot = tGtot(); volScalarField& Gtot = tGtot();
const scalarField Cw = pow(Su_.mesh().V(), 2.0/3.0);
tmp<volScalarField> tN
(
new volScalarField
(
IOobject
(
"tN",
Su_.mesh().time().timeName(),
Su_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
Su_.mesh(),
dimensionedScalar("zero", Nv.dimensions(), 0.0),
zeroGradientFvPatchVectorField::typeName
)
);
volScalarField& N = tN();
N.internalField() = Nv.internalField()*Cw;
forAll(N, celli) forAll(N, celli)
{ {
if (N[celli] > 1e-3) if (N[celli] > 1e-3)

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
@ -31,7 +31,7 @@ namespace Foam
{ {
defineTypeNameAndDebug(PDRDragModel, 0); defineTypeNameAndDebug(PDRDragModel, 0);
defineRunTimeSelectionTable(PDRDragModel, dictionary); defineRunTimeSelectionTable(PDRDragModel, dictionary);
} };
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

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
@ -162,6 +162,11 @@ public:
{ {
return true; return true;
} }
virtual void writeFields() const
{
notImplemented("PDRDragModel::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
@ -53,25 +53,17 @@ Foam::PDRDragModels::basic::basic
Csu("Csu", dimless, PDRDragModelCoeffs_.lookup("Csu")), Csu("Csu", dimless, PDRDragModelCoeffs_.lookup("Csu")),
Csk("Csk", dimless, PDRDragModelCoeffs_.lookup("Csk")), Csk("Csk", dimless, PDRDragModelCoeffs_.lookup("Csk")),
Aw2_ Aw_
(
"Aw2",
sqr
(
volScalarField
( (
IOobject IOobject
( (
"Aw", "Aw",
U_.mesh().time().findInstance(polyMesh::meshSubDir, "Aw"), U_.mesh().facesInstance(),
polyMesh::meshSubDir,
U_.mesh(), U_.mesh(),
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
U_.mesh() U_.mesh()
)
)
), ),
CR_ CR_
@ -79,22 +71,7 @@ Foam::PDRDragModels::basic::basic
IOobject IOobject
( (
"CR", "CR",
U_.mesh().time().findInstance(polyMesh::meshSubDir, "CR"), U_.mesh().facesInstance(),
polyMesh::meshSubDir,
U_.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
U_.mesh()
),
CT_
(
IOobject
(
"CT",
U_.mesh().time().findInstance(polyMesh::meshSubDir, "CT"),
polyMesh::meshSubDir,
U_.mesh(), U_.mesh(),
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
@ -114,19 +91,24 @@ Foam::PDRDragModels::basic::~basic()
Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
{ {
const volScalarField& betav = U_.db().lookupObject<volScalarField>("betav"); const volScalarField& betav =
U_.db().lookupObject<volScalarField>("betav");
return (0.5*rho_)*CR_*mag(U_) + (Csu*I)*betav*turbulence_.muEff()*Aw2_; return (0.5*rho_)*CR_*mag(U_) + (Csu*I)*betav*turbulence_.muEff()*sqr(Aw_);
} }
Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const
{ {
const volScalarField& betav = U_.db().lookupObject<volScalarField>("betav"); const volScalarField& betav =
U_.db().lookupObject<volScalarField>("betav");
const volSymmTensorField& CT =
U_.db().lookupObject<volSymmTensorField>("CT");
return return
(0.5*rho_)*mag(U_)*(U_ & CT_ & U_) (0.5*rho_)*mag(U_)*(U_ & CT & U_)
+ Csk*betav*turbulence_.muEff()*Aw2_*magSqr(U_); + Csk*betav*turbulence_.muEff()*sqr(Aw_)*magSqr(U_);
} }
@ -141,4 +123,10 @@ bool Foam::PDRDragModels::basic::read(const dictionary& PDRProperties)
} }
void Foam::PDRDragModels::basic::writeFields() const
{
Aw_.write();
CR_.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
@ -102,9 +102,8 @@ class basic
dimensionedScalar Csu; dimensionedScalar Csu;
dimensionedScalar Csk; dimensionedScalar Csk;
volScalarField Aw2_; volScalarField Aw_;
volSymmTensorField CR_; volSymmTensorField CR_;
volSymmTensorField CT_;
// Private Member Functions // Private Member Functions
@ -149,6 +148,9 @@ public:
//- Update properties from given dictionary //- Update properties from given dictionary
virtual bool read(const dictionary& PDRProperties); virtual bool read(const dictionary& PDRProperties);
//- Write fields
void writeFields() const;
}; };

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
@ -55,12 +55,42 @@ PDRkEpsilon::PDRkEpsilon
const word& modelName const word& modelName
) )
: :
kEpsilon(rho, U, phi, thermophysicalModel, turbulenceModelName, modelName) kEpsilon(rho, U, phi, thermophysicalModel, turbulenceModelName, modelName),
C4_
(
dimensioned<scalar>::lookupOrAddToDict
(
"C4",
coeffDict_,
0.1
)
)
{}
// * * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
PDRkEpsilon::~PDRkEpsilon()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool PDRkEpsilon::read()
{
if (RASModel::read())
{
C4_.readIfPresent(coeffDict_);
return true;
}
else
{
return false;
}
}
void PDRkEpsilon::correct() void PDRkEpsilon::correct()
{ {
if (!turbulence_) if (!turbulence_)
@ -89,18 +119,25 @@ void PDRkEpsilon::correct()
volScalarField G("RASModel::G", mut_*(tgradU() && dev(twoSymm(tgradU())))); volScalarField G("RASModel::G", mut_*(tgradU() && dev(twoSymm(tgradU()))));
tgradU.clear(); tgradU.clear();
// Update epsilon and G at the wall // Update espsilon and G at the wall
epsilon_.boundaryField().updateCoeffs(); epsilon_.boundaryField().updateCoeffs();
// Add the blockage generation term so that it is included consistently // Add the blockage generation term so that it is included consistently
// in both the k and epsilon equations // in both the k and epsilon equations
const volScalarField& betav = U_.db().lookupObject<volScalarField>("betav"); const volScalarField& betav =
U_.db().lookupObject<volScalarField>("betav");
const volScalarField& Lobs =
U_.db().lookupObject<volScalarField>("Lobs");
const PDRDragModel& drag = const PDRDragModel& drag =
U_.db().lookupObject<PDRDragModel>("PDRDragModel"); U_.db().lookupObject<PDRDragModel>("PDRDragModel");
volScalarField GR(drag.Gk()); volScalarField GR(drag.Gk());
volScalarField LI
(C4_*(Lobs + dimensionedScalar("minLength", dimLength, VSMALL)));
// Dissipation equation // Dissipation equation
tmp<fvScalarMatrix> epsEqn tmp<fvScalarMatrix> epsEqn
( (
@ -108,7 +145,8 @@ void PDRkEpsilon::correct()
+ fvm::div(phi_, epsilon_) + fvm::div(phi_, epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_) - fvm::laplacian(DepsilonEff(), epsilon_)
== ==
C1_*(betav*G + GR)*epsilon_/k_ C1_*betav*G*epsilon_/k_
+ 1.5*pow(Cmu_, 3.0/4.0)*GR*sqrt(k_)/LI
- fvm::SuSp(((2.0/3.0)*C1_)*betav*rho_*divU, epsilon_) - fvm::SuSp(((2.0/3.0)*C1_)*betav*rho_*divU, epsilon_)
- fvm::Sp(C2_*betav*rho_*epsilon_/k_, epsilon_) - fvm::Sp(C2_*betav*rho_*epsilon_/k_, epsilon_)
); );
@ -138,7 +176,6 @@ void PDRkEpsilon::correct()
solve(kEqn); solve(kEqn);
bound(k_, kMin_); bound(k_, kMin_);
// Re-calculate viscosity // Re-calculate viscosity
mut_ = rho_*Cmu_*sqr(k_)/epsilon_; mut_ = rho_*Cmu_*sqr(k_)/epsilon_;
mut_.correctBoundaryConditions(); mut_.correctBoundaryConditions();

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,8 +25,7 @@ Class
Foam::compressible::RASModels::PDRkEpsilon Foam::compressible::RASModels::PDRkEpsilon
Description Description
Standard k-epsilon turbulence model for compressible flow Standard k-epsilon turbulence model with additional source terms
with additional source terms
corresponding to PDR basic drag model (\link basic.H \endlink) corresponding to PDR basic drag model (\link basic.H \endlink)
The default model coefficients correspond to the following: The default model coefficients correspond to the following:
@ -37,6 +36,7 @@ Description
C1 1.44; C1 1.44;
C2 1.92; C2 1.92;
C3 -0.33; // only for compressible C3 -0.33; // only for compressible
C4 0.1;
sigmak 1.0; // only for compressible sigmak 1.0; // only for compressible
sigmaEps 1.3; sigmaEps 1.3;
Prt 1.0; // only for compressible Prt 1.0; // only for compressible
@ -60,7 +60,7 @@ SourceFiles
#ifndef compressiblePDRkEpsilon_H #ifndef compressiblePDRkEpsilon_H
#define compressiblePDRkEpsilon_H #define compressiblePDRkEpsilon_H
#include "RASModel.H"
#include "kEpsilon.H" #include "kEpsilon.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -80,6 +80,11 @@ class PDRkEpsilon
: :
public kEpsilon public kEpsilon
{ {
// Private data
// Model coefficients
dimensionedScalar C4_;
public: public:
@ -102,15 +107,16 @@ public:
//- Destructor //- Destructor
virtual ~PDRkEpsilon() virtual ~PDRkEpsilon();
{}
// Member Functions // Member Functions
//- Solve the turbulence equations and correct the turbulence viscosity //- Solve the turbulence equations and correct the turbulence viscosity
virtual void correct(); void correct();
//- Read turbulenceProperties dictionary
bool read();
}; };

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
@ -49,8 +49,8 @@ Foam::XiEqModels::Gulder::Gulder
) )
: :
XiEqModel(XiEqProperties, thermo, turbulence, Su), XiEqModel(XiEqProperties, thermo, turbulence, Su),
XiEqCoef(readScalar(XiEqModelCoeffs_.lookup("XiEqCoef"))), XiEqCoef_(readScalar(XiEqModelCoeffs_.lookup("XiEqCoef"))),
SuMin(0.01*Su.average()) SuMin_(0.01*Su.average())
{} {}
@ -67,6 +67,11 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
volScalarField up(sqrt((2.0/3.0)*turbulence_.k())); volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
const volScalarField& epsilon = turbulence_.epsilon(); const volScalarField& epsilon = turbulence_.epsilon();
if (subGridSchelkin())
{
up.internalField() += calculateSchelkinEffect();
}
volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon)))); volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));
volScalarField Reta volScalarField Reta
@ -78,7 +83,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
) )
); );
return 1.0 + XiEqCoef*sqrt(up/(Su_ + SuMin))*Reta; return (1.0 + XiEqCoef_*sqrt(up/(Su_ + SuMin_))*Reta);
} }
@ -86,7 +91,9 @@ bool Foam::XiEqModels::Gulder::read(const dictionary& XiEqProperties)
{ {
XiEqModel::read(XiEqProperties); XiEqModel::read(XiEqProperties);
XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef; XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef_;
XiEqModelCoeffs_.lookup("uPrimeCoef") >> uPrimeCoef_;
XiEqModelCoeffs_.lookup("subGridSchelkin") >> subGridSchelkin_;
return true; return true;
} }

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
@ -55,8 +55,11 @@ class Gulder
{ {
// Private data // Private data
scalar XiEqCoef; //- Model constant
dimensionedScalar SuMin; scalar XiEqCoef_;
//- Minimum laminar burning velocity
const dimensionedScalar SuMin_;
// Private Member Functions // Private Member Functions
@ -97,6 +100,7 @@ public:
//- Update properties from given dictionary //- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties); virtual bool read(const dictionary& XiEqProperties);
}; };

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
@ -105,6 +105,7 @@ public:
{ {
return true; return true;
} }
}; };

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
@ -49,10 +49,10 @@ Foam::XiEqModels::SCOPEXiEq::SCOPEXiEq
) )
: :
XiEqModel(XiEqProperties, thermo, turbulence, Su), XiEqModel(XiEqProperties, thermo, turbulence, Su),
XiEqCoef(readScalar(XiEqModelCoeffs_.lookup("XiEqCoef"))), XiEqCoef_(readScalar(XiEqModelCoeffs_.lookup("XiEqCoef"))),
XiEqExp(readScalar(XiEqModelCoeffs_.lookup("XiEqExp"))), XiEqExp_(readScalar(XiEqModelCoeffs_.lookup("XiEqExp"))),
lCoef(readScalar(XiEqModelCoeffs_.lookup("lCoef"))), lCoef_(readScalar(XiEqModelCoeffs_.lookup("lCoef"))),
SuMin(0.01*Su.average()), SuMin_(0.01*Su.average()),
MaModel MaModel
( (
IOdictionary IOdictionary
@ -62,7 +62,7 @@ Foam::XiEqModels::SCOPEXiEq::SCOPEXiEq
"combustionProperties", "combustionProperties",
Su.mesh().time().constant(), Su.mesh().time().constant(),
Su.mesh(), Su.mesh(),
IOobject::MUST_READ_IF_MODIFIED IOobject::MUST_READ
) )
), ),
thermo thermo
@ -84,10 +84,15 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
const volScalarField& epsilon = turbulence_.epsilon(); const volScalarField& epsilon = turbulence_.epsilon();
volScalarField up(sqrt((2.0/3.0)*k)); volScalarField up(sqrt((2.0/3.0)*k));
volScalarField l((lCoef*sqrt(3.0/2.0))*up*k/epsilon); if (subGridSchelkin())
{
up.internalField() += calculateSchelkinEffect();
}
volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon);
volScalarField Rl(up*l*thermo_.rhou()/thermo_.muu()); volScalarField Rl(up*l*thermo_.rhou()/thermo_.muu());
volScalarField upBySu(up/(Su_ + SuMin)); volScalarField upBySu(up/(Su_ + SuMin_));
volScalarField K(0.157*upBySu/sqrt(Rl)); volScalarField K(0.157*upBySu/sqrt(Rl));
volScalarField Ma(MaModel.Ma()); volScalarField Ma(MaModel.Ma());
@ -114,7 +119,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
if (Ma[celli] > 0.01) if (Ma[celli] > 0.01)
{ {
xieq[celli] = xieq[celli] =
XiEqCoef*pow(K[celli]*Ma[celli], -XiEqExp)*upBySu[celli]; XiEqCoef_*pow(K[celli]*Ma[celli], -XiEqExp_)*upBySu[celli];
} }
} }
@ -130,7 +135,8 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
if (Ma[facei] > 0.01) if (Ma[facei] > 0.01)
{ {
xieqp[facei] = xieqp[facei] =
XiEqCoef*pow(Kp[facei]*Map[facei], -XiEqExp)*upBySup[facei]; XiEqCoef_*pow(Kp[facei]*Map[facei], -XiEqExp_)
*upBySup[facei];
} }
} }
} }
@ -143,9 +149,9 @@ bool Foam::XiEqModels::SCOPEXiEq::read(const dictionary& XiEqProperties)
{ {
XiEqModel::read(XiEqProperties); XiEqModel::read(XiEqProperties);
XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef; XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef_;
XiEqModelCoeffs_.lookup("XiEqExp") >> XiEqExp; XiEqModelCoeffs_.lookup("XiEqExp") >> XiEqExp_;
XiEqModelCoeffs_.lookup("lCoef") >> lCoef; XiEqModelCoeffs_.lookup("lCoef") >> lCoef_;
return true; return true;
} }

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
@ -58,10 +58,17 @@ class SCOPEXiEq
{ {
// Private data // Private data
scalar XiEqCoef; // Model constant
scalar XiEqExp; scalar XiEqCoef_;
scalar lCoef;
dimensionedScalar SuMin; // Model constant
scalar XiEqExp_;
// Model constant
scalar lCoef_;
//- Minimum Su
dimensionedScalar SuMin_;
//- The SCOPE laminar flame speed model used to obtain the //- The SCOPE laminar flame speed model used to obtain the
// Marstein number. Note: the laminar flame speed need not be // Marstein number. Note: the laminar flame speed need not be
@ -107,6 +114,7 @@ public:
//- Update properties from given dictionary //- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties); virtual bool read(const dictionary& XiEqProperties);
}; };

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
@ -53,7 +53,36 @@ Foam::XiEqModel::XiEqModel
), ),
thermo_(thermo), thermo_(thermo),
turbulence_(turbulence), turbulence_(turbulence),
Su_(Su) Su_(Su),
Nv_
(
IOobject
(
"Nv",
Su.mesh().facesInstance(),
Su.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
Su.mesh()
),
nsv_
(
IOobject
(
"nsv",
Su.mesh().facesInstance(),
Su.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
Su.mesh()
),
uPrimeCoef_(XiEqModelCoeffs_.lookupOrDefault<scalar>("uPrimeCoef", 0.0)),
subGridSchelkin_
(
XiEqModelCoeffs_.lookupOrDefault<bool>("subGridSchelkin", false)
)
{} {}
@ -69,8 +98,105 @@ bool Foam::XiEqModel::read(const dictionary& XiEqProperties)
{ {
XiEqModelCoeffs_ = XiEqProperties.subDict(type() + "Coeffs"); XiEqModelCoeffs_ = XiEqProperties.subDict(type() + "Coeffs");
uPrimeCoef_ = XiEqModelCoeffs_.lookupOrDefault<scalar>("uPrimeCoef", 0.0);
subGridSchelkin_ =
XiEqModelCoeffs_.lookupOrDefault<bool>("subGridSchelkin", false);
return true; return true;
} }
void Foam::XiEqModel::writeFields() const
{
Nv_.write();
nsv_.write();
if (Su_.mesh().foundObject<volSymmTensorField>("B"))
{
const volSymmTensorField& B =
Su_.mesh().lookupObject<volSymmTensorField>("B");
B.write();
}
}
Foam::tmp<Foam::volScalarField>
Foam::XiEqModel::calculateSchelkinEffect() const
{
const fvMesh& mesh = Su_.mesh();
const volVectorField& U = mesh.lookupObject<volVectorField>("U");
const volSymmTensorField& CT = mesh.lookupObject<volSymmTensorField>("CT");
const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv");
const volSymmTensorField& nsv =
mesh.lookupObject<volSymmTensorField>("nsv");
tmp<volScalarField> tN
(
new volScalarField
(
IOobject
(
"tN",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar("zero", Nv.dimensions(), 0.0),
zeroGradientFvPatchVectorField::typeName
)
);
volScalarField& N = tN();
N.internalField() = Nv.internalField()*pow(mesh.V(), 2.0/3.0);
tmp<volSymmTensorField> tns
(
new volSymmTensorField
(
IOobject
(
"tns",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedSymmTensor
(
"zero",
nsv.dimensions(),
pTraits<symmTensor>::zero
)
)
);
volSymmTensorField& ns = tns();
ns.internalField() = nsv.internalField()*pow(mesh.V(), 2.0/3.0);
const volVectorField Uhat
(
U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4))
);
const volScalarField nr(sqrt(max(N - (Uhat & ns & Uhat), scalar(1e-4))));
const scalarField cellWidth(pow(mesh.V(), 1.0/3.0));
const scalarField upLocal(uPrimeCoef_*sqrt((U & CT & U)*cellWidth));
const scalarField deltaUp(upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0));
//Re use tN
N.internalField() = upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0);
return tN;
}
// ************************************************************************* // // ************************************************************************* //

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
@ -62,12 +62,30 @@ protected:
// Protected data // Protected data
//- Dictionary
dictionary XiEqModelCoeffs_; dictionary XiEqModelCoeffs_;
//- Thermo
const hhuCombustionThermo& thermo_; const hhuCombustionThermo& thermo_;
//- Turbulence
const compressible::RASModel& turbulence_; const compressible::RASModel& turbulence_;
//- Laminar burning velocity
const volScalarField& Su_; const volScalarField& Su_;
//- Volumetric obstacles number
volScalarField Nv_;
//
volSymmTensorField nsv_;
//- Schelkin effect Model constant
scalar uPrimeCoef_;
//- Use sub-grid Schelkin effect
bool subGridSchelkin_;
private: private:
@ -144,8 +162,20 @@ public:
return turbulence_.muEff(); return turbulence_.muEff();
} }
//- Return state of the sub-grid Schelkin effect
bool subGridSchelkin() const
{
return subGridSchelkin_;
}
//- Return the sub-grid Schelkin effect
tmp<volScalarField> calculateSchelkinEffect() const;
//- Update properties from given dictionary //- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties) = 0; virtual bool read(const dictionary& XiEqProperties) = 0;
//- Write fields
void writeFields() const;
}; };

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
@ -101,6 +101,7 @@ public:
//- Update properties from given dictionary //- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties); virtual bool read(const dictionary& XiEqProperties);
}; };

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
@ -49,7 +49,7 @@ Foam::XiGModels::KTS::KTS
) )
: :
XiGModel(XiGProperties, thermo, turbulence, Su), XiGModel(XiGProperties, thermo, turbulence, Su),
GEtaCoef(readScalar(XiGModelCoeffs_.lookup("GEtaCoef"))) GEtaCoef_(readScalar(XiGModelCoeffs_.lookup("GEtaCoef")))
{} {}
@ -63,13 +63,12 @@ Foam::XiGModels::KTS::~KTS()
Foam::tmp<Foam::volScalarField> Foam::XiGModels::KTS::G() const Foam::tmp<Foam::volScalarField> Foam::XiGModels::KTS::G() const
{ {
// volScalarField up(sqrt((2.0/3.0)*turbulence_.k())); volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
const volScalarField& epsilon = turbulence_.epsilon(); const volScalarField& epsilon = turbulence_.epsilon();
tmp<volScalarField> tauEta = volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));
sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon)));
return GEtaCoef/tauEta; return (GEtaCoef_/tauEta);
} }
@ -77,7 +76,7 @@ bool Foam::XiGModels::KTS::read(const dictionary& XiGProperties)
{ {
XiGModel::read(XiGProperties); XiGModel::read(XiGProperties);
XiGModelCoeffs_.lookup("GEtaCoef") >> GEtaCoef; XiGModelCoeffs_.lookup("GEtaCoef") >> GEtaCoef_;
return true; return true;
} }

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
@ -55,7 +55,7 @@ class KTS
{ {
// Private data // Private data
scalar GEtaCoef; scalar GEtaCoef_;
// Private Member Functions // Private Member Functions

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
@ -49,8 +49,8 @@ Foam::XiGModels::instabilityG::instabilityG
) )
: :
XiGModel(XiGProperties, thermo, turbulence, Su), XiGModel(XiGProperties, thermo, turbulence, Su),
GIn(XiGModelCoeffs_.lookup("GIn")), GIn_(XiGModelCoeffs_.lookup("GIn")),
lambdaIn(XiGModelCoeffs_.lookup("lambdaIn")), lambdaIn_(XiGModelCoeffs_.lookup("lambdaIn")),
XiGModel_(XiGModel::New(XiGModelCoeffs_, thermo, turbulence, Su)) XiGModel_(XiGModel::New(XiGModelCoeffs_, thermo, turbulence, Su))
{} {}
@ -66,7 +66,7 @@ Foam::XiGModels::instabilityG::~instabilityG()
Foam::tmp<Foam::volScalarField> Foam::XiGModels::instabilityG::G() const Foam::tmp<Foam::volScalarField> Foam::XiGModels::instabilityG::G() const
{ {
volScalarField turbXiG(XiGModel_->G()); volScalarField turbXiG(XiGModel_->G());
return GIn*GIn/(GIn + turbXiG) + turbXiG; return (GIn_*GIn_/(GIn_ + turbXiG) + turbXiG);
} }
@ -78,7 +78,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiGModels::instabilityG::Db() const
const volScalarField& mgb = db.lookupObject<volScalarField>("mgb"); const volScalarField& mgb = db.lookupObject<volScalarField>("mgb");
return XiGModel_->Db() return XiGModel_->Db()
+ rho*Su_*(Xi - 1.0)*mgb*(0.5*lambdaIn)/(mgb + 1.0/lambdaIn); + rho*Su_*(Xi - 1.0)*mgb*(0.5*lambdaIn_)/(mgb + 1.0/lambdaIn_);
} }
@ -86,8 +86,8 @@ bool Foam::XiGModels::instabilityG::read(const dictionary& XiGProperties)
{ {
XiGModel::read(XiGProperties); XiGModel::read(XiGProperties);
XiGModelCoeffs_.lookup("GIn") >> GIn; XiGModelCoeffs_.lookup("GIn") >> GIn_;
XiGModelCoeffs_.lookup("lambdaIn") >> lambdaIn; XiGModelCoeffs_.lookup("lambdaIn") >> lambdaIn_;
return true; return true;
} }

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
@ -58,10 +58,10 @@ class instabilityG
// Private data // Private data
//- Flame instabilityG wrinling generation rate coefficient //- Flame instabilityG wrinling generation rate coefficient
dimensionedScalar GIn; dimensionedScalar GIn_;
//- InstabilityG length-scale //- InstabilityG length-scale
dimensionedScalar lambdaIn; dimensionedScalar lambdaIn_;
//- Xi generation rate model due to all other processes //- Xi generation rate model due to all other processes
autoPtr<XiGModel> XiGModel_; autoPtr<XiGModel> XiGModel_;

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
@ -237,6 +237,9 @@ public:
//- Update properties from given dictionary //- Update properties from given dictionary
virtual bool read(const dictionary& XiProperties) = 0; virtual bool read(const dictionary& XiProperties) = 0;
//- Write fields related to Xi model
virtual void writeFields() = 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) 1991-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
@ -109,6 +109,13 @@ public:
//- Update properties from given dictionary //- Update properties from given dictionary
virtual bool read(const dictionary& XiProperties); virtual bool read(const dictionary& XiProperties);
//- Write fields of the XiEq model
virtual void writeFields()
{
XiEqModel_().writeFields();
}
}; };

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
@ -95,6 +95,11 @@ public:
//- Update properties from given dictionary //- Update properties from given dictionary
virtual bool read(const dictionary& XiProperties); virtual bool read(const dictionary& XiProperties);
//- Write fields of the XiEq model
virtual void writeFields()
{}
}; };

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
@ -124,6 +124,12 @@ public:
//- Update properties from given dictionary //- Update properties from given dictionary
virtual bool read(const dictionary& XiProperties); virtual bool read(const dictionary& XiProperties);
//- Write fields of the XiEq model
virtual void writeFields()
{
XiEqModel_().writeFields();
}
}; };

View File

@ -30,7 +30,7 @@ if (ign.ignited())
// Calculate flame normal etc. // Calculate flame normal etc.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
// volVectorField n(fvc::grad(b)); //volVectorField n(fvc::grad(b));
volVectorField n(fvc::reconstruct(fvc::snGrad(b)*mesh.magSf())); volVectorField n(fvc::reconstruct(fvc::snGrad(b)*mesh.magSf()));
volScalarField mgb("mgb", mag(n)); volScalarField mgb("mgb", mag(n));

View File

@ -30,7 +30,6 @@
//const volScalarField& T = thermo->T(); //const volScalarField& T = thermo->T();
Info<< "\nReading field U\n" << endl; Info<< "\nReading field U\n" << endl;
volVectorField U volVectorField U
( (
@ -94,8 +93,35 @@
IOobject IOobject
( (
"betav", "betav",
runTime.findInstance(polyMesh::meshSubDir, "betav"), mesh.facesInstance(),
polyMesh::meshSubDir, mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
Info<< "Reading field Lobs\n" << endl;
volScalarField Lobs
(
IOobject
(
"Lobs",
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
Info<< "Reading field CT\n" << endl;
volSymmTensorField CT
(
IOobject
(
"CT",
mesh.facesInstance(),
mesh, mesh,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE IOobject::NO_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) 1991-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,6 +23,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "IFstream.H"
#include "SCOPELaminarFlameSpeed.H" #include "SCOPELaminarFlameSpeed.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
@ -68,7 +69,19 @@ Foam::laminarFlameSpeedModels::SCOPE::SCOPE
: :
laminarFlameSpeed(dict, ct), laminarFlameSpeed(dict, ct),
coeffsDict_(dict.subDict(typeName + "Coeffs").subDict(fuel_)), coeffsDict_
(
dictionary
(
IFstream
(
fileName
(
dict.lookup("fuelFile")
)
)()
).subDict(typeName + "Coeffs")
),
LFL_(readScalar(coeffsDict_.lookup("lowerFlamabilityLimit"))), LFL_(readScalar(coeffsDict_.lookup("lowerFlamabilityLimit"))),
UFL_(readScalar(coeffsDict_.lookup("upperFlamabilityLimit"))), UFL_(readScalar(coeffsDict_.lookup("upperFlamabilityLimit"))),
SuPolyL_(coeffsDict_.subDict("lowerSuPolynomial")), SuPolyL_(coeffsDict_.subDict("lowerSuPolynomial")),

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
@ -134,7 +134,7 @@ class SCOPE
polynomial MaPolyU_; polynomial MaPolyU_;
// Private Member Functions // Private member functions
//- Polynomial evaluated from the given equivalence ratio //- Polynomial evaluated from the given equivalence ratio
// and polynomial coefficients // and polynomial coefficients

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

@ -23,7 +23,7 @@ fvMesh mesh
fvMesh::defaultRegion, fvMesh::defaultRegion,
runTime.timeName(), runTime.timeName(),
runTime, runTime,
IOobject::NO_READ IOobject::MUST_READ
), ),
xferMove<Field<vector> >(points), xferMove<Field<vector> >(points),
faces.xfer(), faces.xfer(),

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/liquids/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/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 \
@ -27,12 +27,12 @@ EXE_LIBS = \
-llagrangian \ -llagrangian \
-lmeshTools \ -lmeshTools \
-ldieselSpray \ -ldieselSpray \
-lliquids \ -lliquidProperties \
-lliquidMixture \ -lliquidMixtureProperties \
-lthermophysicalFunctions \ -lthermophysicalFunctions \
-lspecie \ -lspecie \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-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/liquids/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/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 \
@ -24,13 +24,13 @@ EXE_LIBS = \
-llagrangian \ -llagrangian \
-lmeshTools \ -lmeshTools \
-ldieselSpray \ -ldieselSpray \
-lliquids \ -lliquidProperties \
-lliquidMixture \ -lliquidMixtureProperties \
-lthermophysicalFunctions \ -lthermophysicalFunctions \
-lspecie \ -lspecie \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-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

@ -24,12 +24,17 @@
fvc::interpolate(thermo.psi())*phiv fvc::interpolate(thermo.psi())*phiv
); );
fvScalarMatrix pDDtEqn
(
fvc::ddt(rho) + fvc::div(phi)
+ correction(fvm::ddt(psi, p) + fvm::div(phid, p))
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvc::ddt(rho) + fvc::div(phi) pDDtEqn
+ correction(fvm::ddt(psi, p) + fvm::div(phid, p))
- fvm::laplacian(rho*rAU, p) - fvm::laplacian(rho*rAU, p)
); );
@ -63,12 +68,17 @@
+ fvc::ddtPhiCorr(rAU, rho, U, phi) + fvc::ddtPhiCorr(rAU, rho, U, phi)
); );
fvScalarMatrix pDDtEqn
(
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
+ fvc::div(phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvc::ddt(rho) + psi*correction(fvm::ddt(p)) pDDtEqn
+ fvc::div(phi)
- fvm::laplacian(rho*rAU, p) - fvm::laplacian(rho*rAU, p)
); );

View File

@ -19,12 +19,17 @@
surfaceScalarField buoyancyPhi(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); surfaceScalarField buoyancyPhi(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
phi += buoyancyPhi; phi += buoyancyPhi;
fvScalarMatrix p_rghDDtEqn
(
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
+ fvc::div(phi)
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix p_rghEqn fvScalarMatrix p_rghEqn
( (
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh)) p_rghDDtEqn
+ fvc::div(phi)
- fvm::laplacian(rhorAUf, p_rgh) - fvm::laplacian(rhorAUf, p_rgh)
); );

View File

@ -1,3 +0,0 @@
buoyantSimpleFoam.C
EXE = $(FOAM_APPBIN)/buoyantSimpleFoam

View File

@ -1,13 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lmeshTools \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleRASModels \
-lfiniteVolume

View File

@ -1,24 +0,0 @@
// Solve the Momentum equation
tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
);
UEqn().relax();
solve
(
UEqn()
==
rho*g
- fvc::grad(p)
/*
fvc::reconstruct
(
fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf()
)
*/
);

View File

@ -1,83 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
buoyantSimpleFoam
Description
Steady-state solver for buoyant, turbulent flow of compressible fluids
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "basicPsiThermo.H"
#include "RASModel.H"
#include "fixedGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
p.storePrevIter();
rho.storePrevIter();
// Pressure-velocity SIMPLE corrector
{
#include "UEqn.H"
#include "hEqn.H"
#include "pEqn.H"
}
turbulence->correct();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -1,69 +0,0 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<basicPsiThermo> pThermo
(
basicPsiThermo::New(mesh)
);
basicPsiThermo& thermo = pThermo();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
thermo.rho()
);
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
const volScalarField& psi = thermo.psi();
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::RASModel> turbulence
(
compressible::RASModel::New
(
rho,
U,
phi,
thermo
)
);
thermo.correct();
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell
(
p,
mesh.solutionDict().subDict("SIMPLE"),
pRefCell,
pRefValue
);
dimensionedScalar initialMass = fvc::domainIntegrate(rho);

View File

@ -1,17 +0,0 @@
{
fvScalarMatrix hEqn
(
fvm::div(phi, h)
- fvm::Sp(fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p))
- p*fvc::div(phi/fvc::interpolate(rho))
);
hEqn.relax();
hEqn.solve();
thermo.correct();
}

View File

@ -1,59 +0,0 @@
{
rho = thermo.rho();
volScalarField rAU(1.0/UEqn().A());
surfaceScalarField rhorAUf("(rho*(1|A(U)))", fvc::interpolate(rho*rAU));
U = rAU*UEqn().H();
UEqn.clear();
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
bool closedVolume = adjustPhi(phi, U, p);
surfaceScalarField buoyancyPhi
(
rhorAUf*fvc::interpolate(rho)*(g & mesh.Sf())
);
phi += buoyancyPhi;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rhorAUf, p) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
if (closedVolume)
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
}
// Calculate the conservative fluxes
phi -= pEqn.flux();
// Explicitly relax pressure for momentum corrector
p.relax();
// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U += rAU*(rho*g - fvc::grad(p));
//U += rAU*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rhorAUf);
U.correctBoundaryConditions();
}
}
#include "continuityErrs.H"
rho = thermo.rho();
rho.relax();
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value()
<< endl;
}

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

@ -2,6 +2,7 @@
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
set -x set -x
wclean libso coupledDerivedFvPatchFields
wclean wclean
wclean chtMultiRegionSimpleFoam wclean chtMultiRegionSimpleFoam

View File

@ -2,6 +2,7 @@
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
set -x set -x
wmake libso coupledDerivedFvPatchFields
wmake wmake
wmake chtMultiRegionSimpleFoam wmake chtMultiRegionSimpleFoam

View File

@ -1,5 +1,3 @@
derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
fluid/compressibleCourantNo.C fluid/compressibleCourantNo.C
solid/solidRegionDiffNo.C solid/solidRegionDiffNo.C

View File

@ -7,7 +7,8 @@ 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/basicSolidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
@ -17,4 +18,6 @@ EXE_LIBS = \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lmeshTools \ -lmeshTools \
-lfiniteVolume -lfiniteVolume \
-lradiationModels \
-lcoupledDerivedFvPatchFields

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
@ -38,6 +38,7 @@ Description
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "solidRegionDiffNo.H" #include "solidRegionDiffNo.H"
#include "basicSolidThermo.H" #include "basicSolidThermo.H"
#include "radiationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,7 +1,5 @@
EXE_INC = \ EXE_INC = \
/* -DFULLDEBUG -O0 -g */ \
-I.. \ -I.. \
-I../derivedFvPatchFields \
-Ifluid \ -Ifluid \
-Isolid \ -Isolid \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
@ -9,6 +7,7 @@ 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/basicSolidThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude
@ -20,4 +19,6 @@ EXE_LIBS = \
-lspecie \ -lspecie \
-lcompressibleTurbulenceModel \ -lcompressibleTurbulenceModel \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels -lcompressibleLESModels \
-lradiationModels \
-lcoupledDerivedFvPatchFields

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
@ -35,6 +35,7 @@ Description
#include "fixedGradientFvPatchFields.H" #include "fixedGradientFvPatchFields.H"
#include "regionProperties.H" #include "regionProperties.H"
#include "basicSolidThermo.H" #include "basicSolidThermo.H"
#include "radiationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -9,6 +9,7 @@
PtrList<volScalarField> p_rghFluid(fluidRegions.size()); PtrList<volScalarField> p_rghFluid(fluidRegions.size());
PtrList<volScalarField> ghFluid(fluidRegions.size()); PtrList<volScalarField> ghFluid(fluidRegions.size());
PtrList<surfaceScalarField> ghfFluid(fluidRegions.size()); PtrList<surfaceScalarField> ghfFluid(fluidRegions.size());
PtrList<radiation::radiationModel> radiation(fluidRegions.size());
List<scalar> initialMassFluid(fluidRegions.size()); List<scalar> initialMassFluid(fluidRegions.size());
List<label> pRefCellFluid(fluidRegions.size(),0); List<label> pRefCellFluid(fluidRegions.size(),0);
@ -168,6 +169,12 @@
// Force p_rgh to be consistent with p // Force p_rgh to be consistent with p
p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i]; p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i];
radiation.set
(
i,
radiation::radiationModel::New(thermoFluid[i].T())
);
initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value(); initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();
setRefCell setRefCell

View File

@ -7,6 +7,7 @@
== ==
fvc::div(phi/fvc::interpolate(rho), rho/psi, "div(U,p)") fvc::div(phi/fvc::interpolate(rho), rho/psi, "div(U,p)")
- (rho/psi)*fvc::div(phi/fvc::interpolate(rho)) - (rho/psi)*fvc::div(phi/fvc::interpolate(rho))
+ rad.Sh(thermo)
); );
hEqn.relax(); hEqn.relax();
@ -15,6 +16,8 @@
thermo.correct(); thermo.correct();
rad.correct();
Info<< "Min/max T:" << min(thermo.T()).value() << ' ' Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl; << max(thermo.T()).value() << endl;
} }

View File

@ -19,6 +19,8 @@
initialMassFluid[i] initialMassFluid[i]
); );
radiation::radiationModel& rad = radiation[i];
const label pRefCell = pRefCellFluid[i]; const label pRefCell = pRefCellFluid[i];
const scalar pRefValue = pRefValueFluid[i]; const scalar pRefValue = pRefValueFluid[i];

View File

@ -0,0 +1,4 @@
turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C
externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
LIB = $(FOAM_LIBBIN)/libcoupledDerivedFvPatchFields

View File

@ -0,0 +1,12 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude
EXE_LIBS = \
-lmeshTools \
-lbasicThermophysicalModels \
-lfiniteVolume \
-lradiationModels

View File

@ -0,0 +1,271 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "externalWallHeatFluxTemperatureFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "directMappedPatchBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<>
const char*
NamedEnum
<externalWallHeatFluxTemperatureFvPatchScalarField::operationMode, 3>::names[]=
{
"fixed_heat_flux",
"fixed_heat_transfer_coefficient",
"unknown"
};
const NamedEnum
<
externalWallHeatFluxTemperatureFvPatchScalarField::operationMode, 3
>
externalWallHeatFluxTemperatureFvPatchScalarField::operationModeNames;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::
externalWallHeatFluxTemperatureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), "undefined", "undefined-K"),
oldMode_(unknown),
q_(p.size(), 0.0),
h_(p.size(), 0.0),
Ta_(p.size(), 0.0)
{
this->refValue() = 0.0;
this->refGrad() = 0.0;
this->valueFraction() = 1.0;
}
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::
externalWallHeatFluxTemperatureFvPatchScalarField
(
const externalWallHeatFluxTemperatureFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
mixedFvPatchScalarField(ptf, p, iF, mapper),
temperatureCoupledBase(patch(), ptf.KMethod(), ptf.KName()),
oldMode_(unknown),
q_(ptf.q_, mapper),
h_(ptf.h_, mapper),
Ta_(ptf.Ta_, mapper)
{}
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::
externalWallHeatFluxTemperatureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), dict),
oldMode_(unknown),
q_(p.size(), 0.0),
h_(p.size(), 0.0),
Ta_(p.size(), 0.0)
{
if (dict.found("q") && !dict.found("h") && !dict.found("Ta"))
{
oldMode_ = fixedHeatFlux;
q_ = scalarField("q", dict, p.size());
}
else if(dict.found("h") && dict.found("Ta") && !dict.found("q"))
{
oldMode_ = fixedHeatTransferCoeff;
h_ = scalarField("h", dict, p.size());
Ta_ = scalarField("Ta", dict, p.size());
}
else
{
FatalErrorIn
(
"externalWallHeatFluxTemperatureFvPatchScalarField::"
"externalWallHeatFluxTemperatureFvPatchScalarField\n"
"(\n"
" const fvPatch& p,\n"
" const DimensionedField<scalar, volMesh>& iF,\n"
" const dictionary& dict\n"
")\n"
) << "\n patch type '" << p.type()
<< "' either q or h and Ta were not found '"
<< "\n for patch " << p.name()
<< " of field " << dimensionedInternalField().name()
<< " in file " << dimensionedInternalField().objectPath()
<< exit(FatalError);
}
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
if (dict.found("refValue"))
{
// Full restart
refValue() = scalarField("refValue", dict, p.size());
refGrad() = scalarField("refGradient", dict, p.size());
valueFraction() = scalarField("valueFraction", dict, p.size());
}
else
{
// Start from user entered data. Assume fixedValue.
refValue() = *this;
refGrad() = 0.0;
valueFraction() = 1.0;
}
}
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::
externalWallHeatFluxTemperatureFvPatchScalarField
(
const externalWallHeatFluxTemperatureFvPatchScalarField& tppsf
)
:
mixedFvPatchScalarField(tppsf),
temperatureCoupledBase(tppsf),
oldMode_(unknown),
q_(tppsf.q_),
h_(tppsf.h_),
Ta_(tppsf.Ta_)
{}
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::
externalWallHeatFluxTemperatureFvPatchScalarField
(
const externalWallHeatFluxTemperatureFvPatchScalarField& tppsf,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(tppsf, iF),
temperatureCoupledBase(patch(), tppsf.KMethod(), tppsf.KName()),
oldMode_(tppsf.oldMode_),
q_(tppsf.q_),
h_(tppsf.h_),
Ta_(tppsf.Ta_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
if(oldMode_ == fixedHeatFlux)
{
this->refGrad() = q_/K(*this);
this->refValue() = 0.0;
this->valueFraction() = 0.0;
}
else if(oldMode_ == fixedHeatTransferCoeff)
{
this->refGrad() = (Ta_ - *this)*h_/K(*this);
this->refValue() = 0.0;
this->valueFraction() = 0.0;
}
else
{
FatalErrorIn
(
"externalWallHeatFluxTemperatureFvPatchScalarField"
"::updateCoeffs()"
) << "Illegal mode " << operationModeNames[oldMode_]
<< exit(FatalError);
}
mixedFvPatchScalarField::updateCoeffs();
if (debug)
{
scalar Q = gSum(K(*this)*patch().magSf()*snGrad());
Info<< patch().boundaryMesh().mesh().name() << ':'
<< patch().name() << ':'
<< this->dimensionedInternalField().name() << " :"
<< " heatFlux:" << Q
<< " walltemperature "
<< " min:" << gMin(*this)
<< " max:" << gMax(*this)
<< " avg:" << gAverage(*this)
<< endl;
}
}
void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write
(
Ostream& os
) const
{
mixedFvPatchScalarField::write(os);
temperatureCoupledBase::write(os);
q_.writeEntry("q", os);
h_.writeEntry("h", os);
Ta_.writeEntry("Ta", os);
this->writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
externalWallHeatFluxTemperatureFvPatchScalarField
);
}
// ************************************************************************* //

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) 2011-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,31 +22,42 @@ 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
solidWallHeatFluxTemperatureFvPatchScalarField externalWallHeatFluxTemperatureFvPatchScalarField
Description Description
Heat flux boundary condition for temperature on solid region Heat flux boundary condition for temperature on external wall.
If h and Ta are specified then fixed_heat_transfer_coefficient mode is used
If q is specified then fixed_heat_flux is used.
Example usage: Example usage:
myWallPatch myWallPatch
{ {
type solidWallHeatFluxTemperature; type externalWallHeatFluxTemperature;
K K; // Name of K field K solidThermo; // solidThermo or lookup
q uniform 1000; // Heat flux / [W/m2] q uniform 1000; // Heat flux / [W/m2]
Ta uniform 300.0; // Tambient temperature /[K]
h uniform 10.0; // Heat transfer coeff /[W/Km2]
value uniform 300.0; // Initial temperature / [K] value uniform 300.0; // Initial temperature / [K]
gradient uniform 0.0; // Initial gradient / [K/m] KName none;
} }
Note:
Only the pair h, Ta or q can be specified in the dictionary.
SourceFiles SourceFiles
solidWallHeatFluxTemperatureFvPatchScalarField.C externalWallHeatFluxTemperatureFvPatchScalarField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H #ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H
#define solidWallHeatFluxTemperatureFvPatchScalarField_H #define solidWallHeatFluxTemperatureFvPatchScalarField_H
#include "fixedGradientFvPatchFields.H" //#include "fixedGradientFvPatchFields.H"
#include "mixedFvPatchFields.H"
#include "temperatureCoupledBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,39 +65,62 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class solidWallHeatFluxTemperatureFvPatchScalarField Declaration Class externalWallHeatFluxTemperatureFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class solidWallHeatFluxTemperatureFvPatchScalarField class externalWallHeatFluxTemperatureFvPatchScalarField
: :
public fixedGradientFvPatchScalarField public mixedFvPatchScalarField,
public temperatureCoupledBase
{ {
public:
// Public data
//- Operation mode enumeration
enum operationMode
{
fixedHeatFlux,
fixedHeatTransferCoeff,
unknown
};
static const NamedEnum<operationMode, 3> operationModeNames;
private:
// Private data // Private data
//- Operation mode
operationMode oldMode_;
//- Heat flux / [W/m2] //- Heat flux / [W/m2]
scalarField q_; scalarField q_;
//- Name of thermal conductivity field //- Heat transfer coefficient / [W/m2K]
word KName_; scalarField h_;
//- Ambient temperature / [K]
scalarField Ta_;
public: public:
//- Runtime type information //- Runtime type information
TypeName("solidWallHeatFluxTemperature"); TypeName("externalWallHeatFluxTemperature");
// Constructors // Constructors
//- Construct from patch and internal field //- Construct from patch and internal field
solidWallHeatFluxTemperatureFvPatchScalarField externalWallHeatFluxTemperatureFvPatchScalarField
( (
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>& const DimensionedField<scalar, volMesh>&
); );
//- Construct from patch, internal field and dictionary //- Construct from patch, internal field and dictionary
solidWallHeatFluxTemperatureFvPatchScalarField externalWallHeatFluxTemperatureFvPatchScalarField
( (
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
@ -94,20 +128,20 @@ public:
); );
//- Construct by mapping given //- Construct by mapping given
// solidWallHeatFluxTemperatureFvPatchScalarField // externalWallHeatFluxTemperatureFvPatchScalarField
// onto a new patch // onto a new patch
solidWallHeatFluxTemperatureFvPatchScalarField externalWallHeatFluxTemperatureFvPatchScalarField
( (
const solidWallHeatFluxTemperatureFvPatchScalarField&, const externalWallHeatFluxTemperatureFvPatchScalarField&,
const fvPatch&, const fvPatch&,
const DimensionedField<scalar, volMesh>&, const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper& const fvPatchFieldMapper&
); );
//- Construct as copy //- Construct as copy
solidWallHeatFluxTemperatureFvPatchScalarField externalWallHeatFluxTemperatureFvPatchScalarField
( (
const solidWallHeatFluxTemperatureFvPatchScalarField& const externalWallHeatFluxTemperatureFvPatchScalarField&
); );
//- Construct and return a clone //- Construct and return a clone
@ -115,14 +149,14 @@ public:
{ {
return tmp<fvPatchScalarField> return tmp<fvPatchScalarField>
( (
new solidWallHeatFluxTemperatureFvPatchScalarField(*this) new externalWallHeatFluxTemperatureFvPatchScalarField(*this)
); );
} }
//- Construct as copy setting internal field reference //- Construct as copy setting internal field reference
solidWallHeatFluxTemperatureFvPatchScalarField externalWallHeatFluxTemperatureFvPatchScalarField
( (
const solidWallHeatFluxTemperatureFvPatchScalarField&, const externalWallHeatFluxTemperatureFvPatchScalarField&,
const DimensionedField<scalar, volMesh>& const DimensionedField<scalar, volMesh>&
); );
@ -134,40 +168,18 @@ public:
{ {
return tmp<fvPatchScalarField> return tmp<fvPatchScalarField>
( (
new solidWallHeatFluxTemperatureFvPatchScalarField(*this, iF) new externalWallHeatFluxTemperatureFvPatchScalarField(*this, iF)
); );
} }
// Member functions // Member functions
// Helper
//- Get K field on this patch
tmp<scalarField> K() const;
// Evaluation functions // Evaluation functions
//- Update the coefficients associated with the patch field //- Update the coefficients associated with the patch field
virtual void updateCoeffs(); virtual void updateCoeffs();
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap
(
const fvPatchFieldMapper&
);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchScalarField&,
const labelList&
);
// I-O // I-O
//- Write //- Write

View File

@ -0,0 +1,235 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 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 "turbulentTemperatureRadCoupledMixedFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "directMappedPatchBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
turbulentTemperatureRadCoupledMixedFvPatchScalarField::
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), "undefined", "undefined-K"),
TnbrName_("undefined-Tnbr"),
QrNbrName_("undefined-QrNbr"),
QrName_("undefined-Qr")
{
this->refValue() = 0.0;
this->refGrad() = 0.0;
this->valueFraction() = 1.0;
}
turbulentTemperatureRadCoupledMixedFvPatchScalarField::
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const turbulentTemperatureRadCoupledMixedFvPatchScalarField& psf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
mixedFvPatchScalarField(psf, p, iF, mapper),
temperatureCoupledBase(patch(), psf.KMethod(), psf.KName()),
TnbrName_(psf.TnbrName_),
QrNbrName_(psf.QrNbrName_),
QrName_(psf.QrName_)
{}
turbulentTemperatureRadCoupledMixedFvPatchScalarField::
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
mixedFvPatchScalarField(p, iF),
temperatureCoupledBase(patch(), dict),
TnbrName_(dict.lookup("Tnbr")),
QrNbrName_(dict.lookup("QrNbr")),
QrName_(dict.lookup("Qr"))
{
if (!isA<directMappedPatchBase>(this->patch().patch()))
{
FatalErrorIn
(
"turbulentTemperatureRadCoupledMixedFvPatchScalarField::"
"turbulentTemperatureRadCoupledMixedFvPatchScalarField\n"
"(\n"
" const fvPatch& p,\n"
" const DimensionedField<scalar, volMesh>& iF,\n"
" const dictionary& dict\n"
")\n"
) << "\n patch type '" << p.type()
<< "' not type '" << directMappedPatchBase::typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << dimensionedInternalField().name()
<< " in file " << dimensionedInternalField().objectPath()
<< exit(FatalError);
}
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
if (dict.found("refValue"))
{
// Full restart
refValue() = scalarField("refValue", dict, p.size());
refGrad() = scalarField("refGradient", dict, p.size());
valueFraction() = scalarField("valueFraction", dict, p.size());
}
else
{
// Start from user entered data. Assume fixedValue.
refValue() = *this;
refGrad() = 0.0;
valueFraction() = 1.0;
}
}
turbulentTemperatureRadCoupledMixedFvPatchScalarField::
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const turbulentTemperatureRadCoupledMixedFvPatchScalarField& psf,
const DimensionedField<scalar, volMesh>& iF
)
:
mixedFvPatchScalarField(psf, iF),
temperatureCoupledBase(patch(), psf.KMethod(), psf.KName()),
TnbrName_(psf.TnbrName_),
QrNbrName_(psf.QrNbrName_),
QrName_(psf.QrName_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
// Get the coupling information from the directMappedPatchBase
const directMappedPatchBase& mpp =
refCast<const directMappedPatchBase>(patch().patch());
const polyMesh& nbrMesh = mpp.sampleMesh();
const label samplePatchI = mpp.samplePolyPatch().index();
const fvPatch& nbrPatch =
refCast<const fvMesh>(nbrMesh).boundary()[samplePatchI];
scalarField Tc(patchInternalField());
scalarField& Tp = *this;
const turbulentTemperatureRadCoupledMixedFvPatchScalarField&
nbrField = refCast
<const turbulentTemperatureRadCoupledMixedFvPatchScalarField>
(
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
);
// Swap to obtain full local values of neighbour internal field
scalarField TcNbr(nbrField.patchInternalField());
mpp.map().distribute(TcNbr);
// Swap to obtain full local values of neighbour K*delta
scalarField KDeltaNbr(nbrField.K(TcNbr)*nbrPatch.deltaCoeffs());
mpp.map().distribute(KDeltaNbr);
scalarField KDelta(K(*this)*patch().deltaCoeffs());
scalarField Qr(Tp.size(), 0.0);
if (QrName_ != "none")
{
Qr = patch().lookupPatchField<volScalarField, scalar>(QrName_);
}
scalarField QrNbr(Tp.size(), 0.0);
if (QrNbrName_ != "none")
{
QrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(QrNbrName_);
mpp.map().distribute(QrNbr);
}
scalarField alpha(KDeltaNbr - (Qr + QrNbr)/Tp);
valueFraction() = alpha/(alpha + KDelta);
refValue() = (KDeltaNbr*TcNbr)/alpha;
mixedFvPatchScalarField::updateCoeffs();
}
void turbulentTemperatureRadCoupledMixedFvPatchScalarField::write
(
Ostream& os
) const
{
mixedFvPatchScalarField::write(os);
os.writeKeyword("Tnbr")<< TnbrName_ << token::END_STATEMENT << nl;
os.writeKeyword("QrNbr")<< QrNbrName_ << token::END_STATEMENT << nl;
os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl;
temperatureCoupledBase::write(os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
turbulentTemperatureRadCoupledMixedFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,186 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::
compressible::
turbulentTemperatureRadCoupledMixedFvPatchScalarField
Description
Mixed boundary condition for temperature and radiation heat transfer
to be used for in multiregion cases
Example usage:
myInterfacePatchName
{
type compressible::turbulentTemperatureRadCoupledMixed;
TNbr T; // name of T field on neighbour region
K lookup;
KName K;
QrNbr Qr; // or none. Name of Qr field on neighbour region
Qr Qr; // or none. Name of Qr field on local region
value uniform 300;
}
Needs to be on underlying directMapped(Wall)FvPatch.
Note: K : heat conduction at patch. Gets supplied how to lookup/calculate
K:
- 'lookup' : lookup volScalarField (or volSymmTensorField) with name
- 'basicThermo' : use basicThermo and compressible::RASmodel to calculate K
- 'solidThermo' : use basicSolidThermo K()
- 'directionalSolidThermo' directionalK()
Note: runs in parallel with arbitrary decomposition. Uses directMapped
functionality to calculate exchange.
SourceFiles
turbulentTemperatureRadCoupledMixedFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef turbulentTemperatureRadCoupledMixedFvPatchScalarField_H
#define turbulentTemperatureRadCoupledMixedFvPatchScalarField_H
#include "mixedFvPatchFields.H"
#include "temperatureCoupledBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
/*---------------------------------------------------------------------------*\
Class turbulentTemperatureRadCoupledMixedFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class turbulentTemperatureRadCoupledMixedFvPatchScalarField
:
public mixedFvPatchScalarField,
public temperatureCoupledBase
{
// Private data
//- Name of field on the neighbour region
const word TnbrName_;
//- Name of the radiative heat flux in the neighbout region
const word QrNbrName_;
//- Name of the radiative heat flux in local region
const word QrName_;
public:
//- Runtime type information
TypeName("compressible::turbulentTemperatureRadCoupledMixed");
// Constructors
//- Construct from patch and internal field
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a
// new patch
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const
turbulentTemperatureRadCoupledMixedFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
*this
)
);
}
//- Construct as copy setting internal field reference
turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
const turbulentTemperatureRadCoupledMixedFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new turbulentTemperatureRadCoupledMixedFvPatchScalarField
(
*this,
iF
)
);
}
// Member functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,213 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 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/>.
\*---------------------------------------------------------------------------*/
#include "solidWallHeatFluxTemperatureFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
solidWallHeatFluxTemperatureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(p, iF),
q_(p.size(), 0.0),
KName_("undefined-K")
{}
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
solidWallHeatFluxTemperatureFvPatchScalarField
(
const solidWallHeatFluxTemperatureFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
q_(ptf.q_, mapper),
KName_(ptf.KName_)
{}
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
solidWallHeatFluxTemperatureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
fixedGradientFvPatchScalarField(p, iF, dict),
q_("q", dict, p.size()),
KName_(dict.lookup("K"))
{}
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
solidWallHeatFluxTemperatureFvPatchScalarField
(
const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf
)
:
fixedGradientFvPatchScalarField(tppsf),
q_(tppsf.q_),
KName_(tppsf.KName_)
{}
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::
solidWallHeatFluxTemperatureFvPatchScalarField
(
const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(tppsf, iF),
q_(tppsf.q_),
KName_(tppsf.KName_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
{
fixedGradientFvPatchScalarField::autoMap(m);
q_.autoMap(m);
}
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
fixedGradientFvPatchScalarField::rmap(ptf, addr);
const solidWallHeatFluxTemperatureFvPatchScalarField& hfptf =
refCast<const solidWallHeatFluxTemperatureFvPatchScalarField>(ptf);
q_.rmap(hfptf.q_, addr);
}
Foam::tmp<Foam::scalarField>
Foam::solidWallHeatFluxTemperatureFvPatchScalarField::K() const
{
const fvMesh& mesh = patch().boundaryMesh().mesh();
if (mesh.objectRegistry::foundObject<volScalarField>(KName_))
{
return patch().lookupPatchField<volScalarField, scalar>(KName_);
}
else if (mesh.objectRegistry::foundObject<volSymmTensorField>(KName_))
{
const symmTensorField& KWall =
patch().lookupPatchField<volSymmTensorField, scalar>(KName_);
vectorField n(patch().nf());
return n & KWall & n;
}
else
{
FatalErrorIn
(
"solidWallHeatFluxTemperatureFvPatchScalarField::K()"
" const"
) << "Did not find field " << KName_
<< " on mesh " << mesh.name() << " patch " << patch().name()
<< endl
<< "Please set 'K' to a valid volScalarField"
<< " or a valid volSymmTensorField." << exit(FatalError);
return scalarField(0);
}
}
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
gradient() = q_/K();
fixedGradientFvPatchScalarField::updateCoeffs();
if (debug)
{
scalar Q = gSum(K()*patch().magSf()*snGrad());
Info<< patch().boundaryMesh().mesh().name() << ':'
<< patch().name() << ':'
<< this->dimensionedInternalField().name() << " :"
<< " heatFlux:" << Q
<< " walltemperature "
<< " min:" << gMin(*this)
<< " max:" << gMax(*this)
<< " avg:" << gAverage(*this)
<< endl;
}
}
void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::write
(
Ostream& os
) const
{
fixedGradientFvPatchScalarField::write(os);
q_.writeEntry("q", os);
os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl;
this->writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
solidWallHeatFluxTemperatureFvPatchScalarField
);
}
// ************************************************************************* //

View File

@ -9,6 +9,7 @@
PtrList<volScalarField> p_rghFluid(fluidRegions.size()); PtrList<volScalarField> p_rghFluid(fluidRegions.size());
PtrList<volScalarField> ghFluid(fluidRegions.size()); PtrList<volScalarField> ghFluid(fluidRegions.size());
PtrList<surfaceScalarField> ghfFluid(fluidRegions.size()); PtrList<surfaceScalarField> ghfFluid(fluidRegions.size());
PtrList<radiation::radiationModel> radiation(fluidRegions.size());
PtrList<volScalarField> DpDtFluid(fluidRegions.size()); PtrList<volScalarField> DpDtFluid(fluidRegions.size());
List<scalar> initialMassFluid(fluidRegions.size()); List<scalar> initialMassFluid(fluidRegions.size());
@ -166,6 +167,12 @@
// Force p_rgh to be consistent with p // Force p_rgh to be consistent with p
p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i]; p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i];
radiation.set
(
i,
radiation::radiationModel::New(thermoFluid[i].T())
);
initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value(); initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();
Info<< " Adding to DpDtFluid\n" << endl; Info<< " Adding to DpDtFluid\n" << endl;

View File

@ -6,6 +6,7 @@
- fvm::laplacian(turb.alphaEff(), h) - fvm::laplacian(turb.alphaEff(), h)
== ==
DpDt DpDt
+ rad.Sh(thermo)
); );
hEqn.relax(); hEqn.relax();
@ -13,6 +14,8 @@
thermo.correct(); thermo.correct();
rad.correct();
Info<< "Min/max T:" << min(thermo.T()).value() << ' ' Info<< "Min/max T:" << min(thermo.T()).value() << ' '
<< max(thermo.T()).value() << endl; << max(thermo.T()).value() << endl;
} }

View File

@ -17,6 +17,8 @@
const volScalarField& gh = ghFluid[i]; const volScalarField& gh = ghFluid[i];
const surfaceScalarField& ghf = ghfFluid[i]; const surfaceScalarField& ghf = ghfFluid[i];
radiation::radiationModel& rad = radiation[i];
const dimensionedScalar initialMass const dimensionedScalar initialMass
( (
"initialMass", "initialMass",

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,7 +30,7 @@ Description
causing pressure loss as estimated using an adjoint formulation. causing pressure loss as estimated using an adjoint formulation.
References: References:
@verbatim \verbatim
"Implementation of a continuous adjoint for topology optimization of "Implementation of a continuous adjoint for topology optimization of
ducted flows" ducted flows"
C. Othmer, C. Othmer,
@ -38,7 +38,7 @@ Description
H.G. Weller H.G. Weller
AIAA-2007-3947 AIAA-2007-3947
http://pdf.aiaa.org/preview/CDReadyMCFD07_1379/PV2007_3947.pdf http://pdf.aiaa.org/preview/CDReadyMCFD07_1379/PV2007_3947.pdf
@endverbatim \endverbatim
Note that this solver optimises for total pressure loss whereas the Note that this solver optimises for total pressure loss whereas the
above paper describes the method for optimising power-loss. above paper describes the method for optimising power-loss.

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) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,17 +22,13 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application Application
porousExplicitSourceReactingParcelFoam LTSReactingParcelFoam
Description Description
Transient PISO solver for compressible, laminar or turbulent flow with Local time stepping (LTS) solver for steady, compressible, laminar or
reacting multiphase Lagrangian parcels for porous media, including explicit turbulent reacting and non-reacting flow with multiphase Lagrangian
sources for mass, momentum and energy parcels and porous media, including explicit sources for mass, momentum
and energy
The solver includes:
- reacting multiphase parcel cloud
- porous media
- mass, momentum and energy sources
Note: ddtPhiCorr not used here when porous zones are active Note: ddtPhiCorr not used here when porous zones are active
- not well defined for porous calculations - not well defined for porous calculations
@ -75,7 +71,7 @@ int main(int argc, char *argv[])
while (runTime.run()) while (runTime.run())
{ {
#include "readSIMPLEControls.H" #include "readPISOControls.H"
#include "readChemistryProperties.H" #include "readChemistryProperties.H"
#include "readAdditionalSolutionControls.H" #include "readAdditionalSolutionControls.H"
#include "readTimeControls.H" #include "readTimeControls.H"
@ -84,14 +80,9 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
p.storePrevIter();
// --- Pressure-velocity corrector
{
parcels.evolve(); parcels.evolve();
#include "chemistry.H" #include "chemistry.H"
#include "timeScales.H" #include "timeScales.H"
#include "rhoEqn.H" #include "rhoEqn.H"
@ -99,10 +90,13 @@ int main(int argc, char *argv[])
#include "YEqn.H" #include "YEqn.H"
#include "hsEqn.H" #include "hsEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
#include "pEqn.H" #include "pEqn.H"
}
turbulence->correct(); turbulence->correct();
}
if (runTime.write()) if (runTime.write())
{ {

View File

@ -0,0 +1,3 @@
LTSReactingParcelFoam.C
EXE = $(FOAM_APPBIN)/LTSReactingParcelFoam

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/liquids/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/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)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude
@ -31,15 +31,15 @@ EXE_LIBS = \
-llagrangianIntermediate \ -llagrangianIntermediate \
-lspecie \ -lspecie \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lliquids \ -lliquidProperties \
-lliquidMixture \ -lliquidMixtureProperties \
-lpointSolids \ -lsolidProperties \
-lpointSolidMixture \ -lsolidMixtureProperties \
-lthermophysicalFunctions \ -lthermophysicalFunctions \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lSLGThermo \ -lSLGThermo \
-lchemistryModel \ -lchemistryModel \
-lradiation \ -lradiationModels \
-lODE \ -lODE \
-lregionModels \ -lregionModels \
-lsurfaceFilmModels -lsurfaceFilmModels

View File

@ -73,12 +73,12 @@
dimensionedScalar rhoMax dimensionedScalar rhoMax
( (
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMax") mesh.solutionDict().subDict("PISO").lookup("rhoMax")
); );
dimensionedScalar rhoMin dimensionedScalar rhoMin
( (
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMin") mesh.solutionDict().subDict("PISO").lookup("rhoMin")
); );
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;

View File

@ -23,16 +23,21 @@
); );
} }
fvScalarMatrix pDDtEqn
(
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
+ fvc::div(phi)
==
parcels.Srho()
+ massSource.SuTot()
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvc::ddt(rho) + psi*correction(fvm::ddt(p)) pDDtEqn
+ fvc::div(phi)
- fvm::laplacian(rho*rAU, p) - fvm::laplacian(rho*rAU, p)
==
parcels.Srho()
+ massSource.SuTot()
); );
pEqn.solve(); pEqn.solve();
@ -43,9 +48,6 @@
} }
} }
// Explicitly relax pressure for momentum corrector
p.relax();
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl; Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
// Second part of thermodynamic density update // Second part of thermodynamic density update

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

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

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

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/liquids/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/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)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude -I$(LIB_SRC)/ODE/lnInclude
@ -32,15 +32,15 @@ EXE_LIBS = \
-lcoalCombustion\ -lcoalCombustion\
-lspecie \ -lspecie \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lliquids \ -lliquidProperties \
-lliquidMixture \ -lliquidMixtureProperties \
-lpointSolids \ -lsolidProperties \
-lpointSolidMixture \ -lsolidMixtureProperties \
-lthermophysicalFunctions \ -lthermophysicalFunctions \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lSLGThermo \ -lSLGThermo \
-lchemistryModel \ -lchemistryModel \
-lradiation \ -lradiationModels \
-lregionModels \ -lregionModels \
-lsurfaceFilmModels \ -lsurfaceFilmModels \
-lODE -lODE

View File

@ -0,0 +1,3 @@
icoUncoupledKinematicParcelDyMFoam.C
EXE = $(FOAM_APPBIN)/icoUncoupledKinematicParcelDyMFoam

View File

@ -1,10 +1,11 @@
EXE_INC = \ EXE_INC = \
-I../icoUncoupledKinematicParcelFoam \
-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/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 \
@ -22,7 +23,7 @@ EXE_LIBS = \
-lthermophysicalFunctions \ -lthermophysicalFunctions \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lspecie \ -lspecie \
-lradiation \ -lradiationModels \
-lincompressibleRASModels \ -lincompressibleRASModels \
-lincompressibleLESModels \ -lincompressibleLESModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \

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
@ -36,7 +36,7 @@ Description
#include "dynamicFvMesh.H" #include "dynamicFvMesh.H"
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "turbulenceModel.H" #include "turbulenceModel.H"
#include "basicKinematicCloud.H" #include "basicKinematicCollidingCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,3 @@
icoUncoupledKinematicParcelFoam.C
EXE = $(FOAM_APPBIN)/icoUncoupledKinematicParcelFoam

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