Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy
2012-05-11 14:24:38 +01:00
239 changed files with 5510 additions and 1356 deletions

View File

@ -3,6 +3,7 @@ cd ${0%/*} || exit 1 # run from this directory
set -x set -x
wmake wmake
wmake rhoPimplecFoam
wmake rhoPorousMRFPimpleFoam wmake rhoPorousMRFPimpleFoam
wmake rhoPorousMRFLTSPimpleFoam wmake rhoPorousMRFLTSPimpleFoam

View File

@ -4,13 +4,12 @@ tmp<fvVectorMatrix> UEqn
( (
fvm::ddt(rho, U) fvm::ddt(rho, U)
+ fvm::div(phi, U) + fvm::div(phi, U)
- fvm::Sp(fvc::ddt(rho) + fvc::div(phi), U)
+ turbulence->divDevRhoReff(U) + turbulence->divDevRhoReff(U)
); );
UEqn().relax(); UEqn().relax();
volScalarField rAU(1.0/UEqn().A());
if (pimple.momentumPredictor()) if (pimple.momentumPredictor())
{ {
solve(UEqn() == -fvc::grad(p)); solve(UEqn() == -fvc::grad(p));

View File

@ -3,10 +3,14 @@
( (
fvm::ddt(rho, h) fvm::ddt(rho, h)
+ fvm::div(phi, h) + fvm::div(phi, h)
- fvm::Sp(fvc::ddt(rho) + fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h) - fvm::laplacian(turbulence->alphaEff(), h)
== ==
dpdt dpdt
- (fvc::ddt(rho, K) + fvc::div(phi, K)) - (
fvc::ddt(rho, K) + fvc::div(phi, K)
- (fvc::ddt(rho) + fvc::div(phi))*K
)
); );
hEqn.relax(); hEqn.relax();

View File

@ -3,6 +3,7 @@ rho = max(rho, rhoMin);
rho = min(rho, rhoMax); rho = min(rho, rhoMax);
rho.relax(); rho.relax();
volScalarField rAU(1.0/UEqn().A());
volVectorField HbyA("HbyA", U); volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn().H(); HbyA = rAU*UEqn().H();
@ -23,13 +24,15 @@ if (pimple.transonic())
) )
); );
volScalarField Dp("Dp", rho*rAU);
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvm::ddt(psi, p) fvm::ddt(psi, p)
+ fvm::div(phid, p) + fvm::div(phid, p)
- fvm::laplacian(rho*rAU, p) - fvm::laplacian(Dp, p)
); );
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
@ -52,6 +55,8 @@ else
) )
); );
volScalarField Dp("Dp", rho*rAU);
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
{ {
// Pressure corrector // Pressure corrector
@ -59,7 +64,7 @@ else
( (
fvm::ddt(psi, p) fvm::ddt(psi, p)
+ fvc::div(phiHbyA) + fvc::div(phiHbyA)
- fvm::laplacian(rho*rAU, p) - fvm::laplacian(Dp, p)
); );
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));

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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -66,7 +66,10 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H" if (pimple.nCorrPIMPLE() <= 1)
{
#include "rhoEqn.H"
}
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop()) while (pimple.loop())

View File

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

View File

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

View File

@ -0,0 +1,117 @@
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
volScalarField rAU(1.0/UEqn().A());
volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1()));
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn().H();
if (pimple.nCorrPIMPLE() <= 1)
{
UEqn.clear();
}
if (pimple.transonic())
{
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)
*(
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
)
);
surfaceScalarField phic
(
"phic",
fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf()
);
HbyA -= (rAU - rAtU)*fvc::grad(p);
volScalarField Dp("Dp", rho*rAtU);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvm::div(phid, p)
+ fvc::div(phic)
- fvm::laplacian(Dp, p)
);
// Relax the pressure equation to maintain diagonal dominance
pEqn.relax();
pEqn.solve();
if (pimple.finalNonOrthogonalIter())
{
phi == phic + pEqn.flux();
}
}
}
else
{
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho)
*(
(fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
)
);
phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf();
HbyA -= (rAU - rAtU)*fvc::grad(p);
volScalarField Dp("Dp", rho*rAtU);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvc::div(phiHbyA)
- fvm::laplacian(Dp, p)
);
pEqn.solve();
if (pimple.finalNonOrthogonalIter())
{
phi = phiHbyA + pEqn.flux();
}
}
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
// Explicitly relax pressure for momentum corrector
p.relax();
U = HbyA - rAtU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
// Recalculate density from the relaxed pressure
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
if (!pimple.transonic())
{
rho.relax();
}
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;

View File

@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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
rhoPimplecFoam
Description
Transient solver for laminar or turbulent flow of compressible fluids
for HVAC and similar applications.
Uses the flexible PIMPLEC (PISOC-SIMPLEC) solution for time-resolved and
pseudo-transient simulations.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "basicPsiThermo.H"
#include "turbulenceModel.H"
#include "bound.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
pimpleControl pimple(mesh);
#include "createFields.H"
#include "initContinuityErrs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
#include "readTimeControls.H"
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
if (pimple.nCorrPIMPLE() <= 1)
{
#include "rhoEqn.H"
}
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
#include "UEqn.H"
#include "hEqn.H"
// --- Pressure corrector loop
while (pimple.correct())
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
}
}
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -74,7 +74,10 @@ int main(int argc, char *argv[])
#include "setrDeltaT.H" #include "setrDeltaT.H"
#include "rhoEqn.H" if (pimple.nCorrPIMPLE() <= 1)
{
#include "rhoEqn.H"
}
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop()) while (pimple.loop())

View File

@ -13,8 +13,6 @@ UEqn().relax();
mrfZones.addCoriolis(rho, UEqn()); mrfZones.addCoriolis(rho, UEqn());
pZones.addResistance(UEqn()); pZones.addResistance(UEqn());
volScalarField rAU(1.0/UEqn().A());
if (pimple.momentumPredictor()) if (pimple.momentumPredictor())
{ {
solve(UEqn() == -fvc::grad(p)); solve(UEqn() == -fvc::grad(p));

View File

@ -25,13 +25,15 @@ if (pimple.transonic())
); );
mrfZones.relativeFlux(fvc::interpolate(psi), phid); mrfZones.relativeFlux(fvc::interpolate(psi), phid);
volScalarField Dp("Dp", rho*rAU);
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvm::ddt(psi, p) fvm::ddt(psi, p)
+ fvm::div(phid, p) + fvm::div(phid, p)
- fvm::laplacian(rho*rAU, p) - fvm::laplacian(Dp, p)
); );
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
@ -56,6 +58,8 @@ else
mrfZones.relativeFlux(fvc::interpolate(rho), phiHbyA); mrfZones.relativeFlux(fvc::interpolate(rho), phiHbyA);
volScalarField Dp("Dp", rho*rAU);
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
{ {
// Pressure corrector // Pressure corrector
@ -63,7 +67,7 @@ else
( (
fvm::ddt(psi, p) fvm::ddt(psi, p)
+ fvc::div(phiHbyA) + fvc::div(phiHbyA)
- fvm::laplacian(rho*rAU, p) - fvm::laplacian(Dp, p)
); );
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));

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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -69,7 +69,10 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H" if (pimple.nCorrPIMPLE() <= 1)
{
#include "rhoEqn.H"
}
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop()) while (pimple.loop())

View File

@ -20,7 +20,7 @@
); );
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
volScalarField& h = thermo.h(); volScalarField& e = thermo.e();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;

View File

@ -0,0 +1,18 @@
{
// Kinetic + pressure energy
volScalarField Ekp("Ekp", 0.5*magSqr(U) + p/rho);
fvScalarMatrix eEqn
(
fvm::div(phi, e)
- fvm::Sp(fvc::div(phi), e)
- fvm::laplacian(turbulence->alphaEff(), e)
==
fvc::div(phi)*Ekp - fvc::div(phi, Ekp)
);
eEqn.relax();
eEqn.solve();
thermo.correct();
}

View File

@ -1,18 +0,0 @@
{
volScalarField K("K", 0.5*magSqr(U));
fvScalarMatrix hEqn
(
fvm::div(phi, h)
- fvm::Sp(fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
fvc::div(phi)*K - fvc::div(phi, K)
);
hEqn.relax();
hEqn.solve();
thermo.correct();
}

View File

@ -54,7 +54,8 @@ else
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvm::laplacian(rho*rAU, p) == fvc::div(phiHbyA) fvc::div(phiHbyA)
- fvm::laplacian(rho*rAU, p)
); );
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
@ -63,7 +64,7 @@ else
if (simple.finalNonOrthogonalIter()) if (simple.finalNonOrthogonalIter())
{ {
phi = phiHbyA - pEqn.flux(); phi = phiHbyA + pEqn.flux();
} }
} }
} }
@ -88,5 +89,10 @@ if (closedVolume)
rho = thermo.rho(); rho = thermo.rho();
rho = max(rho, rhoMin); rho = max(rho, rhoMin);
rho = min(rho, rhoMax); rho = min(rho, rhoMax);
rho.relax();
if (!simple.transonic())
{
rho.relax();
}
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;

View File

@ -0,0 +1,19 @@
{
volScalarField Ekp("Ekp", 0.5*magSqr(U) + p/rho);
fvScalarMatrix eEqn
(
fvm::div(phi, e)
- fvm::Sp(fvc::div(phi), e)
- fvm::laplacian(turbulence->alphaEff(), e)
==
fvc::div(phi)*Ekp - fvc::div(phi, Ekp)
);
//pZones.addEnergySource(thermo, rho, eEqn);
eEqn.relax();
eEqn.solve();
thermo.correct();
}

View File

@ -1,18 +0,0 @@
{
fvScalarMatrix hEqn
(
fvm::div(phi, h)
- fvm::Sp(fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
- fvc::div(phi, 0.5*magSqr(U), "div(phi,K)")
);
pZones.addEnthalpySource(thermo, rho, hEqn);
hEqn.relax();
hEqn.solve();
thermo.correct();
}

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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -63,7 +63,7 @@ int main(int argc, char *argv[])
// Pressure-velocity SIMPLE corrector // Pressure-velocity SIMPLE corrector
{ {
#include "UEqn.H" #include "UEqn.H"
#include "hEqn.H" #include "eEqn.H"
#include "pEqn.H" #include "pEqn.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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -59,7 +59,7 @@ int main(int argc, char *argv[])
// Pressure-velocity SIMPLE corrector // Pressure-velocity SIMPLE corrector
{ {
#include "UEqn.H" #include "UEqn.H"
#include "hEqn.H" #include "eEqn.H"
#include "pEqn.H" #include "pEqn.H"
} }

View File

@ -1,61 +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::READ_IF_PRESENT,
IOobject::AUTO_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"
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, simple.dict(), pRefCell, pRefValue);
dimensionedScalar rhoMax(simple.dict().lookup("rhoMax"));
dimensionedScalar rhoMin(simple.dict().lookup("rhoMin"));
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::RASModel> turbulence
(
compressible::RASModel::New
(
rho,
U,
phi,
thermo
)
);
dimensionedScalar initialMass = fvc::domainIntegrate(rho);

View File

@ -3,13 +3,11 @@ rho = max(rho, rhoMin);
rho = min(rho, rhoMax); rho = min(rho, rhoMax);
rho.relax(); rho.relax();
volScalarField p0(p); volScalarField rAU(1.0/UEqn().A());
volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1()));
volScalarField AU(UEqn().A());
volScalarField AtU(AU - UEqn().H1());
volVectorField HbyA("HbyA", U); volVectorField HbyA("HbyA", U);
HbyA = UEqn().H()/AU; HbyA = rAU*UEqn().H();
UEqn.clear(); UEqn.clear();
@ -17,28 +15,32 @@ bool closedVolume = false;
if (simple.transonic()) if (simple.transonic())
{ {
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)*(fvc::interpolate(HbyA) & mesh.Sf())
);
surfaceScalarField phic
(
"phic",
fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf()
);
HbyA -= (rAU - rAtU)*fvc::grad(p);
volScalarField Dp("Dp", rho*rAtU);
while (simple.correctNonOrthogonal()) while (simple.correctNonOrthogonal())
{ {
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi*HbyA) & mesh.Sf()
);
surfaceScalarField phic
(
"phic",
fvc::interpolate(rho/AtU - rho/AU)*fvc::snGrad(p)*mesh.magSf()
);
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvm::div(phid, p) fvm::div(phid, p)
+ fvc::div(phic) + fvc::div(phic)
- fvm::laplacian(rho/AtU, p) - fvm::laplacian(Dp, p)
); );
// Relax the pressure equation to ensure diagonal-dominance // Relax the pressure equation to maintain diagonal dominance
pEqn.relax(); pEqn.relax();
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
@ -53,21 +55,25 @@ if (simple.transonic())
} }
else else
{ {
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf())
);
closedVolume = adjustPhi(phiHbyA, U, p);
phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf();
HbyA -= (rAU - rAtU)*fvc::grad(p);
volScalarField Dp("Dp", rho*rAtU);
while (simple.correctNonOrthogonal()) while (simple.correctNonOrthogonal())
{ {
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho*HbyA) & mesh.Sf()
);
closedVolume = adjustPhi(phi, U, p);
phi += fvc::interpolate(rho/AtU - rho/AU)*fvc::snGrad(p)*mesh.magSf();
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvc::div(phiHbyA) fvc::div(phiHbyA)
- fvm::laplacian(rho/AtU, p) - fvm::laplacian(Dp, p)
); );
pEqn.setReference(pRefCell, pRefValue); pEqn.setReference(pRefCell, pRefValue);
@ -81,16 +87,14 @@ else
} }
} }
// The incompressibe for of the continuity error check is appropriate for // The incompressibe form of the continuity error check is appropriate for
// steady-state compressible also. // steady-state compressible also.
#include "incompressible/continuityErrs.H" #include "incompressible/continuityErrs.H"
// Explicitly relax pressure for momentum corrector // Explicitly relax pressure for momentum corrector
p.relax(); p.relax();
U = HbyA - (fvc::grad(p0)*(1.0/AU - 1.0/AtU) + fvc::grad(p)/AtU); U = HbyA - rAtU*fvc::grad(p);
//U = HbyA - fvc::grad(p)/AU;
U.correctBoundaryConditions(); U.correctBoundaryConditions();
// For closed-volume cases adjust the pressure and density levels // For closed-volume cases adjust the pressure and density levels
@ -101,6 +105,7 @@ if (closedVolume)
/fvc::domainIntegrate(psi); /fvc::domainIntegrate(psi);
} }
// Recalculate density from the relaxed pressure
rho = thermo.rho(); rho = thermo.rho();
rho = max(rho, rhoMin); rho = max(rho, rhoMin);
rho = min(rho, rhoMax); rho = min(rho, rhoMax);

View File

@ -61,8 +61,8 @@ int main(int argc, char *argv[])
// Velocity-pressure-enthalpy SIMPLEC corrector // Velocity-pressure-enthalpy SIMPLEC corrector
{ {
#include "UEqn.H" #include "UEqn.H"
#include "eEqn.H"
#include "pEqn.H" #include "pEqn.H"
#include "hEqn.H"
} }
turbulence->correct(); turbulence->correct();

View File

@ -14,13 +14,16 @@ surfaceScalarField phid
) )
); );
volScalarField Dp("Dp", rho*rAU);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvm::ddt(psi, p) fvm::ddt(psi, p)
+ fvm::div(phid, p) + fvm::div(phid, p)
- fvm::laplacian(rho*rAU, p) - fvm::laplacian(Dp, p)
); );
pEqn.solve(); pEqn.solve();

View File

@ -14,13 +14,15 @@ surfaceScalarField phid
) )
); );
volScalarField Dp("Dp", rho*rAU);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvm::ddt(psi, p) fvm::ddt(psi, p)
+ fvm::div(phid, p) + fvm::div(phid, p)
- fvm::laplacian(rho*rAU, p) - fvm::laplacian(Dp, p)
); );
pEqn.solve(); pEqn.solve();

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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -85,13 +85,14 @@ int main(int argc, char *argv[])
); );
phi = (rhoO/psi)*phid; phi = (rhoO/psi)*phid;
volScalarField Dp("Dp", rho*rAU);
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvm::ddt(psi, p) fvm::ddt(psi, p)
+ fvc::div(phi) + fvc::div(phi)
+ fvm::div(phid, p) + fvm::div(phid, p)
- fvm::laplacian(rho*rAU, p) - fvm::laplacian(Dp, p)
); );
pEqn.solve(); pEqn.solve();

View File

@ -9,8 +9,8 @@
tmp<volScalarField> tcp = thermo.Cp(); tmp<volScalarField> tcp = thermo.Cp();
const volScalarField& cp = tcp(); const volScalarField& cp = tcp();
tmp<volScalarField> tkappa = thermo.K(); tmp<volScalarField> tkappa = thermo.kappa();
//tmp<volSymmTensorField> tkappa = thermo.directionalK()*betav; //tmp<volSymmTensorField> tkappa = thermo.directionalKappa()*betav;
const volScalarField& kappa = tkappa(); const volScalarField& kappa = tkappa();
//const volSymmTensorField& K = tK(); //const volSymmTensorField& K = tK();

View File

@ -7,7 +7,7 @@
tmp<volScalarField> tcp = thermo.Cp(); tmp<volScalarField> tcp = thermo.Cp();
const volScalarField& cp = tcp(); const volScalarField& cp = tcp();
tmp<volScalarField> tkappa = thermo.K(); tmp<volScalarField> tkappa = thermo.kappa();
//tmp<volSymmTensorField> tkappa = thermo.directionalkappa(); //tmp<volSymmTensorField> tkappa = thermo.directionalkappa();
const volScalarField& kappa = tkappa(); const volScalarField& kappa = tkappa();

View File

@ -9,8 +9,8 @@
tmp<volScalarField> tcp = thermo.Cp(); tmp<volScalarField> tcp = thermo.Cp();
const volScalarField& cp = tcp(); const volScalarField& cp = tcp();
tmp<volScalarField> tkappa = thermo.K(); tmp<volScalarField> tkappa = thermo.kappa();
//tmp<volSymmTensorField> tkappa = thermo.directionalK()*betav; //tmp<volSymmTensorField> tkappa = thermo.directionalKappa()*betav;
const volScalarField& kappa = tkappa(); const volScalarField& kappa = tkappa();
//const volSymmTensorField& K = tK(); //const volSymmTensorField& K = tK();

View File

@ -7,9 +7,9 @@
tmp<volScalarField> tcp = thermo.Cp(); tmp<volScalarField> tcp = thermo.Cp();
const volScalarField& cp = tcp(); const volScalarField& cp = tcp();
tmp<volScalarField> tkappa = thermo.K(); tmp<volScalarField> tkappa = thermo.kappa();
const volScalarField& kappa = tkappa(); const volScalarField& kappa = tkappa();
//tmp<volSymmTensorField> tkappa = thermo.directionalK(); //tmp<volSymmTensorField> tkappa = thermo.directionalKappa();
//const volSymmTensorField& kappa = tkappa(); //const volSymmTensorField& kappa = tkappa();
volScalarField& T = thermo.T(); volScalarField& T = thermo.T();

View File

@ -1,3 +1,4 @@
collapseEdges.C collapseEdges.C
pointEdgeCollapse/pointEdgeCollapse.C
EXE = $(FOAM_APPBIN)/collapseEdges EXE = $(FOAM_APPBIN)/collapseEdges

View File

@ -1,6 +1,10 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/dynamicMesh/lnInclude -I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-IpointEdgeCollapse
EXE_LIBS = \ EXE_LIBS = \
-ldynamicMesh \ -ldynamicMesh \
-lmeshTools -lmeshTools \
-lfiniteVolume

View File

@ -0,0 +1,51 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 "pointEdgeCollapse.H"
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::pointEdgeCollapse& wDist
)
{
return os
<< wDist.collapsePoint_ << wDist.collapseIndex_;
}
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::pointEdgeCollapse& wDist
)
{
return is
>> wDist.collapsePoint_ >> wDist.collapseIndex_;
}
// ************************************************************************* //

View File

@ -0,0 +1,227 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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::pointEdgeCollapse
Description
Determines length of string of edges walked to point.
SourceFiles
pointEdgeCollapseI.H
pointEdgeCollapse.C
\*---------------------------------------------------------------------------*/
#ifndef pointEdgeCollapse_H
#define pointEdgeCollapse_H
#include "point.H"
#include "tensor.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class polyPatch;
class polyMesh;
/*---------------------------------------------------------------------------*\
Class pointEdgeCollapse Declaration
\*---------------------------------------------------------------------------*/
class pointEdgeCollapse
{
// Private data
//- Collapse location
point collapsePoint_;
//- Collapse string index
label collapseIndex_;
// Private Member Functions
//- Evaluate distance to point.
template<class TrackingData>
inline bool update
(
const pointEdgeCollapse& w2,
const scalar tol,
TrackingData& td
);
//- Check for same coordinate
inline bool samePoint(const point& pt) const;
public:
// Constructors
//- Construct null
inline pointEdgeCollapse();
//- Construct from components
inline pointEdgeCollapse
(
const point& collapsePoint,
const label collapseIndex
);
// Member Functions
// Access
inline const point& collapsePoint() const;
inline label collapseIndex() const;
// Needed by meshWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
template<class TrackingData>
inline bool valid(TrackingData& td) const;
//- Convert origin to relative vector to leaving point
// (= point coordinate)
template<class TrackingData>
inline void leaveDomain
(
const polyPatch& patch,
const label patchPointI,
const point& pos,
TrackingData& td
);
//- Convert relative origin to absolute by adding entering point
template<class TrackingData>
inline void enterDomain
(
const polyPatch& patch,
const label patchPointI,
const point& pos,
TrackingData& td
);
//- Apply rotation matrix to origin
template<class TrackingData>
inline void transform
(
const tensor& rotTensor,
TrackingData& td
);
//- Influence of edge on point
template<class TrackingData>
inline bool updatePoint
(
const polyMesh& mesh,
const label pointI,
const label edgeI,
const pointEdgeCollapse& edgeInfo,
const scalar tol,
TrackingData& td
);
//- Influence of different value on same point.
// Merge new and old info.
template<class TrackingData>
inline bool updatePoint
(
const polyMesh& mesh,
const label pointI,
const pointEdgeCollapse& newPointInfo,
const scalar tol,
TrackingData& td
);
//- Influence of different value on same point.
// No information about current position whatsoever.
template<class TrackingData>
inline bool updatePoint
(
const pointEdgeCollapse& newPointInfo,
const scalar tol,
TrackingData& td
);
//- Influence of point on edge.
template<class TrackingData>
inline bool updateEdge
(
const polyMesh& mesh,
const label edgeI,
const label pointI,
const pointEdgeCollapse& pointInfo,
const scalar tol,
TrackingData& td
);
//- Same (like operator==)
template<class TrackingData>
inline bool equal(const pointEdgeCollapse&, TrackingData&)
const;
// Member Operators
//Note: Used to determine whether to call update.
inline bool operator==(const pointEdgeCollapse&) const;
inline bool operator!=(const pointEdgeCollapse&) const;
// IOstream Operators
friend Ostream& operator<<(Ostream&, const pointEdgeCollapse&);
friend Istream& operator>>(Istream&, pointEdgeCollapse&);
};
//- Data associated with pointEdgeCollapse type are contiguous
template<>
inline bool contiguous<pointEdgeCollapse>()
{
return true;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "pointEdgeCollapseI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,313 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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"
#include "transform.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Update this with w2.
template<class TrackingData>
inline bool Foam::pointEdgeCollapse::update
(
const pointEdgeCollapse& w2,
const scalar tol,
TrackingData& td
)
{
if (!w2.valid(td))
{
FatalErrorIn("pointEdgeCollapse::update(..)")
<< "problem." << abort(FatalError);
}
if (w2.collapseIndex_ == -1)
{
// Not marked for collapse; only happens on edges.
return false;
}
if (!valid(td))
{
operator=(w2);
return true;
}
else
{
// Same coordinate. Same string?
if (w2.collapseIndex_ < collapseIndex_)
{
// Take over string index from w2 (and also coordinate but this
// was same)
operator=(w2);
return true;
}
else if (w2.collapseIndex_ == collapseIndex_)
{
bool identicalPoint = samePoint(w2.collapsePoint_);
bool nearer = magSqr(w2.collapsePoint_) < magSqr(collapsePoint_);
if (nearer)
{
operator=(w2);
}
if (identicalPoint)
{
return false;
}
else
{
return nearer;
}
}
else
{
return false;
}
// if (samePoint(w2.collapsePoint_))
// {
// // Same coordinate. Same string?
// if (w2.collapseIndex_ < collapseIndex_)
// {
// // Take over string index from w2 (and also coordinate but
// // this was same)
// operator=(w2);
// return true;
// }
// else
// {
// return false;
// }
// }
// else
// {
// // Find nearest coordinate
// if (magSqr(w2.collapsePoint_) < magSqr(collapsePoint_))
// {
// operator=(w2);
// return true;
// }
// else
// {
// return false;
// }
// }
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
inline Foam::pointEdgeCollapse::pointEdgeCollapse()
:
collapsePoint_(GREAT, GREAT, GREAT),
collapseIndex_(-2)
{}
// Construct from origin, distance
inline Foam::pointEdgeCollapse::pointEdgeCollapse
(
const point& collapsePoint,
const label collapseIndex
)
:
collapsePoint_(collapsePoint),
collapseIndex_(collapseIndex)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::point& Foam::pointEdgeCollapse::collapsePoint() const
{
return collapsePoint_;
}
inline Foam::label Foam::pointEdgeCollapse::collapseIndex() const
{
return collapseIndex_;
}
inline bool Foam::pointEdgeCollapse::samePoint(const point& pt) const
{
bool isLegal1 = (cmptMin(collapsePoint_) < 0.5*GREAT);
bool isLegal2 = (cmptMin(pt) < 0.5*GREAT);
if (isLegal1 && isLegal2)
{
return mag(collapsePoint_ - pt) < 1e-9;//SMALL;
}
else
{
return isLegal1 == isLegal2;
}
}
template<class TrackingData>
inline bool Foam::pointEdgeCollapse::valid(TrackingData& td) const
{
return collapseIndex_ != -2;
}
template<class TrackingData>
inline void Foam::pointEdgeCollapse::leaveDomain
(
const polyPatch& patch,
const label patchPointI,
const point& coord,
TrackingData& td
)
{
collapsePoint_ -= coord;
}
template<class TrackingData>
inline void Foam::pointEdgeCollapse::transform
(
const tensor& rotTensor,
TrackingData& td
)
{
collapsePoint_ = Foam::transform(rotTensor, collapsePoint_);
}
// Update absolute geometric quantities. Note that distance (dist_)
// is not affected by leaving/entering domain.
template<class TrackingData>
inline void Foam::pointEdgeCollapse::enterDomain
(
const polyPatch& patch,
const label patchPointI,
const point& coord,
TrackingData& td
)
{
// back to absolute form
collapsePoint_ += coord;
}
// Update this with information from connected edge
template<class TrackingData>
inline bool Foam::pointEdgeCollapse::updatePoint
(
const polyMesh& mesh,
const label pointI,
const label edgeI,
const pointEdgeCollapse& edgeInfo,
const scalar tol,
TrackingData& td
)
{
return update(edgeInfo, tol, td);
}
// Update this with new information on same point
template<class TrackingData>
inline bool Foam::pointEdgeCollapse::updatePoint
(
const polyMesh& mesh,
const label pointI,
const pointEdgeCollapse& newPointInfo,
const scalar tol,
TrackingData& td
)
{
return update(newPointInfo, tol, td);
}
// Update this with new information on same point. No extra information.
template<class TrackingData>
inline bool Foam::pointEdgeCollapse::updatePoint
(
const pointEdgeCollapse& newPointInfo,
const scalar tol,
TrackingData& td
)
{
return update(newPointInfo, tol, td);
}
// Update this with information from connected point
template<class TrackingData>
inline bool Foam::pointEdgeCollapse::updateEdge
(
const polyMesh& mesh,
const label edgeI,
const label pointI,
const pointEdgeCollapse& pointInfo,
const scalar tol,
TrackingData& td
)
{
return update(pointInfo, tol, td);
}
template <class TrackingData>
inline bool Foam::pointEdgeCollapse::equal
(
const pointEdgeCollapse& rhs,
TrackingData& td
) const
{
return operator==(rhs);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::pointEdgeCollapse::operator==
(
const Foam::pointEdgeCollapse& rhs
) const
{
return
collapseIndex_ == rhs.collapseIndex_
&& samePoint(rhs.collapsePoint_);
}
inline bool Foam::pointEdgeCollapse::operator!=
(
const Foam::pointEdgeCollapse& rhs
) const
{
return !(*this == rhs);
}
// ************************************************************************* //

View File

@ -152,13 +152,17 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
{ {
Pstream::mapCombineGather(polyhedralFaces, plusEqOp<label>()); Pstream::mapCombineGather(polyhedralFaces, plusEqOp<label>());
Info<< " Breakdown of polyhedra by number of faces:" << endl; Info<< " Breakdown of polyhedra by number of faces:" << nl
Info<< " faces" << " number of cells" << endl; << " faces" << " number of cells" << endl;
forAllConstIter(Map<label>, polyhedralFaces, iter) labelList sortedKeys = polyhedralFaces.sortedToc();
forAll(sortedKeys, keyI)
{ {
label nFaces = sortedKeys[keyI];
Info<< setf(std::ios::right) << setw(13) Info<< setf(std::ios::right) << setw(13)
<< iter.key() << " " << iter() << nl; << nFaces << " " << polyhedralFaces[nFaces] << nl;
} }
} }

View File

@ -73,7 +73,7 @@ int main(int argc, char *argv[])
forAll(wallHeatFlux.boundaryField(), patchi) forAll(wallHeatFlux.boundaryField(), patchi)
{ {
wallHeatFlux.boundaryField()[patchi] = wallHeatFlux.boundaryField()[patchi] =
thermo().K(patchi) thermo().kappa(patchi)
*T.boundaryField()[patchi].snGrad(); *T.boundaryField()[patchi].snGrad();
if (isA<wallFvPatch>(mesh.boundary()[patchi])) if (isA<wallFvPatch>(mesh.boundary()[patchi]))

View File

@ -0,0 +1,180 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 "codedBasicSourceTemplate.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "unitConversion.H"
//{{{ begin codeInclude
${codeInclude}
//}}} end codeInclude
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
//{{{ begin localCode
${localCode}
//}}} end localCode
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
extern "C"
{
// dynamicCode:
// SHA1 = ${SHA1sum}
//
// unique function name that can be checked if the correct library version
// has been loaded
void ${typeName}_${SHA1sum}(bool load)
{
if (load)
{
// code that can be explicitly executed after loading
}
else
{
// code that can be explicitly executed before unloading
}
}
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
//makeRemovablePatchTypeField
//(
// fvPatch${FieldType},
// ${typeName}CodedBasic${SourceType}
//);
defineTypeNameAndDebug(${typeName}CodedBasic${SourceType}, 0);
addRemovableToRunTimeSelectionTable
(
basicSource,
${typeName}CodedBasic${SourceType},
dictionary
);
const char* const ${typeName}CodedBasic${SourceType}::SHA1sum =
"${SHA1sum}";
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
${typeName}CodedBasic${SourceType}::
${typeName}CodedBasic${SourceType}
(
const word& name,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
)
:
basicSource(name, modelType, dict, mesh)
{
if (${verbose:-false})
{
Info<<"construct ${typeName} sha1: ${SHA1sum}"
" from components\n";
}
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
${typeName}CodedBasic${SourceType}::
~${typeName}CodedBasic${SourceType}()
{
if (${verbose:-false})
{
Info<<"destroy ${typeName} sha1: ${SHA1sum}\n";
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void ${typeName}CodedBasic${SourceType}::correct
(
GeometricField<${TemplateType}, fvPatchField, volMesh>& fld
)
{
if (${verbose:-false})
{
Info<<"${typeName}CodedBasic${SourceType}::correct()\n";
}
//{{{ begin code
${codeCorrect}
//}}} end code
}
void ${typeName}CodedBasic${SourceType}::addSup
(
fvMatrix<${TemplateType}>& eqn,
const label fieldI
)
{
if (${verbose:-false})
{
Info<<"${typeName}CodedBasic${SourceType}::addSup()\n";
}
//{{{ begin code
${codeAddSup}
//}}} end code
}
void ${typeName}CodedBasic${SourceType}::setValue
(
fvMatrix<${TemplateType}>& eqn,
const label fieldI
)
{
if (${verbose:-false})
{
Info<<"${typeName}CodedBasic${SourceType}::setValue()\n";
}
//{{{ begin code
${codeSetValue}
//}}} end code
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,108 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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/>.
Description
Template for use with dynamic code generation of a basicSource
- without state
SourceFiles
codedBasicSourceTemplate.C
\*---------------------------------------------------------------------------*/
#ifndef codedBasicSourceTemplate_H
#define codedBasicSourceTemplate_H
#include "basicSource.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
A templated CodedBasicSource
\*---------------------------------------------------------------------------*/
class ${typeName}CodedBasic${SourceType}
:
public basicSource
{
public:
//- Information about the SHA1 of the code itself
static const char* const SHA1sum;
//- Runtime type information
TypeName("${typeName}");
// Constructors
//- Construct from patch and internal field
${typeName}CodedBasic${SourceType}
(
const word& name,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
);
//- Destructor
virtual ~${typeName}CodedBasic${SourceType}();
// Member functions
//- Correct field
virtual void correct
(
GeometricField<${TemplateType}, fvPatchField, volMesh>&
);
//- Explicit and implicit matrix contributions
virtual void addSup
(
fvMatrix<${TemplateType}>& eqn,
const label fieldI
);
//- Set value
virtual void setValue
(
fvMatrix<${TemplateType}>& eqn,
const label fieldI
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -57,8 +57,12 @@ autoPtr<interpolationWeights> interpolationWeights::New
const scalarField& samples const scalarField& samples
) )
{ {
Info<< nl << "Selecting interpolationWeights " if (debug)
<< type << endl; {
InfoIn("interpolationWeights::New")
<< "Selecting interpolationWeights "
<< type << endl;
}
wordConstructorTable::iterator cstrIter = wordConstructorTable::iterator cstrIter =
wordConstructorTablePtr_->find(type); wordConstructorTablePtr_->find(type);
@ -87,33 +91,6 @@ interpolationWeights::~interpolationWeights()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
//objectRegistry& interpolationWeights::registry
//(
// const objectRegistry& obr,
// const word& name
//)
//{
// if (!obr.foundObject<objectRegistry>(name))
// {
// objectRegistry* fieldsCachePtr = new objectRegistry
// (
// IOobject
// (
// name,
// obr.time().constant(),
// obr,
// IOobject::NO_READ,
// IOobject::NO_WRITE
// )
// );
// fieldsCachePtr->store();
// }
// return const_cast<objectRegistry&>(obr.subRegistry(name));
//}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam } // End namespace Foam

View File

@ -99,8 +99,16 @@ void Foam::SolverPerformance<Type>::print
{ {
for(direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++) for(direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
{ {
os << solverName_ << ": Solving for " if (pTraits<Type>::nComponents == 1)
<< word(fieldName_ + pTraits<Type>::componentNames[cmpt]); {
os << solverName_ << ": Solving for " << fieldName_;
}
else
{
os << solverName_ << ": Solving for "
<< word(fieldName_ + pTraits<Type>::componentNames[cmpt]);
}
if (singular_[cmpt]) if (singular_[cmpt])
{ {

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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -295,4 +295,36 @@ Foam::tmp<Foam::scalarField> Foam::lduMatrix::residual
} }
Foam::tmp<Foam::scalarField > Foam::lduMatrix::H1() const
{
tmp<scalarField > tH1
(
new scalarField(lduAddr().size(), 0.0)
);
if (lowerPtr_ || upperPtr_)
{
scalarField& H1_ = tH1();
scalar* __restrict__ H1Ptr = H1_.begin();
const label* __restrict__ uPtr = lduAddr().upperAddr().begin();
const label* __restrict__ lPtr = lduAddr().lowerAddr().begin();
const scalar* __restrict__ lowerPtr = lower().begin();
const scalar* __restrict__ upperPtr = upper().begin();
register const label nFaces = upper().size();
for (register label face=0; face<nFaces; face++)
{
H1Ptr[uPtr[face]] -= lowerPtr[face];
H1Ptr[lPtr[face]] -= upperPtr[face];
}
}
return tH1;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -351,36 +351,4 @@ void Foam::lduMatrix::operator*=(scalar s)
} }
Foam::tmp<Foam::scalarField > Foam::lduMatrix::H1() const
{
tmp<scalarField > tH1
(
new scalarField(lduAddr().size(), 0.0)
);
if (lowerPtr_ || upperPtr_)
{
scalarField& H1_ = tH1();
scalar* __restrict__ H1Ptr = H1_.begin();
const label* __restrict__ uPtr = lduAddr().upperAddr().begin();
const label* __restrict__ lPtr = lduAddr().lowerAddr().begin();
const scalar* __restrict__ lowerPtr = lower().begin();
const scalar* __restrict__ upperPtr = upper().begin();
register const label nFaces = upper().size();
for (register label face=0; face<nFaces; face++)
{
H1Ptr[uPtr[face]] -= lowerPtr[face];
H1Ptr[lPtr[face]] -= upperPtr[face];
}
}
return tH1;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -45,6 +45,7 @@ const Foam::interpolationWeights& Foam::TableBase<Type>::interpolator() const
tableSamples_ tableSamples_
); );
} }
return interpolatorPtr_(); return interpolatorPtr_();
} }
@ -172,6 +173,7 @@ Foam::TableBase<Type>::outOfBounds
{ {
boundsHandling prev = boundsHandling_; boundsHandling prev = boundsHandling_;
boundsHandling_ = bound; boundsHandling_ = bound;
return prev; return prev;
} }
@ -366,22 +368,8 @@ Type Foam::TableBase<Type>::value(const scalar x) const
{ {
t += currentWeights_[i]*table_[currentIndices_[i]].second(); t += currentWeights_[i]*table_[currentIndices_[i]].second();
} }
return t;
//// Find i such that x(i) < xDash < x(i+1) return t;
//label i = 0;
//while ((table_[i+1].first() < xDash) && (i+1 < table_.size()))
//{
// i++;
//}
//
//// Linear interpolation to find value
//return Type
//(
// (xDash - table_[i].first())/(table_[i+1].first() - table_[i].first())
// * (table_[i+1].second() - table_[i].second())
// + table_[i].second()
//);
} }
@ -396,66 +384,8 @@ Type Foam::TableBase<Type>::integrate(const scalar x1, const scalar x2) const
{ {
sum += currentWeights_[i]*table_[currentIndices_[i]].second(); sum += currentWeights_[i]*table_[currentIndices_[i]].second();
} }
return sum; return sum;
//// Initialise return value
//Type sum = pTraits<Type>::zero;
//
//// Return zero if out of bounds
//if ((x1 > table_.last().first()) || (x2 < table_[0].first()))
//{
// return sum;
//}
//
//// Find next index greater than x1
//label id1 = 0;
//while ((table_[id1].first() < x1) && (id1 < table_.size()))
//{
// id1++;
//}
//
//// Find next index less than x2
//label id2 = table_.size() - 1;
//while ((table_[id2].first() > x2) && (id2 >= 1))
//{
// id2--;
//}
//
//if ((id1 - id2) == 1)
//{
// // x1 and x2 lie within 1 interval
// sum = 0.5*(value(x1) + value(x2))*(x2 - x1);
//}
//else
//{
// // x1 and x2 cross multiple intervals
//
// // Integrate table body
// for (label i=id1; i<id2; i++)
// {
// sum +=
// (table_[i].second() + table_[i+1].second())
// * (table_[i+1].first() - table_[i].first());
// }
// sum *= 0.5;
//
// // Add table ends (partial segments)
// if (id1 > 0)
// {
// sum += 0.5
// * (value(x1) + table_[id1].second())
// * (table_[id1].first() - x1);
// }
// if (id2 < table_.size() - 1)
// {
// sum += 0.5
// * (table_[id2].second() + value(x2))
// * (x2 - table_[id2].first());
// }
//}
//
//return sum;
} }
@ -481,9 +411,9 @@ Foam::dimensioned<Type> Foam::TableBase<Type>::dimIntegrate
); );
} }
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "TableBaseIO.C" #include "TableBaseIO.C"
// ************************************************************************* // // ************************************************************************* //

View File

@ -27,6 +27,10 @@ License
#include "polyMesh.H" #include "polyMesh.H"
#include "polyTopoChange.H" #include "polyTopoChange.H"
#include "ListOps.H" #include "ListOps.H"
#include "globalMeshData.H"
#include "OFstream.H"
#include "meshTools.H"
#include "syncTools.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -121,6 +125,7 @@ void Foam::edgeCollapser::filterFace(const label faceI, face& f) const
} }
} }
// Check for pinched face. Tries to correct // Check for pinched face. Tries to correct
// - consecutive duplicate vertex. Removes duplicate vertex. // - consecutive duplicate vertex. Removes duplicate vertex.
// - duplicate vertex with one other vertex in between (spike). // - duplicate vertex with one other vertex in between (spike).
@ -190,15 +195,15 @@ void Foam::edgeCollapser::printRegions() const
if (master != -1) if (master != -1)
{ {
Info<< "Region:" << regionI << nl Pout<< "Region:" << regionI << nl
<< " master:" << master << " master:" << master
<< ' ' << mesh_.points()[master] << nl; << ' ' << pointRegionMasterLocation_[regionI] << nl;
forAll(pointRegion_, pointI) forAll(pointRegion_, pointI)
{ {
if (pointRegion_[pointI] == regionI && pointI != master) if (pointRegion_[pointI] == regionI && pointI != master)
{ {
Info<< " slave:" << pointI Pout<< " slave:" << pointI
<< ' ' << mesh_.points()[pointI] << nl; << ' ' << mesh_.points()[pointI] << nl;
} }
} }
@ -272,6 +277,7 @@ Foam::edgeCollapser::edgeCollapser(const polyMesh& mesh)
: :
mesh_(mesh), mesh_(mesh),
pointRegion_(mesh.nPoints(), -1), pointRegion_(mesh.nPoints(), -1),
pointRegionMasterLocation_(mesh.nPoints() / 100),
pointRegionMaster_(mesh.nPoints() / 100), pointRegionMaster_(mesh.nPoints() / 100),
freeRegions_() freeRegions_()
{} {}
@ -289,6 +295,8 @@ bool Foam::edgeCollapser::unaffectedEdge(const label edgeI) const
bool Foam::edgeCollapser::collapseEdge(const label edgeI, const label master) bool Foam::edgeCollapser::collapseEdge(const label edgeI, const label master)
{ {
const pointField& points = mesh_.points();
const edge& e = mesh_.edges()[edgeI]; const edge& e = mesh_.edges()[edgeI];
label pointRegion0 = pointRegion_[e[0]]; label pointRegion0 = pointRegion_[e[0]];
@ -310,7 +318,7 @@ bool Foam::edgeCollapser::collapseEdge(const label edgeI, const label master)
{ {
FatalErrorIn FatalErrorIn
("edgeCollapser::collapseEdge(const label, const label)") ("edgeCollapser::collapseEdge(const label, const label)")
<< "Problem : freeed region :" << freeRegion << "Problem : freed region :" << freeRegion
<< " has already master " << " has already master "
<< pointRegionMaster_[freeRegion] << pointRegionMaster_[freeRegion]
<< abort(FatalError); << abort(FatalError);
@ -327,13 +335,22 @@ bool Foam::edgeCollapser::collapseEdge(const label edgeI, const label master)
pointRegion_[e[1]] = freeRegion; pointRegion_[e[1]] = freeRegion;
pointRegionMaster_(freeRegion) = master; pointRegionMaster_(freeRegion) = master;
pointRegionMasterLocation_(freeRegion) = points[master];
} }
else else
{ {
// e[1] is part of collapse network, e[0] not. Add e0 to e1 region. // e[1] is part of collapse network, e[0] not. Add e0 to e1 region.
pointRegion_[e[0]] = pointRegion1; pointRegion_[e[0]] = pointRegion1;
pointRegionMaster_[pointRegion1] = master; if
(
pointRegionMaster_[pointRegion1] == e[0]
|| pointRegionMaster_[pointRegion1] == e[1]
)
{
pointRegionMaster_[pointRegion1] = master;
pointRegionMasterLocation_[pointRegion1] = points[master];
}
} }
} }
else else
@ -343,7 +360,15 @@ bool Foam::edgeCollapser::collapseEdge(const label edgeI, const label master)
// e[0] is part of collapse network. Add e1 to e0 region // e[0] is part of collapse network. Add e1 to e0 region
pointRegion_[e[1]] = pointRegion0; pointRegion_[e[1]] = pointRegion0;
pointRegionMaster_[pointRegion0] = master; if
(
pointRegionMaster_[pointRegion0] == e[0]
|| pointRegionMaster_[pointRegion0] == e[1]
)
{
pointRegionMaster_[pointRegion0] = master;
pointRegionMasterLocation_[pointRegion0] = points[master];
}
} }
else if (pointRegion0 != pointRegion1) else if (pointRegion0 != pointRegion1)
{ {
@ -356,6 +381,9 @@ bool Foam::edgeCollapser::collapseEdge(const label edgeI, const label master)
// Use minRegion as region for combined net, free maxRegion. // Use minRegion as region for combined net, free maxRegion.
pointRegionMaster_[minRegion] = master; pointRegionMaster_[minRegion] = master;
pointRegionMaster_[maxRegion] = -1; pointRegionMaster_[maxRegion] = -1;
pointRegionMasterLocation_[minRegion] = points[master];
pointRegionMasterLocation_[maxRegion] = point(0, 0, 0);
freeRegions_.insert(maxRegion); freeRegions_.insert(maxRegion);
if (minRegion != pointRegion0) if (minRegion != pointRegion0)
@ -380,12 +408,61 @@ bool Foam::edgeCollapser::setRefinement(polyTopoChange& meshMod)
const labelList& faceNeighbour = mesh_.faceNeighbour(); const labelList& faceNeighbour = mesh_.faceNeighbour();
const labelListList& pointFaces = mesh_.pointFaces(); const labelListList& pointFaces = mesh_.pointFaces();
const labelListList& cellEdges = mesh_.cellEdges(); const labelListList& cellEdges = mesh_.cellEdges();
const pointZoneMesh& pointZones = mesh_.pointZones();
// Print regions:
//printRegions()
bool meshChanged = false; bool meshChanged = false;
// Synchronise pointRegionMasterLocation_
const globalMeshData& globalData = mesh_.globalData();
const mapDistribute& map = globalData.globalPointSlavesMap();
const indirectPrimitivePatch& coupledPatch = globalData.coupledPatch();
const labelList& meshPoints = coupledPatch.meshPoints();
const Map<label>& meshPointMap = coupledPatch.meshPointMap();
List<point> newPoints = coupledPatch.localPoints();
for (label pI = 0; pI < coupledPatch.nPoints(); ++pI)
{
const label pointRegionMaster = pointRegion_[meshPoints[pI]];
if (pointRegionMaster != -1)
{
newPoints[pI]
= pointRegionMasterLocation_[pointRegionMaster];
}
}
globalData.syncData
(
newPoints,
globalData.globalPointSlaves(),
globalData.globalPointTransformedSlaves(),
map,
minMagSqrEqOp<point>()
);
OFstream str1("newPoints_" + name(Pstream::myProcNo()) + ".obj");
forAll(pointRegion_, pI)
{
if (meshPointMap.found(pI))
{
meshTools::writeOBJ(str1, newPoints[meshPointMap[pI]]);
}
}
for (label pI = 0; pI < coupledPatch.nPoints(); ++pI)
{
const label pointRegionMaster = pointRegion_[meshPoints[pI]];
if (pointRegionMaster != -1)
{
pointRegionMasterLocation_[pointRegionMaster]
= newPoints[pI];
}
}
// Current faces (is also collapseStatus: f.size() < 3) // Current faces (is also collapseStatus: f.size() < 3)
faceList newFaces(mesh_.faces()); faceList newFaces(mesh_.faces());
@ -393,7 +470,6 @@ bool Foam::edgeCollapser::setRefinement(polyTopoChange& meshMod)
// Current cellCollapse status // Current cellCollapse status
boolList cellRemoved(mesh_.nCells(), false); boolList cellRemoved(mesh_.nCells(), false);
do do
{ {
// Update face collapse from edge collapses // Update face collapse from edge collapses
@ -521,12 +597,49 @@ bool Foam::edgeCollapser::setRefinement(polyTopoChange& meshMod)
} }
} }
// Modify the point location of the remaining points
forAll(pointRegion_, pointI)
{
const label pointRegion = pointRegion_[pointI];
if
(
!pointRemoved(pointI)
&& meshPointMap.found(pointI)
)
{
meshMod.modifyPoint
(
pointI,
newPoints[meshPointMap[pointI]],
pointZones.whichZone(pointI),
false
);
}
else if
(
pointRegion != -1
&& !pointRemoved(pointI)
&& !meshPointMap.found(pointI)
)
{
const point& collapsePoint
= pointRegionMasterLocation_[pointRegion];
meshMod.modifyPoint
(
pointI,
collapsePoint,
pointZones.whichZone(pointI),
false
);
}
}
const polyBoundaryMesh& boundaryMesh = mesh_.boundaryMesh(); const polyBoundaryMesh& boundaryMesh = mesh_.boundaryMesh();
const faceZoneMesh& faceZones = mesh_.faceZones(); const faceZoneMesh& faceZones = mesh_.faceZones();
// Renumber faces that use points // Renumber faces that use points
forAll(pointRegion_, pointI) forAll(pointRegion_, pointI)
{ {
@ -585,6 +698,9 @@ bool Foam::edgeCollapser::setRefinement(polyTopoChange& meshMod)
} }
} }
// Print regions:
// printRegions();
return meshChanged; return meshChanged;
} }
@ -593,8 +709,10 @@ void Foam::edgeCollapser::updateMesh(const mapPolyMesh& map)
{ {
pointRegion_.setSize(mesh_.nPoints()); pointRegion_.setSize(mesh_.nPoints());
pointRegion_ = -1; pointRegion_ = -1;
// Reset count, do not remove underlying storage // Reset count, do not remove underlying storage
pointRegionMaster_.clear(); pointRegionMaster_.clear();
pointRegionMasterLocation_.clear();
freeRegions_.clear(); freeRegions_.clear();
} }

View File

@ -39,6 +39,7 @@ SourceFiles
#include "labelList.H" #include "labelList.H"
#include "DynamicList.H" #include "DynamicList.H"
#include "point.H"
#include "typeInfo.H" #include "typeInfo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -66,6 +67,10 @@ class edgeCollapser
//- For every point -1 or region number //- For every point -1 or region number
labelList pointRegion_; labelList pointRegion_;
//- Actual location of the point to collapse to for every region master
// point. This will be forced to be consistent across processors
DynamicList<point> pointRegionMasterLocation_;
//- -1 or master vertex for region number //- -1 or master vertex for region number
DynamicList<label> pointRegionMaster_; DynamicList<label> pointRegionMaster_;

View File

@ -29,4 +29,6 @@ $(interRegion)/constantHeatTransfer/constantHeatTransfer.C
$(interRegion)/tabulatedHeatTransfer/tabulatedHeatTransfer.C $(interRegion)/tabulatedHeatTransfer/tabulatedHeatTransfer.C
$(interRegion)/variableHeatTransfer/variableHeatTransfer.C $(interRegion)/variableHeatTransfer/variableHeatTransfer.C
basicSource/codedSource/codedSource.C
LIB = $(FOAM_LIBBIN)/libfieldSources LIB = $(FOAM_LIBBIN)/libfieldSources

