Commit 864e56d1 authored by graham's avatar graham
Browse files

Merge branch 'master' into dsmc

parents eefaf720 6d324c0f
......@@ -7,6 +7,7 @@
*.orig
*.bak
\#*\#
.directory
# CVS recovered versions - anywhere
.#*
......@@ -47,7 +48,9 @@ doc/[Dd]oxygen/man
# source packages - anywhere
*.tar.bz2
*.tar.gz
*.tar
*.tgz
*.gtgz
# ignore the persistent .build tag in the main directory
/.build
......
Info << "\nConstructing gas properties" << endl;
/*
PtrList<specieConstProperties> gasProperties(Y.size());
forAll(gasProperties, i)
{
gasProperties.set
(
i,
new specieConstProperties
(
dynamic_cast<const multiComponentMixture<constTransport<
specieThermo<hConstThermo<perfectGas> > > >&>
(thermo()).speciesData()[i]
)
);
}
*/
PtrList<specieReactingProperties> gasProperties(Y.size());
forAll(gasProperties, i)
{
gasProperties.set
(
i,
new specieReactingProperties
(
dynamic_cast<const reactingMixture&>(thermo()).speciesData()[i]
)
);
}
Info<< "\nConstructing reacting cloud" << endl;
basicReactingCloud parcels
(
"reactingCloud1",
rho,
U,
g,
thermo(),
gasProperties
);
coalChemistryFoam.C
EXE = $(FOAM_USER_APPBIN)/coalChemistryFoam
EXE = $(FOAM_APPBIN)/coalChemistryFoam
......@@ -19,7 +19,6 @@ EXE_INC = \
-I$(LIB_SRC)/ODE/lnInclude
EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lfiniteVolume \
-lmeshTools \
-lcompressibleRASModels \
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -35,11 +35,11 @@ Description
#include "hCombustionThermo.H"
#include "turbulenceModel.H"
#include "basicThermoCloud.H"
#include "coalCloud.H"
#include "CoalCloud.H"
#include "chemistryModel.H"
#include "chemistrySolver.H"
#include "ReactingCloudThermoTypes.H"
#include "timeActivatedExplicitSource.H"
#include "reactingThermoTypes.H"
#include "timeActivatedExplicitCellSource.H"
#include "radiationModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -113,8 +113,6 @@ int main(int argc, char *argv[])
turbulence->correct();
enthalpySource.update();
rho = thermo->rho();
if (runTime.write())
......
Info<< "\nConstructing interpolation" << endl;
Info << "\nConstructing gas properties" << endl;
/*
PtrList<specieConstProperties> gasProperties(Y.size());
forAll(gasProperties, i)
{
gasProperties.set
(
i,
new specieConstProperties
(
dynamic_cast<const multiComponentMixture<constTransport<
specieThermo<hConstThermo<perfectGas> > > >&>
(thermo()).speciesData()[i]
)
);
}
*/
PtrList<specieReactingProperties> gasProperties(Y.size());
forAll(gasProperties, i)
{
gasProperties.set
(
i,
new specieReactingProperties
(
dynamic_cast<const reactingMixture&>(thermo()).speciesData()[i]
)
);
}
Info<< "\nConstructing coal cloud" << endl;
coalCloud coalParcels
CoalCloud<specieReactingProperties> coalParcels
(
"coalCloud1",
rho,
U,
g,
thermo(),
gasProperties
thermo()
);
Info<< "\nConstructing limestone cloud" << endl;
......
......@@ -105,8 +105,8 @@
volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
Info<< "\nConstructing explicit enthalpy source" << endl;
timeActivatedExplicitSource enthalpySource
Info<< "\nConstructing explicit enthalpy cell source" << endl;
timeActivatedExplicitCellSource enthalpySource
(
"enthalpySource",
mesh,
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2007 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......
......@@ -37,7 +37,6 @@ volVectorField U
volScalarField& p = thermo->p();
const volScalarField& psi = thermo->psi();
const volScalarField& T = thermo->T();
volScalarField& h = thermo->h();
......@@ -99,5 +98,5 @@ volScalarField dQ
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1,-3,-1,0,0,0,0), 0.0)
dimensionedScalar("zero", dimensionSet(1, -3, -1, 0, 0, 0, 0), 0.0)
);
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......
......@@ -15,12 +15,10 @@
(
UEqn
==
-fvc::reconstruct
fvc::reconstruct
(
(
fvc::snGrad(pd)
+ ghf*fvc::snGrad(rho)
) * mesh.magSf()
fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf()
)
);
}
......@@ -59,27 +59,6 @@
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
);
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef"));
Info<< "Creating field pd\n" << endl;
volScalarField pd
(
IOobject
(
"pd",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
p = pd + rho*gh + pRef;
thermo->correct();
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
{
bool closedVolume = pd.needReference();
bool closedVolume = p.needReference();
rho = thermo->rho();
......@@ -17,38 +17,35 @@
)
);
phi = phiU - ghf*fvc::snGrad(rho)*rhorUAf*mesh.magSf();
phi = phiU + rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pdEqn
fvScalarMatrix pEqn
(
fvm::ddt(psi, pd)
+ fvc::ddt(psi)*pRef
+ fvc::ddt(psi, rho)*gh
fvm::ddt(psi, p)
+ fvc::div(phi)
- fvm::laplacian(rhorUAf, pd)
- fvm::laplacian(rhorUAf, p)
);
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
{
pdEqn.solve(mesh.solver(pd.name() + "Final"));
pEqn.solve(mesh.solver(p.name() + "Final"));
}
else
{
pdEqn.solve(mesh.solver(pd.name()));
pEqn.solve(mesh.solver(p.name()));
}
if (nonOrth == nNonOrthCorr)
{
phi += pdEqn.flux();
phi += pEqn.flux();
}
}
U += rUA*fvc::reconstruct((phi - phiU)/rhorUAf);
U.correctBoundaryConditions();
p == pd + rho*gh + pRef;
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
#include "rhoEqn.H"
......@@ -62,6 +59,4 @@
/fvc::domainIntegrate(thermo->psi());
rho = thermo->rho();
}
pd == p - (rho*gh + pRef);
}
......@@ -13,14 +13,11 @@
(
UEqn()
==
-fvc::reconstruct
fvc::reconstruct
(
(
fvc::snGrad(pd)
+ ghf*fvc::snGrad(rho)
) * mesh.magSf()
fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf()
)
).initialResidual();
maxResidual = max(eqnResidual, maxResidual);
......@@ -39,15 +39,14 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readEnvironmentalProperties.H"
#include "createFields.H"
#include "initContinuityErrs.H"
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "readEnvironmentalProperties.H"
# include "createFields.H"
# include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
......@@ -55,17 +54,17 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
# include "readSIMPLEControls.H"
# include "initConvergenceCheck.H"
#include "readSIMPLEControls.H"
#include "initConvergenceCheck.H"
pd.storePrevIter();
p.storePrevIter();
rho.storePrevIter();
// Pressure-velocity SIMPLE corrector
{
# include "UEqn.H"
# include "hEqn.H"
# include "pEqn.H"
#include "UEqn.H"
#include "hEqn.H"
#include "pEqn.H"
}
turbulence->correct();
......@@ -76,7 +75,7 @@ int main(int argc, char *argv[])
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
# include "convergenceCheck.H"
#include "convergenceCheck.H"
}
Info<< "End\n" << endl;
......
......@@ -51,38 +51,16 @@
)
);
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef"));
Info<< "Creating field pd\n" << endl;
volScalarField pd
(
IOobject
(
"pd",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
p = pd + rho*gh + pRef;
thermo->correct();
label pdRefCell = 0;
scalar pdRefValue = 0.0;
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell
(
pd,
p,
mesh.solutionDict().subDict("SIMPLE"),
pdRefCell,
pdRefValue
pRefCell,
pRefValue
);
......
{
rho = thermo->rho();
volScalarField rUA = 1.0/UEqn().A();
surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
......@@ -7,60 +9,57 @@
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
bool closedVolume = adjustPhi(phi, U, p);
surfaceScalarField buoyancyPhi = ghf*fvc::snGrad(rho)*rhorUAf*mesh.magSf();
phi -= buoyancyPhi;
surfaceScalarField buoyancyPhi =
rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
phi += buoyancyPhi;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pdEqn
fvScalarMatrix pEqn
(
fvm::laplacian(rhorUAf, pd) == fvc::div(phi)
fvm::laplacian(rhorUAf, p) == fvc::div(phi)
);
pdEqn.setReference(pdRefCell, pdRefValue);
pEqn.setReference(pRefCell, p[pRefCell]);
// retain the residual from the first iteration
if (nonOrth == 0)
{
eqnResidual = pdEqn.solve().initialResidual();
eqnResidual = pEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
}
else
{
pdEqn.solve();
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(thermo->psi()*p))
/fvc::domainIntegrate(thermo->psi());
}
// Calculate the conservative fluxes
phi -= pdEqn.flux();
phi -= pEqn.flux();
// Explicitly relax pressure for momentum corrector
pd.relax();
p.relax();
// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U -= rUA*fvc::reconstruct((buoyancyPhi + pdEqn.flux())/rhorUAf);
U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rhorUAf);
U.correctBoundaryConditions();
}
}
#include "continuityErrs.H"
p == pd + rho*gh + pRef;
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
if (closedVolume)
{
p += (initialMass - fvc::domainIntegrate(thermo->psi()*p))
/fvc::domainIntegrate(thermo->psi());
}
rho = thermo->rho();
rho.relax();
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value()
<< endl;
pd == p - (rho*gh + pRef);
}
regionProperties/regionProperties.C
coupleManager/coupleManager.C
derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
derivedFvPatchFields/solidWallHeatFluxTemperatureCoupled/solidWallHeatFluxTemperatureCoupledFvPatchScalarField.C
derivedFvPatchFields/solidWallTemperatureCoupled/solidWallTemperatureCoupledFvPatchScalarField.C
derivedFvPatchFields/solidWallMixedTemperatureCoupled/solidWallMixedTemperatureCoupledFvPatchScalarField.C
fluid/compressibleCourantNo.C
......
......@@ -2,9 +2,7 @@ EXE_INC = \
-Ifluid \
-Isolid \
-IregionProperties \
-IcoupleManager \
-IderivedFvPatchFields/solidWallTemperatureCoupled \
-IderivedFvPatchFields/solidWallHeatFluxTemperatureCoupled \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment