regionModels: Refactored to remove the now redundant regionModel base class
This commit is contained in:
@ -8,8 +8,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
|
||||
-I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/MomentumTransportModels/phaseIncompressible/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
|
||||
@ -5,8 +5,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/physicalProperties/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
@ -17,6 +16,5 @@ EXE_LIBS = \
|
||||
-lincompressibleMomentumTransportModels \
|
||||
-lphysicalProperties \
|
||||
-lfiniteVolume \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels \
|
||||
-lmeshTools
|
||||
|
||||
@ -9,8 +9,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-llagrangian \
|
||||
@ -24,5 +23,4 @@ EXE_LIBS = \
|
||||
-lfvModels \
|
||||
-lfvConstraints \
|
||||
-lmeshTools \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels
|
||||
|
||||
@ -4,8 +4,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \
|
||||
-I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhaseMixture/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lmeshTools \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lregionModels
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -3,8 +3,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/parallel/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
@ -12,5 +11,4 @@ EXE_LIBS = \
|
||||
-lparallel \
|
||||
-ldecompositionMethods \
|
||||
-llagrangian \
|
||||
-lregionModels \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -2,13 +2,11 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/parallel/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lparallel \
|
||||
-llagrangian \
|
||||
-lregionModels \
|
||||
-lgenericPatchFields
|
||||
|
||||
@ -66,7 +66,7 @@ MomentumTransportModels/Allwmake $targetType $*
|
||||
ThermophysicalTransportModels/Allwmake $targetType $*
|
||||
wmake $targetType radiationModels
|
||||
wmake $targetType combustionModels
|
||||
regionModels/Allwmake $targetType $*
|
||||
wmake $targetType surfaceFilmModels
|
||||
lagrangian/Allwmake $targetType $*
|
||||
mesh/Allwmake $targetType $*
|
||||
renumber/Allwmake $targetType $*
|
||||
|
||||
@ -5,8 +5,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/parcel/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/DSMC/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
@ -15,5 +14,4 @@ LIB_LIBS = \
|
||||
-llagrangian \
|
||||
-llagrangianParcel \
|
||||
-llagrangianParcelTurbulence \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels
|
||||
|
||||
@ -7,8 +7,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/multicomponentThermo/lnInclude \
|
||||
-I$(LIB_SRC)/radiationModels/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
@ -22,7 +21,6 @@ LIB_LIBS = \
|
||||
-lmulticomponentThermophysicalModels \
|
||||
-lradiationModels \
|
||||
-lphysicalProperties \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels \
|
||||
-lsampling \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -10,8 +10,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
|
||||
-I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/surfaceFilmModels/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
@ -29,7 +28,6 @@ LIB_LIBS = \
|
||||
-lincompressibleMomentumTransportModels \
|
||||
-lcompressibleMomentumTransportModels \
|
||||
-lphysicalProperties \
|
||||
-lregionModels \
|
||||
-lsurfaceFilmModels \
|
||||
-lsampling \
|
||||
-lfiniteVolume \
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
makeType=${1:-libso}
|
||||
|
||||
wclean $makeType regionModel
|
||||
wclean $makeType surfaceFilmModels
|
||||
wclean $makeType thermalBaffle
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -1,11 +0,0 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
wmake $targetType regionModel
|
||||
wmake $targetType surfaceFilmModels
|
||||
wmake $targetType thermalBaffle
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -1,4 +0,0 @@
|
||||
regionModel/regionModel.C
|
||||
singleLayerRegionModel/singleLayerRegionModel.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libregionModels
|
||||
@ -1,7 +0,0 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
@ -1,180 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "singleLayerRegionModel.H"
|
||||
#include "fvMesh.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "Time.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace regionModels
|
||||
{
|
||||
defineTypeNameAndDebug(singleLayerRegionModel, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionModels::singleLayerRegionModel::singleLayerRegionModel
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& regionType,
|
||||
const word& modelName,
|
||||
bool readFields
|
||||
)
|
||||
:
|
||||
regionModel(mesh, regionType, modelName, false),
|
||||
nHat_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"nHat",
|
||||
time_.timeName(),
|
||||
regionMesh()
|
||||
),
|
||||
regionMesh(),
|
||||
dimensionedVector(dimless, Zero),
|
||||
zeroGradientFvPatchField<vector>::typeName
|
||||
),
|
||||
magSf_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"magSf",
|
||||
time_.timeName(),
|
||||
regionMesh()
|
||||
),
|
||||
regionMesh(),
|
||||
dimensionedScalar(dimArea, 0)
|
||||
),
|
||||
VbyA_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"VbyA",
|
||||
time_.timeName(),
|
||||
regionMesh()
|
||||
),
|
||||
regionMesh(),
|
||||
dimensionedScalar(dimLength, 0),
|
||||
zeroGradientFvPatchField<vector>::typeName
|
||||
),
|
||||
passivePatchIDs_()
|
||||
{
|
||||
label nBoundaryFaces = 0;
|
||||
const polyBoundaryMesh& rbm = regionMesh().boundaryMesh();
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
const label patchi = intCoupledPatchIDs_[i];
|
||||
const polyPatch& pp = rbm[patchi];
|
||||
const labelList& fCells = pp.faceCells();
|
||||
|
||||
nBoundaryFaces += fCells.size();
|
||||
|
||||
UIndirectList<vector>(nHat_, fCells) = pp.faceNormals();
|
||||
UIndirectList<scalar>(magSf_, fCells) = pp.magFaceAreas();
|
||||
}
|
||||
nHat_.correctBoundaryConditions();
|
||||
|
||||
if (nBoundaryFaces != regionMesh().nCells())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Number of primary region coupled boundary faces not equal to "
|
||||
<< "the number of cells in the local region" << nl << nl
|
||||
<< "Number of cells = " << regionMesh().nCells() << nl
|
||||
<< "Boundary faces = " << nBoundaryFaces << nl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
passivePatchIDs_.setSize(intCoupledPatchIDs_.size(), -1);
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
const label patchi = intCoupledPatchIDs_[i];
|
||||
const polyPatch& ppIntCoupled = rbm[patchi];
|
||||
if (ppIntCoupled.size() > 0)
|
||||
{
|
||||
const label cellId = rbm[patchi].faceCells()[0];
|
||||
const cell& cFaces = regionMesh().cells()[cellId];
|
||||
const label faceO
|
||||
(
|
||||
cFaces.opposingFaceLabel
|
||||
(
|
||||
ppIntCoupled.start(), regionMesh().faces()
|
||||
)
|
||||
);
|
||||
passivePatchIDs_[i] = rbm.whichPatch(faceO);
|
||||
}
|
||||
}
|
||||
|
||||
Pstream::listCombineGather(passivePatchIDs_, maxEqOp<label>());
|
||||
Pstream::listCombineScatter(passivePatchIDs_);
|
||||
|
||||
VbyA_.primitiveFieldRef() = regionMesh().V()/magSf_;
|
||||
VbyA_.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionModels::singleLayerRegionModel::~singleLayerRegionModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::volVectorField&
|
||||
Foam::regionModels::singleLayerRegionModel::nHat() const
|
||||
{
|
||||
return nHat_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField::Internal&
|
||||
Foam::regionModels::singleLayerRegionModel::magSf() const
|
||||
{
|
||||
return magSf_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField&
|
||||
Foam::regionModels::singleLayerRegionModel::VbyA() const
|
||||
{
|
||||
return VbyA_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelList&
|
||||
Foam::regionModels::singleLayerRegionModel::passivePatchIDs() const
|
||||
{
|
||||
return passivePatchIDs_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,155 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::regionModels::singleLayerRegionModel
|
||||
|
||||
Description
|
||||
Base class for single layer region models
|
||||
|
||||
SourceFiles
|
||||
singleLayerRegionModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef singleLayerRegionModel_H
|
||||
#define singleLayerRegionModel_H
|
||||
|
||||
#include "regionModel.H"
|
||||
#include "volFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace regionModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class singleLayerRegionModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class singleLayerRegionModel
|
||||
:
|
||||
public regionModel
|
||||
{
|
||||
// Private member data
|
||||
|
||||
// Region addressing
|
||||
|
||||
//- Patch normal vectors
|
||||
volVectorField nHat_;
|
||||
|
||||
//- Cell cross-sectional area magnitude [m^2]
|
||||
volScalarField::Internal magSf_;
|
||||
|
||||
//- Cell layer volume/area [m]
|
||||
volScalarField VbyA_;
|
||||
|
||||
|
||||
// Addressing
|
||||
|
||||
//- List of patch IDs opposite to internally coupled patches
|
||||
labelList passivePatchIDs_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("regionModel");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from mesh, region type and name
|
||||
singleLayerRegionModel
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& regionType,
|
||||
const word& modelName,
|
||||
bool readFields = true
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
singleLayerRegionModel(const singleLayerRegionModel&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~singleLayerRegionModel();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
// Region geometry
|
||||
|
||||
//- Return the patch normal vectors
|
||||
const volVectorField& nHat() const;
|
||||
|
||||
//- Return the face area magnitudes [m^2]
|
||||
const volScalarField::Internal& magSf() const;
|
||||
|
||||
//- Return the cell layer volume/area [m]
|
||||
const volScalarField& VbyA() const;
|
||||
|
||||
|
||||
// Addressing
|
||||
|
||||
//- Return the list of patch IDs opposite to internally
|
||||
// coupled patches
|
||||
const labelList& passivePatchIDs() const;
|
||||
|
||||
|
||||
// Patch type information
|
||||
|
||||
//- Return boundary types for mapped field patches
|
||||
// Also maps internal field value
|
||||
// Mapping region prescribed by underlying mapped poly patch
|
||||
template<class Type>
|
||||
wordList mappedFieldAndInternalPatchTypes() const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const singleLayerRegionModel&) = delete;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace regionModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "singleLayerRegionModelTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,50 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "singleLayerRegionModel.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "mappedValueAndPatchInternalValueFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::wordList Foam::regionModels::singleLayerRegionModel::
|
||||
mappedFieldAndInternalPatchTypes() const
|
||||
{
|
||||
wordList bTypes(regionMesh().boundaryMesh().size());
|
||||
|
||||
bTypes = zeroGradientFvPatchField<Type>::typeName;
|
||||
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
bTypes[intCoupledPatchIDs_[i]] =
|
||||
mappedValueAndPatchInternalValueFvPatchField<Type>::typeName;
|
||||
}
|
||||
|
||||
return bTypes;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,3 +1,5 @@
|
||||
singleLayerRegionModel/singleLayerRegionModel.C
|
||||
|
||||
# Surface film models
|
||||
surfaceFilm/surfaceFilm.C
|
||||
momentumSurfaceFilm/momentumSurfaceFilm.C
|
||||
@ -9,7 +9,6 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/ThermophysicalTransportModels/thermophysicalTransportModel/lnInclude \
|
||||
-I$(LIB_SRC)/ThermophysicalTransportModels/fluid/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
@ -22,6 +21,5 @@ LIB_LIBS = \
|
||||
-lmomentumTransportModels \
|
||||
-lcompressibleMomentumTransportModels \
|
||||
-lfluidThermoThermophysicalTransportModels \
|
||||
-lregionModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
@ -23,11 +23,12 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "regionModel.H"
|
||||
#include "singleLayerRegionModel.H"
|
||||
#include "fvMesh.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "Time.H"
|
||||
#include "mappedWallPolyPatch.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "mappedWallPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -35,111 +36,14 @@ namespace Foam
|
||||
{
|
||||
namespace regionModels
|
||||
{
|
||||
defineTypeNameAndDebug(regionModel, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
void Foam::regionModels::regionModel::constructMeshObjects()
|
||||
{
|
||||
// construct region mesh
|
||||
if (!time_.foundObject<fvMesh>(regionName_))
|
||||
{
|
||||
regionMeshPtr_.reset
|
||||
(
|
||||
new fvMesh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
regionName_,
|
||||
time_.timeName(),
|
||||
time_,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionModels::regionModel::initialise()
|
||||
{
|
||||
DebugInFunction << endl;
|
||||
|
||||
label nBoundaryFaces = 0;
|
||||
DynamicList<label> primaryPatchIDs;
|
||||
DynamicList<label> intCoupledPatchIDs;
|
||||
const polyBoundaryMesh& rbm = regionMesh().boundaryMesh();
|
||||
|
||||
forAll(rbm, patchi)
|
||||
{
|
||||
const polyPatch& regionPatch = rbm[patchi];
|
||||
|
||||
if (isA<mappedPatchBase>(regionPatch))
|
||||
{
|
||||
DebugInFunction
|
||||
<< "found " << mappedWallPolyPatch::typeName
|
||||
<< " " << regionPatch.name() << endl;
|
||||
|
||||
intCoupledPatchIDs.append(patchi);
|
||||
|
||||
nBoundaryFaces += regionPatch.faceCells().size();
|
||||
|
||||
const mappedPatchBase& mapPatch =
|
||||
refCast<const mappedPatchBase>(regionPatch);
|
||||
|
||||
if
|
||||
(
|
||||
primaryMesh_.time().foundObject<polyMesh>
|
||||
(
|
||||
mapPatch.nbrRegionName()
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
const label primaryPatchi = mapPatch.nbrPolyPatch().index();
|
||||
primaryPatchIDs.append(primaryPatchi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
primaryPatchIDs_.transfer(primaryPatchIDs);
|
||||
intCoupledPatchIDs_.transfer(intCoupledPatchIDs);
|
||||
|
||||
if (returnReduce(nBoundaryFaces, sumOp<label>()) == 0)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Region model has no mapped boundary conditions - transfer "
|
||||
<< "between regions will not be possible" << endl;
|
||||
}
|
||||
|
||||
if (!outputPropertiesPtr_.valid())
|
||||
{
|
||||
const fileName uniformPath(word("uniform")/"regionModels");
|
||||
|
||||
outputPropertiesPtr_.reset
|
||||
(
|
||||
new timeIOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
regionName_ + "OutputProperties",
|
||||
time_.timeName(),
|
||||
uniformPath/regionName_,
|
||||
primaryMesh_,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
);
|
||||
defineTypeNameAndDebug(singleLayerRegionModel, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
bool Foam::regionModels::regionModel::read()
|
||||
bool Foam::regionModels::singleLayerRegionModel::read()
|
||||
{
|
||||
if (regIOobject::read())
|
||||
{
|
||||
@ -159,7 +63,7 @@ bool Foam::regionModels::regionModel::read()
|
||||
}
|
||||
|
||||
|
||||
bool Foam::regionModels::regionModel::read(const dictionary& dict)
|
||||
bool Foam::regionModels::singleLayerRegionModel::read(const dictionary& dict)
|
||||
{
|
||||
if (const dictionary* dictPtr = dict.subDictPtr(modelName_ + "Coeffs"))
|
||||
{
|
||||
@ -172,9 +76,9 @@ bool Foam::regionModels::regionModel::read(const dictionary& dict)
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::regionModels::regionModel::nbrCoupledPatchID
|
||||
Foam::label Foam::regionModels::singleLayerRegionModel::nbrCoupledPatchID
|
||||
(
|
||||
const regionModel& nbrRegion,
|
||||
const singleLayerRegionModel& nbrRegion,
|
||||
const label regionPatchi
|
||||
) const
|
||||
{
|
||||
@ -242,37 +146,7 @@ Foam::label Foam::regionModels::regionModel::nbrCoupledPatchID
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionModels::regionModel::regionModel
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& regionType
|
||||
)
|
||||
:
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
regionType + "Properties",
|
||||
mesh.time().constant(),
|
||||
mesh.time(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
primaryMesh_(mesh),
|
||||
time_(mesh.time()),
|
||||
infoOutput_(false),
|
||||
modelName_("none"),
|
||||
regionMeshPtr_(nullptr),
|
||||
coeffs_(dictionary::null),
|
||||
outputPropertiesPtr_(nullptr),
|
||||
primaryPatchIDs_(),
|
||||
intCoupledPatchIDs_(),
|
||||
regionName_("none")
|
||||
{}
|
||||
|
||||
|
||||
Foam::regionModels::regionModel::regionModel
|
||||
Foam::regionModels::singleLayerRegionModel::singleLayerRegionModel
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& regionType,
|
||||
@ -295,75 +169,221 @@ Foam::regionModels::regionModel::regionModel
|
||||
time_(mesh.time()),
|
||||
infoOutput_(true),
|
||||
modelName_(modelName),
|
||||
regionMeshPtr_(nullptr),
|
||||
regionName_(lookup("regionName")),
|
||||
mesh_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
regionName_,
|
||||
time_.timeName(),
|
||||
time_,
|
||||
IOobject::MUST_READ
|
||||
)
|
||||
),
|
||||
coeffs_(optionalSubDict(modelName + "Coeffs")),
|
||||
outputPropertiesPtr_(nullptr),
|
||||
primaryPatchIDs_(),
|
||||
intCoupledPatchIDs_(),
|
||||
regionName_(lookup("regionName"))
|
||||
passivePatchIDs_(),
|
||||
nHat_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"nHat",
|
||||
time_.timeName(),
|
||||
regionMesh()
|
||||
),
|
||||
regionMesh(),
|
||||
dimensionedVector(dimless, Zero),
|
||||
zeroGradientFvPatchField<vector>::typeName
|
||||
),
|
||||
magSf_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"magSf",
|
||||
time_.timeName(),
|
||||
regionMesh()
|
||||
),
|
||||
regionMesh(),
|
||||
dimensionedScalar(dimArea, 0)
|
||||
),
|
||||
VbyA_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"VbyA",
|
||||
time_.timeName(),
|
||||
regionMesh()
|
||||
),
|
||||
regionMesh(),
|
||||
dimensionedScalar(dimLength, 0),
|
||||
zeroGradientFvPatchField<vector>::typeName
|
||||
)
|
||||
{
|
||||
constructMeshObjects();
|
||||
initialise();
|
||||
label nBoundaryFaces = 0;
|
||||
DynamicList<label> primaryPatchIDs;
|
||||
DynamicList<label> intCoupledPatchIDs;
|
||||
const polyBoundaryMesh& rbm = regionMesh().boundaryMesh();
|
||||
|
||||
forAll(rbm, patchi)
|
||||
{
|
||||
const polyPatch& regionPatch = rbm[patchi];
|
||||
|
||||
if (isA<mappedPatchBase>(regionPatch))
|
||||
{
|
||||
DebugInFunction
|
||||
<< "found " << mappedWallPolyPatch::typeName
|
||||
<< " " << regionPatch.name() << endl;
|
||||
|
||||
intCoupledPatchIDs.append(patchi);
|
||||
|
||||
nBoundaryFaces += regionPatch.faceCells().size();
|
||||
|
||||
const mappedPatchBase& mapPatch =
|
||||
refCast<const mappedPatchBase>(regionPatch);
|
||||
|
||||
if
|
||||
(
|
||||
primaryMesh_.time().foundObject<polyMesh>
|
||||
(
|
||||
mapPatch.nbrRegionName()
|
||||
)
|
||||
)
|
||||
{
|
||||
|
||||
const label primaryPatchi = mapPatch.nbrPolyPatch().index();
|
||||
primaryPatchIDs.append(primaryPatchi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
primaryPatchIDs_.transfer(primaryPatchIDs);
|
||||
intCoupledPatchIDs_.transfer(intCoupledPatchIDs);
|
||||
|
||||
if (returnReduce(nBoundaryFaces, sumOp<label>()) == 0)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Region model has no mapped boundary conditions - transfer "
|
||||
<< "between regions will not be possible" << endl;
|
||||
}
|
||||
|
||||
if (!outputPropertiesPtr_.valid())
|
||||
{
|
||||
const fileName uniformPath(word("uniform")/"regionModels");
|
||||
|
||||
outputPropertiesPtr_.reset
|
||||
(
|
||||
new timeIOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
regionName_ + "OutputProperties",
|
||||
time_.timeName(),
|
||||
uniformPath/regionName_,
|
||||
primaryMesh_,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (readFields)
|
||||
{
|
||||
read();
|
||||
}
|
||||
|
||||
nBoundaryFaces = 0;
|
||||
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
const label patchi = intCoupledPatchIDs_[i];
|
||||
const polyPatch& pp = rbm[patchi];
|
||||
const labelList& fCells = pp.faceCells();
|
||||
|
||||
nBoundaryFaces += fCells.size();
|
||||
|
||||
UIndirectList<vector>(nHat_, fCells) = pp.faceNormals();
|
||||
UIndirectList<scalar>(magSf_, fCells) = pp.magFaceAreas();
|
||||
}
|
||||
nHat_.correctBoundaryConditions();
|
||||
|
||||
if (nBoundaryFaces != regionMesh().nCells())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Number of primary region coupled boundary faces not equal to "
|
||||
<< "the number of cells in the local region" << nl << nl
|
||||
<< "Number of cells = " << regionMesh().nCells() << nl
|
||||
<< "Boundary faces = " << nBoundaryFaces << nl
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
|
||||
Foam::regionModels::regionModel::regionModel
|
||||
passivePatchIDs_.setSize(intCoupledPatchIDs_.size(), -1);
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
const label patchi = intCoupledPatchIDs_[i];
|
||||
const polyPatch& ppIntCoupled = rbm[patchi];
|
||||
if (ppIntCoupled.size() > 0)
|
||||
{
|
||||
const label cellId = rbm[patchi].faceCells()[0];
|
||||
const cell& cFaces = regionMesh().cells()[cellId];
|
||||
const label faceO
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& regionType,
|
||||
const word& modelName,
|
||||
const dictionary& dict,
|
||||
bool readFields
|
||||
cFaces.opposingFaceLabel
|
||||
(
|
||||
ppIntCoupled.start(), regionMesh().faces()
|
||||
)
|
||||
:
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
regionType + "Properties",
|
||||
mesh.time().constant(),
|
||||
mesh.time(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
true
|
||||
),
|
||||
dict
|
||||
),
|
||||
primaryMesh_(mesh),
|
||||
time_(mesh.time()),
|
||||
infoOutput_(false),
|
||||
modelName_(modelName),
|
||||
regionMeshPtr_(nullptr),
|
||||
coeffs_(dict.optionalSubDict(modelName + "Coeffs")),
|
||||
outputPropertiesPtr_(nullptr),
|
||||
primaryPatchIDs_(),
|
||||
intCoupledPatchIDs_(),
|
||||
regionName_(dict.lookup("regionName"))
|
||||
{
|
||||
constructMeshObjects();
|
||||
initialise();
|
||||
|
||||
if (readFields)
|
||||
{
|
||||
read(dict);
|
||||
);
|
||||
passivePatchIDs_[i] = rbm.whichPatch(faceO);
|
||||
}
|
||||
}
|
||||
|
||||
Pstream::listCombineGather(passivePatchIDs_, maxEqOp<label>());
|
||||
Pstream::listCombineScatter(passivePatchIDs_);
|
||||
|
||||
VbyA_.primitiveFieldRef() = regionMesh().V()/magSf_;
|
||||
VbyA_.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionModels::regionModel::~regionModel()
|
||||
Foam::regionModels::singleLayerRegionModel::~singleLayerRegionModel()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::regionModels::regionModel::evolve()
|
||||
const Foam::volVectorField&
|
||||
Foam::regionModels::singleLayerRegionModel::nHat() const
|
||||
{
|
||||
return nHat_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField::Internal&
|
||||
Foam::regionModels::singleLayerRegionModel::magSf() const
|
||||
{
|
||||
return magSf_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::volScalarField&
|
||||
Foam::regionModels::singleLayerRegionModel::VbyA() const
|
||||
{
|
||||
return VbyA_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelList&
|
||||
Foam::regionModels::singleLayerRegionModel::passivePatchIDs() const
|
||||
{
|
||||
return passivePatchIDs_;
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionModels::singleLayerRegionModel::evolve()
|
||||
{
|
||||
Info<< "\nEvolving " << modelName_ << " for region "
|
||||
<< regionMesh().name() << endl;
|
||||
@ -395,19 +415,19 @@ void Foam::regionModels::regionModel::evolve()
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionModels::regionModel::preEvolveRegion()
|
||||
void Foam::regionModels::singleLayerRegionModel::preEvolveRegion()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::regionModels::regionModel::evolveRegion()
|
||||
void Foam::regionModels::singleLayerRegionModel::evolveRegion()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::regionModels::regionModel::postEvolveRegion()
|
||||
void Foam::regionModels::singleLayerRegionModel::postEvolveRegion()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::regionModels::regionModel::info()
|
||||
void Foam::regionModels::singleLayerRegionModel::info()
|
||||
{}
|
||||
|
||||
|
||||
@ -22,23 +22,22 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::regionModels::regionModel
|
||||
Foam::regionModels::singleLayerRegionModel
|
||||
|
||||
Description
|
||||
Base class for region models
|
||||
Base class for single layer region models
|
||||
|
||||
SourceFiles
|
||||
regionModelI.H
|
||||
regionModel.C
|
||||
regionModelTemplates.C
|
||||
singleLayerRegionModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionModel_H
|
||||
#define regionModel_H
|
||||
#ifndef singleLayerRegionModel_H
|
||||
#define singleLayerRegionModel_H
|
||||
|
||||
#include "fvMesh.H"
|
||||
#include "timeIOdictionary.H"
|
||||
#include "volFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -48,27 +47,13 @@ namespace regionModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionModel Declaration
|
||||
Class singleLayerRegionModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionModel
|
||||
class singleLayerRegionModel
|
||||
:
|
||||
public IOdictionary
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
regionModel(const regionModel&) = delete;
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const regionModel&) = delete;
|
||||
|
||||
//- Construct region mesh and fields
|
||||
void constructMeshObjects();
|
||||
|
||||
//- Initialise the region
|
||||
void initialise();
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
@ -86,8 +71,11 @@ protected:
|
||||
//- Model name
|
||||
const word modelName_;
|
||||
|
||||
//- Pointer to the region mesh database
|
||||
autoPtr<fvMesh> regionMeshPtr_;
|
||||
//- Region name
|
||||
word regionName_;
|
||||
|
||||
//- Region mesh
|
||||
fvMesh mesh_;
|
||||
|
||||
//- Model coefficients dictionary
|
||||
dictionary coeffs_;
|
||||
@ -104,9 +92,18 @@ protected:
|
||||
//- List of patch IDs internally coupled with the primary region
|
||||
labelList intCoupledPatchIDs_;
|
||||
|
||||
//- List of patch IDs opposite to internally coupled patches
|
||||
labelList passivePatchIDs_;
|
||||
|
||||
//- Region name
|
||||
word regionName_;
|
||||
|
||||
//- Patch normal vectors
|
||||
volVectorField nHat_;
|
||||
|
||||
//- Cell cross-sectional area magnitude [m^2]
|
||||
volScalarField::Internal magSf_;
|
||||
|
||||
//- Cell layer volume/area [m]
|
||||
volScalarField VbyA_;
|
||||
|
||||
|
||||
// Protected member functions
|
||||
@ -126,11 +123,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
regionModel(const fvMesh& mesh, const word& regionType);
|
||||
|
||||
//- Construct from mesh, region type and name
|
||||
regionModel
|
||||
singleLayerRegionModel
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& regionType,
|
||||
@ -138,19 +132,12 @@ public:
|
||||
bool readFields = true
|
||||
);
|
||||
|
||||
//- Construct from mesh and name and dict
|
||||
regionModel
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const word& regionType,
|
||||
const word& modelName,
|
||||
const dictionary& dict,
|
||||
bool readFields = true
|
||||
);
|
||||
//- Disallow default bitwise copy construction
|
||||
singleLayerRegionModel(const singleLayerRegionModel&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~regionModel();
|
||||
virtual ~singleLayerRegionModel();
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -188,6 +175,18 @@ public:
|
||||
inline IOdictionary& outputProperties();
|
||||
|
||||
|
||||
// Region geometry
|
||||
|
||||
//- Return the patch normal vectors
|
||||
const volVectorField& nHat() const;
|
||||
|
||||
//- Return the face area magnitudes [m^2]
|
||||
const volScalarField::Internal& magSf() const;
|
||||
|
||||
//- Return the cell layer volume/area [m]
|
||||
const volScalarField& VbyA() const;
|
||||
|
||||
|
||||
// Addressing
|
||||
|
||||
//- Return true if patchi on the local region is a coupled
|
||||
@ -209,6 +208,19 @@ public:
|
||||
//- Return region ID corresponding to primaryPatchID
|
||||
inline label regionPatchID(const label primaryPatchID) const;
|
||||
|
||||
//- Return the list of patch IDs opposite to internally
|
||||
// coupled patches
|
||||
const labelList& passivePatchIDs() const;
|
||||
|
||||
|
||||
// Patch type information
|
||||
|
||||
//- Return boundary types for mapped field patches
|
||||
// Also maps internal field value
|
||||
// Mapping region prescribed by underlying mapped poly patch
|
||||
template<class Type>
|
||||
wordList mappedFieldAndInternalPatchTypes() const;
|
||||
|
||||
|
||||
// Helper
|
||||
|
||||
@ -216,7 +228,7 @@ public:
|
||||
// regionPatchi
|
||||
label nbrCoupledPatchID
|
||||
(
|
||||
const regionModel& nbrRegion,
|
||||
const singleLayerRegionModel& nbrRegion,
|
||||
const label regionPatchi
|
||||
) const;
|
||||
|
||||
@ -269,6 +281,12 @@ public:
|
||||
|
||||
//- Provide some feedback
|
||||
virtual void info();
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const singleLayerRegionModel&) = delete;
|
||||
};
|
||||
|
||||
|
||||
@ -277,14 +295,15 @@ public:
|
||||
} // End namespace regionModels
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "regionModelI.H"
|
||||
#include "singleLayerRegionModelI.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "regionModelTemplates.C"
|
||||
#include "singleLayerRegionModelTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -23,85 +23,65 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "regionModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::fvMesh&
|
||||
Foam::regionModels::regionModel::primaryMesh() const
|
||||
Foam::regionModels::singleLayerRegionModel::primaryMesh() const
|
||||
{
|
||||
return primaryMesh_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::Time& Foam::regionModels::regionModel::time() const
|
||||
inline const Foam::Time&
|
||||
Foam::regionModels::singleLayerRegionModel::time() const
|
||||
{
|
||||
return time_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::Switch& Foam::regionModels::regionModel::infoOutput() const
|
||||
inline const Foam::Switch&
|
||||
Foam::regionModels::singleLayerRegionModel::infoOutput() const
|
||||
{
|
||||
return infoOutput_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::word& Foam::regionModels::regionModel::modelName() const
|
||||
inline const Foam::word&
|
||||
Foam::regionModels::singleLayerRegionModel::modelName() const
|
||||
{
|
||||
return modelName_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::fvMesh& Foam::regionModels::regionModel::regionMesh() const
|
||||
inline const Foam::fvMesh&
|
||||
Foam::regionModels::singleLayerRegionModel::regionMesh() const
|
||||
{
|
||||
if (time_.foundObject<fvMesh>(regionName_))
|
||||
{
|
||||
return time_.lookupObject<fvMesh>(regionName_);
|
||||
}
|
||||
else if (!regionMeshPtr_.valid())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Region mesh not available" << abort(FatalError);
|
||||
}
|
||||
|
||||
return regionMeshPtr_();
|
||||
return mesh_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::fvMesh& Foam::regionModels::regionModel::regionMesh()
|
||||
inline Foam::fvMesh& Foam::regionModels::singleLayerRegionModel::regionMesh()
|
||||
{
|
||||
if (time_.foundObject<fvMesh>(regionName_))
|
||||
{
|
||||
return const_cast<fvMesh&>
|
||||
(
|
||||
time_.lookupObject<fvMesh>(regionName_)
|
||||
);
|
||||
}
|
||||
else if (!regionMeshPtr_.valid())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Region mesh not available" << abort(FatalError);
|
||||
}
|
||||
|
||||
return regionMeshPtr_();
|
||||
return mesh_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::dictionary& Foam::regionModels::regionModel::coeffs() const
|
||||
inline const Foam::dictionary&
|
||||
Foam::regionModels::singleLayerRegionModel::coeffs() const
|
||||
{
|
||||
return coeffs_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::dictionary&
|
||||
Foam::regionModels::regionModel::solution() const
|
||||
Foam::regionModels::singleLayerRegionModel::solution() const
|
||||
{
|
||||
return regionMesh().solution().dict();
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::IOdictionary&
|
||||
Foam::regionModels::regionModel::outputProperties() const
|
||||
Foam::regionModels::singleLayerRegionModel::outputProperties() const
|
||||
{
|
||||
if (!outputPropertiesPtr_.valid())
|
||||
{
|
||||
@ -115,7 +95,7 @@ Foam::regionModels::regionModel::outputProperties() const
|
||||
|
||||
|
||||
inline Foam::IOdictionary&
|
||||
Foam::regionModels::regionModel::outputProperties()
|
||||
Foam::regionModels::singleLayerRegionModel::outputProperties()
|
||||
{
|
||||
if (!outputPropertiesPtr_.valid())
|
||||
{
|
||||
@ -128,7 +108,7 @@ Foam::regionModels::regionModel::outputProperties()
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::regionModels::regionModel::isCoupledPatch
|
||||
inline bool Foam::regionModels::singleLayerRegionModel::isCoupledPatch
|
||||
(
|
||||
const label regionPatchi
|
||||
) const
|
||||
@ -145,7 +125,7 @@ inline bool Foam::regionModels::regionModel::isCoupledPatch
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::regionModels::regionModel::isRegionPatch
|
||||
inline bool Foam::regionModels::singleLayerRegionModel::isRegionPatch
|
||||
(
|
||||
const label primaryPatchi
|
||||
) const
|
||||
@ -163,20 +143,20 @@ inline bool Foam::regionModels::regionModel::isRegionPatch
|
||||
|
||||
|
||||
inline const Foam::labelList&
|
||||
Foam::regionModels::regionModel::primaryPatchIDs() const
|
||||
Foam::regionModels::singleLayerRegionModel::primaryPatchIDs() const
|
||||
{
|
||||
return primaryPatchIDs_;
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::labelList&
|
||||
Foam::regionModels::regionModel::intCoupledPatchIDs() const
|
||||
Foam::regionModels::singleLayerRegionModel::intCoupledPatchIDs() const
|
||||
{
|
||||
return intCoupledPatchIDs_;
|
||||
}
|
||||
|
||||
|
||||
inline Foam::label Foam::regionModels::regionModel::regionPatchID
|
||||
inline Foam::label Foam::regionModels::singleLayerRegionModel::regionPatchID
|
||||
(
|
||||
const label primaryPatchID
|
||||
) const
|
||||
@ -23,13 +23,14 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "regionModel.H"
|
||||
#include "mappedPatchBase.H"
|
||||
#include "singleLayerRegionModel.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "mappedValueAndPatchInternalValueFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
void Foam::regionModels::regionModel::toPrimary
|
||||
void Foam::regionModels::singleLayerRegionModel::toPrimary
|
||||
(
|
||||
const label regionPatchi,
|
||||
Field<Type>& regionField
|
||||
@ -56,7 +57,7 @@ void Foam::regionModels::regionModel::toPrimary
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::regionModels::regionModel::toRegion
|
||||
void Foam::regionModels::singleLayerRegionModel::toRegion
|
||||
(
|
||||
const label regionPatchi,
|
||||
Field<Type>& primaryField
|
||||
@ -83,7 +84,7 @@ void Foam::regionModels::regionModel::toRegion
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::regionModels::regionModel::toRegion
|
||||
void Foam::regionModels::singleLayerRegionModel::toRegion
|
||||
(
|
||||
Field<Type>& rf,
|
||||
const typename GeometricField<Type, fvPatchField, volMesh>::Boundary& pBf
|
||||
@ -106,4 +107,22 @@ void Foam::regionModels::regionModel::toRegion
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::wordList Foam::regionModels::singleLayerRegionModel::
|
||||
mappedFieldAndInternalPatchTypes() const
|
||||
{
|
||||
wordList bTypes(regionMesh().boundaryMesh().size());
|
||||
|
||||
bTypes = zeroGradientFvPatchField<Type>::typeName;
|
||||
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
bTypes[intCoupledPatchIDs_[i]] =
|
||||
mappedValueAndPatchInternalValueFvPatchField<Type>::typeName;
|
||||
}
|
||||
|
||||
return bTypes;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user