View File

@ -0,0 +1,206 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 "CodedSource.H"
#include "fvMesh.H"
#include "fvMatrices.H"
#include "dynamicCode.H"
#include "dynamicCodeContext.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::CodedSource<Type>::prepare
(
dynamicCode& dynCode,
const dynamicCodeContext& context
) const
{
word sourceType(pTraits<Type>::typeName);
// Set additional rewrite rules
dynCode.setFilterVariable("typeName", redirectType_);
dynCode.setFilterVariable("TemplateType", sourceType);
dynCode.setFilterVariable("SourceType", sourceType + "Source");
//dynCode.removeFilterVariable("code");
dynCode.setFilterVariable("codeCorrect", codeCorrect_);
dynCode.setFilterVariable("codeAddSup", codeAddSup_);
dynCode.setFilterVariable("codeSetValue", codeSetValue_);
// compile filtered C template
dynCode.addCompileFile("codedBasicSourceTemplate.C");
// copy filtered H template
dynCode.addCopyFile("codedBasicSourceTemplate.H");
// debugging: make BC verbose
// dynCode.setFilterVariable("verbose", "true");
// Info<<"compile " << redirectType_ << " sha1: "
// << context.sha1() << endl;
// define Make/options
dynCode.setMakeOptions
(
"EXE_INC = -g \\\n"
"-I$(LIB_SRC)/fieldSources/lnInclude \\\n"
"-I$(LIB_SRC)/finiteVolume/lnInclude \\\n"
"-I$(LIB_SRC)/meshTools/lnInclude \\\n"
"-I$(LIB_SRC)/sampling/lnInclude \\\n"
+ context.options()
+ "\n\nLIB_LIBS = \\\n"
+ " -lmeshTools \\\n"
+ " -lfieldSources \\\n"
+ " -lsampling \\\n"
+ " -lfiniteVolume \\\n"
+ context.libs()
);
}
template<class Type>
Foam::dlLibraryTable& Foam::CodedSource<Type>::libs() const
{
return const_cast<Time&>(mesh_.time()).libs();
}
template<class Type>
Foam::string Foam::CodedSource<Type>::description() const
{
return "basicSource " + name_;
}
template<class Type>
void Foam::CodedSource<Type>::clearRedirect() const
{
redirectBasicSourcePtr_.clear();
}
template<class Type>
const Foam::dictionary& Foam::CodedSource<Type>::codeDict() const
{
return coeffs_;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::CodedSource<Type>::CodedSource
(
const word& name,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
)
:
basicSource(name, modelType, dict, mesh)
{
read(dict);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::basicSource& Foam::CodedSource<Type>::redirectBasicSource()
const
{
if (!redirectBasicSourcePtr_.valid())
{
dictionary constructDict(dict_);
constructDict.set("type", redirectType_);
redirectBasicSourcePtr_ = basicSource::New
(
redirectType_,
constructDict,
mesh_
);
}
return redirectBasicSourcePtr_();
}
template<class Type>
void Foam::CodedSource<Type>::correct
(
GeometricField<Type, fvPatchField, volMesh>& fld
)
{
if (debug)
{
Info<< "CodedSource<"<< pTraits<Type>::typeName
<< ">::correct for source " << name_ << endl;
}
updateLibrary(redirectType_);
redirectBasicSource().correct(fld);
}
template<class Type>
void Foam::CodedSource<Type>::addSup
(
fvMatrix<Type>& eqn,
const label fieldI
)
{
if (debug)
{
Info<< "CodedSource<"<< pTraits<Type>::typeName
<< ">::addSup for source " << name_ << endl;
}
updateLibrary(redirectType_);
redirectBasicSource().addSup(eqn, fieldI);
}
template<class Type>
void Foam::CodedSource<Type>::setValue
(
fvMatrix<Type>& eqn,
const label fieldI
)
{
if (debug)
{
Info<< "CodedSource<"<< pTraits<Type>::typeName
<< ">::setValue for source " << name_ << endl;
}
updateLibrary(redirectType_);
redirectBasicSource().setValue(eqn, fieldI);
}
// ************************************************************************* //

View File

@ -0,0 +1,205 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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::codedSource
Description
Constructs on-the-fly a new basicSource.
E.g. in constant/sourcesProperties
momentumSource
{
type vectorCodedSource;
active on; //on/off switch
timeStart 0.0; //start time
duration 1000000.0; //duration
selectionMode all; //cellSet // points //cellZone
vectorCodedSourceCoeffs
{
fieldNames (U);
redirectType ramp;
codeCorrect
#{
Pout<< "**codeCorrect**" << endl;
#};
codeAddSup
#{
Pout<< "**codeAddSup**" << endl;
#};
codeSetValue
#{
Pout<< "**codeSetValue**" << endl;
#};
// Dummy entry. Make dependent on above to trigger recompilation
code
#{
$codeCorrect
$codeAddSup
$codeSetValue
#};
}
// Dummy entry
rampCoeffs
{}
}
SourceFiles
codedSource.C
\*---------------------------------------------------------------------------*/
#ifndef CodedSource_H
#define CodedSource_H
#include "basicSource.H"
#include "codedBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class codedSource Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class CodedSource
:
public basicSource,
public codedBase
{
protected:
// Protected data
word redirectType_;
string codeCorrect_;
string codeAddSup_;
string codeSetValue_;
//- Underlying functionObject
mutable autoPtr<basicSource> redirectBasicSourcePtr_;
// Protected Member Functions
//- get the loaded dynamic libraries
virtual dlLibraryTable& libs() const;
//- adapt the context for the current object
virtual void prepare(dynamicCode &,const dynamicCodeContext&) const;
// Return a description (type + name) for the output
virtual string description() const;
// Clear any redirected objects
virtual void clearRedirect() const;
// Get the dictionary to initialize the codeContext
virtual const dictionary& codeDict() const;
public:
//- Runtime type information
TypeName("coded");
// Constructors
//- Construct from components
CodedSource
(
const word& name,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
);
// Member Functions
//- Dynamically compiled basicSource
basicSource& redirectBasicSource() const;
// Evaluation
//- Correct field
virtual void correct
(
GeometricField<Type, fvPatchField, volMesh>&
);
//- Explicit and implicit matrix contributions
virtual void addSup
(
fvMatrix<Type>& eqn,
const label fieldI
);
//- Set value
virtual void setValue
(
fvMatrix<Type>& eqn,
const label fieldI
);
// I-O
//- Write the source properties
virtual void writeData(Ostream&) const;
//- Read source dictionary
virtual bool read(const dictionary& dict);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "CodedSource.C"
# include "CodedSourceIO.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,109 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 "CodedSource.H"
#include "stringOps.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::CodedSource<Type>::writeData(Ostream& os) const
{
os << indent << name_ << endl;
dict_.write(os);
}
template<class Type>
bool Foam::CodedSource<Type>::read(const dictionary& dict)
{
if (basicSource::read(dict))
{
coeffs_.lookup("fieldNames") >> fieldNames_;
applied_.setSize(fieldNames_.size(), false);
coeffs_.lookup("redirectType") >> redirectType_;
// Code snippets
{
const entry& e = coeffs_.lookupEntry
(
"codeCorrect",
false,
false
);
codeCorrect_ = stringOps::trim(e.stream());
stringOps::inplaceExpand(codeCorrect_, coeffs_);
dynamicCodeContext::addLineDirective
(
codeCorrect_,
e.startLineNumber(),
coeffs_.name()
);
}
{
const entry& e = coeffs_.lookupEntry
(
"codeAddSup",
false,
false
);
codeAddSup_ = stringOps::trim(e.stream());
stringOps::inplaceExpand(codeAddSup_, coeffs_);
dynamicCodeContext::addLineDirective
(
codeAddSup_,
e.startLineNumber(),
coeffs_.name()
);
}
{
const entry& e = coeffs_.lookupEntry
(
"codeSetValue",
false,
false
);
codeSetValue_ = stringOps::trim(e.stream());
stringOps::inplaceExpand(codeSetValue_, coeffs_);
dynamicCodeContext::addLineDirective
(
codeSetValue_,
e.startLineNumber(),
coeffs_.name()
);
}
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ 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 "makeBasicSource.H"
#include "CodedSource.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeBasicSource(CodedSource, scalar);
makeBasicSource(CodedSource, vector);
makeBasicSource(CodedSource, sphericalTensor);
makeBasicSource(CodedSource, symmTensor);
makeBasicSource(CodedSource, tensor);
}
// ************************************************************************* //

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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -49,7 +49,7 @@ namespace Foam
class interRegionHeatTransferModel class interRegionHeatTransferModel
: :
public basicSource public basicSource
{ {
private: private:

View File

@ -139,7 +139,7 @@ void Foam::cylindricalInletVelocityFvPatchVectorField::updateCoeffs()
(rpm*constant::mathematical::pi/30.0)*(hatAxis) ^ d (rpm*constant::mathematical::pi/30.0)*(hatAxis) ^ d
); );
operator==(tangVel + axis_*axialVelocity + radialVelocity*d); operator==(tangVel + hatAxis*axialVelocity + radialVelocity*d/mag(d));
fixedValueFvPatchField<vector>::updateCoeffs(); fixedValueFvPatchField<vector>::updateCoeffs();
} }

View File

@ -841,25 +841,23 @@ Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Type>::H1() const
); );
volScalarField& H1_ = tH1(); volScalarField& H1_ = tH1();
// Loop over field components
/*
for (direction cmpt=0; cmpt<Type::nComponents; cmpt++)
{
scalarField psiCmpt(psi_.internalField().component(cmpt));
scalarField boundaryDiagCmpt(psi_.size(), 0.0);
addBoundaryDiag(boundaryDiagCmpt, cmpt);
boundaryDiagCmpt.negate();
addCmptAvBoundaryDiag(boundaryDiagCmpt);
H1_.internalField().replace(cmpt, boundaryDiagCmpt);
}
H1_.internalField() += lduMatrix::H1();
*/
H1_.internalField() = lduMatrix::H1(); H1_.internalField() = lduMatrix::H1();
forAll(psi_.boundaryField(), patchI)
{
const fvPatchField<Type>& ptf = psi_.boundaryField()[patchI];
if (ptf.coupled() && ptf.size())
{
addToInternalField
(
lduAddr().patchAddr(patchI),
boundaryCoeffs_[patchI].component(0),
H1_
);
}
}
H1_.internalField() /= psi_.mesh().V(); H1_.internalField() /= psi_.mesh().V();
H1_.correctBoundaryConditions(); H1_.correctBoundaryConditions();

