Commit e49ce4a6 authored by graham's avatar graham
Browse files

Merge branch 'master' into cvm

parents 71271df6 f7c3a8e4
......@@ -27,6 +27,7 @@ PDRModels/XiGModels/basicXiSubG/basicXiSubG.C
laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C
/* PDRFoamAutoRefine.C */
PDRFoam.C
EXE = $(FOAM_APPBIN)/PDRFoam
......@@ -25,8 +25,8 @@ Application
PDRFoam
Description
Compressible premixed/partially-premixed combustion solver with turbulence
modelling.
Solver for compressible premixed/partially-premixed combustion with
turbulence modelling.
Combusting RANS code using the b-Xi two-equation model.
Xi may be obtained by either the solution of the Xi transport
......@@ -35,7 +35,7 @@ Description
to be appropriate by comparison with the results from the
spectral model.
Strain effects are encorporated directly into the Xi equation
Strain effects are incorporated directly into the Xi equation
but not in the algebraic approximation. Further work need to be
done on this issue, particularly regarding the enhanced removal rate
caused by flame compression. Analysis using results of the spectral
......@@ -78,9 +78,9 @@ int main(int argc, char *argv[])
#include "readCombustionProperties.H"
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
scalar StCoNum = 0.0;
......@@ -94,7 +94,6 @@ int main(int argc, char *argv[])
#include "readTimeControls.H"
#include "readPISOControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
runTime++;
......
......@@ -5,6 +5,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude
......
......@@ -7,6 +7,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
......
......@@ -4,7 +4,7 @@
tmp<volScalarField> trho = thermo.rho();
const volScalarField& rho = trho();
tmp<volScalarField> tcp = thermo.cp();
tmp<volScalarField> tcp = thermo.Cp();
const volScalarField& cp = tcp();
tmp<volScalarField> tK = thermo.K();
......
......@@ -4,11 +4,12 @@
tmp<volScalarField> trho = thermo.rho();
const volScalarField& rho = trho();
tmp<volScalarField> tcp = thermo.cp();
tmp<volScalarField> tcp = thermo.Cp();
const volScalarField& cp = tcp();
tmp<volScalarField> tK = thermo.K();
//tmp<volSymmTensorField> tK = thermo.directionalK();
const volScalarField& K = tK();
//const volSymmTensorField& K = tK();
volScalarField& T = thermo.T();
......@@ -55,4 +55,35 @@ Foam::scalar Foam::solidRegionDiffNo
}
Foam::scalar Foam::solidRegionDiffNo
(
const fvMesh& mesh,
const Time& runTime,
const volScalarField& Cprho,
const volSymmTensorField& Kdirectional
)
{
scalar DiNum = 0.0;
scalar meanDiNum = 0.0;
volScalarField K = mag(Kdirectional);
//- Take care: can have fluid domains with 0 cells so do not test for
// zero internal faces.
surfaceScalarField KrhoCpbyDelta =
mesh.surfaceInterpolation::deltaCoeffs()
* fvc::interpolate(K)
/ fvc::interpolate(Cprho);
DiNum = gMax(KrhoCpbyDelta.internalField())*runTime.deltaT().value();
meanDiNum = (average(KrhoCpbyDelta)).value()*runTime.deltaT().value();
Info<< "Region: " << mesh.name() << " Diffusion Number mean: " << meanDiNum
<< " max: " << DiNum << endl;
return DiNum;
}
// ************************************************************************* //
......@@ -41,6 +41,15 @@ namespace Foam
const volScalarField& Cprho,
const volScalarField& K
);
scalar solidRegionDiffNo
(
const fvMesh& mesh,
const Time& runTime,
const volScalarField& Cprho,
const volSymmTensorField& K
);
}
#endif
......
......@@ -18,6 +18,8 @@ if (finalIter)
Info<< "Min/max T:" << min(T) << ' ' << max(T) << endl;
}
thermo.correct();
if (finalIter)
{
mesh.data::remove("finalIteration");
......
......@@ -10,8 +10,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
......@@ -33,8 +33,8 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lliquids \
-lliquidMixture \
-lsolids \
-lsolidMixture \
-lpointSolids \
-lpointSolidMixture \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \
......
......@@ -10,8 +10,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
......@@ -32,8 +32,8 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lliquids \
-lliquidMixture \
-lsolids \
-lsolidMixture \
-lpointSolids \
-lpointSolidMixture \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \
......
......@@ -5,8 +5,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
......@@ -26,8 +26,8 @@ EXE_LIBS = \
-lcompressibleLESModels \
-lspecie \
-lbasicThermophysicalModels \
-lsolids \
-lsolidMixture \
-lpointSolids \
-lpointSolidMixture \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \
......
......@@ -9,8 +9,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
......@@ -31,8 +31,8 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lliquids \
-lliquidMixture \
-lsolids \
-lsolidMixture \
-lpointSolids \
-lpointSolidMixture \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \
......
......@@ -10,8 +10,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolids/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/pointSolidMixture/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
......@@ -32,8 +32,8 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lliquids \
-lliquidMixture \
-lsolids \
-lsolidMixture \
-lpointSolids \
-lpointSolidMixture \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \
......
......@@ -482,7 +482,7 @@ bool doCommand
topoSet& currentSet = currentSetPtr();
Info<< " Set:" << currentSet.name()
<< " Size:" << currentSet.size()
<< " Size:" << returnReduce(currentSet.size(), sumOp<label>())
<< " Action:" << actionName
<< endl;
......@@ -579,7 +579,9 @@ bool doCommand
);
Info<< " Writing " << currentSet.name()
<< " (size " << currentSet.size() << ") to "
<< " (size "
<< returnReduce(currentSet.size(), sumOp<label>())
<< ") to "
<< currentSet.instance()/currentSet.local()
/currentSet.name()
<< " and to vtk file " << vtkName << endl << endl;
......@@ -589,7 +591,9 @@ bool doCommand
else
{
Info<< " Writing " << currentSet.name()
<< " (size " << currentSet.size() << ") to "
<< " (size "
<< returnReduce(currentSet.size(), sumOp<label>())
<< ") to "
<< currentSet.instance()/currentSet.local()
/currentSet.name() << endl << endl;
}
......@@ -642,9 +646,9 @@ enum commandStatus
void printMesh(const Time& runTime, const polyMesh& mesh)
{
Info<< "Time:" << runTime.timeName()
<< " cells:" << mesh.nCells()
<< " faces:" << mesh.nFaces()
<< " points:" << mesh.nPoints()
<< " cells:" << mesh.globalData().nTotalCells()
<< " faces:" << mesh.globalData().nTotalFaces()
<< " points:" << mesh.globalData().nTotalPoints()
<< " patches:" << mesh.boundaryMesh().size()
<< " bb:" << mesh.bounds() << nl;
}
......
......@@ -47,9 +47,9 @@ EXE_LIBS = \
-lrandomProcesses \
-lreactionThermophysicalModels \
-lsampling \
-lsolidMixture \
-lpointSolidMixture \
-lsolidParticle \
-lsolids \
-lpointSolids \
-lspecie \
-lsurfMesh \
-lsystemCall \
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-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 "polyMesh.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
inline Foam::sumData::sumData()
:
oldFace_(-1),
sum_(0.0),
count_(0)
{}
// Construct from components
inline Foam::sumData::sumData
(
const label oldFace,
const scalar sum,
const label count
)
:
oldFace_(oldFace),
sum_(sum),
count_(count)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline bool Foam::sumData::valid() const
{
return oldFace_ != -1;
}
// No geometric data so never any problem on cyclics
inline bool Foam::sumData::sameGeometry
(
const polyMesh&,
const sumData&,
const scalar
) const
{
return true;
}
// No geometric data.
inline void Foam::sumData::leaveDomain
(
const polyMesh&,
const polyPatch& patch,
const label patchFaceI,
const point& faceCentre
)
{}
// No geometric data.
inline void Foam::sumData::transform
(
const polyMesh&,
const tensor& rotTensor
)
{}
// No geometric data.
inline void Foam::sumData::enterDomain
(
const polyMesh&,
const polyPatch& patch,
const label patchFaceI,
const point& faceCentre
)
{
oldFace_ = -1;
}
// Update cell with neighbouring face information
inline bool Foam::sumData::updateCell
(
const polyMesh&,
const label thisCellI,
const label neighbourFaceI,
const sumData& neighbourInfo,
const scalar tol
)
{
if (!valid())
{
FatalErrorIn("sumData::updateCell") << "problem"
<< abort(FatalError);
return false;
}
if (count_ == 0)
{
sum_ += neighbourInfo.sum();
count_ = neighbourInfo.count() + 1;
oldFace_ = neighbourFaceI;
return true;
}
else
{
return false;
}
}
// Update face with neighbouring cell information
inline bool Foam::sumData::updateFace
(
const polyMesh& mesh,
const label thisFaceI,
const label neighbourCellI,
const sumData& neighbourInfo,
const scalar tol
)
{
// From cell to its faces.
// Check that face is opposite the previous one.
const cell& cFaces = mesh.cells()[neighbourCellI];
label wantedFaceI = cFaces.opposingFaceLabel
(
neighbourInfo.oldFace(),
mesh.faces()
);
if (thisFaceI == wantedFaceI)
{
if (count_ != 0)
{
FatalErrorIn("sumData::updateFace") << "problem"
<< abort(FatalError);
return false;
}
sum_ += neighbourInfo.sum();
count_ = neighbourInfo.count();
oldFace_ = thisFaceI;
return true;
}
else
{
return false;
}
}
// Update face with coupled face information
inline bool Foam::sumData::updateFace
(
const polyMesh&,
const label thisFaceI,
const sumData& neighbourInfo,
const scalar tol
)
{
// From face to face (e.g. coupled faces)
if (count_ == 0)
{
sum_ += neighbourInfo.sum();
count_ = neighbourInfo.count();
oldFace_ = thisFaceI;
return true;
}
else
{
return false;
}
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::sumData::operator==(const Foam::sumData& rhs)
const
{
return
oldFace() == rhs.oldFace()
&& sum() == rhs.sum()
&& count() == rhs.count();
}
inline bool Foam::sumData::operator!=(const Foam::sumData& rhs)
const
{
return !(*this == rhs);
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / O peration | Version: 1.7.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
......@@ -95,18 +95,9 @@ sets
type face;
axis x;
//- flangeHex
//start (0 20 -20);
//end (0 20 10);
//- nablaCavity
//start (-1 0.05 0.005);
//end ( 1 0.05 0.005);
//- cavity
start (0.001 0.5101 0.00501);
end (2.01 0.5101 0.00501);
nPoints 10;
start (0.0001 0.0525 0.00501);
end (0.0999 0.0525 0.00501);
}
somePoints
......
......@@ -58,17 +58,17 @@ const scalar
Foam::KRR4::KRR4(const ODE& ode)
:
ODESolver(ode),
yTemp_(n_),
dydxTemp_(n_),
g1_(n_),
g2_(n_),
g3_(n_),
g4_(n_),
yErr_(n_),
dfdx_(n_),
dfdy_(n_, n_),
a_(n_, n_),
pivotIndices_(n_)
yTemp_(n_, 0.0),
dydxTemp_(n_, 0.0),
g1_(n_, 0.0),
g2_(n_, 0.0),
g3_(n_, 0.0),