2010-05-12 13:27:55 +00:00
|
|
|
/*---------------------------------------------------------------------------*\
|
|
|
|
========= |
|
|
|
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
|
|
\\ / O peration |
|
2013-07-17 13:57:27 +00:00
|
|
|
\\ / A nd | Copyright (C) 2008-2011 H. Jasak & H. Rusche
|
|
|
|
\\/ M anipulation | All rights reserved
|
2010-05-12 13:27:55 +00:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
License
|
|
|
|
This file is part of OpenFOAM.
|
|
|
|
|
|
|
|
OpenFOAM is free software; you can redistribute it and/or modify it
|
|
|
|
under the terms of the GNU General Public License as published by the
|
|
|
|
Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
option) any later version.
|
|
|
|
|
|
|
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
|
|
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
|
|
|
Application
|
2013-07-17 13:57:27 +00:00
|
|
|
chipAirCoolingFoam
|
2010-10-18 13:15:37 +00:00
|
|
|
|
2010-05-12 13:27:55 +00:00
|
|
|
Description
|
2013-07-17 13:57:27 +00:00
|
|
|
Transient solver for buoyancy-driven turbulent flow of incompressible
|
|
|
|
Newtonian fluids with conjugate heat transfer, complex heat conduction
|
|
|
|
and radiation
|
2010-05-12 13:27:55 +00:00
|
|
|
|
|
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#include "fvCFD.H"
|
|
|
|
#include "coupledFvMatrices.H"
|
|
|
|
#include "regionCouplePolyPatch.H"
|
2013-07-17 13:57:27 +00:00
|
|
|
#include "radiationModel.H"
|
|
|
|
#include "thermalModel.H"
|
|
|
|
#include "singlePhaseTransportModel.H"
|
|
|
|
#include "RASModel.H"
|
2010-05-12 13:27:55 +00:00
|
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
# include "setRootCase.H"
|
|
|
|
# include "createTime.H"
|
|
|
|
# include "createFluidMesh.H"
|
|
|
|
# include "createSolidMesh.H"
|
2013-07-17 13:57:27 +00:00
|
|
|
# include "readGravitationalAcceleration.H"
|
2010-05-12 13:27:55 +00:00
|
|
|
# include "createFields.H"
|
|
|
|
# include "createSolidFields.H"
|
|
|
|
# include "initContinuityErrs.H"
|
2013-07-17 13:57:27 +00:00
|
|
|
# include "readTimeControls.H"
|
|
|
|
# include "CourantNo.H"
|
|
|
|
# include "setInitialDeltaT.H"
|
2010-05-12 13:27:55 +00:00
|
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
|
|
|
|
Info<< "\nStarting time loop\n" << endl;
|
|
|
|
|
2013-07-17 13:57:27 +00:00
|
|
|
while (runTime.loop())
|
2010-05-12 13:27:55 +00:00
|
|
|
{
|
|
|
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
|
|
|
|
2013-07-17 13:57:27 +00:00
|
|
|
# include "readTimeControls.H"
|
|
|
|
# include "readPISOControls.H"
|
|
|
|
# include "CourantNo.H"
|
|
|
|
# include "setDeltaT.H"
|
|
|
|
|
|
|
|
// Detach patches
|
|
|
|
# include "detachPatches.H"
|
|
|
|
|
|
|
|
# include "UEqn.H"
|
|
|
|
|
|
|
|
p_rgh.storePrevIter();
|
|
|
|
|
|
|
|
for (int corr = 0; corr < nCorr; corr++)
|
|
|
|
{
|
|
|
|
# include "pEqn.H"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Update turbulent quantities
|
|
|
|
turbulence->correct();
|
|
|
|
|
|
|
|
radiation->correct();
|
|
|
|
|
|
|
|
// Update thermal conductivity in the fluid
|
|
|
|
kappaEff = rho*Cp*(turbulence->nu()/Pr + turbulence->nut()/Prt);
|
|
|
|
|
|
|
|
// Update thermal conductivity in the solid
|
|
|
|
solidThermo.correct();
|
|
|
|
ksolid = solidThermo.k();
|
|
|
|
|
|
|
|
rhoCpsolid.oldTime();
|
|
|
|
rhoCpsolid = solidThermo.rho()*solidThermo.C();
|
|
|
|
|
|
|
|
// Coupled patches
|
|
|
|
# include "attachPatches.H"
|
|
|
|
|
|
|
|
kappaEff.correctBoundaryConditions();
|
|
|
|
ksolid.correctBoundaryConditions();
|
|
|
|
|
|
|
|
// Interpolate to the faces and add thermal resistance
|
|
|
|
surfaceScalarField ksolidf = fvc::interpolate(ksolid);
|
|
|
|
solidThermo.modifyResistance(ksolidf);
|
|
|
|
|
2010-05-12 13:27:55 +00:00
|
|
|
# include "solveEnergy.H"
|
|
|
|
|
2013-07-17 13:57:27 +00:00
|
|
|
// Update density according to Boussinesq approximation
|
|
|
|
rhok = 1.0 - beta*(T - TRef);
|
|
|
|
|
2010-05-12 13:27:55 +00:00
|
|
|
runTime.write();
|
|
|
|
|
|
|
|
Info<< "ExecutionTime = "
|
|
|
|
<< runTime.elapsedCpuTime()
|
|
|
|
<< " s\n\n" << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
Info<< "End\n" << endl;
|
|
|
|
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ************************************************************************* //
|