View File

@ -151,15 +151,15 @@ const tmp<volScalarField> noPyrolysis::Cp() const
} }
const volScalarField& noPyrolysis::kappa() const const volScalarField& noPyrolysis::kappaRad() const
{ {
return (solidThermo_->kappa()); return (solidThermo_->kappaRad());
} }
const volScalarField& noPyrolysis::K() const const volScalarField& noPyrolysis::kappa() const
{ {
return (solidThermo_->K()); return (solidThermo_->kappa());
} }

View File

@ -124,10 +124,10 @@ public:
virtual const tmp<volScalarField> Cp() const; virtual const tmp<volScalarField> Cp() const;
//- Return the region absorptivity [1/m] //- Return the region absorptivity [1/m]
virtual const volScalarField& kappa() const; virtual const volScalarField& kappaRad() const;
//- Return the region thermal conductivity [W/m/k] //- Return the region thermal conductivity [W/m/k]
virtual const volScalarField& K() const; virtual const volScalarField& kappa() const;
//- Return the total gas mass flux to primary region [kg/m2/s] //- Return the total gas mass flux to primary region [kg/m2/s]
virtual const surfaceScalarField& phiGas() const; virtual const surfaceScalarField& phiGas() const;

View File

@ -218,10 +218,10 @@ public:
virtual const tmp<volScalarField> Cp() const = 0; virtual const tmp<volScalarField> Cp() const = 0;
//- Return the region absorptivity [1/m] //- Return the region absorptivity [1/m]
virtual const volScalarField& kappa() const = 0; virtual const volScalarField& kappaRad() const = 0;
//- Return the region thermal conductivity [W/m/k] //- Return the region thermal conductivity [W/m/k]
virtual const volScalarField& K() const = 0; virtual const volScalarField& kappa() const = 0;
//- Return the total gas mass flux to primary region [kg/m2/s] //- Return the total gas mass flux to primary region [kg/m2/s]
virtual const surfaceScalarField& phiGas() const = 0; virtual const surfaceScalarField& phiGas() const = 0;

View File

@ -126,7 +126,7 @@ void reactingOneDim::updateQr()
const label cellI = cells[k]; const label cellI = cells[k];
const point& Cf1 = regionMesh().cellCentres()[cellI]; const point& Cf1 = regionMesh().cellCentres()[cellI];
const scalar delta = mag(Cf1 - Cf0); const scalar delta = mag(Cf1 - Cf0);
kappaInt += kappa_[cellI]*delta; kappaInt += kappaRad_[cellI]*delta;
Qr_[cellI] = Qr0*exp(-kappaInt); Qr_[cellI] = Qr0*exp(-kappaInt);
Cf0 = Cf1; Cf0 = Cf1;
} }
@ -294,7 +294,7 @@ void reactingOneDim::solveEnergy()
fvScalarMatrix TEqn fvScalarMatrix TEqn
( (
fvm::ddt(rhoCp, T_) fvm::ddt(rhoCp, T_)
- fvm::laplacian(K_, T_) - fvm::laplacian(kappa_, T_)
== ==
chemistrySh_ chemistrySh_
+ fvc::div(phiQr) + fvc::div(phiQr)
@ -347,8 +347,8 @@ reactingOneDim::reactingOneDim(const word& modelType, const fvMesh& mesh)
pyrolysisModel(modelType, mesh), pyrolysisModel(modelType, mesh),
solidChemistry_(solidChemistryModel::New(regionMesh())), solidChemistry_(solidChemistryModel::New(regionMesh())),
solidThermo_(solidChemistry_->solidThermo()), solidThermo_(solidChemistry_->solidThermo()),
kappaRad_(solidThermo_.kappaRad()),
kappa_(solidThermo_.kappa()), kappa_(solidThermo_.kappa()),
K_(solidThermo_.K()),
rho_(solidThermo_.rho()), rho_(solidThermo_.rho()),
Ys_(solidThermo_.composition().Y()), Ys_(solidThermo_.composition().Y()),
T_(solidThermo_.T()), T_(solidThermo_.T()),
@ -449,8 +449,8 @@ reactingOneDim::reactingOneDim
pyrolysisModel(modelType, mesh, dict), pyrolysisModel(modelType, mesh, dict),
solidChemistry_(solidChemistryModel::New(regionMesh())), solidChemistry_(solidChemistryModel::New(regionMesh())),
solidThermo_(solidChemistry_->solidThermo()), solidThermo_(solidChemistry_->solidThermo()),
kappaRad_(solidThermo_.kappaRad()),
kappa_(solidThermo_.kappa()), kappa_(solidThermo_.kappa()),
K_(solidThermo_.K()),
rho_(solidThermo_.rho()), rho_(solidThermo_.rho()),
Ys_(solidThermo_.composition().Y()), Ys_(solidThermo_.composition().Y()),
T_(solidThermo_.T()), T_(solidThermo_.T()),
@ -584,7 +584,7 @@ scalar reactingOneDim::solidRegionDiffNo() const
surfaceScalarField KrhoCpbyDelta surfaceScalarField KrhoCpbyDelta
( (
regionMesh().surfaceInterpolation::deltaCoeffs() regionMesh().surfaceInterpolation::deltaCoeffs()
* fvc::interpolate(K_) * fvc::interpolate(kappa_)
/ fvc::interpolate(Cp()*rho_) / fvc::interpolate(Cp()*rho_)
); );
@ -619,15 +619,15 @@ const tmp<volScalarField> reactingOneDim::Cp() const
} }
const volScalarField& reactingOneDim::kappa() const const volScalarField& reactingOneDim::kappaRad() const
{ {
return kappa_; return kappaRad_;
} }
const volScalarField& reactingOneDim::K() const const volScalarField& reactingOneDim::kappa() const
{ {
return K_; return kappa_;
} }

