mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://dm/home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -31,7 +31,7 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "psiThermo.H"
|
||||
#include "rhoThermo.H"
|
||||
#include "RASModel.H"
|
||||
#include "radiationModel.H"
|
||||
#include "simpleControl.H"
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
|
||||
autoPtr<psiThermo> pThermo
|
||||
autoPtr<rhoThermo> pThermo
|
||||
(
|
||||
psiThermo::New(mesh)
|
||||
rhoThermo::New(mesh)
|
||||
);
|
||||
psiThermo& thermo = pThermo();
|
||||
rhoThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
volScalarField rho
|
||||
|
||||
34
applications/solvers/heatTransfer/thermoFoam/EEqn.H
Normal file
34
applications/solvers/heatTransfer/thermoFoam/EEqn.H
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
volScalarField& he = thermo.he();
|
||||
|
||||
fvScalarMatrix EEqn
|
||||
(
|
||||
fvm::ddt(rho, he) + fvm::div(phi, he)
|
||||
+ fvc::ddt(rho, K) + fvc::div(phi, K)
|
||||
+ (
|
||||
he.name() == "e"
|
||||
? fvc::div
|
||||
(
|
||||
fvc::absolute(phi/fvc::interpolate(rho), U),
|
||||
p,
|
||||
"div(phiv,p)"
|
||||
)
|
||||
: -dpdt
|
||||
)
|
||||
- fvm::laplacian(alphaEff, he)
|
||||
==
|
||||
radiation->Sh(thermo)
|
||||
+ fvOptions(rho, he)
|
||||
);
|
||||
|
||||
EEqn.relax();
|
||||
|
||||
fvOptions.constrain(EEqn);
|
||||
|
||||
EEqn.solve();
|
||||
|
||||
fvOptions.correct(he);
|
||||
|
||||
thermo.correct();
|
||||
radiation->correct();
|
||||
}
|
||||
3
applications/solvers/heatTransfer/thermoFoam/Make/files
Normal file
3
applications/solvers/heatTransfer/thermoFoam/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
thermoFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/thermoFoam
|
||||
24
applications/solvers/heatTransfer/thermoFoam/Make/options
Normal file
24
applications/solvers/heatTransfer/thermoFoam/Make/options
Normal file
@ -0,0 +1,24 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/fvOptions/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lsampling \
|
||||
-lmeshTools \
|
||||
-lfvOptions \
|
||||
-lfluidThermophysicalModels \
|
||||
-lradiationModels \
|
||||
-lspecie \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleLESModels
|
||||
54
applications/solvers/heatTransfer/thermoFoam/createFields.H
Normal file
54
applications/solvers/heatTransfer/thermoFoam/createFields.H
Normal file
@ -0,0 +1,54 @@
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
|
||||
autoPtr<rhoThermo> pThermo(rhoThermo::New(mesh));
|
||||
rhoThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
thermo.rho()
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
|
||||
#include "setAlphaEff.H"
|
||||
|
||||
Info<< "Creating field dpdt\n" << endl;
|
||||
volScalarField dpdt
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"dpdt",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
|
||||
);
|
||||
|
||||
Info<< "Creating field kinetic energy K\n" << endl;
|
||||
volScalarField K("K", 0.5*magSqr(U));
|
||||
93
applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H
Normal file
93
applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H
Normal file
@ -0,0 +1,93 @@
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
tmp<volScalarField> talphaEff;
|
||||
|
||||
IOobject turbulenceHeader
|
||||
(
|
||||
"turbulenceProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
IOobject RASHeader
|
||||
(
|
||||
"RASProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
IOobject LESHeader
|
||||
(
|
||||
"LESProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
if (turbulenceHeader.headerOk())
|
||||
{
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
(
|
||||
compressible::turbulenceModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
talphaEff = turbulence->alphaEff();
|
||||
}
|
||||
else if (RASHeader.headerOk())
|
||||
{
|
||||
autoPtr<compressible::RASModel> turbulence
|
||||
(
|
||||
compressible::RASModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
talphaEff = turbulence->alphaEff();
|
||||
}
|
||||
else if (LESHeader.headerOk())
|
||||
{
|
||||
autoPtr<compressible::LESModel> turbulence
|
||||
(
|
||||
compressible::LESModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
talphaEff = turbulence->alphaEff();
|
||||
}
|
||||
else
|
||||
{
|
||||
talphaEff = tmp<volScalarField>
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"alphaEff",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("0", dimMass/dimLength/dimTime, 0.0)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
const volScalarField& alphaEff = talphaEff();
|
||||
107
applications/solvers/heatTransfer/thermoFoam/thermoFoam.C
Normal file
107
applications/solvers/heatTransfer/thermoFoam/thermoFoam.C
Normal file
@ -0,0 +1,107 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 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
|
||||
thermoFoam
|
||||
|
||||
Description
|
||||
Evolves the thermodynamics on a forzen flow field
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "rhoThermo.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "RASModel.H"
|
||||
#include "LESModel.H"
|
||||
#include "radiationModel.H"
|
||||
#include "fvIOoptionList.H"
|
||||
#include "simpleControl.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "setRootCase.H"
|
||||
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createFields.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "createRadiationModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nEvolving thermodynamics\n" << endl;
|
||||
|
||||
if (mesh.solutionDict().found("SIMPLE"))
|
||||
{
|
||||
simpleControl simple(mesh);
|
||||
|
||||
while (simple.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
while (simple.correctNonOrthogonal())
|
||||
{
|
||||
#include "EEqn.H"
|
||||
}
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
runTime.write();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
runTime++;
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
#include "EEqn.H"
|
||||
}
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
runTime.write();
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user