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:
@ -30,7 +30,7 @@ Description
|
|||||||
|
|
||||||
Sub-models include:
|
Sub-models include:
|
||||||
- turbulence modelling, i.e. laminar, RAS or LES
|
- turbulence modelling, i.e. laminar, RAS or LES
|
||||||
- run-time selectable fvOptions, e.g. MRF, explicit porosity
|
- run-time selectable finitie volume options, e.g. MRF, explicit porosity
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ cd ${0%/*} || exit 1 # run from this directory
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
wmake
|
wmake
|
||||||
|
wmake simpleReactingParcelFoam
|
||||||
wmake LTSReactingParcelFoam
|
wmake LTSReactingParcelFoam
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
# ----------------------------------------------------------------- end-of-file
|
||||||
|
|||||||
@ -28,7 +28,7 @@ Description
|
|||||||
Local time stepping (LTS) solver for steady, compressible, laminar or
|
Local time stepping (LTS) solver for steady, compressible, laminar or
|
||||||
turbulent reacting and non-reacting flow with multiphase Lagrangian
|
turbulent reacting and non-reacting flow with multiphase Lagrangian
|
||||||
parcels and porous media, including run-time selectable finitite volume
|
parcels and porous media, including run-time selectable finitite volume
|
||||||
options, e.g. fvOptions, constraints
|
options, e.g. sources, constraints
|
||||||
|
|
||||||
Note: ddtPhiCorr not used here when porous zones are active
|
Note: ddtPhiCorr not used here when porous zones are active
|
||||||
- not well defined for porous calculations
|
- not well defined for porous calculations
|
||||||
|
|||||||
@ -22,12 +22,12 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Application
|
Application
|
||||||
porousExplicitSourceReactingParcelFoam
|
reactingParcelFoam
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Transient PIMPLE solver for compressible, laminar or turbulent flow with
|
Transient PIMPLE solver for compressible, laminar or turbulent flow with
|
||||||
reacting multiphase Lagrangian parcels, including run-time selectable
|
reacting multiphase Lagrangian parcels, including run-time selectable
|
||||||
finite volume options, e.g. fvOptions, constraints
|
finite volume options, e.g. sources, constraints
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
volScalarField& he = thermo.he();
|
||||||
|
|
||||||
|
fvScalarMatrix EEqn
|
||||||
|
(
|
||||||
|
mvConvection->fvmDiv(phi, he)
|
||||||
|
+ (
|
||||||
|
he.name() == "e"
|
||||||
|
? fvc::div(phi, volScalarField("Ekp", 0.5*magSqr(U) + p/rho))
|
||||||
|
: fvc::div(phi, volScalarField("K", 0.5*magSqr(U)))
|
||||||
|
)
|
||||||
|
- fvm::laplacian(turbulence->alphaEff(), he)
|
||||||
|
==
|
||||||
|
parcels.Sh(he)
|
||||||
|
+ radiation->Sh(thermo)
|
||||||
|
+ combustion->Sh()
|
||||||
|
+ fvOptions(rho, he)
|
||||||
|
);
|
||||||
|
|
||||||
|
EEqn.relax();
|
||||||
|
|
||||||
|
fvOptions.constrain(EEqn);
|
||||||
|
|
||||||
|
EEqn.solve();
|
||||||
|
|
||||||
|
fvOptions.correct(he);
|
||||||
|
thermo.correct();
|
||||||
|
radiation->correct();
|
||||||
|
|
||||||
|
Info<< "T gas min/max = " << min(T).value() << ", "
|
||||||
|
<< max(T).value() << endl;
|
||||||
|
}
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
simpleReactingParcelFoam.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_APPBIN)/simpleReactingParcelFoam
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I${LIB_SRC}/meshTools/lnInclude \
|
||||||
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
|
-I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
|
||||||
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
||||||
|
-I$(LIB_SRC)/ODE/lnInclude \
|
||||||
|
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||||
|
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||||
|
-I$(LIB_SRC)/combustionModels/lnInclude \
|
||||||
|
-I$(LIB_SRC)/fvOptions/lnInclude \
|
||||||
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
|
-I$(FOAM_SOLVERS)/combustion/reactingFoam
|
||||||
|
|
||||||
|
|
||||||
|
EXE_LIBS = \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lmeshTools \
|
||||||
|
-lcompressibleTurbulenceModel \
|
||||||
|
-lcompressibleRASModels \
|
||||||
|
-lcompressibleLESModels \
|
||||||
|
-llagrangian \
|
||||||
|
-llagrangianIntermediate \
|
||||||
|
-lspecie \
|
||||||
|
-lfluidThermophysicalModels \
|
||||||
|
-lliquidProperties \
|
||||||
|
-lliquidMixtureProperties \
|
||||||
|
-lsolidProperties \
|
||||||
|
-lsolidMixtureProperties \
|
||||||
|
-lthermophysicalFunctions \
|
||||||
|
-lreactionThermophysicalModels \
|
||||||
|
-lSLGThermo \
|
||||||
|
-lchemistryModel \
|
||||||
|
-lradiationModels \
|
||||||
|
-lODE \
|
||||||
|
-lregionModels \
|
||||||
|
-lsurfaceFilmModels \
|
||||||
|
-lcombustionModels \
|
||||||
|
-lfvOptions \
|
||||||
|
-lsampling
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
tmp<fvVectorMatrix> UEqn
|
||||||
|
(
|
||||||
|
fvm::div(phi, U)
|
||||||
|
+ turbulence->divDevRhoReff(U)
|
||||||
|
==
|
||||||
|
rho.dimensionedInternalField()*g
|
||||||
|
+ parcels.SU(U)
|
||||||
|
+ fvOptions(rho, U)
|
||||||
|
);
|
||||||
|
|
||||||
|
UEqn().relax();
|
||||||
|
|
||||||
|
fvOptions.constrain(UEqn());
|
||||||
|
|
||||||
|
solve(UEqn() == -fvc::grad(p));
|
||||||
|
|
||||||
|
fvOptions.correct(U);
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
tmp<fv::convectionScheme<scalar> > mvConvection
|
||||||
|
(
|
||||||
|
fv::convectionScheme<scalar>::New
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
fields,
|
||||||
|
phi,
|
||||||
|
mesh.divScheme("div(phi,Yi_h)")
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
{
|
||||||
|
combustion->correct();
|
||||||
|
dQ = combustion->dQ();
|
||||||
|
label inertIndex = -1;
|
||||||
|
volScalarField Yt(0.0*Y[0]);
|
||||||
|
|
||||||
|
forAll(Y, i)
|
||||||
|
{
|
||||||
|
if (Y[i].name() != inertSpecie)
|
||||||
|
{
|
||||||
|
volScalarField& Yi = Y[i];
|
||||||
|
|
||||||
|
fvScalarMatrix YEqn
|
||||||
|
(
|
||||||
|
mvConvection->fvmDiv(phi, Yi)
|
||||||
|
- fvm::laplacian(turbulence->muEff(), Yi)
|
||||||
|
==
|
||||||
|
parcels.SYi(i, Yi)
|
||||||
|
+ combustion->R(Yi)
|
||||||
|
+ fvOptions(rho, Yi)
|
||||||
|
);
|
||||||
|
|
||||||
|
YEqn.relax();
|
||||||
|
|
||||||
|
fvOptions.constrain(YEqn);
|
||||||
|
|
||||||
|
YEqn.solve(mesh.solver("Yi"));
|
||||||
|
|
||||||
|
fvOptions.correct(Yi);
|
||||||
|
|
||||||
|
Yi.max(0.0);
|
||||||
|
Yt += Yi;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
inertIndex = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Y[inertIndex] = scalar(1) - Yt;
|
||||||
|
Y[inertIndex].max(0.0);
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
Info<< "\nConstructing reacting cloud" << endl;
|
||||||
|
basicReactingMultiphaseCloud parcels
|
||||||
|
(
|
||||||
|
"reactingCloud1",
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
g,
|
||||||
|
slgThermo
|
||||||
|
);
|
||||||
@ -0,0 +1,98 @@
|
|||||||
|
Info<< "Creating combustion model\n" << endl;
|
||||||
|
|
||||||
|
autoPtr<combustionModels::rhoCombustionModel> combustion
|
||||||
|
(
|
||||||
|
combustionModels::rhoCombustionModel::New(mesh)
|
||||||
|
);
|
||||||
|
|
||||||
|
rhoReactionThermo& thermo = combustion->thermo();
|
||||||
|
thermo.validate(args.executable(), "h", "e");
|
||||||
|
|
||||||
|
SLGThermo slgThermo(mesh, thermo);
|
||||||
|
|
||||||
|
basicMultiComponentMixture& composition = thermo.composition();
|
||||||
|
PtrList<volScalarField>& Y = composition.Y();
|
||||||
|
|
||||||
|
const word inertSpecie(thermo.lookup("inertSpecie"));
|
||||||
|
|
||||||
|
if (!composition.contains(inertSpecie))
|
||||||
|
{
|
||||||
|
FatalErrorIn(args.executable())
|
||||||
|
<< "Specified inert specie '" << inertSpecie << "' not found in "
|
||||||
|
<< "species list. Available species:" << composition.species()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
volScalarField& p = thermo.p();
|
||||||
|
const volScalarField& T = thermo.T();
|
||||||
|
const volScalarField& psi = thermo.psi();
|
||||||
|
|
||||||
|
volScalarField rho
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rho",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
thermo.rho()
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< "\nReading field U\n" << endl;
|
||||||
|
volVectorField U
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"U",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
#include "compressibleCreatePhi.H"
|
||||||
|
|
||||||
|
dimensionedScalar rhoMax(simple.dict().lookup("rhoMax"));
|
||||||
|
dimensionedScalar rhoMin(simple.dict().lookup("rhoMin"));
|
||||||
|
|
||||||
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
|
autoPtr<compressible::turbulenceModel> turbulence
|
||||||
|
(
|
||||||
|
compressible::turbulenceModel::New
|
||||||
|
(
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
phi,
|
||||||
|
thermo
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Set the turbulence into the combustion model
|
||||||
|
combustion->setTurbulence(turbulence());
|
||||||
|
|
||||||
|
Info<< "Creating multi-variate interpolation scheme\n" << endl;
|
||||||
|
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||||
|
|
||||||
|
forAll(Y, i)
|
||||||
|
{
|
||||||
|
fields.add(Y[i]);
|
||||||
|
}
|
||||||
|
fields.add(thermo.he());
|
||||||
|
|
||||||
|
volScalarField dQ
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"dQ",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh,
|
||||||
|
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
|
||||||
|
);
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
{
|
||||||
|
rho = thermo.rho();
|
||||||
|
|
||||||
|
// Thermodynamic density needs to be updated by psi*d(p) after the
|
||||||
|
// pressure solution - done in 2 parts. Part 1:
|
||||||
|
thermo.rho() -= psi*p;
|
||||||
|
|
||||||
|
volScalarField rAU(1.0/UEqn().A());
|
||||||
|
volVectorField HbyA("HbyA", U);
|
||||||
|
HbyA = rAU*UEqn().H();
|
||||||
|
|
||||||
|
UEqn.clear();
|
||||||
|
|
||||||
|
surfaceScalarField phiHbyA
|
||||||
|
(
|
||||||
|
"phiHbyA",
|
||||||
|
fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf())
|
||||||
|
);
|
||||||
|
|
||||||
|
fvOptions.relativeFlux(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
|
while (simple.correctNonOrthogonal())
|
||||||
|
{
|
||||||
|
fvScalarMatrix pEqn
|
||||||
|
(
|
||||||
|
fvc::div(phiHbyA)
|
||||||
|
- fvm::laplacian(rho*rAU, p)
|
||||||
|
==
|
||||||
|
parcels.Srho()
|
||||||
|
+ fvOptions(psi, p, rho.name())
|
||||||
|
);
|
||||||
|
|
||||||
|
fvOptions.constrain(pEqn);
|
||||||
|
|
||||||
|
pEqn.solve();
|
||||||
|
|
||||||
|
if (simple.finalNonOrthogonalIter())
|
||||||
|
{
|
||||||
|
phi = phiHbyA + pEqn.flux();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p.relax();
|
||||||
|
|
||||||
|
// Second part of thermodynamic density update
|
||||||
|
thermo.rho() += psi*p;
|
||||||
|
|
||||||
|
#include "compressibleContinuityErrs.H"
|
||||||
|
|
||||||
|
U = HbyA - rAU*fvc::grad(p);
|
||||||
|
U.correctBoundaryConditions();
|
||||||
|
fvOptions.correct(U);
|
||||||
|
|
||||||
|
rho = thermo.rho();
|
||||||
|
rho = max(rho, rhoMin);
|
||||||
|
rho = min(rho, rhoMax);
|
||||||
|
|
||||||
|
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
|
||||||
|
}
|
||||||
@ -0,0 +1,95 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / 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
|
||||||
|
simpleReactingParcelFoam
|
||||||
|
|
||||||
|
Description
|
||||||
|
Steady state SIMPLE solver for compressible, laminar or turbulent flow with
|
||||||
|
reacting multiphase Lagrangian parcels, including run-time selectable
|
||||||
|
finite volume options, e.g. sources, constraints
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "fvCFD.H"
|
||||||
|
#include "turbulenceModel.H"
|
||||||
|
#include "basicReactingMultiphaseCloud.H"
|
||||||
|
#include "rhoCombustionModel.H"
|
||||||
|
#include "radiationModel.H"
|
||||||
|
#include "IOporosityModelList.H"
|
||||||
|
#include "fvIOoptionList.H"
|
||||||
|
#include "SLGThermo.H"
|
||||||
|
#include "simpleControl.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
#include "setRootCase.H"
|
||||||
|
|
||||||
|
#include "createTime.H"
|
||||||
|
#include "createMesh.H"
|
||||||
|
#include "readGravitationalAcceleration.H"
|
||||||
|
|
||||||
|
simpleControl simple(mesh);
|
||||||
|
|
||||||
|
#include "createFields.H"
|
||||||
|
#include "createRadiationModel.H"
|
||||||
|
#include "createClouds.H"
|
||||||
|
#include "createFvOptions.H"
|
||||||
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
while (simple.loop())
|
||||||
|
{
|
||||||
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
parcels.evolve();
|
||||||
|
|
||||||
|
// --- Pressure-velocity SIMPLE corrector loop
|
||||||
|
{
|
||||||
|
#include "UEqn.H"
|
||||||
|
#include "YEqn.H"
|
||||||
|
#include "EEqn.H"
|
||||||
|
#include "pEqn.H"
|
||||||
|
}
|
||||||
|
|
||||||
|
turbulence->correct();
|
||||||
|
|
||||||
|
runTime.write();
|
||||||
|
|
||||||
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
|
<< nl << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -38,94 +38,6 @@ Description
|
|||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
|
|
||||||
// return
|
|
||||||
// 0: no match
|
|
||||||
// +1: identical
|
|
||||||
// -1: same face, but different orientation
|
|
||||||
label compare(const face& a, const face& b)
|
|
||||||
{
|
|
||||||
// Basic rule: we assume that the sequence of labels in each list
|
|
||||||
// will be circular in the same order (but not necessarily in the
|
|
||||||
// same direction or from the same starting point).
|
|
||||||
|
|
||||||
// Trivial reject: faces are different size
|
|
||||||
label sizeA = a.size();
|
|
||||||
label sizeB = b.size();
|
|
||||||
|
|
||||||
if (sizeA != sizeB || sizeA == 0)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
const_circulator<face> aCirc(a);
|
|
||||||
const_circulator<face> bCirc(b);
|
|
||||||
|
|
||||||
// Rotate face b until its element matches the starting element of face a.
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (aCirc() == bCirc())
|
|
||||||
{
|
|
||||||
// Set bCirc fulcrum to its iterator and increment the iterators
|
|
||||||
bCirc.setFulcrumToIterator();
|
|
||||||
++aCirc;
|
|
||||||
++bCirc;
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} while (bCirc.circulate(CirculatorBase::CLOCKWISE));
|
|
||||||
|
|
||||||
// Look forwards around the faces for a match
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (aCirc() != bCirc())
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while
|
|
||||||
(
|
|
||||||
aCirc.circulate(CirculatorBase::CLOCKWISE),
|
|
||||||
bCirc.circulate(CirculatorBase::CLOCKWISE)
|
|
||||||
);
|
|
||||||
|
|
||||||
// If the circulator has stopped then faces a and b matched.
|
|
||||||
if (!aCirc.circulate())
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Reset the circulators back to their fulcrum
|
|
||||||
aCirc.setIteratorToFulcrum();
|
|
||||||
bCirc.setIteratorToFulcrum();
|
|
||||||
++aCirc;
|
|
||||||
--bCirc;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Look backwards around the faces for a match
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (aCirc() != bCirc())
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while
|
|
||||||
(
|
|
||||||
aCirc.circulate(CirculatorBase::CLOCKWISE),
|
|
||||||
bCirc.circulate(CirculatorBase::ANTICLOCKWISE)
|
|
||||||
);
|
|
||||||
|
|
||||||
// If the circulator has stopped then faces a and b matched.
|
|
||||||
if (!aCirc.circulate())
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
// Main program:
|
// Main program:
|
||||||
|
|
||||||
@ -184,40 +96,44 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< nl << nl << "Compare two faces: " << endl;
|
Info<< nl << nl << "Compare two faces: " << endl;
|
||||||
face a(identity(5));
|
face a(identity(5));
|
||||||
Info<< "Compare " << a << " and " << a << " Match = " << compare(a, a)
|
Info<< "Compare " << a << " and " << a << " Match = " << face::compare(a, a)
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
face b(reverseList(a));
|
face b(reverseList(a));
|
||||||
Info<< "Compare " << a << " and " << b << " Match = " << compare(a, b)
|
Info<< "Compare " << a << " and " << b << " Match = " << face::compare(a, b)
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
face c(a);
|
face c(a);
|
||||||
c[4] = 3;
|
c[4] = 3;
|
||||||
Info<< "Compare " << a << " and " << c << " Match = " << compare(a, c)
|
Info<< "Compare " << a << " and " << c << " Match = " << face::compare(a, c)
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
face d(rotateList(a, 2));
|
face d(rotateList(a, 2));
|
||||||
Info<< "Compare " << a << " and " << d << " Match = " << compare(a, d)
|
Info<< "Compare " << a << " and " << d << " Match = " << face::compare(a, d)
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
face g(labelList(5, 1));
|
face g(labelList(5, 1));
|
||||||
face h(g);
|
face h(g);
|
||||||
Info<< "Compare " << g << " and " << h << " Match = " << compare(g, h)
|
Info<< "Compare " << g << " and " << h << " Match = " << face::compare(g, h)
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
g[0] = 2;
|
g[0] = 2;
|
||||||
h[3] = 2;
|
h[3] = 2;
|
||||||
Info<< "Compare " << g << " and " << h << " Match = " << compare(g, h)
|
Info<< "Compare " << g << " and " << h << " Match = " << face::compare(g, h)
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
g[4] = 3;
|
g[4] = 3;
|
||||||
h[4] = 3;
|
h[4] = 3;
|
||||||
Info<< "Compare " << g << " and " << h << " Match = " << compare(g, h)
|
Info<< "Compare " << g << " and " << h << " Match = " << face::compare(g, h)
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
face face1(identity(1));
|
face face1(identity(1));
|
||||||
Info<< "Compare " << face1 << " and " << face1
|
Info<< "Compare " << face1 << " and " << face1
|
||||||
<< " Match = " << compare(face1, face1) << endl;
|
<< " Match = " << face::compare(face1, face1) << endl;
|
||||||
|
|
||||||
|
face face2(identity(1)+1);
|
||||||
|
Info<< "Compare " << face1 << " and " << face2
|
||||||
|
<< " Match = " << face::compare(face1, face2) << endl;
|
||||||
|
|
||||||
Info<< nl << nl << "Zero face" << nl << endl;
|
Info<< nl << nl << "Zero face" << nl << endl;
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ FoamFile
|
|||||||
collapseEdgesCoeffs
|
collapseEdgesCoeffs
|
||||||
{
|
{
|
||||||
// Edges shorter than this absolute value will be merged
|
// Edges shorter than this absolute value will be merged
|
||||||
minimumEdgeLength 1e-8;
|
minimumEdgeLength 1e-6;
|
||||||
|
|
||||||
// The maximum angle between two edges that share a point attached to
|
// The maximum angle between two edges that share a point attached to
|
||||||
// no other edges
|
// no other edges
|
||||||
@ -25,7 +25,7 @@ collapseEdgesCoeffs
|
|||||||
|
|
||||||
// The amount that minimumEdgeLength will be reduced by for each
|
// The amount that minimumEdgeLength will be reduced by for each
|
||||||
// edge if that edge's collapse generates a poor quality face
|
// edge if that edge's collapse generates a poor quality face
|
||||||
reductionFactor 0.5;
|
reductionFactor 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -67,14 +67,17 @@ meshQualityCoeffs
|
|||||||
{
|
{
|
||||||
// Name of the dictionary that has the mesh quality coefficients used
|
// Name of the dictionary that has the mesh quality coefficients used
|
||||||
// by motionSmoother::checkMesh
|
// by motionSmoother::checkMesh
|
||||||
meshQualityCoeffDict meshQualityDict;
|
#include "meshQualityDict";
|
||||||
|
|
||||||
|
// Maximum number of smoothing iterations for the reductionFactors
|
||||||
|
maximumSmoothingIterations 2;
|
||||||
|
|
||||||
// Maximum number of outer iterations is mesh quality checking is enabled
|
// Maximum number of outer iterations is mesh quality checking is enabled
|
||||||
maximumIterations 10;
|
maximumIterations 10;
|
||||||
|
|
||||||
// Maximum number of iterations deletion of a point can cause a bad face
|
// Maximum number of iterations deletion of a point can cause a bad face
|
||||||
// to be constructed before it is forced to not be deleted
|
// to be constructed before it is forced to not be deleted
|
||||||
maxPointErrorCount 5;
|
maxPointErrorCount 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
/* -DFULLDEBUG -g -O0 */ \
|
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
|||||||
@ -26,12 +26,6 @@ License
|
|||||||
#include "patchToPoly2DMesh.H"
|
#include "patchToPoly2DMesh.H"
|
||||||
#include "PatchTools.H"
|
#include "PatchTools.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::patchToPoly2DMesh::flipFaceOrder()
|
void Foam::patchToPoly2DMesh::flipFaceOrder()
|
||||||
@ -275,12 +269,9 @@ void Foam::patchToPoly2DMesh::createPolyMeshComponents()
|
|||||||
addPatchFacesToOwner();
|
addPatchFacesToOwner();
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- Construct from a primitivePatch
|
|
||||||
Foam::patchToPoly2DMesh::patchToPoly2DMesh
|
Foam::patchToPoly2DMesh::patchToPoly2DMesh
|
||||||
(
|
(
|
||||||
const MeshedSurface<face>& patch,
|
const MeshedSurface<face>& patch,
|
||||||
@ -321,13 +312,5 @@ void Foam::patchToPoly2DMesh::createMesh()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -51,6 +51,7 @@ class patchToPoly2DMesh
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
// Reference to the meshed surface
|
||||||
const MeshedSurface<face>& patch_;
|
const MeshedSurface<face>& patch_;
|
||||||
|
|
||||||
const wordList& patchNames_;
|
const wordList& patchNames_;
|
||||||
@ -62,11 +63,16 @@ class patchToPoly2DMesh
|
|||||||
const EdgeMap<label>& mapEdgesRegion_;
|
const EdgeMap<label>& mapEdgesRegion_;
|
||||||
|
|
||||||
pointField points_;
|
pointField points_;
|
||||||
|
|
||||||
faceList faces_;
|
faceList faces_;
|
||||||
|
|
||||||
labelList owner_;
|
labelList owner_;
|
||||||
|
|
||||||
labelList neighbour_;
|
labelList neighbour_;
|
||||||
|
|
||||||
//- Description of data_
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
void flipFaceOrder();
|
void flipFaceOrder();
|
||||||
|
|
||||||
void createNeighbours();
|
void createNeighbours();
|
||||||
@ -79,9 +85,6 @@ class patchToPoly2DMesh
|
|||||||
|
|
||||||
void createPolyMeshComponents();
|
void createPolyMeshComponents();
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
patchToPoly2DMesh(const patchToPoly2DMesh&);
|
patchToPoly2DMesh(const patchToPoly2DMesh&);
|
||||||
|
|
||||||
@ -110,47 +113,47 @@ public:
|
|||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
pointField& points()
|
|
||||||
{
|
|
||||||
return points_;
|
|
||||||
}
|
|
||||||
|
|
||||||
faceList& faces()
|
pointField& points()
|
||||||
{
|
{
|
||||||
return faces_;
|
return points_;
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList& owner()
|
faceList& faces()
|
||||||
{
|
{
|
||||||
return owner_;
|
return faces_;
|
||||||
}
|
}
|
||||||
|
|
||||||
labelList& neighbour()
|
labelList& owner()
|
||||||
{
|
{
|
||||||
return neighbour_;
|
return owner_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const wordList& patchNames() const
|
labelList& neighbour()
|
||||||
{
|
{
|
||||||
return patchNames_;
|
return neighbour_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const labelList& patchSizes() const
|
const wordList& patchNames() const
|
||||||
{
|
{
|
||||||
return patchSizes_;
|
return patchNames_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const labelList& patchSizes() const
|
||||||
|
{
|
||||||
|
return patchSizes_;
|
||||||
|
}
|
||||||
|
|
||||||
|
const labelList& patchStarts() const
|
||||||
|
{
|
||||||
|
return patchStarts_;
|
||||||
|
}
|
||||||
|
|
||||||
const labelList& patchStarts() const
|
|
||||||
{
|
|
||||||
return patchStarts_;
|
|
||||||
}
|
|
||||||
// Check
|
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
void createMesh();
|
|
||||||
|
|
||||||
// Write
|
|
||||||
|
|
||||||
|
//- Create the mesh
|
||||||
|
void createMesh();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -317,12 +317,12 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Take over refinement levels and write to new time directory.
|
// Take over refinement levels and write to new time directory.
|
||||||
Pout<< "\nWriting extruded mesh to time = " << runTimeExtruded.timeName()
|
Info<< "\nWriting extruded mesh to time = " << runTimeExtruded.timeName()
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
|
|
||||||
mesh().write();
|
mesh().write();
|
||||||
|
|
||||||
Pout<< "End\n" << endl;
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,31 +2,31 @@
|
|||||||
#define CGAL_PSURF_RINGS_H_
|
#define CGAL_PSURF_RINGS_H_
|
||||||
|
|
||||||
// This file adapted from
|
// This file adapted from
|
||||||
// CGAL-3.7/examples/Jet_fitting_3//PolyhedralSurf_rings.h
|
// CGAL-4.0/examples/Jet_fitting_3/PolyhedralSurf_rings.h
|
||||||
// Licensed under CGAL-3.7/LICENSE.FREE_USE
|
// Licensed under CGAL-4.0/LICENSE.FREE_USE
|
||||||
|
|
||||||
// Copyright (c) 1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007
|
// Copyright (c) 1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007
|
||||||
// Utrecht University (The Netherlands), ETH Zurich (Switzerland), Freie
|
// Utrecht University (The Netherlands),
|
||||||
// Universitaet Berlin (Germany), INRIA Sophia-Antipolis (France),
|
// ETH Zurich (Switzerland),
|
||||||
// Martin-Luther-University Halle-Wittenberg (Germany), Max-Planck-Institute
|
// INRIA Sophia-Antipolis (France),
|
||||||
// Saarbruecken (Germany), RISC Linz (Austria), and Tel-Aviv University
|
// Max-Planck-Institute Saarbruecken (Germany),
|
||||||
// (Israel). All rights reserved.
|
// and Tel-Aviv University (Israel). All rights reserved.
|
||||||
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// of this software and associated documentation files (the "Software"), to deal
|
// copy of this software and associated documentation files (the
|
||||||
// in the Software without restriction, including without limitation the rights
|
// "Software"), to deal in the Software without restriction, including
|
||||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
// without limitation the rights to use, copy, modify, merge, publish,
|
||||||
// copies of the Software, and to permit persons to whom the Software is
|
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
// furnished to do so, subject to the following conditions:
|
// permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
// the following conditions:
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
//
|
||||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
// SOFTWARE.
|
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
|||||||
@ -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-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -48,6 +48,7 @@ namespace Foam
|
|||||||
// Forward declaration of classes
|
// Forward declaration of classes
|
||||||
class objectRegistry;
|
class objectRegistry;
|
||||||
class dictionary;
|
class dictionary;
|
||||||
|
class polyMesh;
|
||||||
class mapPolyMesh;
|
class mapPolyMesh;
|
||||||
class fvMesh;
|
class fvMesh;
|
||||||
|
|
||||||
@ -131,7 +132,7 @@ public:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
//- Update for changes of mesh
|
//- Update for changes of mesh
|
||||||
virtual void movePoints(const pointField&)
|
virtual void movePoints(const polyMesh&)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,8 @@ Class
|
|||||||
Foam::dynamicIndexedOctree
|
Foam::dynamicIndexedOctree
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Non-pointer based hierarchical recursive searching
|
Non-pointer based hierarchical recursive searching.
|
||||||
|
Storage is dynamic, so elements can be deleted.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
dynamicIndexedOctree.C
|
dynamicIndexedOctree.C
|
||||||
@ -451,6 +452,7 @@ public:
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
@ -656,6 +658,7 @@ public:
|
|||||||
|
|
||||||
label removeIndex(const label nodIndex, const label index);
|
label removeIndex(const label nodIndex, const label index);
|
||||||
|
|
||||||
|
|
||||||
// Write
|
// Write
|
||||||
|
|
||||||
//- Print tree. Either print all indices (printContent = true) or
|
//- Print tree. Either print all indices (printContent = true) or
|
||||||
@ -671,6 +674,7 @@ public:
|
|||||||
|
|
||||||
void writeTreeInfo() const;
|
void writeTreeInfo() const;
|
||||||
|
|
||||||
|
|
||||||
// IOstream Operators
|
// IOstream Operators
|
||||||
|
|
||||||
friend Ostream& operator<< <Type>
|
friend Ostream& operator<< <Type>
|
||||||
|
|||||||
@ -318,6 +318,17 @@ int Foam::face::compare(const face& a, const face& b)
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
else if (sizeA == 1)
|
||||||
|
{
|
||||||
|
if (a[0] == b[0])
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const_circulator<face> aCirc(a);
|
const_circulator<face> aCirc(a);
|
||||||
const_circulator<face> bCirc(b);
|
const_circulator<face> bCirc(b);
|
||||||
@ -337,7 +348,7 @@ int Foam::face::compare(const face& a, const face& b)
|
|||||||
} while (bCirc.circulate(CirculatorBase::CLOCKWISE));
|
} while (bCirc.circulate(CirculatorBase::CLOCKWISE));
|
||||||
|
|
||||||
// If the circulator has stopped then faces a and b do not share a matching
|
// If the circulator has stopped then faces a and b do not share a matching
|
||||||
// point
|
// point. Doesn't work on matching, single element face.
|
||||||
if (!bCirc.circulate())
|
if (!bCirc.circulate())
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -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-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -538,6 +538,9 @@ Foam::List<Foam::tetIndices> Foam::polyMeshTetDecomposition::faceTetIndices
|
|||||||
label cI
|
label cI
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
static label nWarnings = 0;
|
||||||
|
static const label maxWarnings = 100;
|
||||||
|
|
||||||
const faceList& pFaces = mesh.faces();
|
const faceList& pFaces = mesh.faces();
|
||||||
const labelList& pOwner = mesh.faceOwner();
|
const labelList& pOwner = mesh.faceOwner();
|
||||||
|
|
||||||
@ -553,19 +556,27 @@ Foam::List<Foam::tetIndices> Foam::polyMeshTetDecomposition::faceTetIndices
|
|||||||
|
|
||||||
if (tetBasePtI == -1)
|
if (tetBasePtI == -1)
|
||||||
{
|
{
|
||||||
WarningIn
|
if (nWarnings < maxWarnings)
|
||||||
(
|
{
|
||||||
"Foam::List<Foam::tetIndices> "
|
WarningIn
|
||||||
"Foam::polyMeshTetDecomposition::faceTetIndices"
|
(
|
||||||
"("
|
"Foam::List<Foam::tetIndices> "
|
||||||
"const polyMesh&, "
|
"Foam::polyMeshTetDecomposition::faceTetIndices"
|
||||||
"label, "
|
"("
|
||||||
"label"
|
"const polyMesh&, "
|
||||||
")"
|
"label, "
|
||||||
)
|
"label"
|
||||||
<< "No base point for face " << fI << ", " << f
|
")"
|
||||||
<< ", produces a valid tet decomposition."
|
) << "No base point for face " << fI << ", " << f
|
||||||
<< endl;
|
<< ", produces a valid tet decomposition."
|
||||||
|
<< endl;
|
||||||
|
nWarnings++;
|
||||||
|
}
|
||||||
|
if (nWarnings == maxWarnings)
|
||||||
|
{
|
||||||
|
Warning<< "Suppressing any further warnings." << endl;
|
||||||
|
nWarnings++;
|
||||||
|
}
|
||||||
|
|
||||||
tetBasePtI = 0;
|
tetBasePtI = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,6 +35,12 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(polyMeshFilter, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::fvMesh> Foam::polyMeshFilter::copyMesh(const fvMesh& mesh)
|
Foam::autoPtr<Foam::fvMesh> Foam::polyMeshFilter::copyMesh(const fvMesh& mesh)
|
||||||
{
|
{
|
||||||
polyTopoChange originalMeshToNewMesh(mesh);
|
polyTopoChange originalMeshToNewMesh(mesh);
|
||||||
|
|||||||
@ -25,6 +25,10 @@ Class
|
|||||||
Foam::polyMeshFilter
|
Foam::polyMeshFilter
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
Filter the edges and faces of a polyMesh whilst satisfying the given mesh
|
||||||
|
quality criteria.
|
||||||
|
|
||||||
|
Works on a copy of the mesh.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
polyMeshFilter.C
|
polyMeshFilter.C
|
||||||
@ -102,10 +106,10 @@ class polyMeshFilter
|
|||||||
// faces
|
// faces
|
||||||
const scalar faceReductionFactor_;
|
const scalar faceReductionFactor_;
|
||||||
|
|
||||||
//-
|
//- Maximum number of times a deleted point can be associated with the
|
||||||
|
// creation of a bad face it is forced to be kept.
|
||||||
const label maxPointErrorCount_;
|
const label maxPointErrorCount_;
|
||||||
|
|
||||||
|
|
||||||
//- The minimum edge length for each edge
|
//- The minimum edge length for each edge
|
||||||
scalarField minEdgeLen_;
|
scalarField minEdgeLen_;
|
||||||
|
|
||||||
@ -195,6 +199,10 @@ class polyMeshFilter
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
ClassName("polyMeshFilter");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from fvMesh
|
//- Construct from fvMesh
|
||||||
@ -225,6 +233,7 @@ public:
|
|||||||
//- Filter edges only.
|
//- Filter edges only.
|
||||||
label filterEdges(const label nOriginalBadFaces);
|
label filterEdges(const label nOriginalBadFaces);
|
||||||
|
|
||||||
|
//- Filter all faces that are in the face zone indirectPatchFaces
|
||||||
label filterIndirectPatchFaces();
|
label filterIndirectPatchFaces();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,12 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(edgeCollapser, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::label Foam::edgeCollapser::longestEdge
|
Foam::label Foam::edgeCollapser::longestEdge
|
||||||
(
|
(
|
||||||
const face& f,
|
const face& f,
|
||||||
|
|||||||
@ -61,7 +61,7 @@ class face;
|
|||||||
class edge;
|
class edge;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class edgeCollapser Declaration
|
Class edgeCollapser Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class edgeCollapser
|
class edgeCollapser
|
||||||
@ -84,12 +84,18 @@ private:
|
|||||||
//- Reference to mesh
|
//- Reference to mesh
|
||||||
const polyMesh& mesh_;
|
const polyMesh& mesh_;
|
||||||
|
|
||||||
|
//- Controls collapse of a face to an edge
|
||||||
const scalar guardFraction_;
|
const scalar guardFraction_;
|
||||||
|
|
||||||
|
//- Only collapse face to a point if high aspect ratio
|
||||||
const scalar maxCollapseFaceToPointSideLengthCoeff_;
|
const scalar maxCollapseFaceToPointSideLengthCoeff_;
|
||||||
|
|
||||||
|
//- Allow a face to be collapsed to a point early, before the test
|
||||||
|
// to collapse to an edge
|
||||||
const Switch allowEarlyCollapseToPoint_;
|
const Switch allowEarlyCollapseToPoint_;
|
||||||
|
|
||||||
|
//- Fraction of maxCollapseFaceToPointSideLengthCoeff_ to use when
|
||||||
|
// allowEarlyCollapseToPoint_ is on
|
||||||
const scalar allowEarlyCollapseCoeff_;
|
const scalar allowEarlyCollapseCoeff_;
|
||||||
|
|
||||||
|
|
||||||
@ -266,8 +272,8 @@ public:
|
|||||||
const dictionary& meshQualityDict
|
const dictionary& meshQualityDict
|
||||||
);
|
);
|
||||||
|
|
||||||
// Check mesh and mark points on faces in error
|
//- Check mesh and mark points on faces in error
|
||||||
// Returns boolList with points in error set
|
// Returns boolList with points in error set
|
||||||
static label checkMeshQuality
|
static label checkMeshQuality
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
@ -300,7 +306,7 @@ public:
|
|||||||
polyTopoChange& meshMod
|
polyTopoChange& meshMod
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
// Mark (in collapseEdge) any edges to collapse
|
//- Mark (in collapseEdge) any edges to collapse
|
||||||
label markSmallEdges
|
label markSmallEdges
|
||||||
(
|
(
|
||||||
const scalarField& minEdgeLen,
|
const scalarField& minEdgeLen,
|
||||||
@ -309,7 +315,7 @@ public:
|
|||||||
Map<point>& collapsePointToLocation
|
Map<point>& collapsePointToLocation
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
// Mark (in collapseEdge) any edges to merge
|
//- Mark (in collapseEdge) any edges to merge
|
||||||
label markMergeEdges
|
label markMergeEdges
|
||||||
(
|
(
|
||||||
const scalar maxCos,
|
const scalar maxCos,
|
||||||
@ -332,6 +338,7 @@ public:
|
|||||||
Map<point>& collapsePointToLocation
|
Map<point>& collapsePointToLocation
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Marks edges in the faceZone indirectPatchFaces for collapse
|
||||||
void markIndirectPatchFaces
|
void markIndirectPatchFaces
|
||||||
(
|
(
|
||||||
PackedBoolList& collapseEdge,
|
PackedBoolList& collapseEdge,
|
||||||
|
|||||||
@ -28,11 +28,12 @@ $(derivedSources)/rotorDiskSource/trimModel/trimModel/trimModelNew.C
|
|||||||
$(derivedSources)/rotorDiskSource/trimModel/fixed/fixedTrim.C
|
$(derivedSources)/rotorDiskSource/trimModel/fixed/fixedTrim.C
|
||||||
$(derivedSources)/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.C
|
$(derivedSources)/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.C
|
||||||
|
|
||||||
interRegion = $(derivedSources)/interRegionHeatTransferModel
|
interRegion = sources/interRegion
|
||||||
$(interRegion)/constantHeatTransfer/constantHeatTransfer.C
|
$(interRegion)/interRegionHeatTransferModel/constantHeatTransfer/constantHeatTransfer.C
|
||||||
$(interRegion)/interRegionHeatTransferModel/interRegionHeatTransferModel.C
|
$(interRegion)/interRegionHeatTransferModel/interRegionHeatTransferModel/interRegionHeatTransferModel.C
|
||||||
$(interRegion)/tabulatedHeatTransfer/tabulatedHeatTransfer.C
|
$(interRegion)/interRegionHeatTransferModel/tabulatedHeatTransfer/tabulatedHeatTransfer.C
|
||||||
$(interRegion)/variableHeatTransfer/variableHeatTransfer.C
|
$(interRegion)/interRegionHeatTransferModel/variableHeatTransfer/variableHeatTransfer.C
|
||||||
|
$(interRegion)/interRegionExplicitPorositySource/interRegionExplicitPorositySource.C
|
||||||
|
|
||||||
|
|
||||||
/* constraints */
|
/* constraints */
|
||||||
|
|||||||
@ -45,14 +45,15 @@ Foam::IOobject Foam::fv::IOoptionList::createIOobject
|
|||||||
|
|
||||||
if (io.headerOk())
|
if (io.headerOk())
|
||||||
{
|
{
|
||||||
Info<< "Creating field source list from " << io.name() << nl << endl;
|
Info<< "Creating fintite volume options from " << io.name() << nl
|
||||||
|
<< endl;
|
||||||
|
|
||||||
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
|
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
|
||||||
return io;
|
return io;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info<< "No field sources present" << nl << endl;
|
Info<< "No finite volume options present" << nl << endl;
|
||||||
|
|
||||||
io.readOpt() = IOobject::NO_READ;
|
io.readOpt() = IOobject::NO_READ;
|
||||||
return io;
|
return io;
|
||||||
|
|||||||
@ -27,6 +27,7 @@ License
|
|||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
#include "fvMatrices.H"
|
#include "fvMatrices.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
|
#include "ListOps.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
@ -86,9 +87,7 @@ void Foam::fv::option::setSelection(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
case smMapRegion:
|
case smMapRegion:
|
||||||
{
|
{
|
||||||
dict.lookup("nbrModelName") >> nbrModelName_;
|
|
||||||
dict.lookup("nbrRegionName") >> nbrRegionName_;
|
dict.lookup("nbrRegionName") >> nbrRegionName_;
|
||||||
master_ = readBool(dict.lookup("master"));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case smAll:
|
case smAll:
|
||||||
@ -191,7 +190,10 @@ void Foam::fv::option::setCellSet()
|
|||||||
(
|
(
|
||||||
mesh_,
|
mesh_,
|
||||||
nbrMesh,
|
nbrMesh,
|
||||||
readBool(dict_.lookup("consistentMeshes"))
|
meshToMeshNew::interpolationMethodNames_.read
|
||||||
|
(
|
||||||
|
dict_.lookup("interpolationMethod")
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -247,7 +249,8 @@ Foam::fv::option::option
|
|||||||
const word& name,
|
const word& name,
|
||||||
const word& modelType,
|
const word& modelType,
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const fvMesh& mesh
|
const fvMesh& mesh,
|
||||||
|
const bool master
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
name_(name),
|
name_(name),
|
||||||
@ -261,9 +264,8 @@ Foam::fv::option::option
|
|||||||
cellSetName_("none"),
|
cellSetName_("none"),
|
||||||
V_(0.0),
|
V_(0.0),
|
||||||
meshInterpPtr_(),
|
meshInterpPtr_(),
|
||||||
nbrModelName_("none"),
|
|
||||||
nbrRegionName_("none"),
|
nbrRegionName_("none"),
|
||||||
master_(false),
|
master_(master),
|
||||||
fieldNames_(),
|
fieldNames_(),
|
||||||
applied_()
|
applied_()
|
||||||
{
|
{
|
||||||
@ -350,15 +352,7 @@ Foam::label Foam::fv::option::applyToField(const word& fieldName) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(fieldNames_, i)
|
return findIndex(fieldNames_, fieldName);
|
||||||
{
|
|
||||||
if (fieldNames_[i] == fieldName)
|
|
||||||
{
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -134,9 +134,6 @@ protected:
|
|||||||
//- Mesh to mesh interpolation object
|
//- Mesh to mesh interpolation object
|
||||||
autoPtr<meshToMeshNew> meshInterpPtr_;
|
autoPtr<meshToMeshNew> meshInterpPtr_;
|
||||||
|
|
||||||
//- Name of the model in the neighbour mesh
|
|
||||||
word nbrModelName_;
|
|
||||||
|
|
||||||
//- Name of the neighbour region to map
|
//- Name of the neighbour region to map
|
||||||
word nbrRegionName_;
|
word nbrRegionName_;
|
||||||
|
|
||||||
@ -194,7 +191,8 @@ public:
|
|||||||
const word& name,
|
const word& name,
|
||||||
const word& modelType,
|
const word& modelType,
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const fvMesh& mesh
|
const fvMesh& mesh,
|
||||||
|
const bool master = false
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Return clone
|
//- Return clone
|
||||||
@ -288,9 +286,6 @@ public:
|
|||||||
//- Return const access to the total cell volume
|
//- Return const access to the total cell volume
|
||||||
inline scalar V() const;
|
inline scalar V() const;
|
||||||
|
|
||||||
//- Return const access to the neighbour model name
|
|
||||||
inline const word& nbrModelName() const;
|
|
||||||
|
|
||||||
//- Return const access to the neighbour region name
|
//- Return const access to the neighbour region name
|
||||||
inline const word& nbrRegionName() const;
|
inline const word& nbrRegionName() const;
|
||||||
|
|
||||||
|
|||||||
@ -126,12 +126,6 @@ inline Foam::scalar& Foam::fv::option::duration()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::word& Foam::fv::option::nbrModelName() const
|
|
||||||
{
|
|
||||||
return nbrModelName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::word& Foam::fv::option::nbrRegionName() const
|
inline const Foam::word& Foam::fv::option::nbrRegionName() const
|
||||||
{
|
{
|
||||||
return nbrRegionName_;
|
return nbrRegionName_;
|
||||||
|
|||||||
@ -90,8 +90,11 @@ void Foam::fv::option::writeData(Ostream& os) const
|
|||||||
bool Foam::fv::option::read(const dictionary& dict)
|
bool Foam::fv::option::read(const dictionary& dict)
|
||||||
{
|
{
|
||||||
active_ = readBool(dict.lookup("active"));
|
active_ = readBool(dict.lookup("active"));
|
||||||
timeStart_ = readScalar(dict.lookup("timeStart"));
|
|
||||||
duration_ = readScalar(dict.lookup("duration"));
|
if (dict.readIfPresent("timeStart", timeStart_))
|
||||||
|
{
|
||||||
|
dict.lookup("duration") >> duration_;
|
||||||
|
}
|
||||||
|
|
||||||
coeffs_ = dict.subDict(type() + "Coeffs");
|
coeffs_ = dict.subDict(type() + "Coeffs");
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,230 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2012-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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "interRegionExplicitPorositySource.H"
|
||||||
|
#include "fvMesh.H"
|
||||||
|
#include "fvMatrices.H"
|
||||||
|
#include "porosityModel.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(interRegionExplicitPorositySource, 0);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
option,
|
||||||
|
interRegionExplicitPorositySource,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fv::interRegionExplicitPorositySource::initialise()
|
||||||
|
{
|
||||||
|
if (!firstIter_)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const word zoneName(name_ + ".porous");
|
||||||
|
|
||||||
|
const fvMesh& nbrMesh = mesh_.time().lookupObject<fvMesh>(nbrRegionName_);
|
||||||
|
const cellZoneMesh& cellZones = nbrMesh.cellZones();
|
||||||
|
label zoneID = cellZones.findZoneID(zoneName);
|
||||||
|
|
||||||
|
if (zoneID == -1)
|
||||||
|
{
|
||||||
|
cellZoneMesh& cz = const_cast<cellZoneMesh&>(cellZones);
|
||||||
|
|
||||||
|
zoneID = cz.size();
|
||||||
|
|
||||||
|
cz.setSize(zoneID + 1);
|
||||||
|
|
||||||
|
cz.set
|
||||||
|
(
|
||||||
|
zoneID,
|
||||||
|
new cellZone
|
||||||
|
(
|
||||||
|
zoneName,
|
||||||
|
nbrMesh.faceNeighbour(), // neighbour internal cells
|
||||||
|
zoneID,
|
||||||
|
cellZones
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
cz.clearAddressing();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"void Foam::fv::interRegionExplicitPorositySource::initialise()"
|
||||||
|
)
|
||||||
|
<< "Unable to create porous cellZone " << zoneName
|
||||||
|
<< ": zone already exists"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
porosityPtr_.reset
|
||||||
|
(
|
||||||
|
porosityModel::New
|
||||||
|
(
|
||||||
|
name_,
|
||||||
|
nbrMesh,
|
||||||
|
coeffs_,
|
||||||
|
zoneName
|
||||||
|
).ptr()
|
||||||
|
),
|
||||||
|
|
||||||
|
firstIter_ = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::fv::interRegionExplicitPorositySource::interRegionExplicitPorositySource
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
)
|
||||||
|
:
|
||||||
|
option(name, modelType, dict, mesh, true),
|
||||||
|
porosityPtr_(NULL),
|
||||||
|
firstIter_(-1),
|
||||||
|
UName_(coeffs_.lookupOrDefault<word>("UName", "U")),
|
||||||
|
rhoName_(coeffs_.lookupOrDefault<word>("rhoName", "rho")),
|
||||||
|
muName_(coeffs_.lookupOrDefault<word>("muName", "thermo:mu"))
|
||||||
|
{
|
||||||
|
if (active_)
|
||||||
|
{
|
||||||
|
fieldNames_.setSize(1, UName_);
|
||||||
|
applied_.setSize(1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::fv::interRegionExplicitPorositySource::addSup
|
||||||
|
(
|
||||||
|
fvMatrix<vector>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
)
|
||||||
|
{
|
||||||
|
initialise();
|
||||||
|
|
||||||
|
const fvMesh& nbrMesh = mesh_.time().lookupObject<fvMesh>(nbrRegionName_);
|
||||||
|
|
||||||
|
const volVectorField& U = eqn.psi();
|
||||||
|
|
||||||
|
volVectorField UNbr
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
name_ + ".UNbr",
|
||||||
|
nbrMesh.time().timeName(),
|
||||||
|
nbrMesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
nbrMesh,
|
||||||
|
dimensionedVector("zero", U.dimensions(), vector::zero)
|
||||||
|
);
|
||||||
|
|
||||||
|
// map local velocity onto neighbour region
|
||||||
|
meshInterp().mapSrcToTgt
|
||||||
|
(
|
||||||
|
U.internalField(),
|
||||||
|
plusEqOp<vector>(),
|
||||||
|
UNbr.internalField()
|
||||||
|
);
|
||||||
|
|
||||||
|
fvMatrix<vector> nbrEqn(UNbr, eqn.dimensions());
|
||||||
|
|
||||||
|
if (eqn.dimensions() == dimForce)
|
||||||
|
{
|
||||||
|
const volScalarField& rhoNbr =
|
||||||
|
nbrMesh.lookupObject<volScalarField>(rhoName_);
|
||||||
|
const volScalarField& muNbr =
|
||||||
|
nbrMesh.lookupObject<volScalarField>(muName_);
|
||||||
|
|
||||||
|
porosityPtr_->addResistance(nbrEqn, rhoNbr, muNbr);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
porosityPtr_->addResistance(nbrEqn);
|
||||||
|
}
|
||||||
|
|
||||||
|
// convert source from neighbour to local region
|
||||||
|
fvMatrix<vector> porosityEqn(U, eqn.dimensions());
|
||||||
|
scalarField& Udiag = porosityEqn.diag();
|
||||||
|
vectorField& Usource = porosityEqn.source();
|
||||||
|
|
||||||
|
Udiag.setSize(eqn.diag().size(), 0.0);
|
||||||
|
Usource.setSize(eqn.source().size(), vector::zero);
|
||||||
|
|
||||||
|
meshInterp().mapTgtToSrc(nbrEqn.diag(), plusEqOp<scalar>(), Udiag);
|
||||||
|
meshInterp().mapTgtToSrc(nbrEqn.source(), plusEqOp<vector>(), Usource);
|
||||||
|
|
||||||
|
eqn -= porosityEqn;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::interRegionExplicitPorositySource::writeData(Ostream& os) const
|
||||||
|
{
|
||||||
|
os << indent << name_ << endl;
|
||||||
|
dict_.write(os);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Foam::fv::interRegionExplicitPorositySource::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (option::read(dict))
|
||||||
|
{
|
||||||
|
coeffs_.readIfPresent("UName", UName_);
|
||||||
|
coeffs_.readIfPresent("rhoName", rhoName_);
|
||||||
|
coeffs_.readIfPresent("muName", muName_);
|
||||||
|
|
||||||
|
// reset the porosity model?
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,177 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2012-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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::fv::interRegionExplicitPorositySource
|
||||||
|
|
||||||
|
Description
|
||||||
|
Inter-region explicit porosity source
|
||||||
|
|
||||||
|
Sources described by, for example using the DarcyForchheimer model:
|
||||||
|
|
||||||
|
interRegionExplicitPorositySourceCoeffs
|
||||||
|
{
|
||||||
|
type DarcyForchheimer;
|
||||||
|
DarcyForchheimerCoeffs
|
||||||
|
{
|
||||||
|
d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000);
|
||||||
|
f f [0 -1 0 0 0 0 0] (0 0 0);
|
||||||
|
|
||||||
|
coordinateSystem
|
||||||
|
{
|
||||||
|
e1 (0.70710678 0.70710678 0);
|
||||||
|
e2 (0 0 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Note:
|
||||||
|
The porous region must be selected as a cellZone.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
interRegionExplicitPorositySource.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef interRegionExplicitPorositySource_H
|
||||||
|
#define interRegionExplicitPorositySource_H
|
||||||
|
|
||||||
|
#include "fvOption.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
class porosityModel;
|
||||||
|
|
||||||
|
namespace fv
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class interRegionExplicitPorositySource Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class interRegionExplicitPorositySource
|
||||||
|
:
|
||||||
|
public option
|
||||||
|
{
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected data
|
||||||
|
|
||||||
|
//- Run-time selectable porosity model
|
||||||
|
autoPtr<porosityModel> porosityPtr_;
|
||||||
|
|
||||||
|
//- First iteration
|
||||||
|
bool firstIter_;
|
||||||
|
|
||||||
|
//- Velocity field name, default = U
|
||||||
|
word UName_;
|
||||||
|
|
||||||
|
//- Density field name (compressible case only), default = rho
|
||||||
|
word rhoName_;
|
||||||
|
|
||||||
|
//- Dynamic viscosity field name (compressible case only)
|
||||||
|
// default = thermo:mu
|
||||||
|
word muName_;
|
||||||
|
|
||||||
|
|
||||||
|
// Protected Member Functions
|
||||||
|
|
||||||
|
//- Initialise
|
||||||
|
void initialise();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
interRegionExplicitPorositySource
|
||||||
|
(
|
||||||
|
const interRegionExplicitPorositySource&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const interRegionExplicitPorositySource&);
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("interRegionExplicitPorositySource");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
interRegionExplicitPorositySource
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const word& modelType,
|
||||||
|
const dictionary& dict,
|
||||||
|
const fvMesh& mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~interRegionExplicitPorositySource()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
// Add explicit and implicit contributions
|
||||||
|
|
||||||
|
//- Vector
|
||||||
|
virtual void addSup
|
||||||
|
(
|
||||||
|
fvMatrix<vector>& eqn,
|
||||||
|
const label fieldI
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// I-O
|
||||||
|
|
||||||
|
//- Write data
|
||||||
|
virtual void writeData(Ostream&) const;
|
||||||
|
|
||||||
|
//- Read dictionary
|
||||||
|
virtual bool read(const dictionary& dict);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace fv
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -91,14 +91,7 @@ Foam::fv::constantHeatTransfer::constantHeatTransfer
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
const DimensionedField<scalar, volMesh>& htcConsti =
|
htc_ = htcConst_()*AoV_();
|
||||||
htcConst_().dimensionedInternalField();
|
|
||||||
const DimensionedField<scalar, volMesh>& AoVi =
|
|
||||||
AoV_().dimensionedInternalField();
|
|
||||||
dimensionedScalar interVol("V", dimVolume, meshInterp().V());
|
|
||||||
|
|
||||||
htc_.dimensionedInternalField() = htcConsti*AoVi*interVol/mesh.V();
|
|
||||||
htc_.correctBoundaryConditions();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,10 +104,9 @@ Foam::fv::constantHeatTransfer::~constantHeatTransfer()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::tmp<Foam::volScalarField>
|
void Foam::fv::constantHeatTransfer::calculateHtc()
|
||||||
Foam::fv::constantHeatTransfer::calculateHtc()
|
|
||||||
{
|
{
|
||||||
return htc_;
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ public:
|
|||||||
// Public Functions
|
// Public Functions
|
||||||
|
|
||||||
//- Calculate the heat transfer coefficient
|
//- Calculate the heat transfer coefficient
|
||||||
virtual const tmp<volScalarField> calculateHtc();
|
virtual void calculateHtc();
|
||||||
|
|
||||||
|
|
||||||
// I-O
|
// I-O
|
||||||
@ -41,7 +41,7 @@ namespace fv
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Private member functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected member functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::fv::interRegionHeatTransferModel::setNbrModel()
|
void Foam::fv::interRegionHeatTransferModel::setNbrModel()
|
||||||
{
|
{
|
||||||
@ -71,7 +71,7 @@ void Foam::fv::interRegionHeatTransferModel::setNbrModel()
|
|||||||
|
|
||||||
if (!nbrModelFound)
|
if (!nbrModelFound)
|
||||||
{
|
{
|
||||||
FatalErrorIn("interRegionHeatTransferModel::check()")
|
FatalErrorIn("interRegionHeatTransferModel::setNbrModel()")
|
||||||
<< "Neighbour model not found" << nbrModelName_
|
<< "Neighbour model not found" << nbrModelName_
|
||||||
<< " in region " << nbrMesh.name() << nl
|
<< " in region " << nbrMesh.name() << nl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
@ -81,6 +81,24 @@ void Foam::fv::interRegionHeatTransferModel::setNbrModel()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fv::interRegionHeatTransferModel::correct()
|
||||||
|
{
|
||||||
|
if (master_)
|
||||||
|
{
|
||||||
|
if (mesh_.time().timeIndex() != timeIndex_)
|
||||||
|
{
|
||||||
|
calculateHtc();
|
||||||
|
timeIndex_ = mesh_.time().timeIndex();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nbrModel().correct();
|
||||||
|
interpolate(nbrModel().htc(), htc_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::fv::interRegionHeatTransferModel::interRegionHeatTransferModel
|
Foam::fv::interRegionHeatTransferModel::interRegionHeatTransferModel
|
||||||
@ -91,9 +109,11 @@ Foam::fv::interRegionHeatTransferModel::interRegionHeatTransferModel
|
|||||||
const fvMesh& mesh
|
const fvMesh& mesh
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
option(name, modelType, dict, mesh),
|
option(name, modelType, dict, mesh, readBool(dict.lookup("master"))),
|
||||||
nbrModel_(NULL),
|
nbrModel_(NULL),
|
||||||
|
nbrModelName_(word::null),
|
||||||
firstIter_(true),
|
firstIter_(true),
|
||||||
|
timeIndex_(-1),
|
||||||
htc_
|
htc_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
@ -119,6 +139,8 @@ Foam::fv::interRegionHeatTransferModel::interRegionHeatTransferModel
|
|||||||
{
|
{
|
||||||
if (active())
|
if (active())
|
||||||
{
|
{
|
||||||
|
coeffs_.lookup("nbrModelName") >> nbrModelName_;
|
||||||
|
|
||||||
coeffs_.lookup("fieldNames") >> fieldNames_;
|
coeffs_.lookup("fieldNames") >> fieldNames_;
|
||||||
applied_.setSize(fieldNames_.size(), false);
|
applied_.setSize(fieldNames_.size(), false);
|
||||||
|
|
||||||
@ -143,6 +165,8 @@ void Foam::fv::interRegionHeatTransferModel::addSup
|
|||||||
{
|
{
|
||||||
setNbrModel();
|
setNbrModel();
|
||||||
|
|
||||||
|
correct();
|
||||||
|
|
||||||
const volScalarField& h = eqn.psi();
|
const volScalarField& h = eqn.psi();
|
||||||
|
|
||||||
const volScalarField& T = mesh_.lookupObject<volScalarField>(TName_);
|
const volScalarField& T = mesh_.lookupObject<volScalarField>(TName_);
|
||||||
@ -172,11 +196,6 @@ void Foam::fv::interRegionHeatTransferModel::addSup
|
|||||||
|
|
||||||
interpolate(Tnbr, Tmapped.internalField());
|
interpolate(Tnbr, Tmapped.internalField());
|
||||||
|
|
||||||
if (!master_)
|
|
||||||
{
|
|
||||||
interpolate(nbrModel().calculateHtc()(), htc_);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Volumetric integral of htc: "
|
Info<< "Volumetric integral of htc: "
|
||||||
@ -65,22 +65,21 @@ private:
|
|||||||
//- Pointer to neighbour interRegionHeatTransferModel
|
//- Pointer to neighbour interRegionHeatTransferModel
|
||||||
interRegionHeatTransferModel* nbrModel_;
|
interRegionHeatTransferModel* nbrModel_;
|
||||||
|
|
||||||
|
//- Name of the model in the neighbour mesh
|
||||||
|
word nbrModelName_;
|
||||||
|
|
||||||
//- First iteration
|
//- First iteration
|
||||||
bool firstIter_;
|
bool firstIter_;
|
||||||
|
|
||||||
|
//- Time index - used for updating htc
|
||||||
// Private members
|
label timeIndex_;
|
||||||
|
|
||||||
//- Set the neighbour interRegionHeatTransferModel
|
|
||||||
void setNbrModel();
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
//- Heat transfer coefficient [W/m2/k] by area/volume [1/m]
|
//- Heat transfer coefficient [W/m2/k] times area/volume [1/m]
|
||||||
// registered on the master mesh
|
|
||||||
volScalarField htc_;
|
volScalarField htc_;
|
||||||
|
|
||||||
//- Flag to activate semi-implicit coupling
|
//- Flag to activate semi-implicit coupling
|
||||||
@ -95,6 +94,12 @@ protected:
|
|||||||
|
|
||||||
// Protected member functions
|
// Protected member functions
|
||||||
|
|
||||||
|
//- Set the neighbour interRegionHeatTransferModel
|
||||||
|
void setNbrModel();
|
||||||
|
|
||||||
|
//- Correct to calculate the inter-region heat transfer coefficient
|
||||||
|
void correct();
|
||||||
|
|
||||||
//- Interpolate field with nbrModel specified
|
//- Interpolate field with nbrModel specified
|
||||||
template<class Type>
|
template<class Type>
|
||||||
tmp<Field<Type> > interpolate
|
tmp<Field<Type> > interpolate
|
||||||
@ -168,7 +173,7 @@ public:
|
|||||||
virtual void addSup(fvMatrix<scalar>& eqn, const label fieldI);
|
virtual void addSup(fvMatrix<scalar>& eqn, const label fieldI);
|
||||||
|
|
||||||
//- Calculate heat transfer coefficient
|
//- Calculate heat transfer coefficient
|
||||||
virtual const tmp<volScalarField> calculateHtc() = 0;
|
virtual void calculateHtc() = 0;
|
||||||
|
|
||||||
|
|
||||||
// I-O
|
// I-O
|
||||||
@ -109,8 +109,7 @@ Foam::fv::tabulatedHeatTransfer::~tabulatedHeatTransfer()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::tmp<Foam::volScalarField>
|
void Foam::fv::tabulatedHeatTransfer::calculateHtc()
|
||||||
Foam::fv::tabulatedHeatTransfer::calculateHtc()
|
|
||||||
{
|
{
|
||||||
const fvMesh& nbrMesh = mesh_.time().lookupObject<fvMesh>(nbrRegionName());
|
const fvMesh& nbrMesh = mesh_.time().lookupObject<fvMesh>(nbrRegionName());
|
||||||
|
|
||||||
@ -130,9 +129,7 @@ Foam::fv::tabulatedHeatTransfer::calculateHtc()
|
|||||||
htcc[i] = hTable()(mag(U[i]), UMagNbrMapped[i]);
|
htcc[i] = hTable()(mag(U[i]), UMagNbrMapped[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
htcc = htcc*AoV()*meshInterp().V()/mesh_.V();
|
htcc = htcc*AoV();
|
||||||
|
|
||||||
return htc_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ public:
|
|||||||
// Public Functions
|
// Public Functions
|
||||||
|
|
||||||
//- Calculate the heat transfer coefficient
|
//- Calculate the heat transfer coefficient
|
||||||
virtual const tmp<volScalarField> calculateHtc();
|
virtual void calculateHtc();
|
||||||
|
|
||||||
|
|
||||||
// I-O
|
// I-O
|
||||||
@ -97,8 +97,7 @@ Foam::fv::variableHeatTransfer::~variableHeatTransfer()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::tmp<Foam::volScalarField>
|
void Foam::fv::variableHeatTransfer::calculateHtc()
|
||||||
Foam::fv::variableHeatTransfer::calculateHtc()
|
|
||||||
{
|
{
|
||||||
const fvMesh& nbrMesh =
|
const fvMesh& nbrMesh =
|
||||||
mesh_.time().lookupObject<fvMesh>(nbrRegionName());
|
mesh_.time().lookupObject<fvMesh>(nbrRegionName());
|
||||||
@ -120,9 +119,7 @@ Foam::fv::variableHeatTransfer::calculateHtc()
|
|||||||
|
|
||||||
const scalarField htcNbrMapped(interpolate(htcNbr));
|
const scalarField htcNbrMapped(interpolate(htcNbr));
|
||||||
|
|
||||||
htc_.internalField() = htcNbrMapped*AoV_*meshInterp().V()/mesh_.V();
|
htc_.internalField() = htcNbrMapped*AoV_;
|
||||||
|
|
||||||
return htc_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ public:
|
|||||||
// Public Functions
|
// Public Functions
|
||||||
|
|
||||||
//- Calculate the heat transfer coefficient
|
//- Calculate the heat transfer coefficient
|
||||||
virtual const tmp<volScalarField> calculateHtc();
|
virtual void calculateHtc();
|
||||||
|
|
||||||
|
|
||||||
// I-O
|
// I-O
|
||||||
@ -383,15 +383,25 @@ template<class CloudType>
|
|||||||
inline Foam::scalar Foam::ThermoCloud<CloudType>::Tmax() const
|
inline Foam::scalar Foam::ThermoCloud<CloudType>::Tmax() const
|
||||||
{
|
{
|
||||||
scalar T = -GREAT;
|
scalar T = -GREAT;
|
||||||
|
scalar n = 0;
|
||||||
forAllConstIter(typename ThermoCloud<CloudType>, *this, iter)
|
forAllConstIter(typename ThermoCloud<CloudType>, *this, iter)
|
||||||
{
|
{
|
||||||
const parcelType& p = iter();
|
const parcelType& p = iter();
|
||||||
T = max(T, p.T());
|
T = max(T, p.T());
|
||||||
|
n++;
|
||||||
}
|
}
|
||||||
|
|
||||||
reduce(T, maxOp<scalar>());
|
reduce(T, maxOp<scalar>());
|
||||||
|
reduce(n, sumOp<label>());
|
||||||
|
|
||||||
return max(0.0, T);
|
if (n > 0)
|
||||||
|
{
|
||||||
|
return T;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -399,15 +409,25 @@ template<class CloudType>
|
|||||||
inline Foam::scalar Foam::ThermoCloud<CloudType>::Tmin() const
|
inline Foam::scalar Foam::ThermoCloud<CloudType>::Tmin() const
|
||||||
{
|
{
|
||||||
scalar T = GREAT;
|
scalar T = GREAT;
|
||||||
|
scalar n = 0;
|
||||||
forAllConstIter(typename ThermoCloud<CloudType>, *this, iter)
|
forAllConstIter(typename ThermoCloud<CloudType>, *this, iter)
|
||||||
{
|
{
|
||||||
const parcelType& p = iter();
|
const parcelType& p = iter();
|
||||||
T = min(T, p.T());
|
T = min(T, p.T());
|
||||||
|
n++;
|
||||||
}
|
}
|
||||||
|
|
||||||
reduce(T, minOp<scalar>());
|
reduce(T, minOp<scalar>());
|
||||||
|
reduce(n, sumOp<label>());
|
||||||
|
|
||||||
return max(0.0, T);
|
if (n > 0)
|
||||||
|
{
|
||||||
|
return T;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -510,6 +510,9 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
|||||||
const CompositionModel<reactingCloudType>& composition =
|
const CompositionModel<reactingCloudType>& composition =
|
||||||
td.cloud().composition();
|
td.cloud().composition();
|
||||||
|
|
||||||
|
const scalar TMax = td.cloud().phaseChange().TMax(pc_, this->Tc_);
|
||||||
|
const scalar Tdash = min(T, TMax);
|
||||||
|
const scalar Tsdash = min(Ts, TMax);
|
||||||
|
|
||||||
// Calculate mass transfer due to phase change
|
// Calculate mass transfer due to phase change
|
||||||
td.cloud().phaseChange().calculate
|
td.cloud().phaseChange().calculate
|
||||||
@ -520,8 +523,8 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
|||||||
Pr,
|
Pr,
|
||||||
d,
|
d,
|
||||||
nus,
|
nus,
|
||||||
T,
|
Tdash,
|
||||||
Ts,
|
Tsdash,
|
||||||
pc_,
|
pc_,
|
||||||
this->Tc_,
|
this->Tc_,
|
||||||
YComponents,
|
YComponents,
|
||||||
@ -541,7 +544,7 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
|||||||
const label idc = composition.localToGlobalCarrierId(idPhase, i);
|
const label idc = composition.localToGlobalCarrierId(idPhase, i);
|
||||||
const label idl = composition.globalIds(idPhase)[i];
|
const label idl = composition.globalIds(idPhase)[i];
|
||||||
|
|
||||||
const scalar dh = td.cloud().phaseChange().dh(idc, idl, pc_, T);
|
const scalar dh = td.cloud().phaseChange().dh(idc, idl, pc_, Tdash);
|
||||||
Sh -= dMassPC[i]*dh/dt;
|
Sh -= dMassPC[i]*dh/dt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -558,12 +561,12 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
|||||||
const label idc = composition.localToGlobalCarrierId(idPhase, i);
|
const label idc = composition.localToGlobalCarrierId(idPhase, i);
|
||||||
const label idl = composition.globalIds(idPhase)[i];
|
const label idl = composition.globalIds(idPhase)[i];
|
||||||
|
|
||||||
const scalar Cp = composition.carrier().Cp(idc, pc_, Ts);
|
const scalar Cp = composition.carrier().Cp(idc, pc_, Tsdash);
|
||||||
const scalar W = composition.carrier().W(idc);
|
const scalar W = composition.carrier().W(idc);
|
||||||
const scalar Ni = dMassPC[i]/(this->areaS(d)*dt*W);
|
const scalar Ni = dMassPC[i]/(this->areaS(d)*dt*W);
|
||||||
|
|
||||||
const scalar Dab =
|
const scalar Dab =
|
||||||
composition.liquids().properties()[idl].D(pc_, Ts, Wc);
|
composition.liquids().properties()[idl].D(pc_, Tsdash, Wc);
|
||||||
|
|
||||||
// Molar flux of species coming from the particle (kmol/m^2/s)
|
// Molar flux of species coming from the particle (kmol/m^2/s)
|
||||||
N += Ni;
|
N += Ni;
|
||||||
|
|||||||
@ -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) 2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -404,20 +404,23 @@ void Foam::ParticleCollector<CloudType>::write()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Field<scalar> faceMassTotal(mass_.size());
|
Field<scalar> faceMassTotal(mass_.size(), 0.0);
|
||||||
Field<scalar> faceMassFlowRate(massFlowRate_.size());
|
this->getModelProperty("massTotal", faceMassTotal);
|
||||||
|
|
||||||
|
Field<scalar> faceMassFlowRate(massFlowRate_.size(), 0.0);
|
||||||
|
this->getModelProperty("massFlowRate", faceMassFlowRate);
|
||||||
|
|
||||||
forAll(faces_, faceI)
|
forAll(faces_, faceI)
|
||||||
{
|
{
|
||||||
scalarList allProcMass(Pstream::nProcs());
|
scalarList allProcMass(Pstream::nProcs());
|
||||||
allProcMass[procI] = massTotal_[faceI];
|
allProcMass[procI] = massTotal_[faceI];
|
||||||
Pstream::gatherList(allProcMass);
|
Pstream::gatherList(allProcMass);
|
||||||
faceMassTotal[faceI] = sum(allProcMass);
|
faceMassTotal[faceI] += sum(allProcMass);
|
||||||
|
|
||||||
scalarList allProcMassFlowRate(Pstream::nProcs());
|
scalarList allProcMassFlowRate(Pstream::nProcs());
|
||||||
allProcMassFlowRate[procI] = massFlowRate_[faceI];
|
allProcMassFlowRate[procI] = massFlowRate_[faceI];
|
||||||
Pstream::gatherList(allProcMassFlowRate);
|
Pstream::gatherList(allProcMassFlowRate);
|
||||||
faceMassFlowRate[faceI] = sum(allProcMassFlowRate);
|
faceMassFlowRate[faceI] += sum(allProcMassFlowRate);
|
||||||
|
|
||||||
Info<< " face " << faceI
|
Info<< " face " << faceI
|
||||||
<< ": total mass = " << faceMassTotal[faceI]
|
<< ": total mass = " << faceMassTotal[faceI]
|
||||||
@ -470,20 +473,25 @@ void Foam::ParticleCollector<CloudType>::write()
|
|||||||
|
|
||||||
if (resetOnWrite_)
|
if (resetOnWrite_)
|
||||||
{
|
{
|
||||||
forAll(faces_, faceI)
|
Field<scalar> dummy(faceMassTotal.size(), 0.0);
|
||||||
{
|
this->setModelProperty("massTotal", dummy);
|
||||||
massFlowRate_[faceI] = 0.0;
|
this->setModelProperty("massFlowRate", dummy);
|
||||||
}
|
|
||||||
timeOld_ = timeNew;
|
timeOld_ = timeNew;
|
||||||
totalTime_ = 0.0;
|
totalTime_ = 0.0;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->setModelProperty("massTotal", faceMassTotal);
|
||||||
|
this->setModelProperty("massFlowRate", faceMassFlowRate);
|
||||||
|
}
|
||||||
|
|
||||||
forAll(faces_, faceI)
|
forAll(faces_, faceI)
|
||||||
{
|
{
|
||||||
mass_[faceI] = 0.0;
|
mass_[faceI] = 0.0;
|
||||||
|
massTotal_[faceI] = 0.0;
|
||||||
|
massFlowRate_[faceI] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// writeProperties();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -552,8 +560,8 @@ Foam::ParticleCollector<CloudType>::ParticleCollector
|
|||||||
(
|
(
|
||||||
"Foam::ParticleCollector<CloudType>::ParticleCollector"
|
"Foam::ParticleCollector<CloudType>::ParticleCollector"
|
||||||
"("
|
"("
|
||||||
"const dictionary& dict,"
|
"const dictionary&,"
|
||||||
"CloudType& owner"
|
"CloudType&"
|
||||||
")"
|
")"
|
||||||
)
|
)
|
||||||
<< "Unknown mode " << mode << ". Available options are "
|
<< "Unknown mode " << mode << ". Available options are "
|
||||||
@ -565,8 +573,6 @@ Foam::ParticleCollector<CloudType>::ParticleCollector
|
|||||||
massFlowRate_.setSize(faces_.size(), 0.0);
|
massFlowRate_.setSize(faces_.size(), 0.0);
|
||||||
|
|
||||||
makeLogFile(faces_, points_, area_);
|
makeLogFile(faces_, points_, area_);
|
||||||
|
|
||||||
// readProperties(); AND initialise mass... fields
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -579,6 +585,7 @@ Foam::ParticleCollector<CloudType>::ParticleCollector
|
|||||||
CloudFunctionObject<CloudType>(pc),
|
CloudFunctionObject<CloudType>(pc),
|
||||||
mode_(pc.mode_),
|
mode_(pc.mode_),
|
||||||
parcelType_(pc.parcelType_),
|
parcelType_(pc.parcelType_),
|
||||||
|
removeCollected_(pc.removeCollected_),
|
||||||
points_(pc.points_),
|
points_(pc.points_),
|
||||||
faces_(pc.faces_),
|
faces_(pc.faces_),
|
||||||
faceTris_(pc.faceTris_),
|
faceTris_(pc.faceTris_),
|
||||||
|
|||||||
@ -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-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -200,8 +200,8 @@ Foam::scalar Foam::LiquidEvaporation<CloudType>::dh
|
|||||||
(
|
(
|
||||||
const label idc,
|
const label idc,
|
||||||
const label idl,
|
const label idl,
|
||||||
const label p,
|
const scalar p,
|
||||||
const label T
|
const scalar T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
scalar dh = 0;
|
scalar dh = 0;
|
||||||
@ -230,8 +230,8 @@ Foam::scalar Foam::LiquidEvaporation<CloudType>::dh
|
|||||||
"("
|
"("
|
||||||
"const label, "
|
"const label, "
|
||||||
"const label, "
|
"const label, "
|
||||||
"const label, "
|
"const scalar, "
|
||||||
"const label"
|
"const scalar"
|
||||||
") const"
|
") const"
|
||||||
) << "Unknown enthalpyTransfer type" << abort(FatalError);
|
) << "Unknown enthalpyTransfer type" << abort(FatalError);
|
||||||
}
|
}
|
||||||
@ -241,4 +241,21 @@ Foam::scalar Foam::LiquidEvaporation<CloudType>::dh
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
Foam::scalar Foam::LiquidEvaporation<CloudType>::TMax
|
||||||
|
(
|
||||||
|
const scalar pIn,
|
||||||
|
const scalar TIn
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar T = -GREAT;
|
||||||
|
forAll(liquids_, i)
|
||||||
|
{
|
||||||
|
T = max(T, liquids_.properties()[i].pv(pIn, TIn));
|
||||||
|
}
|
||||||
|
|
||||||
|
return T;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -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-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -127,9 +127,12 @@ public:
|
|||||||
(
|
(
|
||||||
const label idc,
|
const label idc,
|
||||||
const label idl,
|
const label idl,
|
||||||
const label p,
|
const scalar p,
|
||||||
const label T
|
const scalar T
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Return maximum/limiting temperature
|
||||||
|
virtual scalar TMax(const scalar pIn, const scalar TIn) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -293,8 +293,8 @@ Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::dh
|
|||||||
(
|
(
|
||||||
const label idc,
|
const label idc,
|
||||||
const label idl,
|
const label idl,
|
||||||
const label p,
|
const scalar p,
|
||||||
const label T
|
const scalar T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
scalar dh = 0;
|
scalar dh = 0;
|
||||||
@ -329,8 +329,8 @@ Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::dh
|
|||||||
"("
|
"("
|
||||||
"const label, "
|
"const label, "
|
||||||
"const label, "
|
"const label, "
|
||||||
"const label, "
|
"const scalar, "
|
||||||
"const label"
|
"const scalar"
|
||||||
") const"
|
") const"
|
||||||
) << "Unknown enthalpyTransfer type" << abort(FatalError);
|
) << "Unknown enthalpyTransfer type" << abort(FatalError);
|
||||||
}
|
}
|
||||||
@ -340,4 +340,21 @@ Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::dh
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::TMax
|
||||||
|
(
|
||||||
|
const scalar pIn,
|
||||||
|
const scalar TIn
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
scalar T = -GREAT;
|
||||||
|
forAll(liquids_, i)
|
||||||
|
{
|
||||||
|
T = max(T, liquids_.properties()[i].pv(pIn, TIn));
|
||||||
|
}
|
||||||
|
|
||||||
|
return T;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -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-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -137,9 +137,12 @@ public:
|
|||||||
(
|
(
|
||||||
const label idc,
|
const label idc,
|
||||||
const label idl,
|
const label idl,
|
||||||
const label p,
|
const scalar p,
|
||||||
const label T
|
const scalar T
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Return maximum/limiting temperature
|
||||||
|
virtual scalar TMax(const scalar pIn, const scalar TIn) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -170,14 +170,25 @@ Foam::scalar Foam::PhaseChangeModel<CloudType>::dh
|
|||||||
(
|
(
|
||||||
const label idc,
|
const label idc,
|
||||||
const label idl,
|
const label idl,
|
||||||
const label p,
|
const scalar p,
|
||||||
const label T
|
const scalar T
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
Foam::scalar Foam::PhaseChangeModel<CloudType>::TMax
|
||||||
|
(
|
||||||
|
const scalar,
|
||||||
|
const scalar
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return GREAT;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
void Foam::PhaseChangeModel<CloudType>::addToPhaseChangeMass(const scalar dMass)
|
void Foam::PhaseChangeModel<CloudType>::addToPhaseChangeMass(const scalar dMass)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -180,10 +180,12 @@ public:
|
|||||||
(
|
(
|
||||||
const label idc,
|
const label idc,
|
||||||
const label idl,
|
const label idl,
|
||||||
const label p,
|
const scalar p,
|
||||||
const label T
|
const scalar T
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Return maximum/limiting temperature
|
||||||
|
virtual scalar TMax(const scalar pIn, const scalar TIn) const;
|
||||||
|
|
||||||
//- Add to phase change mass
|
//- Add to phase change mass
|
||||||
void addToPhaseChangeMass(const scalar dMass);
|
void addToPhaseChangeMass(const scalar dMass);
|
||||||
|
|||||||
@ -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-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -572,7 +572,7 @@ bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel
|
|||||||
regionModels::surfaceFilmModels::surfaceFilmModel& filmModel =
|
regionModels::surfaceFilmModels::surfaceFilmModel& filmModel =
|
||||||
const_cast<regionModels::surfaceFilmModels::surfaceFilmModel&>
|
const_cast<regionModels::surfaceFilmModels::surfaceFilmModel&>
|
||||||
(
|
(
|
||||||
this->owner().db().objectRegistry::template
|
this->owner().db().time().objectRegistry::template
|
||||||
lookupObject<regionModels::surfaceFilmModels::surfaceFilmModel>
|
lookupObject<regionModels::surfaceFilmModels::surfaceFilmModel>
|
||||||
(
|
(
|
||||||
"surfaceFilmProperties"
|
"surfaceFilmProperties"
|
||||||
|
|||||||
@ -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-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -43,9 +43,11 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const pointData& wDist)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::Istream& Foam::operator>>(Istream& is, pointData& wDist)
|
Foam::Istream& Foam::operator>>(Istream& is, pointData& wDist)
|
||||||
{
|
{
|
||||||
return is >> static_cast<pointEdgePoint&>(wDist) >> wDist.s_ >> wDist.v_;
|
return is >> static_cast<pointEdgePoint&>(wDist) >> wDist.s_ >> wDist.v_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -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-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -148,6 +148,13 @@ public:
|
|||||||
TrackingData& td
|
TrackingData& td
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Member Operators
|
||||||
|
|
||||||
|
// Needed for List IO
|
||||||
|
inline bool operator==(const pointData&) const;
|
||||||
|
inline bool operator!=(const pointData&) const;
|
||||||
|
|
||||||
|
|
||||||
// IOstream Operators
|
// IOstream Operators
|
||||||
|
|
||||||
friend Ostream& operator<<(Ostream&, const pointData&);
|
friend Ostream& operator<<(Ostream&, const pointData&);
|
||||||
|
|||||||
@ -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-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -215,4 +215,23 @@ inline bool Foam::pointData::updateEdge
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
inline bool Foam::pointData::operator==(const Foam::pointData& rhs)
|
||||||
|
const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
pointEdgePoint::operator==(rhs)
|
||||||
|
&& (s() == rhs.s())
|
||||||
|
&& (v() == rhs.v());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline bool Foam::pointData::operator!=(const Foam::pointData& rhs)
|
||||||
|
const
|
||||||
|
{
|
||||||
|
return !(*this == rhs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -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-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -258,6 +258,106 @@ void Foam::meshRefinement::updateIntersections(const labelList& changedFaces)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::meshRefinement::testSyncPointList
|
||||||
|
(
|
||||||
|
const string& msg,
|
||||||
|
const polyMesh& mesh,
|
||||||
|
const List<scalar>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (fld.size() != mesh.nPoints())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"meshRefinement::testSyncPointList(const polyMesh&"
|
||||||
|
", const List<scalar>&)"
|
||||||
|
) << msg << endl
|
||||||
|
<< "fld size:" << fld.size() << " mesh points:" << mesh.nPoints()
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
Pout<< "Checking field " << msg << endl;
|
||||||
|
scalarField minFld(fld);
|
||||||
|
syncTools::syncPointList
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
minFld,
|
||||||
|
minEqOp<scalar>(),
|
||||||
|
GREAT
|
||||||
|
);
|
||||||
|
scalarField maxFld(fld);
|
||||||
|
syncTools::syncPointList
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
maxFld,
|
||||||
|
maxEqOp<scalar>(),
|
||||||
|
-GREAT
|
||||||
|
);
|
||||||
|
forAll(minFld, pointI)
|
||||||
|
{
|
||||||
|
const scalar& minVal = minFld[pointI];
|
||||||
|
const scalar& maxVal = maxFld[pointI];
|
||||||
|
if (mag(minVal-maxVal) > SMALL)
|
||||||
|
{
|
||||||
|
Pout<< msg << " at:" << mesh.points()[pointI] << nl
|
||||||
|
<< " minFld:" << minVal << nl
|
||||||
|
<< " maxFld:" << maxVal << nl
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::meshRefinement::testSyncPointList
|
||||||
|
(
|
||||||
|
const string& msg,
|
||||||
|
const polyMesh& mesh,
|
||||||
|
const List<point>& fld
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (fld.size() != mesh.nPoints())
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"meshRefinement::testSyncPointList(const polyMesh&"
|
||||||
|
", const List<point>&)"
|
||||||
|
) << msg << endl
|
||||||
|
<< "fld size:" << fld.size() << " mesh points:" << mesh.nPoints()
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
Pout<< "Checking field " << msg << endl;
|
||||||
|
pointField minFld(fld);
|
||||||
|
syncTools::syncPointList
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
minFld,
|
||||||
|
minMagSqrEqOp<point>(),
|
||||||
|
point(GREAT, GREAT, GREAT)
|
||||||
|
);
|
||||||
|
pointField maxFld(fld);
|
||||||
|
syncTools::syncPointList
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
maxFld,
|
||||||
|
maxMagSqrEqOp<point>(),
|
||||||
|
vector::zero
|
||||||
|
);
|
||||||
|
forAll(minFld, pointI)
|
||||||
|
{
|
||||||
|
const point& minVal = minFld[pointI];
|
||||||
|
const point& maxVal = maxFld[pointI];
|
||||||
|
if (mag(minVal-maxVal) > SMALL)
|
||||||
|
{
|
||||||
|
Pout<< msg << " at:" << mesh.points()[pointI] << nl
|
||||||
|
<< " minFld:" << minVal << nl
|
||||||
|
<< " maxFld:" << maxVal << nl
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::meshRefinement::checkData()
|
void Foam::meshRefinement::checkData()
|
||||||
{
|
{
|
||||||
Pout<< "meshRefinement::checkData() : Checking refinement structure."
|
Pout<< "meshRefinement::checkData() : Checking refinement structure."
|
||||||
|
|||||||
@ -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-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -879,6 +879,20 @@ public:
|
|||||||
//- Debugging: check that all faces still obey start()>end()
|
//- Debugging: check that all faces still obey start()>end()
|
||||||
void checkData();
|
void checkData();
|
||||||
|
|
||||||
|
static void testSyncPointList
|
||||||
|
(
|
||||||
|
const string& msg,
|
||||||
|
const polyMesh& mesh,
|
||||||
|
const List<scalar>& fld
|
||||||
|
);
|
||||||
|
|
||||||
|
static void testSyncPointList
|
||||||
|
(
|
||||||
|
const string& msg,
|
||||||
|
const polyMesh& mesh,
|
||||||
|
const List<point>& fld
|
||||||
|
);
|
||||||
|
|
||||||
//- Compare two lists over all boundary faces
|
//- Compare two lists over all boundary faces
|
||||||
template<class T>
|
template<class T>
|
||||||
void testSyncBoundaryFaceList
|
void testSyncBoundaryFaceList
|
||||||
|
|||||||
@ -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-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,8 +25,8 @@ Class
|
|||||||
Foam::pointEdgePoint
|
Foam::pointEdgePoint
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Holds information regarding nearest wall point. Used in pointEdgeWave.
|
Holds information regarding nearest wall point. Used in PointEdgeWave.
|
||||||
(so not standard meshWave)
|
(so not standard FaceCellWave)
|
||||||
To be used in wall distance calculation.
|
To be used in wall distance calculation.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
@ -116,7 +116,7 @@ public:
|
|||||||
inline scalar distSqr() const;
|
inline scalar distSqr() const;
|
||||||
|
|
||||||
|
|
||||||
// Needed by meshWave
|
// Needed by PointEdgeWave
|
||||||
|
|
||||||
//- Check whether origin has been changed at all or
|
//- Check whether origin has been changed at all or
|
||||||
// still contains original (invalid) value.
|
// still contains original (invalid) value.
|
||||||
|
|||||||
@ -310,14 +310,14 @@ inline bool Foam::pointEdgePoint::equal
|
|||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
inline bool Foam::pointEdgePoint::operator==(const Foam::pointEdgePoint& rhs)
|
inline bool Foam::pointEdgePoint::operator==(const Foam::pointEdgePoint& rhs)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
return origin() == rhs.origin();
|
return (origin() == rhs.origin()) && (distSqr() == rhs.distSqr());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline bool Foam::pointEdgePoint::operator!=(const Foam::pointEdgePoint& rhs)
|
inline bool Foam::pointEdgePoint::operator!=(const Foam::pointEdgePoint& rhs)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
return !(*this == rhs);
|
return !(*this == rhs);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,9 +54,9 @@ Foam::scalar Foam::tetOverlapVolume::tetTetOverlapVol
|
|||||||
const tetPoints& tetB
|
const tetPoints& tetB
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
tetPointRef::tetIntersectionList insideTets;
|
static tetPointRef::tetIntersectionList insideTets;
|
||||||
label nInside = 0;
|
label nInside = 0;
|
||||||
tetPointRef::tetIntersectionList cutInsideTets;
|
static tetPointRef::tetIntersectionList cutInsideTets;
|
||||||
label nCutInside = 0;
|
label nCutInside = 0;
|
||||||
|
|
||||||
tetPointRef::storeOp inside(insideTets, nInside);
|
tetPointRef::storeOp inside(insideTets, nInside);
|
||||||
|
|||||||
@ -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-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -77,6 +77,8 @@ Description
|
|||||||
mean on;
|
mean on;
|
||||||
prime2Mean on;
|
prime2Mean on;
|
||||||
base time;
|
base time;
|
||||||
|
window 10.0;
|
||||||
|
windowName w1;
|
||||||
}
|
}
|
||||||
p
|
p
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -42,7 +42,15 @@ void Foam::fieldAverage::addMeanField
|
|||||||
|
|
||||||
const word& fieldName = faItems_[fieldI].fieldName();
|
const word& fieldName = faItems_[fieldI].fieldName();
|
||||||
|
|
||||||
const word meanFieldName = fieldName + EXT_MEAN;
|
word meanFieldName = fieldName + EXT_MEAN;
|
||||||
|
if
|
||||||
|
(
|
||||||
|
(faItems_[fieldI].window() > 0)
|
||||||
|
&& (faItems_[fieldI].windowName() != "")
|
||||||
|
)
|
||||||
|
{
|
||||||
|
meanFieldName = meanFieldName + "_" + faItems_[fieldI].windowName();
|
||||||
|
}
|
||||||
|
|
||||||
Info<< "Reading/calculating field " << meanFieldName << nl << endl;
|
Info<< "Reading/calculating field " << meanFieldName << nl << endl;
|
||||||
|
|
||||||
@ -100,7 +108,16 @@ void Foam::fieldAverage::addPrime2MeanField
|
|||||||
|
|
||||||
const word& fieldName = faItems_[fieldI].fieldName();
|
const word& fieldName = faItems_[fieldI].fieldName();
|
||||||
|
|
||||||
const word meanFieldName = fieldName + EXT_PRIME2MEAN;
|
word meanFieldName = fieldName + EXT_PRIME2MEAN;
|
||||||
|
if
|
||||||
|
(
|
||||||
|
(faItems_[fieldI].window() > 0)
|
||||||
|
&& (faItems_[fieldI].windowName() != "")
|
||||||
|
)
|
||||||
|
{
|
||||||
|
meanFieldName = meanFieldName + "_" + faItems_[fieldI].windowName();
|
||||||
|
}
|
||||||
|
|
||||||
Info<< "Reading/calculating field " << meanFieldName << nl << endl;
|
Info<< "Reading/calculating field " << meanFieldName << nl << endl;
|
||||||
|
|
||||||
if (obr_.foundObject<fieldType2>(meanFieldName))
|
if (obr_.foundObject<fieldType2>(meanFieldName))
|
||||||
|
|||||||
@ -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-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -54,7 +54,8 @@ Foam::fieldAverageItem::fieldAverageItem()
|
|||||||
mean_(0),
|
mean_(0),
|
||||||
prime2Mean_(0),
|
prime2Mean_(0),
|
||||||
base_(ITER),
|
base_(ITER),
|
||||||
window_(-1.0)
|
window_(-1.0),
|
||||||
|
windowName_("")
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -64,7 +65,8 @@ Foam::fieldAverageItem::fieldAverageItem(const fieldAverageItem& faItem)
|
|||||||
mean_(faItem.mean_),
|
mean_(faItem.mean_),
|
||||||
prime2Mean_(faItem.prime2Mean_),
|
prime2Mean_(faItem.prime2Mean_),
|
||||||
base_(faItem.base_),
|
base_(faItem.base_),
|
||||||
window_(faItem.window_)
|
window_(faItem.window_),
|
||||||
|
windowName_(faItem.windowName_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -94,6 +96,7 @@ void Foam::fieldAverageItem::operator=(const fieldAverageItem& rhs)
|
|||||||
prime2Mean_ = rhs.prime2Mean_;
|
prime2Mean_ = rhs.prime2Mean_;
|
||||||
base_ = rhs.base_;
|
base_ = rhs.base_;
|
||||||
window_ = rhs.window_;
|
window_ = rhs.window_;
|
||||||
|
windowName_ = rhs.windowName_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -34,6 +34,7 @@ Description
|
|||||||
prime2Mean on;
|
prime2Mean on;
|
||||||
base time; // iteration
|
base time; // iteration
|
||||||
window 200; // optional averaging window
|
window 200; // optional averaging window
|
||||||
|
windowName w1; // optional window name (default = "")
|
||||||
}
|
}
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
@ -107,6 +108,9 @@ private:
|
|||||||
//- Averaging window - defaults to -1 for 'all iters/time'
|
//- Averaging window - defaults to -1 for 'all iters/time'
|
||||||
scalar window_;
|
scalar window_;
|
||||||
|
|
||||||
|
//- Averaging window name - defaults to 'window'
|
||||||
|
word windowName_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -171,6 +175,11 @@ public:
|
|||||||
return window_;
|
return window_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const word& windowName() const
|
||||||
|
{
|
||||||
|
return windowName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
// Member Operators
|
||||||
|
|
||||||
@ -190,7 +199,8 @@ public:
|
|||||||
&& a.mean_ == b.mean_
|
&& a.mean_ == b.mean_
|
||||||
&& a.prime2Mean_ == b.prime2Mean_
|
&& a.prime2Mean_ == b.prime2Mean_
|
||||||
&& a.base_ == b.base_
|
&& a.base_ == b.base_
|
||||||
&& a.window_ == b.window_;
|
&& a.window_ == b.window_
|
||||||
|
&& a.windowName_ == b.windowName_;
|
||||||
}
|
}
|
||||||
|
|
||||||
friend bool operator!=
|
friend bool operator!=
|
||||||
|
|||||||
@ -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-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -46,6 +46,7 @@ Foam::fieldAverageItem::fieldAverageItem(Istream& is)
|
|||||||
entry.lookup("prime2Mean") >> prime2Mean_;
|
entry.lookup("prime2Mean") >> prime2Mean_;
|
||||||
base_ = baseTypeNames_[entry.lookup("base")];
|
base_ = baseTypeNames_[entry.lookup("base")];
|
||||||
window_ = entry.lookupOrDefault<scalar>("window", -1.0);
|
window_ = entry.lookupOrDefault<scalar>("window", -1.0);
|
||||||
|
windowName_ = entry.lookupOrDefault<word>("windowName", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -66,6 +67,7 @@ Foam::Istream& Foam::operator>>(Istream& is, fieldAverageItem& faItem)
|
|||||||
entry.lookup("prime2Mean") >> faItem.prime2Mean_;
|
entry.lookup("prime2Mean") >> faItem.prime2Mean_;
|
||||||
faItem.base_ = faItem.baseTypeNames_[entry.lookup("base")];
|
faItem.base_ = faItem.baseTypeNames_[entry.lookup("base")];
|
||||||
faItem.window_ = entry.lookupOrDefault<scalar>("window", -1.0);
|
faItem.window_ = entry.lookupOrDefault<scalar>("window", -1.0);
|
||||||
|
faItem.windowName_ = entry.lookupOrDefault<word>("windowName", "");
|
||||||
|
|
||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
@ -90,6 +92,12 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const fieldAverageItem& faItem)
|
|||||||
{
|
{
|
||||||
os.writeKeyword("window") << faItem.window_
|
os.writeKeyword("window") << faItem.window_
|
||||||
<< token::END_STATEMENT << nl;
|
<< token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
if (faItem.windowName_ != "")
|
||||||
|
{
|
||||||
|
os.writeKeyword("windowName") << faItem.windowName_
|
||||||
|
<< token::END_STATEMENT << nl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
os << token::END_BLOCK << nl;
|
os << token::END_BLOCK << nl;
|
||||||
|
|||||||
@ -27,6 +27,9 @@ Class
|
|||||||
Description
|
Description
|
||||||
mesh to mesh interpolation class.
|
mesh to mesh interpolation class.
|
||||||
|
|
||||||
|
Note
|
||||||
|
This class is due to be deprecated in favour of meshToMeshNew
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
meshToMesh.C
|
meshToMesh.C
|
||||||
calculateMeshToMeshAddressing.C
|
calculateMeshToMeshAddressing.C
|
||||||
|
|||||||
@ -39,6 +39,20 @@ License
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(meshToMeshNew, 0);
|
defineTypeNameAndDebug(meshToMeshNew, 0);
|
||||||
|
|
||||||
|
template<>
|
||||||
|
const char* Foam::NamedEnum
|
||||||
|
<
|
||||||
|
Foam::meshToMeshNew::interpolationMethod,
|
||||||
|
2
|
||||||
|
>::names[] =
|
||||||
|
{
|
||||||
|
"map",
|
||||||
|
"cellVolumeWeight"
|
||||||
|
};
|
||||||
|
|
||||||
|
const NamedEnum<meshToMeshNew::interpolationMethod, 2>
|
||||||
|
meshToMeshNew::interpolationMethodNames_;
|
||||||
}
|
}
|
||||||
|
|
||||||
Foam::scalar Foam::meshToMeshNew::tolerance_ = 1e-6;
|
Foam::scalar Foam::meshToMeshNew::tolerance_ = 1e-6;
|
||||||
@ -707,22 +721,40 @@ void Foam::meshToMeshNew::calcAddressing
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (directMapping_)
|
switch (method_)
|
||||||
{
|
{
|
||||||
calcDirect(src, tgt, srcSeedI, tgtSeedI);
|
case imMap:
|
||||||
}
|
{
|
||||||
else
|
calcDirect(src, tgt, srcSeedI, tgtSeedI);
|
||||||
{
|
break;
|
||||||
calcIndirect
|
}
|
||||||
(
|
case imCellVolumeWeight:
|
||||||
src,
|
{
|
||||||
tgt,
|
calcIndirect
|
||||||
srcSeedI,
|
(
|
||||||
tgtSeedI,
|
src,
|
||||||
srcCellIDs,
|
tgt,
|
||||||
mapFlag,
|
srcSeedI,
|
||||||
startSeedI
|
tgtSeedI,
|
||||||
);
|
srcCellIDs,
|
||||||
|
mapFlag,
|
||||||
|
startSeedI
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"void Foam::meshToMeshNew::calcAddressing"
|
||||||
|
"("
|
||||||
|
"const polyMesh&, "
|
||||||
|
"const polyMesh&"
|
||||||
|
")"
|
||||||
|
)
|
||||||
|
<< "Unknown interpolation method"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -739,7 +771,7 @@ Foam::meshToMeshNew::meshToMeshNew
|
|||||||
(
|
(
|
||||||
const polyMesh& src,
|
const polyMesh& src,
|
||||||
const polyMesh& tgt,
|
const polyMesh& tgt,
|
||||||
const bool directMapping
|
const interpolationMethod& method
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
srcRegionName_(src.name()),
|
srcRegionName_(src.name()),
|
||||||
@ -748,11 +780,11 @@ Foam::meshToMeshNew::meshToMeshNew
|
|||||||
tgtToSrcCellAddr_(),
|
tgtToSrcCellAddr_(),
|
||||||
srcToTgtCellWght_(),
|
srcToTgtCellWght_(),
|
||||||
tgtToSrcCellWght_(),
|
tgtToSrcCellWght_(),
|
||||||
|
method_(method),
|
||||||
V_(0.0),
|
V_(0.0),
|
||||||
singleMeshProc_(-1),
|
singleMeshProc_(-1),
|
||||||
srcMapPtr_(NULL),
|
srcMapPtr_(NULL),
|
||||||
tgtMapPtr_(NULL),
|
tgtMapPtr_(NULL)
|
||||||
directMapping_(directMapping)
|
|
||||||
{
|
{
|
||||||
Info<< "Creating mesh-to-mesh addressing for " << src.name()
|
Info<< "Creating mesh-to-mesh addressing for " << src.name()
|
||||||
<< " and " << tgt.name() << " regions" << endl;
|
<< " and " << tgt.name() << " regions" << endl;
|
||||||
|
|||||||
@ -40,6 +40,7 @@ SourceFiles
|
|||||||
#include "boundBox.H"
|
#include "boundBox.H"
|
||||||
#include "mapDistribute.H"
|
#include "mapDistribute.H"
|
||||||
#include "volFieldsFwd.H"
|
#include "volFieldsFwd.H"
|
||||||
|
#include "NamedEnum.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -52,6 +53,22 @@ namespace Foam
|
|||||||
|
|
||||||
class meshToMeshNew
|
class meshToMeshNew
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Public data types
|
||||||
|
|
||||||
|
//- Enumeration specifying required accuracy
|
||||||
|
enum interpolationMethod
|
||||||
|
{
|
||||||
|
imMap,
|
||||||
|
imCellVolumeWeight
|
||||||
|
};
|
||||||
|
|
||||||
|
static const NamedEnum<interpolationMethod, 2>
|
||||||
|
interpolationMethodNames_;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Name of source mesh region
|
//- Name of source mesh region
|
||||||
@ -72,6 +89,9 @@ class meshToMeshNew
|
|||||||
//- Target to source cell interpolation weights
|
//- Target to source cell interpolation weights
|
||||||
scalarListList tgtToSrcCellWght_;
|
scalarListList tgtToSrcCellWght_;
|
||||||
|
|
||||||
|
//- Interpolation method
|
||||||
|
interpolationMethod method_;
|
||||||
|
|
||||||
//- Cell total volume in overlap region [m3]
|
//- Cell total volume in overlap region [m3]
|
||||||
scalar V_;
|
scalar V_;
|
||||||
|
|
||||||
@ -85,9 +105,6 @@ class meshToMeshNew
|
|||||||
//- Target map pointer - parallel running only
|
//- Target map pointer - parallel running only
|
||||||
autoPtr<mapDistribute> tgtMapPtr_;
|
autoPtr<mapDistribute> tgtMapPtr_;
|
||||||
|
|
||||||
//- Flag to indicate that direct (one-to-one) mapping should be applied
|
|
||||||
bool directMapping_;
|
|
||||||
|
|
||||||
//- Tolerance used in volume overlap calculations
|
//- Tolerance used in volume overlap calculations
|
||||||
static scalar tolerance_;
|
static scalar tolerance_;
|
||||||
|
|
||||||
@ -289,7 +306,7 @@ public:
|
|||||||
(
|
(
|
||||||
const polyMesh& src,
|
const polyMesh& src,
|
||||||
const polyMesh& tgt,
|
const polyMesh& tgt,
|
||||||
const bool directMapping
|
const interpolationMethod& method
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -395,28 +395,33 @@ void Foam::meshToMeshNew::interpolate
|
|||||||
|
|
||||||
if (interpPatches)
|
if (interpPatches)
|
||||||
{
|
{
|
||||||
if (directMapping_)
|
switch (method_)
|
||||||
{
|
{
|
||||||
result.boundaryField() == field.boundaryField();
|
case imMap:
|
||||||
}
|
{
|
||||||
else
|
result.boundaryField() == field.boundaryField();
|
||||||
{
|
break;
|
||||||
notImplemented
|
}
|
||||||
(
|
default:
|
||||||
"void Foam::meshToMeshNew::interpolate"
|
{
|
||||||
"("
|
notImplemented
|
||||||
"const GeometricField<Type, fvPatchField, volMesh>&, "
|
(
|
||||||
"const CombineOp&, "
|
"void Foam::meshToMeshNew::interpolate"
|
||||||
"GeometricField<Type, fvPatchField, volMesh>&, "
|
"("
|
||||||
"const bool"
|
"const GeometricField<Type, fvPatchField, volMesh>&, "
|
||||||
") const - non-conformal patches"
|
"const CombineOp&, "
|
||||||
)
|
"GeometricField<Type, fvPatchField, volMesh>&, "
|
||||||
|
"const bool"
|
||||||
|
") const - non-conformal patches"
|
||||||
|
)
|
||||||
|
|
||||||
// do something...
|
// do something...
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type, class CombineOp>
|
template<class Type, class CombineOp>
|
||||||
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
|
||||||
Foam::meshToMeshNew::interpolate
|
Foam::meshToMeshNew::interpolate
|
||||||
|
|||||||
@ -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-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -312,7 +312,30 @@ Foam::radiation::greyMeanAbsorptionEmission::ECont(const label bandI) const
|
|||||||
{
|
{
|
||||||
const volScalarField& dQ =
|
const volScalarField& dQ =
|
||||||
mesh_.lookupObject<volScalarField>("dQ");
|
mesh_.lookupObject<volScalarField>("dQ");
|
||||||
E().internalField() = EhrrCoeff_*dQ;
|
|
||||||
|
if (dQ.dimensions() == dimEnergy/dimTime)
|
||||||
|
{
|
||||||
|
E().internalField() = EhrrCoeff_*dQ/mesh_.V();
|
||||||
|
}
|
||||||
|
else if (dQ.dimensions() == dimEnergy/dimTime/dimVolume)
|
||||||
|
{
|
||||||
|
E().internalField() = EhrrCoeff_*dQ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
WarningIn
|
||||||
|
(
|
||||||
|
"tmp<volScalarField>"
|
||||||
|
"radiation::greyMeanAbsorptionEmission::ECont"
|
||||||
|
"("
|
||||||
|
"const label"
|
||||||
|
") const"
|
||||||
|
)
|
||||||
|
<< "Incompatible dimensions for dQ field" << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return E;
|
return E;
|
||||||
|
|||||||
@ -137,8 +137,82 @@ gasSpecies() const
|
|||||||
template<class ReactionThermo>
|
template<class ReactionThermo>
|
||||||
void Foam::solidReaction<ReactionThermo>::write(Ostream& os) const
|
void Foam::solidReaction<ReactionThermo>::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
Reaction<ReactionThermo>::write(os);
|
OStringStream reaction;
|
||||||
|
os.writeKeyword("reaction") << solidReactionStr(reaction)
|
||||||
|
<< token::END_STATEMENT << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ReactionThermo>
|
||||||
|
Foam::string Foam::solidReaction<ReactionThermo>::solidReactionStr
|
||||||
|
(
|
||||||
|
OStringStream& reaction
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
this->reactionStrLeft(reaction);
|
||||||
|
reaction << " + ";
|
||||||
|
solidReactionStrLeft(reaction);
|
||||||
|
reaction << " = ";
|
||||||
|
this->reactionStrRight(reaction);
|
||||||
|
reaction << " + ";
|
||||||
|
solidReactionStrRight(reaction);
|
||||||
|
return reaction.str();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ReactionThermo>
|
||||||
|
void Foam::solidReaction<ReactionThermo>::solidReactionStrLeft
|
||||||
|
(
|
||||||
|
OStringStream& reaction
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
for (label i = 0; i < glhs().size(); ++i)
|
||||||
|
{
|
||||||
|
reaction << " + ";
|
||||||
|
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
|
reaction << " + ";
|
||||||
|
}
|
||||||
|
if (mag(glhs()[i].stoichCoeff - 1) > SMALL)
|
||||||
|
{
|
||||||
|
reaction << glhs()[i].stoichCoeff;
|
||||||
|
}
|
||||||
|
reaction << gasSpecies()[glhs()[i].index];
|
||||||
|
if (mag(glhs()[i].exponent - glhs()[i].stoichCoeff) > SMALL)
|
||||||
|
{
|
||||||
|
reaction << "^" << glhs()[i].exponent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ReactionThermo>
|
||||||
|
void Foam::solidReaction<ReactionThermo>::solidReactionStrRight
|
||||||
|
(
|
||||||
|
OStringStream& reaction
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
|
||||||
|
for (label i = 0; i < grhs().size(); ++i)
|
||||||
|
{
|
||||||
|
reaction << " + ";
|
||||||
|
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
|
reaction << " + ";
|
||||||
|
}
|
||||||
|
if (mag(grhs()[i].stoichCoeff - 1) > SMALL)
|
||||||
|
{
|
||||||
|
reaction << grhs()[i].stoichCoeff;
|
||||||
|
}
|
||||||
|
reaction << gasSpecies()[grhs()[i].index];
|
||||||
|
if (mag(grhs()[i].exponent - grhs()[i].stoichCoeff) > SMALL)
|
||||||
|
{
|
||||||
|
reaction << "^" << grhs()[i].exponent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -81,6 +81,15 @@ private:
|
|||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
|
|
||||||
|
//- Return string representation of reaction
|
||||||
|
string solidReactionStr(OStringStream&) const;
|
||||||
|
|
||||||
|
//- Return string representation of the left of the reaction
|
||||||
|
void solidReactionStrLeft(OStringStream&) const;
|
||||||
|
|
||||||
|
//- Return string representation of the right of the reaction
|
||||||
|
void solidReactionStrRight(OStringStream&) const;
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const solidReaction&);
|
void operator=(const solidReaction&);
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,8 @@ inline Ostream& operator<<
|
|||||||
const solidReaction<ReactionThermo>& r
|
const solidReaction<ReactionThermo>& r
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
r.write(os);
|
OStringStream reaction;
|
||||||
|
os << r.solidReactionStr(reaction)<< token::END_STATEMENT <<nl;
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -31,21 +31,14 @@ License
|
|||||||
template<class ReactionThermo>
|
template<class ReactionThermo>
|
||||||
Foam::label Foam::Reaction<ReactionThermo>::nUnNamedReactions = 0;
|
Foam::label Foam::Reaction<ReactionThermo>::nUnNamedReactions = 0;
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
template<class ReactionThermo>
|
||||||
Foam::label Foam::Reaction<ReactionThermo>::getNewReactionID()
|
void Foam::Reaction<ReactionThermo>::reactionStrLeft
|
||||||
|
(
|
||||||
|
OStringStream& reaction
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
return nUnNamedReactions++;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ReactionThermo>
|
|
||||||
Foam::string Foam::Reaction<ReactionThermo>::reactionStr() const
|
|
||||||
{
|
|
||||||
OStringStream reaction;
|
|
||||||
|
|
||||||
for (label i = 0; i < lhs_.size(); ++i)
|
for (label i = 0; i < lhs_.size(); ++i)
|
||||||
{
|
{
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
@ -62,28 +55,15 @@ Foam::string Foam::Reaction<ReactionThermo>::reactionStr() const
|
|||||||
reaction << "^" << lhs_[i].exponent;
|
reaction << "^" << lhs_[i].exponent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (label i = 0; i < glhs().size(); ++i)
|
|
||||||
{
|
|
||||||
reaction << " + ";
|
|
||||||
|
|
||||||
if (i > 0)
|
|
||||||
{
|
|
||||||
reaction << " + ";
|
|
||||||
}
|
|
||||||
if (mag(glhs()[i].stoichCoeff - 1) > SMALL)
|
|
||||||
{
|
|
||||||
reaction << glhs()[i].stoichCoeff;
|
|
||||||
}
|
|
||||||
reaction << gasSpecies()[glhs()[i].index];
|
|
||||||
if (mag(glhs()[i].exponent - glhs()[i].stoichCoeff) > SMALL)
|
|
||||||
{
|
|
||||||
reaction << "^" << glhs()[i].exponent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
reaction << " = ";
|
|
||||||
|
|
||||||
|
template<class ReactionThermo>
|
||||||
|
void Foam::Reaction<ReactionThermo>::reactionStrRight
|
||||||
|
(
|
||||||
|
OStringStream& reaction
|
||||||
|
) const
|
||||||
|
{
|
||||||
for (label i = 0; i < rhs_.size(); ++i)
|
for (label i = 0; i < rhs_.size(); ++i)
|
||||||
{
|
{
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
@ -100,26 +80,27 @@ Foam::string Foam::Reaction<ReactionThermo>::reactionStr() const
|
|||||||
reaction << "^" << rhs_[i].exponent;
|
reaction << "^" << rhs_[i].exponent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (label i = 0; i < grhs().size(); ++i)
|
|
||||||
{
|
|
||||||
reaction << " + ";
|
|
||||||
|
|
||||||
if (i > 0)
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
{
|
|
||||||
reaction << " + ";
|
|
||||||
}
|
|
||||||
if (mag(grhs()[i].stoichCoeff - 1) > SMALL)
|
|
||||||
{
|
|
||||||
reaction << grhs()[i].stoichCoeff;
|
|
||||||
}
|
|
||||||
reaction << gasSpecies()[grhs()[i].index];
|
|
||||||
if (mag(grhs()[i].exponent - grhs()[i].stoichCoeff) > SMALL)
|
|
||||||
{
|
|
||||||
reaction << "^" << grhs()[i].exponent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
template<class ReactionThermo>
|
||||||
|
Foam::label Foam::Reaction<ReactionThermo>::getNewReactionID()
|
||||||
|
{
|
||||||
|
return nUnNamedReactions++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ReactionThermo>
|
||||||
|
Foam::string Foam::Reaction<ReactionThermo>::reactionStr
|
||||||
|
(
|
||||||
|
OStringStream& reaction
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
reactionStrLeft(reaction);
|
||||||
|
reaction << " = ";
|
||||||
|
reactionStrRight(reaction);
|
||||||
return reaction.str();
|
return reaction.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -464,7 +445,9 @@ Foam::Reaction<ReactionThermo>::New
|
|||||||
template<class ReactionThermo>
|
template<class ReactionThermo>
|
||||||
void Foam::Reaction<ReactionThermo>::write(Ostream& os) const
|
void Foam::Reaction<ReactionThermo>::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
os.writeKeyword("reaction") << reactionStr() << token::END_STATEMENT << nl;
|
OStringStream reaction;
|
||||||
|
os.writeKeyword("reaction") << reactionStr(reaction)
|
||||||
|
<< token::END_STATEMENT << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -66,6 +66,16 @@ class Reaction
|
|||||||
:
|
:
|
||||||
public ReactionThermo
|
public ReactionThermo
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected member functions
|
||||||
|
|
||||||
|
//- Return string representation of the left of the reaction
|
||||||
|
void reactionStrLeft(OStringStream& reaction) const;
|
||||||
|
|
||||||
|
//- Return string representation of the right of the reaction
|
||||||
|
void reactionStrRight(OStringStream& reaction) const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -134,7 +144,7 @@ private:
|
|||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Return string representation of reaction
|
//- Return string representation of reaction
|
||||||
string reactionStr() const;
|
string reactionStr(OStringStream& reaction) const;
|
||||||
|
|
||||||
//- Construct reaction thermo
|
//- Construct reaction thermo
|
||||||
void setThermo(const HashPtrTable<ReactionThermo>& thermoDatabase);
|
void setThermo(const HashPtrTable<ReactionThermo>& thermoDatabase);
|
||||||
|
|||||||
@ -67,8 +67,8 @@ Reaction<ReactionThermo>::rhs() const
|
|||||||
template<class ReactionThermo>
|
template<class ReactionThermo>
|
||||||
inline Ostream& operator<<(Ostream& os, const Reaction<ReactionThermo>& r)
|
inline Ostream& operator<<(Ostream& os, const Reaction<ReactionThermo>& r)
|
||||||
{
|
{
|
||||||
os << r.reactionStr()<< token::END_STATEMENT <<nl;
|
OStringStream reaction;
|
||||||
|
os << r.reactionStr(reaction)<< token::END_STATEMENT <<nl;
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,14 +17,14 @@ FoamFile
|
|||||||
|
|
||||||
dimensions [0 1 -1 0 0 0 0];
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
internalField uniform (0.1 0 0);
|
internalField uniform (0.01 0 0);
|
||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
type fixedValue;
|
type fixedValue;
|
||||||
value uniform (0.1 0 0);
|
value uniform (0.01 0 0);
|
||||||
}
|
}
|
||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
|
|||||||
@ -52,15 +52,15 @@ vertices
|
|||||||
|
|
||||||
blocks
|
blocks
|
||||||
(
|
(
|
||||||
hex (0 1 5 4 12 13 17 16) (20 20 20) simpleGrading (1 1 1)
|
hex (0 1 5 4 12 13 17 16) (30 30 30) simpleGrading (1 1 1)
|
||||||
hex (1 2 6 5 13 14 18 17) (20 20 20) simpleGrading (1 1 1)
|
hex (1 2 6 5 13 14 18 17) (30 30 30) simpleGrading (1 1 1)
|
||||||
hex (2 3 7 6 14 15 19 18) (20 20 20) simpleGrading (1 1 1)
|
hex (2 3 7 6 14 15 19 18) (30 30 30) simpleGrading (1 1 1)
|
||||||
hex (3 0 4 7 15 12 16 19) (20 20 20) simpleGrading (1 1 1)
|
hex (3 0 4 7 15 12 16 19) (30 30 30) simpleGrading (1 1 1)
|
||||||
hex (4 5 9 8 16 17 21 20) cylinder (20 20 20) simpleGrading (1 1 1)
|
hex (4 5 9 8 16 17 21 20) cylinder (30 30 30) simpleGrading (1 1 1)
|
||||||
hex (5 6 10 9 17 18 22 21) cylinder (20 20 20) simpleGrading (1 1 1)
|
hex (5 6 10 9 17 18 22 21) cylinder (30 30 30) simpleGrading (1 1 1)
|
||||||
hex (6 7 11 10 18 19 23 22) cylinder (20 20 20) simpleGrading (1 1 1)
|
hex (6 7 11 10 18 19 23 22) cylinder (30 30 30) simpleGrading (1 1 1)
|
||||||
hex (7 4 8 11 19 16 20 23) cylinder (20 20 20) simpleGrading (1 1 1)
|
hex (7 4 8 11 19 16 20 23) cylinder (30 30 30) simpleGrading (1 1 1)
|
||||||
hex (8 9 10 11 20 21 22 23) innerCylinder (20 20 20) simpleGrading (1 1 1)
|
hex (8 9 10 11 20 21 22 23) innerCylinder (30 30 30) simpleGrading (1 1 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
edges
|
edges
|
||||||
|
|||||||
@ -18,20 +18,20 @@ convertToMeters 0.05;
|
|||||||
|
|
||||||
vertices
|
vertices
|
||||||
(
|
(
|
||||||
(-2 4 4) // 0
|
(-2 2 6) // 0
|
||||||
(12 4 4) // 1
|
(12 2 6) // 1
|
||||||
(12 6 4) // 2
|
(12 8 6) // 2
|
||||||
(-2 6 4) // 3
|
(-2 8 6) // 3
|
||||||
|
|
||||||
(-2 4 6) // 4
|
(-2 2 7) // 4
|
||||||
(12 4 6) // 5
|
(12 2 7) // 5
|
||||||
(12 6 6) // 6
|
(12 8 7) // 6
|
||||||
(-2 6 6) // 7
|
(-2 8 7) // 7
|
||||||
);
|
);
|
||||||
|
|
||||||
blocks
|
blocks
|
||||||
(
|
(
|
||||||
hex (0 1 2 3 4 5 6 7) (20 4 4) simpleGrading (1 1 1)
|
hex (0 1 2 3 4 5 6 7) (40 30 30) simpleGrading (1 1 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
edges
|
edges
|
||||||
|
|||||||
@ -20,18 +20,44 @@ airToporous
|
|||||||
type constantHeatTransfer;
|
type constantHeatTransfer;
|
||||||
active on;
|
active on;
|
||||||
selectionMode mapRegion;
|
selectionMode mapRegion;
|
||||||
consistentMeshes no;
|
interpolationMethod cellVolumeWeight;
|
||||||
nbrModelName porousToair;
|
|
||||||
nbrRegionName porous;
|
nbrRegionName porous;
|
||||||
master false;
|
master false;
|
||||||
|
|
||||||
constantHeatTransferCoeffs
|
constantHeatTransferCoeffs
|
||||||
{
|
{
|
||||||
|
nbrModelName porousToair;
|
||||||
fieldNames (h);
|
fieldNames (h);
|
||||||
semiImplicit no;
|
semiImplicit no;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
porosityBlockage
|
||||||
|
{
|
||||||
|
type interRegionExplicitPorositySource;
|
||||||
|
active on;
|
||||||
|
selectionMode mapRegion;
|
||||||
|
interpolationMethod cellVolumeWeight;
|
||||||
|
nbrRegionName porous;
|
||||||
|
|
||||||
|
interRegionExplicitPorositySourceCoeffs
|
||||||
|
{
|
||||||
|
type DarcyForchheimer;
|
||||||
|
|
||||||
|
DarcyForchheimerCoeffs
|
||||||
|
{
|
||||||
|
d d [0 -2 0 0 0] (10 -1000 -1000);
|
||||||
|
f f [0 -1 0 0 0] (0 0 0);
|
||||||
|
|
||||||
|
coordinateSystem
|
||||||
|
{
|
||||||
|
e1 (0 1 0);
|
||||||
|
e2 (0 0 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MRF1
|
MRF1
|
||||||
{
|
{
|
||||||
type MRFSource;
|
type MRFSource;
|
||||||
|
|||||||
@ -55,14 +55,14 @@ relaxationFactors
|
|||||||
fields
|
fields
|
||||||
{
|
{
|
||||||
rho 1;
|
rho 1;
|
||||||
p_rgh 0.5;
|
p_rgh 0.7;
|
||||||
}
|
}
|
||||||
equations
|
equations
|
||||||
{
|
{
|
||||||
U 0.2;
|
U 0.3;
|
||||||
"(h|e)" 0.2;
|
"(h|e)" 0.3;
|
||||||
k 0.2;
|
k 0.3;
|
||||||
epsilon 0.2;
|
epsilon 0.3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,13 +20,13 @@ porousToair
|
|||||||
type constantHeatTransfer;
|
type constantHeatTransfer;
|
||||||
active on;
|
active on;
|
||||||
selectionMode mapRegion;
|
selectionMode mapRegion;
|
||||||
consistentMeshes no;
|
interpolationMethod cellVolumeWeight;
|
||||||
nbrModelName airToporous;
|
|
||||||
nbrRegionName air;
|
nbrRegionName air;
|
||||||
master true;
|
master true;
|
||||||
|
|
||||||
constantHeatTransferCoeffs
|
constantHeatTransferCoeffs
|
||||||
{
|
{
|
||||||
|
nbrModelName airToporous;
|
||||||
fieldNames (h);
|
fieldNames (h);
|
||||||
semiImplicit no;
|
semiImplicit no;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,14 +53,14 @@ relaxationFactors
|
|||||||
fields
|
fields
|
||||||
{
|
{
|
||||||
rho 1;
|
rho 1;
|
||||||
p_rgh 0.5;
|
p_rgh 0.7;
|
||||||
}
|
}
|
||||||
equations
|
equations
|
||||||
{
|
{
|
||||||
U 0.2;
|
U 0.3;
|
||||||
"(h|e)" 0.2;
|
"(h|e)" 0.3;
|
||||||
k 0.2;
|
k 0.3;
|
||||||
epsilon 0.2;
|
epsilon 0.3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -133,7 +133,24 @@ subModels
|
|||||||
|
|
||||||
|
|
||||||
cloudFunctions
|
cloudFunctions
|
||||||
{}
|
{
|
||||||
|
particleCollector
|
||||||
|
{
|
||||||
|
mode concentricCircle;
|
||||||
|
|
||||||
|
origin (0.05 0.025 0.005);
|
||||||
|
radius (0.01 0.025 0.05);
|
||||||
|
nSector 10;
|
||||||
|
refDir (1 0 0);
|
||||||
|
normal (0 0 1);
|
||||||
|
|
||||||
|
negateParcelsOppositeNormal no;
|
||||||
|
removeCollected no;
|
||||||
|
surfaceFormat vtk;
|
||||||
|
resetOnWrite no;
|
||||||
|
log yes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -0,0 +1,54 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object H2O;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0.01;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 0.0;
|
||||||
|
}
|
||||||
|
inletSides
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0.01;
|
||||||
|
}
|
||||||
|
inletCentral
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0.01;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object T;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 1 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 473.0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 473.0;
|
||||||
|
}
|
||||||
|
inletSides
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 473.0;
|
||||||
|
}
|
||||||
|
inletCentral
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 573.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volVectorField;
|
||||||
|
location "0";
|
||||||
|
object U;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform (0 0 0);
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
inletCentral
|
||||||
|
{
|
||||||
|
type flowRateInletVelocity;
|
||||||
|
rhoInlet 1.2;
|
||||||
|
massFlowRate constant 0.00379;
|
||||||
|
value uniform (0 14.68 0);
|
||||||
|
}
|
||||||
|
inletSides
|
||||||
|
{
|
||||||
|
type flowRateInletVelocity;
|
||||||
|
rhoInlet 1.2;
|
||||||
|
massFlowRate constant 0.00832;
|
||||||
|
value uniform (0 17.79 0);
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform (0 0 0);
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform (0 0 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object air;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0.99;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 1.0;
|
||||||
|
}
|
||||||
|
inletSides
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0.99;
|
||||||
|
}
|
||||||
|
inletCentral
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0.99;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object alphat;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [1 -1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
inletCentral
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
inletSides
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type alphatWallFunction;
|
||||||
|
Prt 0.85;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object k;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 2 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 3.75e-9;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
inletCentral
|
||||||
|
{
|
||||||
|
type turbulentIntensityKineticEnergyInlet;
|
||||||
|
intensity 0.15;
|
||||||
|
value uniform 3.75e-9;
|
||||||
|
}
|
||||||
|
inletSides
|
||||||
|
{
|
||||||
|
type turbulentIntensityKineticEnergyInlet;
|
||||||
|
intensity 0.16;
|
||||||
|
value uniform 3.75e-9;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 3.75e-9;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type compressible::kqRWallFunction;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object mut;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [1 -1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
inletCentral
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
inletSides
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type mutkWallFunction;
|
||||||
|
Cmu 0.09;
|
||||||
|
kappa 0.41;
|
||||||
|
E 9.8;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object omega;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 4.5e-3;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
inletCentral
|
||||||
|
{
|
||||||
|
type compressible::turbulentMixingLengthFrequencyInlet;
|
||||||
|
mixingLength 0.007;
|
||||||
|
k k;
|
||||||
|
value uniform 4.5e-3;
|
||||||
|
}
|
||||||
|
inletSides
|
||||||
|
{
|
||||||
|
type compressible::turbulentMixingLengthFrequencyInlet;
|
||||||
|
mixingLength 0.007;
|
||||||
|
k k;
|
||||||
|
value uniform 4.5e-3;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 4.5e-3;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type compressible::omegaWallFunction;
|
||||||
|
Cmu 0.09;
|
||||||
|
kappa 0.41;
|
||||||
|
E 9.8;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object p;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [1 -1 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 100000;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
inletCentral
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
inletSides
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 100000;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object H2O;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0.01;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 0.0;
|
||||||
|
}
|
||||||
|
inletSides
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0.01;
|
||||||
|
}
|
||||||
|
inletCentral
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0.01;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object T;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 1 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 473.0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
back
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
front
|
||||||
|
{
|
||||||
|
type symmetryPlane;
|
||||||
|
}
|
||||||
|
walls
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 473.0;
|
||||||
|
}
|
||||||
|
inletSides
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 473.0;
|
||||||
|
}
|
||||||
|
inletCentral
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 573.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user