View File

@ -84,10 +84,10 @@ protected:
// Reference to solid thermo properties // Reference to solid thermo properties
//- Absorption coefficient [1/m] //- Absorption coefficient [1/m]
const volScalarField& kappa_; const volScalarField& kappaRad_;
//- Thermal conductivity [W/m/K] //- Thermal conductivity [W/m/K]
const volScalarField& K_; const volScalarField& kappa_;
//- Density [kg/m3] //- Density [kg/m3]
volScalarField& rho_; volScalarField& rho_;
@ -230,10 +230,10 @@ public:
virtual const tmp<volScalarField> Cp() const; virtual const tmp<volScalarField> Cp() const;
//- Return the region absorptivity [1/m] //- Return the region absorptivity [1/m]
virtual const volScalarField& kappa() const; virtual const volScalarField& kappaRad() const;
//- Return the region thermal conductivity [W/m/k] //- Return the region thermal conductivity [W/m/k]
virtual const volScalarField& K() const; virtual const volScalarField& kappa() const;
//- Return the total gas mass flux to primary region [kg/m2/s] //- Return the total gas mass flux to primary region [kg/m2/s]
virtual const surfaceScalarField& phiGas() const; virtual const surfaceScalarField& phiGas() const;

View File

@ -35,7 +35,7 @@ Description
// Coupled BC. // Coupled BC.
neighbourFieldName T; neighbourFieldName T;
K basicThermo; kappa basicThermo;
KName none; KName none;
@ -57,10 +57,10 @@ Description
//- thermo properties //- thermo properties
rho rho [1 -3 0 0 0 0 0] 80; rho rho [1 -3 0 0 0 0 0] 80;
Cp Cp [0 2 -2 -1 0 0 0] 15; Cp Cp [0 2 -2 -1 0 0 0] 15;
K K [1 1 -3 -1 0 0 0] 0.01; kappa kappa [1 1 -3 -1 0 0 0] 0.01;
//- radiative properties //- radiative properties
kappa kappa [0 -1 0 0 0 0 0] 0; kappaRad kappaRad [0 -1 0 0 0 0 0] 0;
sigmaS sigmaS [0 -1 0 0 0 0 0] 0; sigmaS sigmaS [0 -1 0 0 0 0 0] 0;
emissivity emissivity [0 0 0 0 0 0 0] 1; emissivity emissivity [0 0 0 0 0 0 0] 1;

View File

@ -95,9 +95,9 @@ const tmp<volScalarField> noThermo::Cp() const
); );
} }
const volScalarField& noThermo::kappa() const const volScalarField& noThermo::kappaRad() const
{ {
FatalErrorIn("const volScalarField& noThermo::kappa() const") FatalErrorIn("const volScalarField& noThermo::kappaRad() const")
<< "kappa field not available for " << type() << abort(FatalError); << "kappa field not available for " << type() << abort(FatalError);
return volScalarField::null(); return volScalarField::null();
} }
@ -111,9 +111,9 @@ const volScalarField& noThermo::rho() const
} }
const volScalarField& noThermo::K() const const volScalarField& noThermo::kappa() const
{ {
FatalErrorIn("const volScalarField& noThermo::K() const") FatalErrorIn("const volScalarField& noThermo::kappa() const")
<< "K field not available for " << type() << abort(FatalError); << "K field not available for " << type() << abort(FatalError);
return volScalarField::null(); return volScalarField::null();
} }

View File

@ -105,7 +105,7 @@ public:
virtual const tmp<volScalarField> Cp() const; virtual const tmp<volScalarField> Cp() const;
//- Return solid absortivity [1/m] //- Return solid absortivity [1/m]
virtual const volScalarField& kappa() const; virtual const volScalarField& kappaRad() const;
//- Return the film mean temperature [K] //- Return the film mean temperature [K]
virtual const volScalarField& T() const; virtual const volScalarField& T() const;
@ -114,7 +114,7 @@ public:
virtual const volScalarField& rho() const; virtual const volScalarField& rho() const;
//- Return thermal conductivity [W/m/K] //- Return thermal conductivity [W/m/K]
virtual const volScalarField& K() const; virtual const volScalarField& kappa() const;
// Evolution // Evolution

View File

@ -96,7 +96,7 @@ void thermoBaffle2D::solveEnergy()
volScalarField& Q = tQ(); volScalarField& Q = tQ();
volScalarField rhoCp("rhoCp", thermo_->rho()*thermo_->Cp()()); volScalarField rhoCp("rhoCp", thermo_->rho()*thermo_->Cp()());
volScalarField K("K", thermo_->K()); volScalarField kappa("kappa", thermo_->kappa());
//If region is one-dimension variable thickness //If region is one-dimension variable thickness
@ -119,7 +119,7 @@ void thermoBaffle2D::solveEnergy()
rhoCp[cellId] *= delta_.value()/thickness_[localFaceI]; rhoCp[cellId] *= delta_.value()/thickness_[localFaceI];
K[cellId] *= delta_.value()/thickness_[localFaceI]; kappa[cellId] *= delta_.value()/thickness_[localFaceI];
} }
} }
} }
@ -131,7 +131,7 @@ void thermoBaffle2D::solveEnergy()
fvScalarMatrix TEqn fvScalarMatrix TEqn
( (
fvm::ddt(rhoCp, T_) fvm::ddt(rhoCp, T_)
- fvm::laplacian(K, T_) - fvm::laplacian(kappa, T_)
== ==
Q Q
); );
@ -316,9 +316,9 @@ const tmp<volScalarField> thermoBaffle2D::Cp() const
} }
const volScalarField& thermoBaffle2D::kappa() const const volScalarField& thermoBaffle2D::kappaRad() const
{ {
return thermo_->kappa(); return thermo_->kappaRad();
} }
@ -328,9 +328,9 @@ const volScalarField& thermoBaffle2D::rho() const
} }
const volScalarField& thermoBaffle2D::K() const const volScalarField& thermoBaffle2D::kappa() const
{ {
return thermo_->K(); return thermo_->kappa();
} }
@ -362,7 +362,7 @@ void thermoBaffle2D::info() const
( (
mag(regionMesh().Sf().boundaryField()[patchI]) mag(regionMesh().Sf().boundaryField()[patchI])
* pT.snGrad() * pT.snGrad()
* thermo_->K(patchI) * thermo_->kappa(patchI)
) << endl; ) << endl;
} }
} }

View File

@ -155,7 +155,7 @@ public:
virtual const tmp<volScalarField> Cp() const; virtual const tmp<volScalarField> Cp() const;
//- Return solid absortivity [1/m] //- Return solid absortivity [1/m]
virtual const volScalarField& kappa() const; virtual const volScalarField& kappaRad() const;
//- Return the film mean temperature [K] //- Return the film mean temperature [K]
virtual const volScalarField& T() const; virtual const volScalarField& T() const;
@ -164,7 +164,7 @@ public:
virtual const volScalarField& rho() const; virtual const volScalarField& rho() const;
//- Return thermal conductivity [W/m/K] //- Return thermal conductivity [W/m/K]
virtual const volScalarField& K() const; virtual const volScalarField& kappa() const;
// Helper functions // Helper functions

View File

@ -211,10 +211,10 @@ public:
virtual const tmp<volScalarField> Cp() const = 0; virtual const tmp<volScalarField> Cp() const = 0;
//- Return the region absorptivity [1/m] //- Return the region absorptivity [1/m]
virtual const volScalarField& kappa() const = 0; virtual const volScalarField& kappaRad() const = 0;
//- Return the region thermal conductivity [W/m/k] //- Return the region thermal conductivity [W/m/k]
virtual const volScalarField& K() const = 0; virtual const volScalarField& kappa() const = 0;
// Evolution // Evolution

View File

@ -32,6 +32,7 @@ Description
#include "makeBasicMixture.H" #include "makeBasicMixture.H"
#include "perfectGas.H" #include "perfectGas.H"
#include "pressurePerfectGas.H"
#include "incompressible.H" #include "incompressible.H"
#include "eConstThermo.H" #include "eConstThermo.H"
@ -119,6 +120,30 @@ makeBasicPolyMixture
8 8
); );
makeBasicMixture
(
pureMixture,
constTransport,
hConstThermo,
pressurePerfectGas
);
makeBasicMixture
(
pureMixture,
sutherlandTransport,
hConstThermo,
pressurePerfectGas
);
makeBasicMixture
(
pureMixture,
sutherlandTransport,
janafThermo,
pressurePerfectGas
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam } // End namespace Foam

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -49,7 +49,7 @@ void Foam::ePsiThermo<MixtureType>::calculate()
psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]); psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]);
muCells[celli] = mixture_.mu(TCells[celli]); muCells[celli] = mixture_.mu(TCells[celli]);
alphaCells[celli] = mixture_.alpha(TCells[celli]); alphaCells[celli] = mixture_.alphae(TCells[celli]);
} }
forAll(this->T_.boundaryField(), patchi) forAll(this->T_.boundaryField(), patchi)
@ -74,7 +74,7 @@ void Foam::ePsiThermo<MixtureType>::calculate()
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pT[facei]); pmu[facei] = mixture_.mu(pT[facei]);
palpha[facei] = mixture_.alpha(pT[facei]); palpha[facei] = mixture_.alphae(pT[facei]);
} }
} }
else else
@ -88,7 +88,7 @@ void Foam::ePsiThermo<MixtureType>::calculate()
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pT[facei]); pmu[facei] = mixture_.mu(pT[facei]);
palpha[facei] = mixture_.alpha(pT[facei]); palpha[facei] = mixture_.alphae(pT[facei]);
} }
} }
} }

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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -47,7 +47,7 @@ void Foam::hPsiThermo<MixtureType>::calculate()
psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]); psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]);
muCells[celli] = mixture_.mu(TCells[celli]); muCells[celli] = mixture_.mu(TCells[celli]);
alphaCells[celli] = mixture_.alpha(TCells[celli]); alphaCells[celli] = mixture_.alphah(TCells[celli]);
} }
forAll(T_.boundaryField(), patchi) forAll(T_.boundaryField(), patchi)
@ -72,7 +72,7 @@ void Foam::hPsiThermo<MixtureType>::calculate()
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pT[facei]); pmu[facei] = mixture_.mu(pT[facei]);
palpha[facei] = mixture_.alpha(pT[facei]); palpha[facei] = mixture_.alphah(pT[facei]);
} }
} }
else else
@ -86,7 +86,7 @@ void Foam::hPsiThermo<MixtureType>::calculate()
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pT[facei]); pmu[facei] = mixture_.mu(pT[facei]);
palpha[facei] = mixture_.alpha(pT[facei]); palpha[facei] = mixture_.alphah(pT[facei]);
} }
} }
} }

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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -47,7 +47,7 @@ void Foam::hsPsiThermo<MixtureType>::calculate()
psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]); psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]);
muCells[celli] = mixture_.mu(TCells[celli]); muCells[celli] = mixture_.mu(TCells[celli]);
alphaCells[celli] = mixture_.alpha(TCells[celli]); alphaCells[celli] = mixture_.alphah(TCells[celli]);
} }
forAll(T_.boundaryField(), patchi) forAll(T_.boundaryField(), patchi)
@ -72,7 +72,7 @@ void Foam::hsPsiThermo<MixtureType>::calculate()
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pT[facei]); pmu[facei] = mixture_.mu(pT[facei]);
palpha[facei] = mixture_.alpha(pT[facei]); palpha[facei] = mixture_.alphah(pT[facei]);
} }
} }
else else
@ -86,7 +86,7 @@ void Foam::hsPsiThermo<MixtureType>::calculate()
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pT[facei]); pmu[facei] = mixture_.mu(pT[facei]);
palpha[facei] = mixture_.alpha(pT[facei]); palpha[facei] = mixture_.alphah(pT[facei]);
} }
} }
} }

View File

@ -49,7 +49,7 @@ void Foam::hRhoThermo<MixtureType>::calculate()
rhoCells[celli] = mixture_.rho(pCells[celli], TCells[celli]); rhoCells[celli] = mixture_.rho(pCells[celli], TCells[celli]);
muCells[celli] = mixture_.mu(TCells[celli]); muCells[celli] = mixture_.mu(TCells[celli]);
alphaCells[celli] = mixture_.alpha(TCells[celli]); alphaCells[celli] = mixture_.alphah(TCells[celli]);
} }
forAll(this->T_.boundaryField(), patchi) forAll(this->T_.boundaryField(), patchi)
@ -76,7 +76,7 @@ void Foam::hRhoThermo<MixtureType>::calculate()
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
prho[facei] = mixture_.rho(pp[facei], pT[facei]); prho[facei] = mixture_.rho(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pT[facei]); pmu[facei] = mixture_.mu(pT[facei]);
palpha[facei] = mixture_.alpha(pT[facei]); palpha[facei] = mixture_.alphah(pT[facei]);
} }
} }
else else
@ -91,7 +91,7 @@ void Foam::hRhoThermo<MixtureType>::calculate()
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
prho[facei] = mixture_.rho(pp[facei], pT[facei]); prho[facei] = mixture_.rho(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pT[facei]); pmu[facei] = mixture_.mu(pT[facei]);
palpha[facei] = mixture_.alpha(pT[facei]); palpha[facei] = mixture_.alphah(pT[facei]);
} }
} }
} }

View File

@ -26,6 +26,7 @@ License
#include "makeBasicRhoThermo.H" #include "makeBasicRhoThermo.H"
#include "perfectGas.H" #include "perfectGas.H"
#include "pressurePerfectGas.H"
#include "incompressible.H" #include "incompressible.H"
#include "hConstThermo.H" #include "hConstThermo.H"
@ -99,6 +100,33 @@ makeBasicRhoPolyThermo
8 8
); );
makeBasicRhoThermo
(
hRhoThermo,
pureMixture,
constTransport,
hConstThermo,
pressurePerfectGas
);
makeBasicRhoThermo
(
hRhoThermo,
pureMixture,
sutherlandTransport,
hConstThermo,
pressurePerfectGas
);
makeBasicRhoThermo
(
hRhoThermo,
pureMixture,
sutherlandTransport,
janafThermo,
pressurePerfectGas
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam } // End namespace Foam

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -49,7 +49,7 @@ void Foam::hsRhoThermo<MixtureType>::calculate()
rhoCells[celli] = mixture_.rho(pCells[celli], TCells[celli]); rhoCells[celli] = mixture_.rho(pCells[celli], TCells[celli]);
muCells[celli] = mixture_.mu(TCells[celli]); muCells[celli] = mixture_.mu(TCells[celli]);
alphaCells[celli] = mixture_.alpha(TCells[celli]); alphaCells[celli] = mixture_.alphah(TCells[celli]);
} }
forAll(this->T_.boundaryField(), patchi) forAll(this->T_.boundaryField(), patchi)
@ -76,7 +76,7 @@ void Foam::hsRhoThermo<MixtureType>::calculate()
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
prho[facei] = mixture_.rho(pp[facei], pT[facei]); prho[facei] = mixture_.rho(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pT[facei]); pmu[facei] = mixture_.mu(pT[facei]);
palpha[facei] = mixture_.alpha(pT[facei]); palpha[facei] = mixture_.alphah(pT[facei]);
} }
} }
else else
@ -91,7 +91,7 @@ void Foam::hsRhoThermo<MixtureType>::calculate()
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
prho[facei] = mixture_.rho(pp[facei], pT[facei]); prho[facei] = mixture_.rho(pp[facei], pT[facei]);
pmu[facei] = mixture_.mu(pT[facei]); pmu[facei] = mixture_.mu(pT[facei]);
palpha[facei] = mixture_.alpha(pT[facei]); palpha[facei] = mixture_.alphah(pT[facei]);
} }
} }
} }

View File

