Commit 44414c0d authored by andy's avatar andy
Browse files

ENH: Updated region models to reflect AMI additions

parent aa6fe273
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/AMIInterpolation/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
......@@ -14,11 +16,19 @@ EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
LIB_LIBS = \
-lregionModels \
-lsolidChemistryModel \
-lbasicSolidThermo \
-lfiniteVolume \
-lsampling \
-lAMIInterpolation \
-lmeshTools \
-lcompressibleLESModels
-lchemistryModel \
-lspecie \
-lspecie \
-lsolid \
-lbasicThermophysicalModels \
-lsolidChemistryModel \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lLESdeltas \
-lregionModels
......@@ -25,7 +25,7 @@ License
#include "pyrolysisModel.H"
#include "fvMesh.H"
#include "directMappedFieldFvPatchField.H"
#include "mappedFieldFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -70,7 +70,7 @@ void pyrolysisModel::constructMeshObjects()
forAll(filmDelta.boundaryField(), patchI)
{
const fvPatchField<scalar>& fvp = filmDelta.boundaryField()[patchI];
if (isA<directMappedFieldFvPatchField<scalar> >(fvp))
if (isA<mappedFieldFvPatchField<scalar> >(fvp))
{
foundCoupledPatch = true;
break;
......@@ -81,7 +81,7 @@ void pyrolysisModel::constructMeshObjects()
{
WarningIn("void pyrolysisModels::constructMeshObjects()")
<< "filmCoupled flag set to true, but no "
<< directMappedFieldFvPatchField<scalar>::typeName
<< mappedFieldFvPatchField<scalar>::typeName
<< " patches found on " << filmDelta.name() << " field"
<< endl;
}
......
......@@ -25,8 +25,6 @@ License
#include "reactingOneDim.H"
#include "addToRunTimeSelectionTable.H"
#include "directMappedPatchBase.H"
#include "mapDistribute.H"
#include "zeroGradientFvPatchFields.H"
#include "surfaceInterpolate.H"
#include "fvm.H"
......
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/AMIInterpolation/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
......
......@@ -146,7 +146,7 @@ void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs()
const label filmPatchI = filmModel.regionPatchID(patchI);
const mapDistribute& filmMap = filmModel.mappedPatches()[filmPatchI].map();
const mappedPatchBase& filmMap = filmModel.mappedPatches()[filmPatchI];
scalarField deltaFilm = filmModel.delta().boundaryField()[filmPatchI];
filmMap.distribute(deltaFilm);
......@@ -161,7 +161,7 @@ void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs()
const label pyrPatchI = pyrModel.regionPatchID(patchI);
const mapDistribute& pyrMap = pyrModel.mappedPatches()[pyrPatchI].map();
const mappedPatchBase& pyrMap = pyrModel.mappedPatches()[pyrPatchI];
scalarField TPyr = pyrModel.T().boundaryField()[pyrPatchI];
pyrMap.distribute(TPyr);
......
......@@ -149,7 +149,7 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs()
const label filmPatchI = filmModel.regionPatchID(patchI);
const mapDistribute& filmMap = filmModel.mappedPatches()[filmPatchI].map();
const mappedPatchBase& filmMap = filmModel.mappedPatches()[filmPatchI];
scalarField deltaFilm = filmModel.delta().boundaryField()[filmPatchI];
filmMap.distribute(deltaFilm);
......@@ -167,7 +167,7 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs()
const label pyrPatchI = pyrModel.regionPatchID(patchI);
const mapDistribute& pyrMap = pyrModel.mappedPatches()[pyrPatchI].map();
const mappedPatchBase& pyrMap = pyrModel.mappedPatches()[pyrPatchI];
scalarField phiPyr = pyrModel.phiGas().boundaryField()[pyrPatchI];
pyrMap.distribute(phiPyr);
......
......@@ -4,6 +4,6 @@ singleLayerRegion/singleLayerRegion.C
regionModel1D/regionModel1D.C
/* Boundary conditions */
derivedFvPatches/directMappedVariableThicknessWall/directMappedVariableThicknessWallFvPatch.C
derivedFvPatches/mappedVariableThicknessWall/mappedVariableThicknessWallFvPatch.C
LIB = $(FOAM_LIBBIN)/libregionModels
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/AMIInterpolation/lnInclude
LIB_LIBS = \
-lfiniteVolume \
-lmeshTools
-lmeshTools \
-lsampling \
-lAMIInterpolation
......@@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include "directMappedVariableThicknessWallFvPatch.H"
#include "mappedVariableThicknessWallFvPatch.H"
#include "addToRunTimeSelectionTable.H"
#include "regionModel1D.H"
......@@ -31,11 +31,11 @@ License
namespace Foam
{
defineTypeNameAndDebug(directMappedVariableThicknessWallFvPatch, 0);
defineTypeNameAndDebug(mappedVariableThicknessWallFvPatch, 0);
addToRunTimeSelectionTable
(
fvPatch,
directMappedVariableThicknessWallFvPatch,
mappedVariableThicknessWallFvPatch,
polyPatch
);
}
......@@ -43,19 +43,13 @@ namespace Foam
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::directMappedVariableThicknessWallFvPatch::
void Foam::mappedVariableThicknessWallFvPatch::
makeDeltaCoeffs(scalarField& dc) const
{
const directMappedVariableThicknessWallPolyPatch& pp =
refCast<const directMappedVariableThicknessWallPolyPatch>
(
patch()
);
const mappedVariableThicknessWallPolyPatch& pp =
refCast<const mappedVariableThicknessWallPolyPatch>(patch());
const directMappedPatchBase& mpp = refCast<const directMappedPatchBase>
(
patch()
);
const mappedPatchBase& mpp = refCast<const mappedPatchBase>(patch());
const polyMesh& nbrMesh = mpp.sampleMesh();
......
......@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::directMappedVariableThicknessWallFvPatch
Foam::mappedVariableThicknessWallFvPatch
Description
Take thickness field and number of layers and returns deltaCoeffs
......@@ -30,15 +30,15 @@ Description
To be used with 1D thermo baffle.
SourceFiles
directMappedVariableThicknessWallFvPatch.C
mappedVariableThicknessWallFvPatch.C
\*---------------------------------------------------------------------------*/
#ifndef directMappedWallFvPatch_H
#define directMappedWallFvPatch_H
#ifndef mappedWallFvPatch_H
#define mappedWallFvPatch_H
#include "wallFvPatch.H"
#include "directMappedVariableThicknessWallPolyPatch.H"
#include "mappedVariableThicknessWallPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -46,10 +46,10 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class directMappedVariableThicknessWallFvPatch Declaration
Class mappedVariableThicknessWallFvPatch Declaration
\*---------------------------------------------------------------------------*/
class directMappedVariableThicknessWallFvPatch
class mappedVariableThicknessWallFvPatch
:
public wallFvPatch
{
......@@ -65,13 +65,13 @@ protected:
public:
//- Runtime type information
TypeName(directMappedVariableThicknessWallPolyPatch::typeName_());
TypeName(mappedVariableThicknessWallPolyPatch::typeName_());
// Constructors
//- Construct from components
directMappedVariableThicknessWallFvPatch
mappedVariableThicknessWallFvPatch
(
const polyPatch& patch,
const fvBoundaryMesh& bm
......@@ -79,7 +79,6 @@ public:
:
wallFvPatch(patch, bm)
{}
};
......
......@@ -26,7 +26,7 @@ License
#include "regionModel.H"
#include "fvMesh.H"
#include "Time.H"
#include "directMappedWallPolyPatch.H"
#include "mappedWallPolyPatch.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -99,11 +99,11 @@ void Foam::regionModels::regionModel::initialise()
forAll(rbm, patchI)
{
const polyPatch& regionPatch = rbm[patchI];
if (isA<directMappedWallPolyPatch>(regionPatch))
if (isA<mappedWallPolyPatch>(regionPatch))
{
if (debug)
{
Pout<< "found " << directMappedWallPolyPatch::typeName
Pout<< "found " << mappedWallPolyPatch::typeName
<< " " << regionPatch.name() << endl;
}
......@@ -111,20 +111,20 @@ void Foam::regionModels::regionModel::initialise()
nBoundaryFaces += regionPatch.faceCells().size();
const directMappedWallPolyPatch& dmp =
refCast<const directMappedWallPolyPatch>(regionPatch);
const mappedWallPolyPatch& mapPatch =
refCast<const mappedWallPolyPatch>(regionPatch);
const label primaryPatchI = dmp.samplePolyPatch().index();
const label primaryPatchI = mapPatch.samplePolyPatch().index();
primaryPatchIDs.append(primaryPatchI);
mappedPatches_.set
(
patchI,
new directMappedPatchBase
new mappedPatchBase
(
pbm[primaryPatchI],
regionMesh().name(),
directMappedPatchBase::NEARESTPATCHFACE,
mapPatch.mode(),
regionPatch.name(),
vector::zero
)
......@@ -134,13 +134,12 @@ void Foam::regionModels::regionModel::initialise()
primaryPatchIDs_.transfer(primaryPatchIDs);
intCoupledPatchIDs_.transfer(intCoupledPatchIDs);
// mappedPatches_.resize(nCoupledPatches);
if (nBoundaryFaces == 0)
{
WarningIn("regionModel::initialise()")
<< "Region model being applied without direct mapped boundary "
<< "conditions" << endl;
<< "Region model has no mapped boundary conditions - transfer "
<< "between regions will not be possible" << endl;
}
}
......
......@@ -40,7 +40,7 @@ SourceFiles
#include "Switch.H"
#include "labelList.H"
#include "volFields.H"
#include "directMappedPatchBase.H"
#include "mappedPatchBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -118,7 +118,7 @@ protected:
labelList intCoupledPatchIDs_;
//- List of patch map info
PtrList<directMappedPatchBase> mappedPatches_;
PtrList<mappedPatchBase> mappedPatches_;
// Protected member functions
......@@ -213,8 +213,7 @@ public:
inline const labelList& intCoupledPatchIDs() const;
//- Return the list of patch map info
inline const PtrList<directMappedPatchBase>&
mappedPatches() const;
inline const PtrList<mappedPatchBase>& mappedPatches() const;
//- Return region ID corresponding to primaryPatchID
inline label regionPatchID(const label primaryPatchID) const;
......
......@@ -132,7 +132,7 @@ Foam::regionModels::regionModel::intCoupledPatchIDs() const
}
inline const Foam::PtrList<Foam::directMappedPatchBase>&
inline const Foam::PtrList<Foam::mappedPatchBase>&
Foam::regionModels::regionModel::mappedPatches() const
{
return mappedPatches_;
......
......@@ -26,7 +26,6 @@ License
#include "singleLayerRegion.H"
#include "fvMesh.H"
#include "Time.H"
#include "directMappedWallPolyPatch.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......
......@@ -25,8 +25,8 @@ License
#include "singleLayerRegion.H"
#include "zeroGradientFvPatchFields.H"
#include "directMappedFixedInternalValueFvPatchFields.H"
#include "directMappedFixedPushedInternalValueFvPatchFields.H"
#include "mappedFixedInternalValueFvPatchFields.H"
#include "mappedFixedPushedInternalValueFvPatchFields.H"
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
......@@ -41,8 +41,7 @@ Foam::regionModels::singleLayerRegion::mappedFieldAndInternalPatchTypes() const
forAll(intCoupledPatchIDs_, i)
{
const label patchI = intCoupledPatchIDs_[i];
bTypes[patchI] =
directMappedFixedInternalValueFvPatchField<Type>::typeName;
bTypes[patchI] = mappedFixedInternalValueFvPatchField<Type>::typeName;
}
return bTypes;
......@@ -61,7 +60,7 @@ Foam::regionModels::singleLayerRegion::mappedPushedFieldPatchTypes() const
{
const label patchI = intCoupledPatchIDs_[i];
bTypes[patchI] =
directMappedFixedPushedInternalValueFvPatchField<Type>::typeName;
mappedFixedPushedInternalValueFvPatchField<Type>::typeName;
}
return bTypes;
......
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/AMIInterpolation/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
......@@ -11,15 +13,25 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
LIB_LIBS = \
-lregionModels \
-lSLGThermo \
-lfiniteVolume \
-lsampling \
-lAMIInterpolation \
-lmeshTools \
-lbasicThermophysicalModels \
-lspecie \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \
-lsolidMixtureProperties \
-lreactionThermophysicalModels \
-lSLGThermo \
-ldistributionModels \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels
-lcompressibleLESModels \
-lregionModels
......@@ -29,7 +29,7 @@ License
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
#include "directMappedWallPolyPatch.H"
#include "mappedWallPolyPatch.H"
#include "mapDistribute.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -153,11 +153,11 @@ void alphatFilmWallFunctionFvPatchScalarField::updateCoeffs()
const label filmPatchI = filmModel.regionPatchID(patchI);
const mapDistribute& distMap = filmModel.mappedPatches()[filmPatchI].map();
const mappedPatchBase& filmMap = filmModel.mappedPatches()[filmPatchI];
tmp<volScalarField> mDotFilm(filmModel.primaryMassTrans());
scalarField mDotFilmp = mDotFilm().boundaryField()[filmPatchI];
distMap.distribute(mDotFilmp);
filmMap.distribute(mDotFilmp);
// Retrieve RAS turbulence model
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
......
......@@ -29,7 +29,7 @@ License
#include "RASModel.H"
#include "addToRunTimeSelectionTable.H"
#include "surfaceFilmModel.H"
#include "directMappedWallPolyPatch.H"
#include "mappedWallPolyPatch.H"
#include "mapDistribute.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -70,11 +70,11 @@ tmp<scalarField> mutkFilmWallFunctionFvPatchScalarField::calcUTau
const label filmPatchI = filmModel.regionPatchID(patchI);
const mapDistribute& distMap = filmModel.mappedPatches()[filmPatchI].map();
const mappedPatchBase& filmMap = filmModel.mappedPatches()[filmPatchI];
tmp<volScalarField> mDotFilm(filmModel.primaryMassTrans());
scalarField mDotFilmp = mDotFilm().boundaryField()[filmPatchI];
distMap.distribute(mDotFilmp);
filmMap.distribute(mDotFilmp);
// Retrieve RAS turbulence model
......
......@@ -31,7 +31,7 @@ License
#include "fvcReconstruct.H"
#include "fvcVolumeIntegrate.H"
#include "addToRunTimeSelectionTable.H"
#include "directMappedWallPolyPatch.H"
#include "mappedWallPolyPatch.H"
#include "mapDistribute.H"
#include "cachedRandom.H"
......@@ -90,7 +90,7 @@ void kinematicSingleLayer::correctThermoFields()
"void Foam::surfaceFilmModels::kinematicSingleLayer::"
"correctThermo()"
) << "Kinematic surface film must use "
<< thermoModelTypeNames_[thermoModel_] << "thermodynamics" << endl;
<< thermoModelTypeNames_[tmConstant] << "thermodynamics" << endl;
}
}
......@@ -115,6 +115,7 @@ void kinematicSingleLayer::transferPrimaryRegionThermoFields()
Info<< "kinematicSingleLayer::"
<< "transferPrimaryRegionThermoFields()" << endl;
}
// Update fields from primary region via direct mapped
// (coupled) boundary conditions
UPrimary_.correctBoundaryConditions();
......@@ -132,6 +133,18 @@ void kinematicSingleLayer::transferPrimaryRegionSourceFields()
<< "transferPrimaryRegionSourceFields()" << endl;
}
// Convert accummulated source terms into per unit area per unit time
const scalar deltaT = time_.deltaTValue();
forAll(rhoSpPrimary_.boundaryField(), patchI)
{
const scalarField& priMagSf =
primaryMesh().magSf().boundaryField()[patchI];
rhoSpPrimary_.boundaryField()[patchI] /= priMagSf*deltaT;
USpPrimary_.boundaryField()[patchI] /= priMagSf*deltaT;
pSpPrimary_.boundaryField()[patchI] /= priMagSf*deltaT;
}
// Retrieve the source fields from the primary region via direct mapped
// (coupled) boundary conditions
// - fields require transfer of values for both patch AND to push the
......@@ -139,13 +152,6 @@ void kinematicSingleLayer::transferPrimaryRegionSourceFields()
rhoSp_.correctBoundaryConditions();
USp_.correctBoundaryConditions();
pSp_.correctBoundaryConditions();
// Convert accummulated source terms into per unit area per unit time
// Note: boundary values will still have original (neat) values
const scalar deltaT = time_.deltaTValue();
rhoSp_.field() /= magSf()*deltaT;
USp_.field() /= magSf()*deltaT;
pSp_.field() /= magSf()*deltaT;
}
......
......@@ -65,7 +65,7 @@ private:
//- Heat transfer coefficient - film region [W/m2/K]
// Assumes that the primary regtion to film region boundaries are
// described as directMappedPushed types
// described as mappedPushed types
volScalarField htcConvFilm_;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment