From f90380150281e6c76ebe2392c000cf20d7ba0d2d Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 5 Feb 2009 15:36:56 +0000 Subject: [PATCH] forgot to commit new files --- .../fluid/compressibleContinuityErrors.H | 21 ++++++++ .../fluid/compressibleCourantNo.H | 49 +++++++++++++++++++ .../fluid/initContinuityErrs.H | 1 + .../fluid/setRegionFluidFields.H | 18 +++++++ .../solid/setRegionSolidFields.H | 6 +++ 5 files changed, 95 insertions(+) create mode 100644 applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleContinuityErrors.H create mode 100644 applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.H create mode 100644 applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/initContinuityErrs.H create mode 100644 applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H create mode 100644 applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleContinuityErrors.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleContinuityErrors.H new file mode 100644 index 0000000000..046ca5ec37 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleContinuityErrors.H @@ -0,0 +1,21 @@ +{ + dimensionedScalar totalMass = fvc::domainIntegrate(rho); + + scalar sumLocalContErr = + ( + fvc::domainIntegrate(mag(rho - thermo.rho()))/totalMass + ).value(); + + scalar globalContErr = + ( + fvc::domainIntegrate(rho - thermo.rho())/totalMass + ).value(); + + cumulativeContErr[i] += globalContErr; + + Info<< "time step continuity errors (" << mesh.name() << ")" + << ": sum local = " << sumLocalContErr + << ", global = " << globalContErr + << ", cumulative = " << cumulativeContErr[i] + << endl; +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.H new file mode 100644 index 0000000000..4bdfb84fcb --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 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 + +Description + Calculates and outputs the mean and maximum Courant Numbers for the fluid + regions + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleCourantNo_H +#define compressibleCourantNo_H + +#include "fvMesh.H" + +namespace Foam +{ + scalar compressibleCourantNo + ( + const fvMesh& mesh, + const Time& runTime, + const volScalarField& rho, + const surfaceScalarField& phi + ); +} + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/initContinuityErrs.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/initContinuityErrs.H new file mode 100644 index 0000000000..1a7f5a3262 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/initContinuityErrs.H @@ -0,0 +1 @@ +List cumulativeContErr(fluidRegions.size(), 0.0); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H new file mode 100644 index 0000000000..bc4590a428 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H @@ -0,0 +1,18 @@ + const fvMesh& mesh = fluidRegions[i]; + + basicThermo& thermo = thermoFluid[i]; + volScalarField& rho = rhoFluid[i]; + volScalarField& K = KFluid[i]; + volVectorField& U = UFluid[i]; + surfaceScalarField phi = phiFluid[i]; + compressible::turbulenceModel& turb = turbulence[i]; + volScalarField& DpDt = DpDtFluid[i]; + const volScalarField& gh = ghFluid[i]; + const surfaceScalarField& ghf = ghfFluid[i]; + volScalarField& pd = pdFluid[i]; + + volScalarField& p = thermo.p(); + const volScalarField& psi = thermo.psi(); + volScalarField& h = thermo.h(); + + const dimensionedScalar massIni("massIni", dimMass, initialMassFluid[i]); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H new file mode 100644 index 0000000000..04c90d2c4c --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H @@ -0,0 +1,6 @@ +// fvMesh& mesh = solidRegions[i]; + + volScalarField& rho = rhos[i]; + volScalarField& cp = cps[i]; + volScalarField& K = Ks[i]; + volScalarField& T = Ts[i];