@ -26,6 +26,7 @@ License
#include "makeBasicRhoThermo.H" #include "makeBasicRhoThermo.H"
#include "perfectGas.H" #include "perfectGas.H"
#include "pressurePerfectGas.H"
#include "hConstThermo.H" #include "hConstThermo.H"
#include "janafThermo.H" #include "janafThermo.H"
@ -71,6 +72,32 @@ makeBasicRhoThermo
perfectGas perfectGas
); );
makeBasicRhoThermo
(
hsRhoThermo,
pureMixture,
constTransport,
hConstThermo,
pressurePerfectGas
);
makeBasicRhoThermo
(
hsRhoThermo,
pureMixture,
sutherlandTransport,
hConstThermo,
pressurePerfectGas
);
makeBasicRhoThermo
(
hsRhoThermo,
pureMixture,
sutherlandTransport,
janafThermo,
pressurePerfectGas
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -78,11 +78,11 @@ Foam::basicSolidThermo::basicSolidThermo(const fvMesh& mesh)
mesh, mesh,
dimMass/dimVolume dimMass/dimVolume
), ),
kappa_ kappaRad_
( (
IOobject IOobject
( (
"kappa", "kappaRad",
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -165,11 +165,11 @@ Foam::basicSolidThermo::basicSolidThermo
mesh, mesh,
dimMass/dimVolume dimMass/dimVolume
), ),
kappa_ kappaRad_
( (
IOobject IOobject
( (
"kappa", "kappaRad",
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -239,9 +239,9 @@ Foam::volScalarField& Foam::basicSolidThermo::rho()
} }
const Foam::volScalarField& Foam::basicSolidThermo::kappa() const const Foam::volScalarField& Foam::basicSolidThermo::kappaRad() const
{ {
return kappa_; return kappaRad_;
} }

View File

@ -73,7 +73,7 @@ protected:
volScalarField rho_; volScalarField rho_;
//- Absorption coefficient [1/m] //- Absorption coefficient [1/m]
volScalarField kappa_; volScalarField kappaRad_;
//- Scatter coeffcient [1/m] //- Scatter coeffcient [1/m]
volScalarField sigmaS_; volScalarField sigmaS_;
@ -157,7 +157,7 @@ public:
virtual volScalarField& rho(); virtual volScalarField& rho();
//- Absorption coefficient [1/m] //- Absorption coefficient [1/m]
virtual const volScalarField& kappa() const; virtual const volScalarField& kappaRad() const;
//- Emissivity coefficient //- Emissivity coefficient
virtual const volScalarField& sigmaS() const; virtual const volScalarField& sigmaS() const;
@ -169,10 +169,10 @@ public:
// Derived thermal properties // Derived thermal properties
//- Thermal conductivity [W/m/K] //- Thermal conductivity [W/m/K]
virtual tmp<volScalarField> K() const = 0; virtual tmp<volScalarField> kappa() const = 0;
//- Thermal conductivity [W/m/K] //- Thermal conductivity [W/m/K]
virtual tmp<volSymmTensorField> directionalK() const = 0; virtual tmp<volSymmTensorField> directionalKappa() const = 0;
//- Specific heat capacity [J/kg/K] //- Specific heat capacity [J/kg/K]
virtual tmp<volScalarField> Cp() const = 0; virtual tmp<volScalarField> Cp() const = 0;
@ -187,10 +187,13 @@ public:
// Per patch calculation // Per patch calculation
//- Thermal conductivity [W//m/K] //- Thermal conductivity [W//m/K]
virtual tmp<scalarField> K(const label patchI) const = 0; virtual tmp<scalarField> kappa(const label patchI) const = 0;
//- Thermal conductivity [W//m/K] //- Thermal conductivity [W//m/K]
virtual tmp<symmTensorField> directionalK(const label) const = 0; virtual tmp<symmTensorField> directionalKappa
(
const label
) const = 0;
//- Specific heat capacity [J/kg/K)] //- Specific heat capacity [J/kg/K)]
virtual tmp<scalarField> Cp(const label patchI) const = 0; virtual tmp<scalarField> Cp(const label patchI) const = 0;

View File

@ -46,36 +46,36 @@ Foam::constSolidThermo::constSolidThermo
: :
basicSolidThermo(mesh, dict), basicSolidThermo(mesh, dict),
dict_(dict.subDict(typeName + "Coeffs")), dict_(dict.subDict(typeName + "Coeffs")),
constK_(dimensionedScalar(dict_.lookup("K"))), constKappa_(dimensionedScalar(dict_.lookup("kappa"))),
K_ kappa_
( (
IOobject IOobject
( (
"K", "kappa",
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
constK_ constKappa_
), ),
constRho_(dimensionedScalar(dict_.lookup("rho"))), constRho_(dimensionedScalar(dict_.lookup("rho"))),
constCp_(dimensionedScalar(dict_.lookup("Cp"))), constCp_(dimensionedScalar(dict_.lookup("Cp"))),
constHf_(dimensionedScalar(dict_.lookup("Hf"))), constHf_(dimensionedScalar(dict_.lookup("Hf"))),
constEmissivity_(dimensionedScalar(dict_.lookup("emissivity"))), constEmissivity_(dimensionedScalar(dict_.lookup("emissivity"))),
constKappa_(dimensionedScalar(dict_.lookup("kappa"))), constKappaRad_(dimensionedScalar(dict_.lookup("kappaRad"))),
constSigmaS_(dimensionedScalar(dict_.lookup("sigmaS"))) constSigmaS_(dimensionedScalar(dict_.lookup("sigmaS")))
{ {
read(); read();
K_ = constK_; kappa_ = constKappa_;
rho_ = constRho_; rho_ = constRho_;
emissivity_ = constEmissivity_; emissivity_ = constEmissivity_;
kappa_ = constKappa_; kappaRad_ = constKappaRad_;
sigmaS_ = constSigmaS_; sigmaS_ = constSigmaS_;
} }
@ -85,36 +85,36 @@ Foam::constSolidThermo::constSolidThermo(const fvMesh& mesh)
: :
basicSolidThermo(mesh), basicSolidThermo(mesh),
dict_(subDict(typeName + "Coeffs")), dict_(subDict(typeName + "Coeffs")),
constK_(dimensionedScalar(dict_.lookup("K"))), constKappa_(dimensionedScalar(dict_.lookup("kappa"))),
K_ kappa_
( (
IOobject IOobject
( (
"K", "kappa",
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
constK_ constKappa_
), ),
constRho_(dimensionedScalar(dict_.lookup("rho"))), constRho_(dimensionedScalar(dict_.lookup("rho"))),
constCp_(dimensionedScalar(dict_.lookup("Cp"))), constCp_(dimensionedScalar(dict_.lookup("Cp"))),
constHf_(dimensionedScalar(dict_.lookup("Hf"))), constHf_(dimensionedScalar(dict_.lookup("Hf"))),
constEmissivity_(dimensionedScalar(dict_.lookup("emissivity"))), constEmissivity_(dimensionedScalar(dict_.lookup("emissivity"))),
constKappa_(dimensionedScalar(dict_.lookup("kappa"))), constKappaRad_(dimensionedScalar(dict_.lookup("kappaRad"))),
constSigmaS_(dimensionedScalar(dict_.lookup("sigmaS"))) constSigmaS_(dimensionedScalar(dict_.lookup("sigmaS")))
{ {
read(); read();
K_ = constK_; kappa_ = constKappa_;
rho_ = constRho_; rho_ = constRho_;
emissivity_ = constEmissivity_; emissivity_ = constEmissivity_;
kappa_ = constKappa_; kappaRad_ = constKappaRad_;
sigmaS_ = constSigmaS_; sigmaS_ = constSigmaS_;
} }
@ -132,26 +132,27 @@ void Foam::constSolidThermo::correct()
{} {}
Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::K() const Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::kappa() const
{ {
return K_; return kappa_;
} }
Foam::tmp<Foam::volSymmTensorField> Foam::constSolidThermo::directionalK() const Foam::tmp<Foam::volSymmTensorField>
Foam::constSolidThermo::directionalKappa() const
{ {
dimensionedSymmTensor t dimensionedSymmTensor t
( (
constK_.name(), constKappa_.name(),
constK_.dimensions(), constKappa_.dimensions(),
symmTensor symmTensor
( (
constK_.value(), constKappa_.value(),
0.0, 0.0,
0.0, 0.0,
constK_.value(), constKappa_.value(),
0.0, 0.0,
constK_.value() constKappa_.value()
) )
); );
return tmp<volSymmTensorField> return tmp<volSymmTensorField>
@ -160,7 +161,7 @@ Foam::tmp<Foam::volSymmTensorField> Foam::constSolidThermo::directionalK() const
( (
IOobject IOobject
( (
"K", "kappa",
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::NO_READ, IOobject::NO_READ,
@ -215,28 +216,28 @@ Foam::tmp<Foam::volScalarField> Foam::constSolidThermo::Hf() const
} }
Foam::tmp<Foam::scalarField> Foam::constSolidThermo::K Foam::tmp<Foam::scalarField> Foam::constSolidThermo::kappa
( (
const label patchI const label patchI
) const ) const
{ {
return (K_.boundaryField()[patchI]); return (kappa_.boundaryField()[patchI]);
} }
Foam::tmp<Foam::symmTensorField> Foam::constSolidThermo::directionalK Foam::tmp<Foam::symmTensorField> Foam::constSolidThermo::directionalKappa
( (
const label patchI const label patchI
) const ) const
{ {
symmTensor t symmTensor t
( (
constK_.value(), constKappa_.value(),
0.0, 0.0,
0.0, 0.0,
constK_.value(), constKappa_.value(),
0.0, 0.0,
constK_.value() constKappa_.value()
); );
return tmp<symmTensorField> return tmp<symmTensorField>
( (
@ -291,19 +292,19 @@ bool Foam::constSolidThermo::read(const dictionary& dict)
{ {
constRho_ = dimensionedScalar(dict.lookup("rho")); constRho_ = dimensionedScalar(dict.lookup("rho"));
constCp_ = dimensionedScalar(dict.lookup("Cp")); constCp_ = dimensionedScalar(dict.lookup("Cp"));
constK_ = dimensionedScalar(dict.lookup("K")); constKappa_ = dimensionedScalar(dict.lookup("kappa"));
constHf_ = dimensionedScalar(dict.lookup("Hf")); constHf_ = dimensionedScalar(dict.lookup("Hf"));
constEmissivity_ = dimensionedScalar(dict.lookup("emissivity")); constEmissivity_ = dimensionedScalar(dict.lookup("emissivity"));
constKappa_ = dimensionedScalar(dict_.lookup("kappa")); constKappaRad_ = dimensionedScalar(dict_.lookup("kappaRad"));
constSigmaS_ = dimensionedScalar(dict_.lookup("sigmaS")); constSigmaS_ = dimensionedScalar(dict_.lookup("sigmaS"));
Info<< "Constructed constSolidThermo with" << nl Info<< "Constructed constSolidThermo with" << nl
<< " rho : " << constRho_ << nl << " rho : " << constRho_ << nl
<< " Cp : " << constCp_ << nl << " Cp : " << constCp_ << nl
<< " K : " << constK_ << nl << " kappa : " << constKappa_ << nl
<< " Hf : " << constHf_ << nl << " Hf : " << constHf_ << nl
<< " emissivity : " << constEmissivity_ << nl << " emissivity : " << constEmissivity_ << nl
<< " kappa : " << constKappa_ << nl << " kappaRad : " << constKappaRad_ << nl
<< " sigmaS : " << constSigmaS_ << nl << " sigmaS : " << constSigmaS_ << nl
<< endl; << endl;
@ -316,9 +317,9 @@ bool Foam::constSolidThermo::writeData(Ostream& os) const
bool ok = basicSolidThermo::writeData(os); bool ok = basicSolidThermo::writeData(os);
os.writeKeyword("rho") << constRho_ << token::END_STATEMENT << nl; os.writeKeyword("rho") << constRho_ << token::END_STATEMENT << nl;
os.writeKeyword("Cp") << constCp_ << token::END_STATEMENT << nl; os.writeKeyword("Cp") << constCp_ << token::END_STATEMENT << nl;
os.writeKeyword("K") << constK_ << token::END_STATEMENT << nl;
os.writeKeyword("Hf") << constHf_ << token::END_STATEMENT << nl;
os.writeKeyword("kappa") << constKappa_ << token::END_STATEMENT << nl; os.writeKeyword("kappa") << constKappa_ << token::END_STATEMENT << nl;
os.writeKeyword("Hf") << constHf_ << token::END_STATEMENT << nl;
os.writeKeyword("kappaRad") << constKappaRad_ << token::END_STATEMENT << nl;
os.writeKeyword("sigmaS") << constSigmaS_ << token::END_STATEMENT << nl; os.writeKeyword("sigmaS") << constSigmaS_ << token::END_STATEMENT << nl;
os.writeKeyword("emissivity") << constEmissivity_ << token::END_STATEMENT os.writeKeyword("emissivity") << constEmissivity_ << token::END_STATEMENT
<< nl; << nl;

View File

@ -58,10 +58,10 @@ private:
dictionary dict_; dictionary dict_;
//- Constant thermal conductivity [W/(m.K)] //- Constant thermal conductivity [W/(m.K)]
dimensionedScalar constK_; dimensionedScalar constKappa_;
//- Thermal conductivity field[W/(m.K)] //- Thermal conductivity field[W/(m.K)]
volScalarField K_; volScalarField kappa_;
//- Density [kg/m3] //- Density [kg/m3]
dimensionedScalar constRho_; dimensionedScalar constRho_;
@ -76,7 +76,7 @@ private:
dimensionedScalar constEmissivity_; dimensionedScalar constEmissivity_;
//- Absorptivity [1/m] //- Absorptivity [1/m]
dimensionedScalar constKappa_; dimensionedScalar constKappaRad_;
//- Scatter [1/m] //- Scatter [1/m]
dimensionedScalar constSigmaS_; dimensionedScalar constSigmaS_;
@ -110,10 +110,10 @@ public:
// Derived thermal properties // Derived thermal properties
//- Thermal conductivity [W/m/K] //- Thermal conductivity [W/m/K]
virtual tmp<volScalarField> K() const; virtual tmp<volScalarField> kappa() const;
//- Thermal conductivity [W/m/K] //- Thermal conductivity [W/m/K]
virtual tmp<volSymmTensorField> directionalK() const; virtual tmp<volSymmTensorField> directionalKappa() const;
//- Specific heat capacity [J/(kg.K)] //- Specific heat capacity [J/(kg.K)]
virtual tmp<volScalarField> Cp() const; virtual tmp<volScalarField> Cp() const;
@ -125,10 +125,10 @@ public:
// Per patch calculation // Per patch calculation
//- Thermal conductivity [W//m/K] //- Thermal conductivity [W//m/K]
virtual tmp<scalarField> K(const label patchI) const; virtual tmp<scalarField> kappa(const label patchI) const;
//- Thermal conductivity [W//m/K] //- Thermal conductivity [W//m/K]
virtual tmp<symmTensorField>directionalK(const label) const; virtual tmp<symmTensorField>directionalKappa(const label) const;
//- Specific heat capacity [J/kg/K)] //- Specific heat capacity [J/kg/K)]
virtual tmp<scalarField> Cp(const label patchI) const; virtual tmp<scalarField> Cp(const label patchI) const;

View File

@ -59,11 +59,11 @@ Foam::directionalKSolidThermo::directionalKSolidThermo
) )
: :
interpolatedSolidThermo(mesh, typeName + "Coeffs", dict), interpolatedSolidThermo(mesh, typeName + "Coeffs", dict),
directionalK_ directionalKappa_
( (
IOobject IOobject
( (
"K", "kappa",
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::NO_READ, IOobject::NO_READ,
@ -93,11 +93,11 @@ Foam::directionalKSolidThermo::directionalKSolidThermo
Foam::directionalKSolidThermo::directionalKSolidThermo(const fvMesh& mesh) Foam::directionalKSolidThermo::directionalKSolidThermo(const fvMesh& mesh)
: :
interpolatedSolidThermo(mesh, typeName + "Coeffs"), interpolatedSolidThermo(mesh, typeName + "Coeffs"),
directionalK_ directionalKappa_
( (
IOobject IOobject
( (
"K", "kappa",
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::NO_READ, IOobject::NO_READ,
@ -134,7 +134,10 @@ Foam::directionalKSolidThermo::~directionalKSolidThermo()
void Foam::directionalKSolidThermo::init() void Foam::directionalKSolidThermo::init()
{ {
KValues_ = Field<vector>(subDict(typeName + "Coeffs").lookup("KValues")); kappaValues_ =
Field<vector>(subDict(typeName + "Coeffs").lookup("kappaValues"));
Info<< " kappa : " << kappaValues_ << nl << endl;
// Determine transforms for cell centres // Determine transforms for cell centres
forAll(mesh_.C(), cellI) forAll(mesh_.C(), cellI)
@ -362,51 +365,55 @@ void Foam::directionalKSolidThermo::correct()
Foam::tmp<Foam::volSymmTensorField> Foam::tmp<Foam::volSymmTensorField>
Foam::directionalKSolidThermo::directionalK() const Foam::directionalKSolidThermo::directionalKappa() const
{ {
return directionalK_; return directionalKappa_;
} }
void Foam::directionalKSolidThermo::calculate() void Foam::directionalKSolidThermo::calculate()
{ {
// Correct directionalK // Correct directionalK
Field<vector> localK Field<vector> localKappa
( (
interpolateXY interpolateXY
( (
T_.internalField(), T_.internalField(),
TValues_, TValues_,
KValues_ kappaValues_
) )
); );
// Transform into global coordinate system // Transform into global coordinate system
transformField transformField
( (
directionalK_.internalField(), directionalKappa_.internalField(),
ccTransforms_.internalField(), ccTransforms_.internalField(),
localK localKappa
); );
forAll(directionalK_.boundaryField(), patchI) forAll(directionalKappa_.boundaryField(), patchI)
{ {
directionalK_.boundaryField()[patchI] == this->directionalK(patchI)(); directionalKappa_.boundaryField()[patchI] ==
this->directionalKappa(patchI)();
} }
} }
Foam::tmp<Foam::symmTensorField> Foam::directionalKSolidThermo::directionalK Foam::tmp<Foam::symmTensorField> Foam::directionalKSolidThermo::directionalKappa
( (
const label patchI const label patchI
) const ) const
{ {
const fvPatchScalarField& patchT = T_.boundaryField()[patchI]; const fvPatchScalarField& patchT = T_.boundaryField()[patchI];
Field<vector> localK(interpolateXY(patchT, TValues_, KValues_)); Field<vector> localKappa(interpolateXY(patchT, TValues_, kappaValues_));
tmp<symmTensorField> tglobalK(new symmTensorField(localK.size())); tmp<symmTensorField> tglobalK(new symmTensorField(localKappa.size()));
transformField(tglobalK(), ccTransforms_.boundaryField()[patchI], localK); transformField
(
tglobalK(), ccTransforms_.boundaryField()[patchI], localKappa
);
return tglobalK; return tglobalK;
} }
@ -421,7 +428,8 @@ bool Foam::directionalKSolidThermo::read()
bool Foam::directionalKSolidThermo::read(const dictionary& dict) bool Foam::directionalKSolidThermo::read(const dictionary& dict)
{ {
coordSys_ = coordinateSystem(dict, mesh_); coordSys_ = coordinateSystem(dict, mesh_);
KValues_ = Field<vector>(subDict(typeName + "Coeffs").lookup("KValues")); kappaValues_ =
Field<vector>(subDict(typeName + "Coeffs").lookup("kappaValues"));
return true; return true;
} }
@ -429,7 +437,8 @@ bool Foam::directionalKSolidThermo::read(const dictionary& dict)
bool Foam::directionalKSolidThermo::writeData(Ostream& os) const bool Foam::directionalKSolidThermo::writeData(Ostream& os) const
{ {
bool ok = interpolatedSolidThermo::writeData(os); bool ok = interpolatedSolidThermo::writeData(os);
os.writeKeyword("KValues") << KValues_ << token::END_STATEMENT << nl; os.writeKeyword("kappaValues")
<< kappaValues_ << token::END_STATEMENT << nl;
return ok && os.good(); return ok && os.good();
} }

View File

@ -54,10 +54,10 @@ class directionalKSolidThermo
// Private data // Private data
//- Thermal conductivity [W/(m.K)] //- Thermal conductivity [W/(m.K)]
volSymmTensorField directionalK_; volSymmTensorField directionalKappa_;
//- Thermal conductivity vector //- Thermal conductivity vector
Field<vector> KValues_; Field<vector> kappaValues_;
//- Coordinate system used for the directional properties //- Coordinate system used for the directional properties
coordinateSystem coordSys_; coordinateSystem coordSys_;
@ -117,26 +117,29 @@ public:
//- Access functions //- Access functions
//- Thermal conductivity [W/m/K] //- Thermal conductivity [W/m/K]
virtual tmp<volScalarField> K() const virtual tmp<volScalarField> kappa() const
{ {
notImplemented("directionalKSolidThermo::K() const"); notImplemented("directionalKSolidThermo::kappa() const");
return tmp<volScalarField>(NULL); return tmp<volScalarField>(NULL);
} }
//- Thermal conductivity [W/m/K] //- Thermal conductivity [W/m/K]
virtual tmp<volSymmTensorField> directionalK() const; virtual tmp<volSymmTensorField> directionalKappa() const;
// Per patch calculation // Per patch calculation
//- Thermal conductivity [W//m/K] //- Thermal conductivity [W//m/K]
virtual tmp<scalarField> K(const label patchI) const virtual tmp<scalarField> kappa(const label patchI) const
{ {
notImplemented("directionalKSolidThermo::K(const label) const"); notImplemented
(
"directionalKSolidThermo::kappa(const label) const"
);
return tmp<scalarField>(NULL); return tmp<scalarField>(NULL);
} }
//- Thermal conductivity [W//m/K] //- Thermal conductivity [W//m/K]
virtual tmp<symmTensorField> directionalK(const label) const; virtual tmp<symmTensorField> directionalKappa(const label) const;
// I-O // I-O

View File

@ -33,15 +33,14 @@ Foam::interpolateSolid::interpolateSolid(const dictionary& dict)
{ {
read(dict); read(dict);
Info<< "Constructed directionalKSolidThermo with samples" << nl Info<< "Constructed solid thermo with samples" << nl
<< " T : " << TValues_ << nl << " T : " << TValues_ << nl
<< " rho : " << rhoValues_ << nl << " rho : " << rhoValues_ << nl
<< " cp : " << cpValues_ << nl << " cp : " << cpValues_ << nl
<< " Hf : " << HfValues_ << nl << " Hf : " << HfValues_ << nl
<< " emissivity : " << emissivityValues_ << nl << " emissivity : " << emissivityValues_ << nl
<< " kappa : " << kappaValues_ << nl << " kappaRad : " << kappaRadValues_ << nl
<< " sigmaS : " << sigmaSValues_ << nl << " sigmaS : " << sigmaSValues_ << nl;
<< endl;
if if
@ -88,7 +87,7 @@ bool Foam::interpolateSolid::writeData(Ostream& os) const
os.writeKeyword("HfValues") << HfValues_ << token::END_STATEMENT << nl; os.writeKeyword("HfValues") << HfValues_ << token::END_STATEMENT << nl;
os.writeKeyword("emissivityValues") << emissivityValues_ << os.writeKeyword("emissivityValues") << emissivityValues_ <<
token::END_STATEMENT << nl; token::END_STATEMENT << nl;
os.writeKeyword("kappaValues") << kappaValues_ os.writeKeyword("kappaRadValues") << kappaRadValues_
<< token::END_STATEMENT << nl; << token::END_STATEMENT << nl;
os.writeKeyword("sigmaSValues") << sigmaSValues_ os.writeKeyword("sigmaSValues") << sigmaSValues_
<< token::END_STATEMENT << nl; << token::END_STATEMENT << nl;
@ -103,7 +102,7 @@ bool Foam::interpolateSolid::read(const dictionary& dict)
TValues_ = Field<scalar>(dict.lookup("TValues")); TValues_ = Field<scalar>(dict.lookup("TValues"));
rhoValues_ = Field<scalar>(dict.lookup("rhoValues")); rhoValues_ = Field<scalar>(dict.lookup("rhoValues"));
cpValues_ = Field<scalar>(dict.lookup("cpValues")); cpValues_ = Field<scalar>(dict.lookup("cpValues"));
kappaValues_ = Field<scalar>(dict.lookup("kappaValues")); kappaRadValues_ = Field<scalar>(dict.lookup("kappaRadValues"));
sigmaSValues_ = Field<scalar>(dict.lookup("sigmaSValues")); sigmaSValues_ = Field<scalar>(dict.lookup("sigmaSValues"));
HfValues_ = Field<scalar>(dict.lookup("HfValues")); HfValues_ = Field<scalar>(dict.lookup("HfValues"));
emissivityValues_ = Field<scalar>(dict.lookup("emissivityValues")); emissivityValues_ = Field<scalar>(dict.lookup("emissivityValues"));

View File

@ -63,7 +63,7 @@ protected:
Field<scalar> emissivityValues_; Field<scalar> emissivityValues_;
Field<scalar> kappaValues_; Field<scalar> kappaRadValues_;
Field<scalar> sigmaSValues_; Field<scalar> sigmaSValues_;

View File

@ -69,7 +69,7 @@ Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::emissivity
} }
Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::kappa Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::kappaRad
( (
const label patchI const label patchI
) const ) const
@ -82,7 +82,7 @@ Foam::tmp<Foam::scalarField> Foam::interpolatedSolidThermo::kappa
( (
T_.boundaryField()[patchI], T_.boundaryField()[patchI],
TValues_, TValues_,
kappaValues_ kappaRadValues_
) )
) )
); );
@ -178,16 +178,16 @@ void Foam::interpolatedSolidThermo::calculate()
// Correct absorptivity // Correct absorptivity
kappa_.internalField() = interpolateXY kappaRad_.internalField() = interpolateXY
( (
T_.internalField(), T_.internalField(),
TValues_, TValues_,
kappaValues_ kappaRadValues_
); );
forAll(kappa_.boundaryField(), patchI) forAll(kappaRad_.boundaryField(), patchI)
{ {
kappa_.boundaryField()[patchI] == this->kappa(patchI)(); kappaRad_.boundaryField()[patchI] == this->kappaRad(patchI)();
} }

View File

@ -69,7 +69,7 @@ private:
tmp<scalarField> sigmaS(const label) const; tmp<scalarField> sigmaS(const label) const;
//- Absorption coefficient [1/m] //- Absorption coefficient [1/m]
tmp<scalarField> kappa(const label) const; tmp<scalarField> kappaRad(const label) const;
//- Emissivity [] //- Emissivity []
tmp<scalarField> emissivity(const label) const; tmp<scalarField> emissivity(const label) const;

View File

@ -57,11 +57,11 @@ Foam::isotropicKSolidThermo::isotropicKSolidThermo
) )
: :
interpolatedSolidThermo(mesh, typeName + "Coeffs", dict), interpolatedSolidThermo(mesh, typeName + "Coeffs", dict),
K_ kappa_
( (
IOobject IOobject
( (
"K", "kappa",
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -70,8 +70,12 @@ Foam::isotropicKSolidThermo::isotropicKSolidThermo
mesh, mesh,
dimEnergy/dimTime/(dimLength*dimTemperature) dimEnergy/dimTime/(dimLength*dimTemperature)
), ),
KValues_ (Field<scalar>(subDict(typeName + "Coeffs").lookup("KValues"))) kappaValues_
(
Field<scalar>(subDict(typeName + "Coeffs").lookup("kappaValues"))
)
{ {
Info<< " kappa : " << kappaValues_ << nl << endl;
correct(); correct();
} }
@ -79,11 +83,11 @@ Foam::isotropicKSolidThermo::isotropicKSolidThermo
Foam::isotropicKSolidThermo::isotropicKSolidThermo(const fvMesh& mesh) Foam::isotropicKSolidThermo::isotropicKSolidThermo(const fvMesh& mesh)
: :
interpolatedSolidThermo(mesh, typeName + "Coeffs"), interpolatedSolidThermo(mesh, typeName + "Coeffs"),
K_ kappa_
( (
IOobject IOobject
( (
"K", "kappa",
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -92,8 +96,12 @@ Foam::isotropicKSolidThermo::isotropicKSolidThermo(const fvMesh& mesh)
mesh, mesh,
dimEnergy/dimTime/(dimLength*dimTemperature) dimEnergy/dimTime/(dimLength*dimTemperature)
), ),
KValues_ (Field<scalar>(subDict(typeName + "Coeffs").lookup("KValues"))) kappaValues_
(
Field<scalar>(subDict(typeName + "Coeffs").lookup("kappaValues"))
)
{ {
Info<< " kappa : " << kappaValues_ << nl <<endl;
correct(); correct();
} }
@ -101,20 +109,20 @@ Foam::isotropicKSolidThermo::isotropicKSolidThermo(const fvMesh& mesh)
void Foam::isotropicKSolidThermo::correct() void Foam::isotropicKSolidThermo::correct()
{ {
// Correct K // Correct K
K_.internalField() = interpolateXY kappa_.internalField() = interpolateXY
( (
T_.internalField(), T_.internalField(),
TValues_, TValues_,
KValues_ kappaValues_
); );
forAll(K_.boundaryField(), patchI) forAll(kappa_.boundaryField(), patchI)
{ {
K_.boundaryField()[patchI] == interpolateXY kappa_.boundaryField()[patchI] == interpolateXY
( (
T_.boundaryField()[patchI], T_.boundaryField()[patchI],
TValues_, TValues_,
KValues_ kappaValues_
); );
} }
@ -122,31 +130,33 @@ void Foam::isotropicKSolidThermo::correct()
} }
Foam::tmp<Foam::volScalarField> Foam::isotropicKSolidThermo::K() const Foam::tmp<Foam::volScalarField> Foam::isotropicKSolidThermo::kappa() const
{ {
return K_; return kappa_;
} }
Foam::tmp<Foam::scalarField> Foam::isotropicKSolidThermo::K Foam::tmp<Foam::scalarField> Foam::isotropicKSolidThermo::kappa
( (
const label patchI const label patchI
) const ) const
{ {
return K_.boundaryField()[patchI]; return kappa_.boundaryField()[patchI];
} }
bool Foam::isotropicKSolidThermo::read() bool Foam::isotropicKSolidThermo::read()
{ {
KValues_ = Field<scalar>(subDict(typeName + "Coeffs").lookup("KValues")); kappaValues_ =
Field<scalar>(subDict(typeName + "Coeffs").lookup("kappaValues"));
return true; return true;
} }
bool Foam::isotropicKSolidThermo::writeData(Ostream& os) const bool Foam::isotropicKSolidThermo::writeData(Ostream& os) const
{ {
os.writeKeyword("KValues") << KValues_ << token::END_STATEMENT << nl; os.writeKeyword("kappaValues") << kappaValues_
<< token::END_STATEMENT << nl;
bool ok = interpolatedSolidThermo::writeData(os); bool ok = interpolatedSolidThermo::writeData(os);
return ok && os.good(); return ok && os.good();

View File

@ -53,10 +53,10 @@ class isotropicKSolidThermo
// Private data // Private data
//- Thermal conductivity [W/(m.K)] //- Thermal conductivity [W/(m.K)]
volScalarField K_; volScalarField kappa_;
//- Thermal conductivity vector //- Thermal conductivity vector
Field<scalar> KValues_; Field<scalar> kappaValues_;
public: public:
@ -87,26 +87,31 @@ public:
// Access functions // Access functions
//- Constant access to K //- Constant access to K
virtual tmp<volScalarField> K() const; virtual tmp<volScalarField> kappa() const;
//- Thermal conductivity [W/m/K] //- Thermal conductivity [W/m/K]
virtual tmp<volSymmTensorField> directionalK() const virtual tmp<volSymmTensorField> directionalKappa() const
{
notImplemented("directionalKSolidThermo::directionalK() const");
return tmp<volSymmTensorField>(NULL);
}
// Per patch calculation
//- Thermal conductivity [W//m/K]
virtual tmp<scalarField> K(const label patchI) const;
//- Thermal conductivity [W//m/K]
virtual tmp<symmTensorField> directionalK(const label) const
{ {
notImplemented notImplemented
( (
"directionalKSolidThermo::directionalK(const label) const" "directionalKSolidThermo::directionalKappa() const"
);
return tmp<volSymmTensorField>(NULL);
}
// Per patch calculation
//- Thermal conductivity [W/m/K]
virtual tmp<scalarField> kappa(const label patchI) const;
//- Thermal conductivity [W/m/K]
virtual tmp<symmTensorField> directionalKappa(const label) const
{
notImplemented
(
"directionalKSolidThermo::directionalKappa(const label)"
"const"
); );
return tmp<symmTensorField>(NULL); return tmp<symmTensorField>(NULL);
} }

View File

@ -114,13 +114,13 @@ public:
virtual scalar rho(scalar T, label celli) const = 0; virtual scalar rho(scalar T, label celli) const = 0;
//- Absorption coefficient //- Absorption coefficient
virtual scalar kappa(scalar T, label celli) const = 0; virtual scalar kappaRad(scalar T, label celli) const = 0;
//- Scatter coefficient //- Scatter coefficient
virtual scalar sigmaS(scalar T, label celli) const = 0; virtual scalar sigmaS(scalar T, label celli) const = 0;
//- Thermal conductivity //- Thermal conductivity
virtual scalar K(scalar T, label celli) const = 0; virtual scalar kappa(scalar T, label celli) const = 0;
//- Emissivity coefficient //- Emissivity coefficient
virtual scalar emissivity(scalar T, label celli) const = 0; virtual scalar emissivity(scalar T, label celli) const = 0;

View File

@ -159,7 +159,7 @@ Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::h
template<class ThermoSolidType> template<class ThermoSolidType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::kappa Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::kappaRad
( (
scalar T, label celli scalar T, label celli
) const ) const
@ -167,7 +167,7 @@ Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::kappa
scalar tmp = 0.0; scalar tmp = 0.0;
forAll(solidData_, i) forAll(solidData_, i)
{ {
tmp += solidData_[i].kappa(T)*X(i, celli, T); tmp += solidData_[i].kappaRad(T)*X(i, celli, T);
} }
return tmp; return tmp;
} }
@ -189,7 +189,7 @@ Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::sigmaS
template<class ThermoSolidType> template<class ThermoSolidType>
Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::K Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::kappa
( (
scalar T, label celli scalar T, label celli
) const ) const
@ -197,7 +197,7 @@ Foam::scalar Foam::multiComponentSolidMixture<ThermoSolidType>::K
scalar tmp = 0.0; scalar tmp = 0.0;
forAll(solidData_, i) forAll(solidData_, i)
{ {
tmp += solidData_[i].K(T)*X(i, celli, T); tmp += solidData_[i].kappa(T)*X(i, celli, T);
} }
return tmp; return tmp;
} }

View File

@ -99,13 +99,13 @@ public:
virtual scalar rho(scalar T, label celli) const; virtual scalar rho(scalar T, label celli) const;
//- Absorption coefficient //- Absorption coefficient
virtual scalar kappa(scalar T, label celli) const; virtual scalar kappaRad(scalar T, label celli) const;
//- Scatter coefficient //- Scatter coefficient
virtual scalar sigmaS(scalar T, label celli) const; virtual scalar sigmaS(scalar T, label celli) const;
//- Thermal conductivity //- Thermal conductivity
virtual scalar K(scalar T, label celli) const; virtual scalar kappa(scalar T, label celli) const;
//- Emissivity coefficient //- Emissivity coefficient
virtual scalar emissivity(scalar T, label celli) const; virtual scalar emissivity(scalar T, label celli) const;

View File

@ -34,8 +34,8 @@ void Foam::solidMixtureThermo<MixtureType>::calculate()
{ {
scalarField& rhoCells = rho_.internalField(); scalarField& rhoCells = rho_.internalField();
scalarField& KCells = K_.internalField();
scalarField& kappaCells = kappa_.internalField(); scalarField& kappaCells = kappa_.internalField();
scalarField& kappaRadCells = kappaRad_.internalField();
scalarField& sigmaSCells = sigmaS_.internalField(); scalarField& sigmaSCells = sigmaS_.internalField();
scalarField& emissivityCells = emissivity_.internalField(); scalarField& emissivityCells = emissivity_.internalField();
@ -44,9 +44,9 @@ void Foam::solidMixtureThermo<MixtureType>::calculate()
forAll(iT, celli) forAll(iT, celli)
{ {
rhoCells[celli] = MixtureType::rho(iT[celli], celli); rhoCells[celli] = MixtureType::rho(iT[celli], celli);
kappaCells[celli] = MixtureType::kappa(iT[celli], celli); kappaRadCells[celli] = MixtureType::kappaRad(iT[celli], celli);
sigmaSCells[celli] = MixtureType::sigmaS(iT[celli], celli); sigmaSCells[celli] = MixtureType::sigmaS(iT[celli], celli);
KCells[celli] = MixtureType::K(iT[celli], celli); kappaCells[celli] = MixtureType::kappa(iT[celli], celli);
emissivityCells[celli] = MixtureType::emissivity(iT[celli], celli); emissivityCells[celli] = MixtureType::emissivity(iT[celli], celli);
} }
@ -55,8 +55,8 @@ void Foam::solidMixtureThermo<MixtureType>::calculate()
forAll(bT, patchI) forAll(bT, patchI)
{ {
rho_.boundaryField()[patchI] == this->rho(patchI)(); rho_.boundaryField()[patchI] == this->rho(patchI)();
K_.boundaryField()[patchI] == this->K(patchI)();
kappa_.boundaryField()[patchI] == this->kappa(patchI)(); kappa_.boundaryField()[patchI] == this->kappa(patchI)();
kappaRad_.boundaryField()[patchI] == this->kappaRad(patchI)();
sigmaS_.boundaryField()[patchI] == this->sigmaS(patchI)(); sigmaS_.boundaryField()[patchI] == this->sigmaS(patchI)();
emissivity_.boundaryField()[patchI] == this->emissivity(patchI)(); emissivity_.boundaryField()[patchI] == this->emissivity(patchI)();
} }
@ -109,25 +109,25 @@ Foam::tmp<Foam::scalarField> Foam::solidMixtureThermo<MixtureType>::sigmaS
template<class MixtureType> template<class MixtureType>
Foam::tmp<Foam::scalarField> Foam::solidMixtureThermo<MixtureType>::kappa Foam::tmp<Foam::scalarField> Foam::solidMixtureThermo<MixtureType>::kappaRad
( (
const label patchI const label patchI
) const ) const
{ {
const scalarField& patchT = T_.boundaryField()[patchI]; const scalarField& patchT = T_.boundaryField()[patchI];
const polyPatch& pp = mesh_.boundaryMesh()[patchI]; const polyPatch& pp = mesh_.boundaryMesh()[patchI];
const labelUList& cells = pp.faceCells(); const labelUList& cells = pp.faceCells();
tmp<scalarField> tKappa(new scalarField(patchT.size())); tmp<scalarField> tKappaRad(new scalarField(patchT.size()));
scalarField& kappa = tKappa(); scalarField& kappaRad = tKappaRad();
forAll(patchT, celli) forAll(patchT, celli)
{ {
kappa[celli] = kappaRad[celli] =
MixtureType::kappa(patchT[celli], cells[celli]); MixtureType::kappaRad(patchT[celli], cells[celli]);
} }
return tKappa; return tKappaRad;
} }
@ -163,11 +163,11 @@ Foam::solidMixtureThermo<MixtureType>::solidMixtureThermo
: :
basicSolidThermo(mesh), basicSolidThermo(mesh),
MixtureType(*this, mesh), MixtureType(*this, mesh),
K_ kappa_
( (
IOobject IOobject
( (
"K", "kappa",
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -190,11 +190,11 @@ Foam::solidMixtureThermo<MixtureType>::solidMixtureThermo
: :
basicSolidThermo(mesh, dict), basicSolidThermo(mesh, dict),
MixtureType(*this, mesh), MixtureType(*this, mesh),
K_ kappa_
( (
IOobject IOobject
( (
"K", "kappa",
mesh.time().timeName(), mesh.time().timeName(),
mesh, mesh,
IOobject::NO_READ, IOobject::NO_READ,
@ -225,9 +225,10 @@ void Foam::solidMixtureThermo<MixtureType>::correct()
template<class MixtureType> template<class MixtureType>
Foam::tmp<Foam::volScalarField> Foam::solidMixtureThermo<MixtureType>::K() const Foam::tmp<Foam::volScalarField> Foam::solidMixtureThermo<MixtureType>::
kappa() const
{ {
return K_; return kappa_;
} }
@ -352,7 +353,7 @@ Foam::solidMixtureThermo<MixtureType>::Hf() const
template<class MixtureType> template<class MixtureType>
Foam::tmp<Foam::scalarField> Foam::solidMixtureThermo<MixtureType>::K Foam::tmp<Foam::scalarField> Foam::solidMixtureThermo<MixtureType>::kappa
( (
const label patchI const label patchI
) const ) const
@ -361,15 +362,15 @@ Foam::tmp<Foam::scalarField> Foam::solidMixtureThermo<MixtureType>::K
const polyPatch& pp = mesh_.boundaryMesh()[patchI]; const polyPatch& pp = mesh_.boundaryMesh()[patchI];
const labelUList& cells = pp.faceCells(); const labelUList& cells = pp.faceCells();
tmp<scalarField> tK(new scalarField(patchT.size())); tmp<scalarField> tkappa(new scalarField(patchT.size()));
scalarField& K = tK(); scalarField& kappa = tkappa();
forAll(patchT, celli) forAll(patchT, celli)
{ {
K[celli] = MixtureType::K(patchT[celli], cells[celli]); kappa[celli] = MixtureType::kappa(patchT[celli], cells[celli]);
} }
return tK; return tkappa;
} }

View File

@ -57,7 +57,7 @@ protected:
// Protected data // Protected data
//- Thermal conductivity [W/m/K] //- Thermal conductivity [W/m/K]
volScalarField K_; volScalarField kappa_;
private: private:
@ -74,7 +74,7 @@ private:
tmp<scalarField> sigmaS(const label patchI) const; tmp<scalarField> sigmaS(const label patchI) const;
tmp<scalarField> kappa(const label patchI) const; tmp<scalarField> kappaRad(const label patchI) const;
tmp<scalarField> emissivity(const label patchI) const; tmp<scalarField> emissivity(const label patchI) const;
@ -118,12 +118,12 @@ public:
// Derived thermal properties // Derived thermal properties
//- Thermal conductivity [W/m/K] //- Thermal conductivity [W/m/K]
virtual tmp<volScalarField> K() const; virtual tmp<volScalarField> kappa() const;
//- Thermal conductivity [W/m/K] //- Thermal conductivity [W/m/K]
virtual tmp<volSymmTensorField> directionalK() const virtual tmp<volSymmTensorField> directionalKappa() const
{ {
notImplemented("solidMixtureThermo::directionalK() const"); notImplemented("solidMixtureThermo::directionalKappa() const");
return tmp<volSymmTensorField>(NULL); return tmp<volSymmTensorField>(NULL);
} }
@ -140,14 +140,14 @@ public:
// Per patch calculation // Per patch calculation
//- Thermal conductivity [W/(m.K)] //- Thermal conductivity [W/(m.K)]
virtual tmp<scalarField> K(const label patchI) const; virtual tmp<scalarField> kappa(const label patchI) const;
//- Thermal conductivity [W/(m.K)] //- Thermal conductivity [W/(m.K)]
virtual tmp<symmTensorField> directionalK(const label) const virtual tmp<symmTensorField> directionalKappa(const label) const
{ {
notImplemented notImplemented
( (
"solidMixtureThermo::directionalK(const label) const" "solidMixtureThermo::directionalKappa(const label) const"
); );
return tmp<symmTensorField>(NULL); return tmp<symmTensorField>(NULL);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -49,7 +49,7 @@ void Foam::hPsiMixtureThermo<MixtureType>::calculate()
psiCells[celli] = mixture.psi(pCells[celli], TCells[celli]); psiCells[celli] = mixture.psi(pCells[celli], TCells[celli]);
muCells[celli] = mixture.mu(TCells[celli]); muCells[celli] = mixture.mu(TCells[celli]);
alphaCells[celli] = mixture.alpha(TCells[celli]); alphaCells[celli] = mixture.alphah(TCells[celli]);
} }
forAll(T_.boundaryField(), patchi) forAll(T_.boundaryField(), patchi)
@ -74,7 +74,7 @@ void Foam::hPsiMixtureThermo<MixtureType>::calculate()
ppsi[facei] = mixture.psi(pp[facei], pT[facei]); ppsi[facei] = mixture.psi(pp[facei], pT[facei]);
pmu_[facei] = mixture.mu(pT[facei]); pmu_[facei] = mixture.mu(pT[facei]);
palpha_[facei] = mixture.alpha(pT[facei]); palpha_[facei] = mixture.alphah(pT[facei]);
} }
} }
else else
@ -88,7 +88,7 @@ void Foam::hPsiMixtureThermo<MixtureType>::calculate()
ppsi[facei] = mixture.psi(pp[facei], pT[facei]); ppsi[facei] = mixture.psi(pp[facei], pT[facei]);
pmu_[facei] = mixture.mu(pT[facei]); pmu_[facei] = mixture.mu(pT[facei]);
palpha_[facei] = mixture.alpha(pT[facei]); palpha_[facei] = mixture.alphah(pT[facei]);
} }
} }
} }

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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -98,7 +98,7 @@ void Foam::hhuMixtureThermo<MixtureType>::calculate()
psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]); psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]);
muCells[celli] = mixture_.mu(TCells[celli]); muCells[celli] = mixture_.mu(TCells[celli]);
alphaCells[celli] = mixture_.alpha(TCells[celli]); alphaCells[celli] = mixture_.alphah(TCells[celli]);
TuCells[celli] = TuCells[celli] =
this->cellReactants(celli).TH(huCells[celli], TuCells[celli]); this->cellReactants(celli).TH(huCells[celli], TuCells[celli]);
@ -128,7 +128,7 @@ void Foam::hhuMixtureThermo<MixtureType>::calculate()
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu_[facei] = mixture_.mu(pT[facei]); pmu_[facei] = mixture_.mu(pT[facei]);
palpha_[facei] = mixture_.alpha(pT[facei]); palpha_[facei] = mixture_.alphah(pT[facei]);
} }
} }
else else
@ -142,7 +142,7 @@ void Foam::hhuMixtureThermo<MixtureType>::calculate()
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu_[facei] = mixture_.mu(pT[facei]); pmu_[facei] = mixture_.mu(pT[facei]);
palpha_[facei] = mixture_.alpha(pT[facei]); palpha_[facei] = mixture_.alphah(pT[facei]);
pTu[facei] = pTu[facei] =
this->patchFaceReactants(patchi, facei) this->patchFaceReactants(patchi, facei)

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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -84,7 +84,7 @@ void Foam::hsPsiMixtureThermo<MixtureType>::calculate()
psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]); psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]);
muCells[celli] = mixture_.mu(TCells[celli]); muCells[celli] = mixture_.mu(TCells[celli]);
alphaCells[celli] = mixture_.alpha(TCells[celli]); alphaCells[celli] = mixture_.alphah(TCells[celli]);
} }
forAll(T_.boundaryField(), patchi) forAll(T_.boundaryField(), patchi)
@ -109,7 +109,7 @@ void Foam::hsPsiMixtureThermo<MixtureType>::calculate()
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu_[facei] = mixture_.mu(pT[facei]); pmu_[facei] = mixture_.mu(pT[facei]);
palpha_[facei] = mixture_.alpha(pT[facei]); palpha_[facei] = mixture_.alphah(pT[facei]);
} }
} }
else else
@ -123,7 +123,7 @@ void Foam::hsPsiMixtureThermo<MixtureType>::calculate()
ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]);
pmu_[facei] = mixture_.mu(pT[facei]); pmu_[facei] = mixture_.mu(pT[facei]);
palpha_[facei] = mixture_.alpha(pT[facei]); palpha_[facei] = mixture_.alphah(pT[facei]);
} }
} }
} }

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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -166,8 +166,13 @@ public:
//- Thermal conductivity [W/m/K] //- Thermal conductivity [W/m/K]
virtual scalar kappa(const label specieI, const scalar T) const = 0; virtual scalar kappa(const label specieI, const scalar T) const = 0;
//- Thermal diffusivity [kg/m/s] //- Thermal diffusivity enthalpy [kg/m/s]
virtual scalar alpha(const label specieI, const scalar T) const = 0; virtual scalar alphah(const label specieI, const scalar T) const
= 0;
//- Thermal diffusivity internal energy [kg/m/s]
virtual scalar alphae(const label specieI, const scalar T) const
= 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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -272,13 +272,24 @@ Foam::scalar Foam::dieselMixture<ThermoType>::kappa
template<class ThermoType> template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::alpha Foam::scalar Foam::dieselMixture<ThermoType>::alphah
( (
const label specieI, const label specieI,
const scalar T const scalar T
) const ) const
{ {
return getLocalThermo(specieI).alpha(T); return getLocalThermo(specieI).alphah(T);
}
template<class ThermoType>
Foam::scalar Foam::dieselMixture<ThermoType>::alphae
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).alphae(T);
} }

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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -203,8 +203,11 @@ public:
//- Thermal conductivity [W/m/K] //- Thermal conductivity [W/m/K]
virtual scalar kappa(const label specieI, const scalar T) const; virtual scalar kappa(const label specieI, const scalar T) const;
//- Thermal diffusivity [kg/m/s] //- Thermal diffusivity for enthalpy [kg/m/s]
virtual scalar alpha(const label specieI, const scalar T) const; virtual scalar alphah(const label specieI, const scalar T) const;
//- Thermal diffusivity for internal energy [kg/m/s]
virtual scalar alphae(const label specieI, const scalar T) 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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -282,13 +282,24 @@ Foam::scalar Foam::egrMixture<ThermoType>::kappa
template<class ThermoType> template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::alpha Foam::scalar Foam::egrMixture<ThermoType>::alphah
( (
const label specieI, const label specieI,
const scalar T const scalar T
) const ) const
{ {
return getLocalThermo(specieI).alpha(T); return getLocalThermo(specieI).alphah(T);
}
template<class ThermoType>
Foam::scalar Foam::egrMixture<ThermoType>::alphae
(
const label specieI,
const scalar T
) const
{
return getLocalThermo(specieI).alphae(T);
} }

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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -219,8 +219,11 @@ public:
//- Thermal conductivity [W/m/K] //- Thermal conductivity [W/m/K]
virtual scalar kappa(const label specieI, const scalar T) const; virtual scalar kappa(const label specieI, const scalar T) const;
//- Thermal diffusivity [kg/m/s] //- Thermal diffusivity enthalpy [kg/m/s]
virtual scalar alpha(const label specieI, const scalar T) const; virtual scalar alphah(const label specieI, const scalar T) const;
//- Thermal diffusivity internal energy [kg/m/s]
virtual scalar alphae(const label specieI, const scalar T) const;
}; };

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