surfaceFilmModels: Rewritten in mass conservative form

All of the film transport equations are now formulated with respect to the film
volume fraction in the region cell layer rather than the film thickness which
ensures mass conservation of the film even as it flows over curved surfaces and
around corners.  (In the previous formulation the conservation error could be as
large as 15% for a film flowing around a corner.)

The film Courant number is now formulated in terms of the film cell volumetric
flux which avoids the stabilised division by the film thickness and provides a
more reliable estimate for time-step evaluation.  As a consequence the film
solution is substantially more robust even though the time-step is now
significantly higher.  For film flow dominated problem the simulations now runs
10-30x faster.

The inconsistent extended PISO controls have been replaced by the standard
PIMPLE control system used in all other flow solvers, providing consistent
input, a flexible structure and easier maintenance.

The momentum corrector has been re-formulated to be consistent with the momentum
predictor so the optional PIMPLE outer-corrector loop converges which it did not
previously.

nonuniformTransformCyclic patches and corresponding fields are no longer needed
and have been removed which paves the way for a future rationalisation of the
handling of cyclic transformations in OpenFOAM to improve robustness, usability
and maintainability.

Film sources have been simplified to avoid the need for fictitious boundary
conditions, in particular mappedFixedPushedInternalValueFvPatchField which has
been removed.

Film variables previously appended with an "f" for "film" rather than "face"
have been renamed without the unnecessary and confusing "f" as they are
localised to the film region and hence already directly associated with it.

All film tutorials have been updated to test and demonstrate the developments
and improvements listed above.

Henry G. Weller
CFD Direct Ltd.
This commit is contained in:
Henry Weller
2019-12-12 10:34:08 +00:00
parent 01af447add
commit 0ad918f659
116 changed files with 1174 additions and 3690 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,6 +25,7 @@ License
#include "VoFPatchTransfer.H" #include "VoFPatchTransfer.H"
#include "twoPhaseMixtureThermo.H" #include "twoPhaseMixtureThermo.H"
#include "thermoSingleLayer.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -143,16 +144,18 @@ void VoFPatchTransfer::correct
// Do not correct if no patches selected // Do not correct if no patches selected
if (!patchIDs_.size()) return; if (!patchIDs_.size()) return;
const scalarField& delta = film().delta(); const thermoSingleLayer& film = filmType<thermoSingleLayer>();
const scalarField& rho = film().rho();
const scalarField& magSf = film().magSf();
const polyBoundaryMesh& pbm = film().regionMesh().boundaryMesh(); const scalarField& delta = film.delta();
const scalarField& rho = film.rho();
const scalarField& magSf = film.magSf();
const polyBoundaryMesh& pbm = film.regionMesh().boundaryMesh();
const twoPhaseMixtureThermo& thermo const twoPhaseMixtureThermo& thermo
( (
film().primaryMesh().lookupObject<twoPhaseMixtureThermo> film.primaryMesh().lookupObject<twoPhaseMixtureThermo>
( (
twoPhaseMixtureThermo::dictName twoPhaseMixtureThermo::dictName
) )
@ -169,13 +172,13 @@ void VoFPatchTransfer::correct
const label patchi = patchIDs_[pidi]; const label patchi = patchIDs_[pidi];
label primaryPatchi = -1; label primaryPatchi = -1;
forAll(film().intCoupledPatchIDs(), i) forAll(film.intCoupledPatchIDs(), i)
{ {
const label filmPatchi = film().intCoupledPatchIDs()[i]; const label filmPatchi = film.intCoupledPatchIDs()[i];
if (filmPatchi == patchi) if (filmPatchi == patchi)
{ {
primaryPatchi = film().primaryPatchIDs()[i]; primaryPatchi = film.primaryPatchIDs()[i];
} }
} }
@ -183,31 +186,31 @@ void VoFPatchTransfer::correct
{ {
scalarField deltaCoeffs scalarField deltaCoeffs
( (
film().primaryMesh().boundary()[primaryPatchi].deltaCoeffs() film.primaryMesh().boundary()[primaryPatchi].deltaCoeffs()
); );
film().toRegion(patchi, deltaCoeffs); film.toRegion(patchi, deltaCoeffs);
scalarField hp(heVoF.boundaryField()[primaryPatchi]); scalarField hp(heVoF.boundaryField()[primaryPatchi]);
film().toRegion(patchi, hp); film.toRegion(patchi, hp);
scalarField Tp(TVoF.boundaryField()[primaryPatchi]); scalarField Tp(TVoF.boundaryField()[primaryPatchi]);
film().toRegion(patchi, Tp); film.toRegion(patchi, Tp);
scalarField Cpp(CpVoF.boundaryField()[primaryPatchi]); scalarField Cpp(CpVoF.boundaryField()[primaryPatchi]);
film().toRegion(patchi, Cpp); film.toRegion(patchi, Cpp);
scalarField rhop(rhoVoF.boundaryField()[primaryPatchi]); scalarField rhop(rhoVoF.boundaryField()[primaryPatchi]);
film().toRegion(patchi, rhop); film.toRegion(patchi, rhop);
scalarField alphap(alphaVoF.boundaryField()[primaryPatchi]); scalarField alphap(alphaVoF.boundaryField()[primaryPatchi]);
film().toRegion(patchi, alphap); film.toRegion(patchi, alphap);
scalarField Vp scalarField Vp
( (
film().primaryMesh().boundary()[primaryPatchi] film.primaryMesh().boundary()[primaryPatchi]
.patchInternalField(film().primaryMesh().V()) .patchInternalField(film.primaryMesh().V())
); );
film().toRegion(patchi, Vp); film.toRegion(patchi, Vp);
const polyPatch& pp = pbm[patchi]; const polyPatch& pp = pbm[patchi];
const labelList& faceCells = pp.faceCells(); const labelList& faceCells = pp.faceCells();
@ -231,7 +234,7 @@ void VoFPatchTransfer::correct
transferRateCoeff_*delta[celli]*rho[celli]*magSf[celli]; transferRateCoeff_*delta[celli]*rho[celli]*magSf[celli];
massToTransfer[celli] += dMass; massToTransfer[celli] += dMass;
energyToTransfer[celli] += dMass*film().hs()[celli]; energyToTransfer[celli] += dMass*film.h()[celli];
} }
if if

View File

@ -35,8 +35,6 @@ Description
- if extruding boundary faces: - if extruding boundary faces:
- convert boundary faces to mappedWall patches - convert boundary faces to mappedWall patches
- extrude edges of faceZone as a \<zone\>_sidePatch - extrude edges of faceZone as a \<zone\>_sidePatch
- extrude edges in between different faceZones as a
(nonuniformTransform)cyclic \<zoneA\>_\<zoneB\>
- extrudes into master direction (i.e. away from the owner cell - extrudes into master direction (i.e. away from the owner cell
if flipMap is false) if flipMap is false)
@ -123,7 +121,6 @@ Notes:
#include "syncTools.H" #include "syncTools.H"
#include "cyclicPolyPatch.H" #include "cyclicPolyPatch.H"
#include "wedgePolyPatch.H" #include "wedgePolyPatch.H"
#include "nonuniformTransformCyclicPolyPatch.H"
#include "extrudeModel.H" #include "extrudeModel.H"
#include "faceSet.H" #include "faceSet.H"
#include "fvMeshTools.H" #include "fvMeshTools.H"
@ -1051,89 +1048,6 @@ void addZoneSidePatches
} }
void addInterZonePatches
(
const fvMesh& mesh,
const wordList& zoneNames,
const bool oneD,
labelList& zoneZonePatch_min,
labelList& zoneZonePatch_max,
DynamicList<polyPatch*>& newPatches
)
{
Pout<< "Adding inter-zone patches:" << nl << nl
<< "patchID\tpatch" << nl
<< "-------\t-----"
<< endl;
dictionary transformDict;
transformDict.add
(
"transform",
cyclicPolyPatch::transformTypeNames[cyclicPolyPatch::NOORDERING]
);
// Allow arbitrary matching for nonuniformTransformCyclicPolyPatch
transformDict.add("matchTolerance", 1e6);
label nOldPatches = newPatches.size();
if (!oneD)
{
forAll(zoneZonePatch_min, minZone)
{
for (label maxZone = minZone; maxZone < zoneNames.size(); maxZone++)
{
label index = minZone*zoneNames.size()+maxZone;
if (zoneZonePatch_min[index] > 0)
{
word minToMax =
zoneNames[minZone]
+ "_to_"
+ zoneNames[maxZone];
word maxToMin =
zoneNames[maxZone]
+ "_to_"
+ zoneNames[minZone];
{
transformDict.set("neighbourPatch", maxToMin);
zoneZonePatch_min[index] =
addPatch<nonuniformTransformCyclicPolyPatch>
(
mesh.boundaryMesh(),
minToMax,
transformDict,
newPatches
);
Pout<< zoneZonePatch_min[index] << '\t' << minToMax
<< nl;
}
{
transformDict.set("neighbourPatch", minToMax);
zoneZonePatch_max[index] =
addPatch<nonuniformTransformCyclicPolyPatch>
(
mesh.boundaryMesh(),
maxToMin,
transformDict,
newPatches
);
Pout<< zoneZonePatch_max[index] << '\t' << maxToMin
<< nl;
}
}
}
}
}
Pout<< "Added " << newPatches.size()-nOldPatches << " inter-zone patches."
<< nl << endl;
}
tmp<pointField> calcOffset tmp<pointField> calcOffset
( (
const primitiveFacePatch& extrudePatch, const primitiveFacePatch& extrudePatch,
@ -2042,19 +1956,6 @@ int main(int argc, char *argv[])
); );
// Add the patches in between zones
addInterZonePatches
(
mesh,
zoneNames,
oneD,
zoneZonePatch_min,
zoneZonePatch_max,
regionPatches
);
// Sets sidePatchID[edgeI] to interprocessor patch. Adds any // Sets sidePatchID[edgeI] to interprocessor patch. Adds any
// interprocessor or cyclic patches if necessary. // interprocessor or cyclic patches if necessary.
labelList sidePatchID; labelList sidePatchID;

View File

@ -37,11 +37,6 @@ empty
type empty; type empty;
} }
nonuniformTransformCyclic
{
type nonuniformTransformCyclic;
}
cyclicRepeatAMI cyclicRepeatAMI
{ {
type cyclicRepeatAMI; type cyclicRepeatAMI;

View File

@ -473,7 +473,6 @@ $(constraintPolyPatches)/cyclic/cyclicPolyPatch.C
$(constraintPolyPatches)/cyclicSlip/cyclicSlipPolyPatch.C $(constraintPolyPatches)/cyclicSlip/cyclicSlipPolyPatch.C
$(constraintPolyPatches)/oldCyclic/oldCyclicPolyPatch.C $(constraintPolyPatches)/oldCyclic/oldCyclicPolyPatch.C
$(constraintPolyPatches)/empty/emptyPolyPatch.C $(constraintPolyPatches)/empty/emptyPolyPatch.C
$(constraintPolyPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C
$(constraintPolyPatches)/processorCyclic/processorCyclicPolyPatch.C $(constraintPolyPatches)/processorCyclic/processorCyclicPolyPatch.C
$(constraintPolyPatches)/processor/processorPolyPatch.C $(constraintPolyPatches)/processor/processorPolyPatch.C
$(constraintPolyPatches)/symmetryPlane/symmetryPlanePolyPatch.C $(constraintPolyPatches)/symmetryPlane/symmetryPlanePolyPatch.C
@ -595,7 +594,6 @@ constraintPointPatches = $(pointPatches)/constraint
$(constraintPointPatches)/cyclic/cyclicPointPatch.C $(constraintPointPatches)/cyclic/cyclicPointPatch.C
$(constraintPointPatches)/cyclicSlip/cyclicSlipPointPatch.C $(constraintPointPatches)/cyclicSlip/cyclicSlipPointPatch.C
$(constraintPointPatches)/empty/emptyPointPatch.C $(constraintPointPatches)/empty/emptyPointPatch.C
$(constraintPointPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatch.C
$(constraintPointPatches)/processor/processorPointPatch.C $(constraintPointPatches)/processor/processorPointPatch.C
$(constraintPointPatches)/processorCyclic/processorCyclicPointPatch.C $(constraintPointPatches)/processorCyclic/processorCyclicPointPatch.C
$(constraintPointPatches)/symmetryPlane/symmetryPlanePointPatch.C $(constraintPointPatches)/symmetryPlane/symmetryPlanePointPatch.C
@ -670,7 +668,6 @@ constraintPointPatchFields = $(pointPatchFields)/constraint
$(constraintPointPatchFields)/cyclic/cyclicPointPatchFields.C $(constraintPointPatchFields)/cyclic/cyclicPointPatchFields.C
$(constraintPointPatchFields)/cyclicSlip/cyclicSlipPointPatchFields.C $(constraintPointPatchFields)/cyclicSlip/cyclicSlipPointPatchFields.C
$(constraintPointPatchFields)/empty/emptyPointPatchFields.C $(constraintPointPatchFields)/empty/emptyPointPatchFields.C
$(constraintPointPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchFields.C
$(constraintPointPatchFields)/processor/processorPointPatchFields.C $(constraintPointPatchFields)/processor/processorPointPatchFields.C
$(constraintPointPatchFields)/processorCyclic/processorCyclicPointPatchFields.C $(constraintPointPatchFields)/processorCyclic/processorCyclicPointPatchFields.C
$(constraintPointPatchFields)/symmetryPlane/symmetryPlanePointPatchFields.C $(constraintPointPatchFields)/symmetryPlane/symmetryPlanePointPatchFields.C

View File

@ -1,109 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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 "nonuniformTransformCyclicPointPatchField.H"
#include "transformField.H"
#include "symmTransformField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::nonuniformTransformCyclicPointPatchField<Type>::
nonuniformTransformCyclicPointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF
)
:
cyclicPointPatchField<Type>(p, iF)
{}
template<class Type>
Foam::nonuniformTransformCyclicPointPatchField<Type>::
nonuniformTransformCyclicPointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF,
const dictionary& dict
)
:
cyclicPointPatchField<Type>(p, iF, dict)
{}
template<class Type>
Foam::nonuniformTransformCyclicPointPatchField<Type>::
nonuniformTransformCyclicPointPatchField
(
const nonuniformTransformCyclicPointPatchField<Type>& ptf,
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF,
const pointPatchFieldMapper& mapper
)
:
cyclicPointPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type>
Foam::nonuniformTransformCyclicPointPatchField<Type>::
nonuniformTransformCyclicPointPatchField
(
const nonuniformTransformCyclicPointPatchField<Type>& ptf,
const DimensionedField<Type, pointMesh>& iF
)
:
cyclicPointPatchField<Type>(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::nonuniformTransformCyclicPointPatchField<Type>::evaluate
(
const Pstream::commsTypes
)
{
const vectorField& nHat = this->patch().pointNormals();
tmp<Field<Type>> tvalues =
(
(
this->patchInternalField()
+ transform(I - 2.0*sqr(nHat), this->patchInternalField())
)/2.0
);
// Get internal field to insert values into
Field<Type>& iF = const_cast<Field<Type>&>(this->primitiveField());
this->setInInternalField(iF, tvalues());
}
// ************************************************************************* //

View File

@ -1,147 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 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::nonuniformTransformCyclicPointPatchField
Description
Cyclic + slip constraints
SourceFiles
nonuniformTransformCyclicPointPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicPointPatchField_H
#define nonuniformTransformCyclicPointPatchField_H
#include "cyclicPointPatchField.H"
#include "nonuniformTransformCyclicPointPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class nonuniformTransformCyclicPointPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class nonuniformTransformCyclicPointPatchField
:
public cyclicPointPatchField<Type>
{
public:
//- Runtime type information
TypeName(nonuniformTransformCyclicPointPatch::typeName_());
// Constructors
//- Construct from patch and internal field
nonuniformTransformCyclicPointPatchField
(
const pointPatch&,
const DimensionedField<Type, pointMesh>&
);
//- Construct from patch, internal field and dictionary
nonuniformTransformCyclicPointPatchField
(
const pointPatch&,
const DimensionedField<Type, pointMesh>&,
const dictionary&
);
//- Construct by mapping given patchField<Type> onto a new patch
nonuniformTransformCyclicPointPatchField
(
const nonuniformTransformCyclicPointPatchField<Type>&,
const pointPatch&,
const DimensionedField<Type, pointMesh>&,
const pointPatchFieldMapper&
);
//- Construct and return a clone
virtual autoPtr<pointPatchField<Type>> clone() const
{
return autoPtr<pointPatchField<Type>>
(
new nonuniformTransformCyclicPointPatchField<Type>
(
*this
)
);
}
//- Construct as copy setting internal field reference
nonuniformTransformCyclicPointPatchField
(
const nonuniformTransformCyclicPointPatchField<Type>&,
const DimensionedField<Type, pointMesh>&
);
//- Construct and return a clone setting internal field reference
virtual autoPtr<pointPatchField<Type>> clone
(
const DimensionedField<Type, pointMesh>& iF
) const
{
return autoPtr<pointPatchField<Type>>
(
new nonuniformTransformCyclicPointPatchField<Type>
(
*this, iF
)
);
}
// Member Functions
//- Evaluate the patch field
virtual void evaluate
(
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "nonuniformTransformCyclicPointPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,43 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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 "nonuniformTransformCyclicPointPatchFields.H"
#include "pointPatchFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePointPatchFields(nonuniformTransformCyclic);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,49 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicPointPatchFields_H
#define nonuniformTransformCyclicPointPatchFields_H
#include "nonuniformTransformCyclicPointPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePointPatchFieldTypedefs(nonuniformTransformCyclic);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,73 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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 "nonuniformTransformCyclicPointPatch.H"
#include "pointConstraint.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(nonuniformTransformCyclicPointPatch, 0);
addToRunTimeSelectionTable
(
facePointPatch,
nonuniformTransformCyclicPointPatch,
polyPatch
);
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const vectorField& nonuniformTransformCyclicPointPatch::pointNormals() const
{
// Use underlying patch normals
return refCast<const facePointPatch>
(
*this
).facePointPatch::pointNormals();
}
void nonuniformTransformCyclicPointPatch::applyConstraint
(
const label pointi,
pointConstraint& pc
) const
{
pc.applyConstraint(pointNormals()[pointi]);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,102 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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::nonuniformTransformCyclicPointPatch
Description
Cyclic patch with slip constraint
SourceFiles
nonuniformTransformCyclicPointPatch.C
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicPointPatch_H
#define nonuniformTransformCyclicPointPatch_H
#include "cyclicPointPatch.H"
#include "nonuniformTransformCyclicPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class nonuniformTransformCyclicPointPatch Declaration
\*---------------------------------------------------------------------------*/
class nonuniformTransformCyclicPointPatch
:
public cyclicPointPatch
{
public:
//- Runtime type information
TypeName(nonuniformTransformCyclicPolyPatch::typeName_());
// Constructors
//- Construct from components
nonuniformTransformCyclicPointPatch
(
const polyPatch& patch,
const pointBoundaryMesh& bm
)
:
cyclicPointPatch(patch, bm)
{}
// Destructor
virtual ~nonuniformTransformCyclicPointPatch()
{}
// Member Functions
//- Return point unit normals.
virtual const vectorField& pointNormals() const;
//- Accumulate the effect of constraint direction of this patch
virtual void applyConstraint
(
const label pointi,
pointConstraint&
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,50 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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 "nonuniformTransformCyclicPolyPatch.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(nonuniformTransformCyclicPolyPatch, 0);
addToRunTimeSelectionTable
(
polyPatch,
nonuniformTransformCyclicPolyPatch,
word
);
addToRunTimeSelectionTable
(
polyPatch,
nonuniformTransformCyclicPolyPatch,
dictionary
);
}
// ************************************************************************* //

View File

@ -1,203 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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::nonuniformTransformCyclicPolyPatch
Description
Transform boundary used in extruded regions. Allows non-uniform transforms.
Wip.
SourceFiles
nonuniformTransformCyclicPolyPatch.C
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicPolyPatch_H
#define nonuniformTransformCyclicPolyPatch_H
#include "cyclicPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class nonuniformTransformCyclicPolyPatch Declaration
\*---------------------------------------------------------------------------*/
class nonuniformTransformCyclicPolyPatch
:
public cyclicPolyPatch
{
public:
//- Runtime type information
TypeName("nonuniformTransformCyclic");
// Constructors
//- Construct from components
nonuniformTransformCyclicPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const polyBoundaryMesh& bm,
const word& patchType,
const transformType transform = UNKNOWN
)
:
cyclicPolyPatch(name, size, start, index, bm, patchType, transform)
{}
//- Construct from dictionary
nonuniformTransformCyclicPolyPatch
(
const word& name,
const dictionary& dict,
const label index,
const polyBoundaryMesh& bm,
const word& patchType
)
:
cyclicPolyPatch(name, dict, index, bm, patchType)
{}
//- Construct as copy, resetting the boundary mesh
nonuniformTransformCyclicPolyPatch
(
const nonuniformTransformCyclicPolyPatch& pp,
const polyBoundaryMesh& bm
)
:
cyclicPolyPatch(pp, bm)
{}
//- Construct given the original patch and resetting the
// face list and boundary mesh information
nonuniformTransformCyclicPolyPatch
(
const nonuniformTransformCyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart,
const word& neighbPatchName
)
:
cyclicPolyPatch(pp, bm, index, newSize, newStart, neighbPatchName)
{}
//- Construct given the original patch and a map
nonuniformTransformCyclicPolyPatch
(
const nonuniformTransformCyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
)
:
cyclicPolyPatch(pp, bm, index, mapAddressing, newStart)
{}
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
return autoPtr<polyPatch>
(
new nonuniformTransformCyclicPolyPatch(*this, bm)
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new nonuniformTransformCyclicPolyPatch
(
*this,
bm,
index,
newSize,
newStart,
neighbPatchName()
)
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new nonuniformTransformCyclicPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
// Destructor
virtual ~nonuniformTransformCyclicPolyPatch()
{}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -20,7 +20,6 @@ $(constraintFvPatches)/cyclicAMI/cyclicAMIFvPatch.C
$(constraintFvPatches)/cyclicACMI/cyclicACMIFvPatch.C $(constraintFvPatches)/cyclicACMI/cyclicACMIFvPatch.C
$(constraintFvPatches)/cyclicSlip/cyclicSlipFvPatch.C $(constraintFvPatches)/cyclicSlip/cyclicSlipFvPatch.C
$(constraintFvPatches)/empty/emptyFvPatch.C $(constraintFvPatches)/empty/emptyFvPatch.C
$(constraintFvPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatch.C
$(constraintFvPatches)/cyclicRepeatAMI/cyclicRepeatAMIFvPatch.C $(constraintFvPatches)/cyclicRepeatAMI/cyclicRepeatAMIFvPatch.C
$(constraintFvPatches)/processor/processorFvPatch.C $(constraintFvPatches)/processor/processorFvPatch.C
$(constraintFvPatches)/processorCyclic/processorCyclicFvPatch.C $(constraintFvPatches)/processorCyclic/processorCyclicFvPatch.C
@ -120,7 +119,6 @@ $(constraintFvPatchFields)/cyclicSlip/cyclicSlipFvPatchFields.C
$(constraintFvPatchFields)/empty/emptyFvPatchFields.C $(constraintFvPatchFields)/empty/emptyFvPatchFields.C
$(constraintFvPatchFields)/jumpCyclic/jumpCyclicFvPatchFields.C $(constraintFvPatchFields)/jumpCyclic/jumpCyclicFvPatchFields.C
$(constraintFvPatchFields)/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.C $(constraintFvPatchFields)/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.C
$(constraintFvPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFields.C
$(constraintFvPatchFields)/cyclicRepeatAMI/cyclicRepeatAMIFvPatchFields.C $(constraintFvPatchFields)/cyclicRepeatAMI/cyclicRepeatAMIFvPatchFields.C
$(constraintFvPatchFields)/processor/processorFvPatchFields.C $(constraintFvPatchFields)/processor/processorFvPatchFields.C
$(constraintFvPatchFields)/processor/processorFvPatchScalarField.C $(constraintFvPatchFields)/processor/processorFvPatchScalarField.C
@ -159,7 +157,6 @@ $(derivedFvPatchFields)/inletOutlet/inletOutletFvPatchFields.C
$(derivedFvPatchFields)/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C $(derivedFvPatchFields)/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C
$(derivedFvPatchFields)/mappedField/mappedFieldFvPatchFields.C $(derivedFvPatchFields)/mappedField/mappedFieldFvPatchFields.C
$(derivedFvPatchFields)/mappedFixedInternalValue/mappedFixedInternalValueFvPatchFields.C $(derivedFvPatchFields)/mappedFixedInternalValue/mappedFixedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/mappedFixedValue/mappedFixedValueFvPatchFields.C $(derivedFvPatchFields)/mappedFixedValue/mappedFixedValueFvPatchFields.C
$(derivedFvPatchFields)/mappedFlowRate/mappedFlowRateFvPatchVectorField.C $(derivedFvPatchFields)/mappedFlowRate/mappedFlowRateFvPatchVectorField.C
$(derivedFvPatchFields)/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C $(derivedFvPatchFields)/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C
@ -231,7 +228,6 @@ $(constraintFvsPatchFields)/cyclicAMI/cyclicAMIFvsPatchFields.C
$(constraintFvsPatchFields)/cyclicACMI/cyclicACMIFvsPatchFields.C $(constraintFvsPatchFields)/cyclicACMI/cyclicACMIFvsPatchFields.C
$(constraintFvsPatchFields)/cyclicSlip/cyclicSlipFvsPatchFields.C $(constraintFvsPatchFields)/cyclicSlip/cyclicSlipFvsPatchFields.C
$(constraintFvsPatchFields)/empty/emptyFvsPatchFields.C $(constraintFvsPatchFields)/empty/emptyFvsPatchFields.C
$(constraintFvsPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchFields.C
$(constraintFvsPatchFields)/cyclicRepeatAMI/cyclicRepeatAMIFvsPatchFields.C $(constraintFvsPatchFields)/cyclicRepeatAMI/cyclicRepeatAMIFvsPatchFields.C
$(constraintFvsPatchFields)/processor/processorFvsPatchFields.C $(constraintFvsPatchFields)/processor/processorFvsPatchFields.C
$(constraintFvsPatchFields)/processorCyclic/processorCyclicFvsPatchFields.C $(constraintFvsPatchFields)/processorCyclic/processorCyclicFvsPatchFields.C

View File

@ -1,92 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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 "nonuniformTransformCyclicFvPatchField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::nonuniformTransformCyclicFvPatchField<Type>::
nonuniformTransformCyclicFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
cyclicFvPatchField<Type>(p, iF)
{}
template<class Type>
Foam::nonuniformTransformCyclicFvPatchField<Type>::
nonuniformTransformCyclicFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
cyclicFvPatchField<Type>(p, iF, dict)
{}
template<class Type>
Foam::nonuniformTransformCyclicFvPatchField<Type>::
nonuniformTransformCyclicFvPatchField
(
const nonuniformTransformCyclicFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
cyclicFvPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type>
Foam::nonuniformTransformCyclicFvPatchField<Type>::
nonuniformTransformCyclicFvPatchField
(
const nonuniformTransformCyclicFvPatchField<Type>& ptf
)
:
cyclicFvPatchField<Type>(ptf)
{}
template<class Type>
Foam::nonuniformTransformCyclicFvPatchField<Type>::
nonuniformTransformCyclicFvPatchField
(
const nonuniformTransformCyclicFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
cyclicFvPatchField<Type>(ptf, iF)
{}
// ************************************************************************* //

View File

@ -1,145 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 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::nonuniformTransformCyclicFvPatchField
Description
This boundary condition enforces a cyclic condition between a pair of
boundaries, incorporating a non-uniform transformation.
SourceFiles
nonuniformTransformCyclicFvPatchField.C
nonuniformTransformCyclicFvPatchFields.H
nonuniformTransformCyclicFvPatchFields.C
nonuniformTransformCyclicFvPatchFieldsFwd.H
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicFvPatchField_H
#define nonuniformTransformCyclicFvPatchField_H
#include "cyclicFvPatchField.H"
#include "nonuniformTransformCyclicFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class nonuniformTransformCyclicFvPatch Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class nonuniformTransformCyclicFvPatchField
:
public cyclicFvPatchField<Type>
{
// Private Data
public:
//- Runtime type information
TypeName(nonuniformTransformCyclicFvPatch::typeName_());
// Constructors
//- Construct from patch and internal field
nonuniformTransformCyclicFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
nonuniformTransformCyclicFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// nonuniformTransformCyclicFvPatchField onto a new patch
nonuniformTransformCyclicFvPatchField
(
const nonuniformTransformCyclicFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Copy constructor
nonuniformTransformCyclicFvPatchField
(
const nonuniformTransformCyclicFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type>> clone() const
{
return tmp<fvPatchField<Type>>
(
new nonuniformTransformCyclicFvPatchField<Type>(*this)
);
}
//- Copy constructor setting internal field reference
nonuniformTransformCyclicFvPatchField
(
const nonuniformTransformCyclicFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type>> clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type>>
(
new nonuniformTransformCyclicFvPatchField<Type>(*this, iF)
);
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "nonuniformTransformCyclicFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,43 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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 "nonuniformTransformCyclicFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(nonuniformTransformCyclic);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,49 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicFvPatchFields_H
#define nonuniformTransformCyclicFvPatchFields_H
#include "nonuniformTransformCyclicFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(nonuniformTransformCyclic);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,50 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicFvPatchFieldsFwd_H
#define nonuniformTransformCyclicFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class nonuniformTransformCyclicFvPatchField;
makePatchTypeFieldTypedefs(nonuniformTransformCyclic);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,122 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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 "mappedFixedPushedInternalValueFvPatchField.H"
#include "UIndirectList.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::mappedFixedPushedInternalValueFvPatchField<Type>::
mappedFixedPushedInternalValueFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
mappedFixedValueFvPatchField<Type>(p, iF)
{}
template<class Type>
Foam::mappedFixedPushedInternalValueFvPatchField<Type>::
mappedFixedPushedInternalValueFvPatchField
(
const mappedFixedPushedInternalValueFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
mappedFixedValueFvPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type>
Foam::mappedFixedPushedInternalValueFvPatchField<Type>::
mappedFixedPushedInternalValueFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
mappedFixedValueFvPatchField<Type>(p, iF, dict)
{}
template<class Type>
Foam::mappedFixedPushedInternalValueFvPatchField<Type>::
mappedFixedPushedInternalValueFvPatchField
(
const mappedFixedPushedInternalValueFvPatchField<Type>& ptf
)
:
mappedFixedValueFvPatchField<Type>(ptf)
{}
template<class Type>
Foam::mappedFixedPushedInternalValueFvPatchField<Type>::
mappedFixedPushedInternalValueFvPatchField
(
const mappedFixedPushedInternalValueFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
mappedFixedValueFvPatchField<Type>(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::mappedFixedPushedInternalValueFvPatchField<Type>::updateCoeffs()
{
if (this->updated())
{
return;
}
// Retrieve the neighbour values and assign to this patch boundary field
mappedFixedValueFvPatchField<Type>::updateCoeffs();
// Assign the patch internal field to its boundary value
Field<Type>& intFld = const_cast<Field<Type>&>(this->primitiveField());
UIndirectList<Type>(intFld, this->patch().faceCells()) = *this;
}
template<class Type>
void Foam::mappedFixedPushedInternalValueFvPatchField<Type>::write
(
Ostream& os
) const
{
mappedFixedValueFvPatchField<Type>::write(os);
}
// ************************************************************************* //

View File

@ -1,187 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 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::mappedFixedPushedInternalValueFvPatchField
Description
This boundary condition maps the boundary values of a neighbour patch
field to the boundary and internal cell values of *this.
Usage
\table
Property | Description | Required | Default value
fieldName | name of field to be mapped | no | this field name
setAverage | flag to activate setting of average value | yes |
average | average value to apply if \c setAverage = yes | yes |
\endtable
Example of the boundary condition specification:
\verbatim
<patchName>
{
type mappedFixedPushedInternalValue;
fieldName T;
setAverage no;
average 0;
value uniform 0;
}
\endverbatim
Note
This boundary condition can only be applied to patches that are of
the \c mappedPolyPatch type.
See also
Foam::mappedPatchBase
Foam::mappedPolyPatch
Foam::mappedFvPatch
Foam::mappedFixedValueFvPatchField
SourceFiles
mappedFixedPushedInternalValueFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef mappedFixedPushedInternalValueFvPatchField_H
#define mappedFixedPushedInternalValueFvPatchField_H
#include "mappedFixedValueFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class mappedFixedPushedInternalValueFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class mappedFixedPushedInternalValueFvPatchField
:
public mappedFixedValueFvPatchField<Type>
{
public:
//- Runtime type information
TypeName("mappedFixedPushedInternalValue");
// Constructors
//- Construct from patch and internal field
mappedFixedPushedInternalValueFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
mappedFixedPushedInternalValueFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given a
// mappedFixedPushedInternalValueFvPatchField onto a new patch
mappedFixedPushedInternalValueFvPatchField
(
const mappedFixedPushedInternalValueFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Copy constructor
mappedFixedPushedInternalValueFvPatchField
(
const mappedFixedPushedInternalValueFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type>> clone() const
{
return tmp<fvPatchField<Type>>
(
new mappedFixedPushedInternalValueFvPatchField<Type>
(
*this
)
);
}
//- Copy constructor setting internal field reference
mappedFixedPushedInternalValueFvPatchField
(
const mappedFixedPushedInternalValueFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type>> clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type>>
(
new mappedFixedPushedInternalValueFvPatchField<Type>
(
*this,
iF
)
);
}
// Member Functions
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "mappedFixedPushedInternalValueFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,43 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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 "mappedFixedPushedInternalValueFvPatchFields.H"
#include "volMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(mappedFixedPushedInternalValue);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,49 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
\*---------------------------------------------------------------------------*/
#ifndef mappedFixedPushedInternalValueFvPatchFields_H
#define mappedFixedPushedInternalValueFvPatchFields_H
#include "mappedFixedPushedInternalValueFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(mappedFixedPushedInternalValue)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,50 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
\*---------------------------------------------------------------------------*/
#ifndef mappedFixedPushedInternalValueFvPatchFieldsFwd_H
#define mappedFixedPushedInternalValueFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class mappedFixedPushedInternalValueFvPatchField;
makePatchTypeFieldTypedefs(mappedFixedPushedInternalValue)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,92 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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 "nonuniformTransformCyclicFvsPatchField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::nonuniformTransformCyclicFvsPatchField<Type>::
nonuniformTransformCyclicFvsPatchField
(
const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF
)
:
cyclicFvsPatchField<Type>(p, iF)
{}
template<class Type>
Foam::nonuniformTransformCyclicFvsPatchField<Type>::
nonuniformTransformCyclicFvsPatchField
(
const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF,
const dictionary& dict
)
:
cyclicFvsPatchField<Type>(p, iF, dict)
{}
template<class Type>
Foam::nonuniformTransformCyclicFvsPatchField<Type>::
nonuniformTransformCyclicFvsPatchField
(
const nonuniformTransformCyclicFvsPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
cyclicFvsPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type>
Foam::nonuniformTransformCyclicFvsPatchField<Type>::
nonuniformTransformCyclicFvsPatchField
(
const nonuniformTransformCyclicFvsPatchField<Type>& ptf
)
:
cyclicFvsPatchField<Type>(ptf)
{}
template<class Type>
Foam::nonuniformTransformCyclicFvsPatchField<Type>::
nonuniformTransformCyclicFvsPatchField
(
const nonuniformTransformCyclicFvsPatchField<Type>& ptf,
const DimensionedField<Type, surfaceMesh>& iF
)
:
cyclicFvsPatchField<Type>(ptf, iF)
{}
// ************************************************************************* //

View File

@ -1,139 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 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::nonuniformTransformCyclicFvsPatchField
Description
Foam::nonuniformTransformCyclicFvsPatchField
SourceFiles
nonuniformTransformCyclicFvsPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicFvsPatchField_H
#define nonuniformTransformCyclicFvsPatchField_H
#include "cyclicFvsPatchField.H"
#include "nonuniformTransformCyclicFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class nonuniformTransformCyclicFvsPatch Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class nonuniformTransformCyclicFvsPatchField
:
public cyclicFvsPatchField<Type>
{
public:
//- Runtime type information
TypeName(nonuniformTransformCyclicFvPatch::typeName_());
// Constructors
//- Construct from patch and internal field
nonuniformTransformCyclicFvsPatchField
(
const fvPatch&,
const DimensionedField<Type, surfaceMesh>&
);
//- Construct from patch, internal field and dictionary
nonuniformTransformCyclicFvsPatchField
(
const fvPatch&,
const DimensionedField<Type, surfaceMesh>&,
const dictionary&
);
//- Construct by mapping given
// nonuniformTransformCyclicFvsPatchField onto a new patch
nonuniformTransformCyclicFvsPatchField
(
const nonuniformTransformCyclicFvsPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, surfaceMesh>&,
const fvPatchFieldMapper&
);
//- Copy constructor
nonuniformTransformCyclicFvsPatchField
(
const nonuniformTransformCyclicFvsPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvsPatchField<Type>> clone() const
{
return tmp<fvsPatchField<Type>>
(
new nonuniformTransformCyclicFvsPatchField<Type>(*this)
);
}
//- Copy constructor setting internal field reference
nonuniformTransformCyclicFvsPatchField
(
const nonuniformTransformCyclicFvsPatchField<Type>&,
const DimensionedField<Type, surfaceMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvsPatchField<Type>> clone
(
const DimensionedField<Type, surfaceMesh>& iF
) const
{
return tmp<fvsPatchField<Type>>
(
new nonuniformTransformCyclicFvsPatchField<Type>(*this, iF)
);
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "nonuniformTransformCyclicFvsPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,43 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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 "nonuniformTransformCyclicFvsPatchFields.H"
#include "fvsPatchFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeFvsPatchFields(nonuniformTransformCyclic);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,49 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicFvsPatchFields_H
#define nonuniformTransformCyclicFvsPatchFields_H
#include "nonuniformTransformCyclicFvsPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeFvsPatchTypeFieldTypedefs(nonuniformTransformCyclic);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,50 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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/>.
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicFvsPatchFieldsFwd_H
#define nonuniformTransformCyclicFvsPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class nonuniformTransformCyclicFvsPatchField;
makeFvsPatchTypeFieldTypedefs(nonuniformTransformCyclic);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,49 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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 "nonuniformTransformCyclicFvPatch.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(nonuniformTransformCyclicFvPatch, 0);
addToRunTimeSelectionTable
(
fvPatch,
nonuniformTransformCyclicFvPatch,
polyPatch
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,83 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 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::nonuniformTransformCyclicFvPatch
Description
Cyclic-plane patch.
SourceFiles
nonuniformTransformCyclicFvPatch.C
\*---------------------------------------------------------------------------*/
#ifndef nonuniformTransformCyclicFvPatch_H
#define nonuniformTransformCyclicFvPatch_H
#include "cyclicFvPatch.H"
#include "nonuniformTransformCyclicPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class nonuniformTransformCyclicFvPatch Declaration
\*---------------------------------------------------------------------------*/
class nonuniformTransformCyclicFvPatch
:
public cyclicFvPatch
{
public:
//- Runtime type information
TypeName(nonuniformTransformCyclicPolyPatch::typeName_());
// Constructors
//- Construct from polyPatch
nonuniformTransformCyclicFvPatch
(
const polyPatch& patch,
const fvBoundaryMesh& bm
)
:
cyclicFvPatch(patch, bm)
{}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "ThermoSurfaceFilm.H" #include "ThermoSurfaceFilm.H"
#include "thermoSingleLayer.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H" #include "mathematicalConstants.H"
#include "Pstream.H" #include "Pstream.H"
@ -618,10 +619,16 @@ void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields
filmModel filmModel
); );
TFilmPatch_ = filmModel.Ts().boundaryField()[filmPatchi]; const regionModels::surfaceFilmModels::thermoSingleLayer& thermalFilmModel =
refCast<const regionModels::surfaceFilmModels::thermoSingleLayer>
(
filmModel
);
TFilmPatch_ = thermalFilmModel.Ts().boundaryField()[filmPatchi];
filmModel.toPrimary(filmPatchi, TFilmPatch_); filmModel.toPrimary(filmPatchi, TFilmPatch_);
CpFilmPatch_ = filmModel.Cp().boundaryField()[filmPatchi]; CpFilmPatch_ = thermalFilmModel.Cp().boundaryField()[filmPatchi];
filmModel.toPrimary(filmPatchi, CpFilmPatch_); filmModel.toPrimary(filmPatchi, CpFilmPatch_);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -65,10 +65,7 @@ void Foam::regionModels::regionModel::constructMeshObjects()
void Foam::regionModels::regionModel::initialise() void Foam::regionModels::regionModel::initialise()
{ {
if (debug) DebugInFunction << endl;
{
Pout<< "regionModel::initialise()" << endl;
}
label nBoundaryFaces = 0; label nBoundaryFaces = 0;
DynamicList<label> primaryPatchIDs; DynamicList<label> primaryPatchIDs;
@ -80,11 +77,9 @@ void Foam::regionModels::regionModel::initialise()
const polyPatch& regionPatch = rbm[patchi]; const polyPatch& regionPatch = rbm[patchi];
if (isA<mappedPatchBase>(regionPatch)) if (isA<mappedPatchBase>(regionPatch))
{ {
if (debug) DebugInFunction
{ << "found " << mappedWallPolyPatch::typeName
Pout<< "found " << mappedWallPolyPatch::typeName
<< " " << regionPatch.name() << endl; << " " << regionPatch.name() << endl;
}
intCoupledPatchIDs.append(patchi); intCoupledPatchIDs.append(patchi);

View File

@ -30,17 +30,15 @@ Description
SourceFiles SourceFiles
regionModelI.H regionModelI.H
regionModel.C regionModel.C
regionModelTemplates.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef regionModel_H #ifndef regionModel_H
#define regionModel_H #define regionModel_H
#include "IOdictionary.H" #include "fvMesh.H"
#include "Switch.H" #include "AMIInterpolation.H"
#include "labelList.H"
#include "volFields.H"
#include "mappedPatchBase.H"
#include "regionModelFunctionObjectList.H" #include "regionModelFunctionObjectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -291,14 +289,6 @@ public:
List<Type>& regionField List<Type>& regionField
) const; ) const;
//- Convert a primary region field to the local region
template<class Type>
void toRegion
(
const label regionPatchi,
List<Type>& primaryFieldField
) const;
//- Convert a local region field to the primary region with op //- Convert a local region field to the primary region with op
template<class Type, class CombineOp> template<class Type, class CombineOp>
void toPrimary void toPrimary
@ -308,13 +298,34 @@ public:
const CombineOp& cop const CombineOp& cop
) const; ) const;
//- Convert a primary region field to the local region with op //- Convert a primary region field to the local region
template<class Type, class CombineOp> template<class Type>
void toRegion void toRegion
( (
const label regionPatchi, const label regionPatchi,
List<Type>& primaryFieldField, List<Type>& primaryFieldField
const CombineOp& cop ) const;
//- Return a primary patch field mapped the region internal field
template<class Type>
void toRegion
(
Field<Type>& regionField,
const label regionPatchi,
const fvPatchField<Type>& primaryPatchField
) const;
//- Return a primary patch field mapped the local region
template<class Type>
void toRegion
(
Field<Type>& rf,
const typename GeometricField
<
Type,
fvPatchField,
volMesh
>::Boundary& pBf
) const; ) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,6 +23,10 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "mappedPatchFieldBase.H"
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Type> template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::tmp<Foam::Field<Type>>
Foam::regionModels::regionModel::mapRegionPatchField Foam::regionModels::regionModel::mapRegionPatchField
@ -183,33 +187,6 @@ void Foam::regionModels::regionModel::toPrimary
} }
template<class Type>
void Foam::regionModels::regionModel::toRegion
(
const label regionPatchi,
List<Type>& primaryField
) const
{
forAll(intCoupledPatchIDs_, i)
{
if (intCoupledPatchIDs_[i] == regionPatchi)
{
const mappedPatchBase& mpb =
refCast<const mappedPatchBase>
(
regionMesh().boundaryMesh()[regionPatchi]
);
mpb.distribute(primaryField);
return;
}
}
FatalErrorInFunction
<< "Region patch ID " << regionPatchi << " not found in region mesh"
<< abort(FatalError);
}
template<class Type, class CombineOp> template<class Type, class CombineOp>
void Foam::regionModels::regionModel::toPrimary void Foam::regionModels::regionModel::toPrimary
( (
@ -238,12 +215,11 @@ void Foam::regionModels::regionModel::toPrimary
} }
template<class Type, class CombineOp> template<class Type>
void Foam::regionModels::regionModel::toRegion void Foam::regionModels::regionModel::toRegion
( (
const label regionPatchi, const label regionPatchi,
List<Type>& primaryField, List<Type>& primaryField
const CombineOp& cop
) const ) const
{ {
forAll(intCoupledPatchIDs_, i) forAll(intCoupledPatchIDs_, i)
@ -255,7 +231,7 @@ void Foam::regionModels::regionModel::toRegion
( (
regionMesh().boundaryMesh()[regionPatchi] regionMesh().boundaryMesh()[regionPatchi]
); );
mpb.distribute(primaryField, cop); mpb.distribute(primaryField);
return; return;
} }
} }
@ -266,4 +242,39 @@ void Foam::regionModels::regionModel::toRegion
} }
template<class Type>
void Foam::regionModels::regionModel::toRegion
(
Field<Type>& regionField,
const label regionPatchi,
const fvPatchField<Type>& primaryPatchField
) const
{
const polyPatch& regionPatch = regionMesh().boundaryMesh()[regionPatchi];
const mappedPatchBase& mpb = refCast<const mappedPatchBase>(regionPatch);
mappedPatchFieldBase<Type> mpf(mpb, primaryPatchField);
UIndirectList<Type>(regionField, regionPatch.faceCells())
= mpf.mappedField();
}
template<class Type>
void Foam::regionModels::regionModel::toRegion
(
Field<Type>& rf,
const typename GeometricField<Type, fvPatchField, volMesh>::Boundary& pBf
) const
{
forAll(intCoupledPatchIDs_, i)
{
const label regionPatchi = intCoupledPatchIDs_[i];
const label primaryPatchi = primaryPatchIDs_[i];
toRegion(rf, regionPatchi, pBf[primaryPatchi]);
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -60,10 +60,7 @@ void Foam::regionModels::regionModel1D::constructMeshObjects()
void Foam::regionModels::regionModel1D::initialise() void Foam::regionModels::regionModel1D::initialise()
{ {
if (debug) DebugInFunction << endl;
{
Pout<< "regionModel1D::initialise()" << endl;
}
// Calculate boundaryFaceFaces and boundaryFaceCells // Calculate boundaryFaceFaces and boundaryFaceCells

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,6 +25,7 @@ License
#include "singleLayerRegion.H" #include "singleLayerRegion.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "surfaceFields.H"
#include "Time.H" #include "Time.H"
#include "zeroGradientFvPatchFields.H" #include "zeroGradientFvPatchFields.H"
@ -38,61 +39,57 @@ namespace regionModels
} }
} }
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
void Foam::regionModels::singleLayerRegion::constructMeshObjects() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
{
// construct patch normal vectors Foam::regionModels::singleLayerRegion::singleLayerRegion
nHatPtr_.reset
( (
new volVectorField const fvMesh& mesh,
const word& regionType,
const word& modelName,
bool readFields
)
:
regionModel(mesh, regionType, modelName, false),
nHat_
( (
IOobject IOobject
( (
"nHat", "nHat",
time_.timeName(), time_.timeName(),
regionMesh(), regionMesh()
IOobject::READ_IF_PRESENT,
NO_WRITE
), ),
regionMesh(), regionMesh(),
dimensionedVector(dimless, Zero), dimensionedVector(dimless, Zero),
zeroGradientFvPatchField<vector>::typeName zeroGradientFvPatchField<vector>::typeName
) ),
); magSf_
// construct patch areas
magSfPtr_.reset
(
new volScalarField
( (
IOobject IOobject
( (
"magSf", "magSf",
time_.timeName(), time_.timeName(),
regionMesh(), regionMesh()
IOobject::READ_IF_PRESENT,
NO_WRITE
), ),
regionMesh(), regionMesh(),
dimensionedScalar(dimArea, 0), dimensionedScalar(dimArea, 0)
zeroGradientFvPatchField<scalar>::typeName ),
) VbyA_
); (
} IOobject
(
"d",
void Foam::regionModels::singleLayerRegion::initialise() time_.timeName(),
regionMesh()
),
regionMesh(),
dimensionedScalar(dimLength, 0),
zeroGradientFvPatchField<vector>::typeName
),
passivePatchIDs_()
{ {
if (debug)
{
Pout<< "singleLayerRegion::initialise()" << endl;
}
label nBoundaryFaces = 0; label nBoundaryFaces = 0;
const polyBoundaryMesh& rbm = regionMesh().boundaryMesh(); const polyBoundaryMesh& rbm = regionMesh().boundaryMesh();
volVectorField& nHat = nHatPtr_();
volScalarField& magSf = magSfPtr_();
forAll(intCoupledPatchIDs_, i) forAll(intCoupledPatchIDs_, i)
{ {
const label patchi = intCoupledPatchIDs_[i]; const label patchi = intCoupledPatchIDs_[i];
@ -101,11 +98,10 @@ void Foam::regionModels::singleLayerRegion::initialise()
nBoundaryFaces += fCells.size(); nBoundaryFaces += fCells.size();
UIndirectList<vector>(nHat, fCells) = pp.faceNormals(); UIndirectList<vector>(nHat_, fCells) = pp.faceNormals();
UIndirectList<scalar>(magSf, fCells) = mag(pp.faceAreas()); UIndirectList<scalar>(magSf_, fCells) = mag(pp.faceAreas());
} }
nHat.correctBoundaryConditions(); nHat_.correctBoundaryConditions();
magSf.correctBoundaryConditions();
if (nBoundaryFaces != regionMesh().nCells()) if (nBoundaryFaces != regionMesh().nCells())
{ {
@ -117,7 +113,6 @@ void Foam::regionModels::singleLayerRegion::initialise()
<< abort(FatalError); << abort(FatalError);
} }
scalarField passiveMagSf(magSf.size(), 0.0);
passivePatchIDs_.setSize(intCoupledPatchIDs_.size(), -1); passivePatchIDs_.setSize(intCoupledPatchIDs_.size(), -1);
forAll(intCoupledPatchIDs_, i) forAll(intCoupledPatchIDs_, i)
{ {
@ -125,74 +120,24 @@ void Foam::regionModels::singleLayerRegion::initialise()
const polyPatch& ppIntCoupled = rbm[patchi]; const polyPatch& ppIntCoupled = rbm[patchi];
if (ppIntCoupled.size() > 0) if (ppIntCoupled.size() > 0)
{ {
label cellId = rbm[patchi].faceCells()[0]; const label cellId = rbm[patchi].faceCells()[0];
const cell& cFaces = regionMesh().cells()[cellId]; const cell& cFaces = regionMesh().cells()[cellId];
const label faceO
label facei = ppIntCoupled.start(); (
label faceO = cFaces.opposingFaceLabel(facei, regionMesh().faces()); cFaces.opposingFaceLabel
(
label passivePatchi = rbm.whichPatch(faceO); ppIntCoupled.start(), regionMesh().faces()
passivePatchIDs_[i] = passivePatchi; )
const polyPatch& ppPassive = rbm[passivePatchi]; );
UIndirectList<scalar>(passiveMagSf, ppPassive.faceCells()) = passivePatchIDs_[i] = rbm.whichPatch(faceO);
mag(ppPassive.faceAreas());
} }
} }
Pstream::listCombineGather(passivePatchIDs_, maxEqOp<label>()); Pstream::listCombineGather(passivePatchIDs_, maxEqOp<label>());
Pstream::listCombineScatter(passivePatchIDs_); Pstream::listCombineScatter(passivePatchIDs_);
magSf.field() = 0.5*(magSf + passiveMagSf); VbyA_.primitiveFieldRef() = regionMesh().V()/magSf_;
magSf.correctBoundaryConditions(); VbyA_.correctBoundaryConditions();
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
bool Foam::regionModels::singleLayerRegion::read()
{
return regionModel::read();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::regionModels::singleLayerRegion::singleLayerRegion
(
const fvMesh& mesh,
const word& regionType
)
:
regionModel(mesh, regionType),
nHatPtr_(nullptr),
magSfPtr_(nullptr),
passivePatchIDs_()
{}
Foam::regionModels::singleLayerRegion::singleLayerRegion
(
const fvMesh& mesh,
const word& regionType,
const word& modelName,
bool readFields
)
:
regionModel(mesh, regionType, modelName, false),
nHatPtr_(nullptr),
magSfPtr_(nullptr),
passivePatchIDs_()
{
if (active_)
{
constructMeshObjects();
initialise();
if (readFields)
{
read();
}
}
} }
@ -206,27 +151,20 @@ Foam::regionModels::singleLayerRegion::~singleLayerRegion()
const Foam::volVectorField& Foam::regionModels::singleLayerRegion::nHat() const const Foam::volVectorField& Foam::regionModels::singleLayerRegion::nHat() const
{ {
if (!nHatPtr_.valid()) return nHat_;
{
FatalErrorInFunction
<< "Region patch normal vectors not available"
<< abort(FatalError);
}
return nHatPtr_();
} }
const Foam::volScalarField& Foam::regionModels::singleLayerRegion::magSf() const const Foam::volScalarField::Internal&
Foam::regionModels::singleLayerRegion::magSf() const
{ {
if (!magSfPtr_.valid()) return magSf_;
{
FatalErrorInFunction
<< "Region patch areas not available"
<< abort(FatalError);
} }
return magSfPtr_();
const Foam::volScalarField& Foam::regionModels::singleLayerRegion::VbyA() const
{
return VbyA_;
} }

View File

@ -52,26 +52,18 @@ class singleLayerRegion
: :
public regionModel public regionModel
{ {
// Private Member Functions // Private member data
//- Construct region mesh and fields
void constructMeshObjects();
//- Initialise the region
void initialise();
protected:
// Protected data
// Region addressing // Region addressing
//- Patch normal vectors //- Patch normal vectors
autoPtr<volVectorField> nHatPtr_; volVectorField nHat_;
//- Face area magnitudes / [m^2] //- Cell cross-sectional area magnitude [m^2]
autoPtr<volScalarField> magSfPtr_; volScalarField::Internal magSf_;
//- Cell layer volume/area [m]
volScalarField VbyA_;
// Addressing // Addressing
@ -80,12 +72,6 @@ protected:
labelList passivePatchIDs_; labelList passivePatchIDs_;
// Protected member functions
//- Read control parameters from dictionary
virtual bool read();
public: public:
//- Runtime type information //- Runtime type information
@ -94,9 +80,6 @@ public:
// Constructors // Constructors
//- Construct null
singleLayerRegion(const fvMesh& mesh, const word& regionType);
//- Construct from mesh, region type and name //- Construct from mesh, region type and name
singleLayerRegion singleLayerRegion
( (
@ -121,17 +104,20 @@ public:
// Region geometry // Region geometry
//- Return the patch normal vectors //- Return the patch normal vectors
virtual const volVectorField& nHat() const; const volVectorField& nHat() const;
//- Return the face area magnitudes / [m^2] //- Return the face area magnitudes [m^2]
virtual const volScalarField& magSf() const; const volScalarField::Internal& magSf() const;
//- Return the cell layer volume/area [m]
const volScalarField& VbyA() const;
// Addressing // Addressing
//- Return the list of patch IDs opposite to internally //- Return the list of patch IDs opposite to internally
// coupled patches // coupled patches
virtual const labelList& passivePatchIDs() const; const labelList& passivePatchIDs() const;
// Patch type information // Patch type information
@ -142,11 +128,6 @@ public:
template<class Type> template<class Type>
wordList mappedFieldAndInternalPatchTypes() const; wordList mappedFieldAndInternalPatchTypes() const;
//- Return boundary types for pushed mapped field patches
// Mapping region prescribed by underlying mapped poly patch
template<class Type>
wordList mappedPushedFieldPatchTypes() const;
// Member Operators // Member Operators

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,7 +26,6 @@ License
#include "singleLayerRegion.H" #include "singleLayerRegion.H"
#include "zeroGradientFvPatchFields.H" #include "zeroGradientFvPatchFields.H"
#include "mappedFixedInternalValueFvPatchFields.H" #include "mappedFixedInternalValueFvPatchFields.H"
#include "mappedFixedPushedInternalValueFvPatchFields.H"
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
@ -48,23 +47,4 @@ Foam::regionModels::singleLayerRegion::mappedFieldAndInternalPatchTypes() const
} }
template<class Type>
Foam::wordList
Foam::regionModels::singleLayerRegion::mappedPushedFieldPatchTypes() const
{
wordList bTypes(regionMesh().boundaryMesh().size());
bTypes = zeroGradientFvPatchField<Type>::typeName;
forAll(intCoupledPatchIDs_, i)
{
const label patchi = intCoupledPatchIDs_[i];
bTypes[patchi] =
mappedFixedPushedInternalValueFvPatchField<Type>::typeName;
}
return bTypes;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -40,7 +40,7 @@ filmHeightInletVelocityFvPatchVectorField
fixedValueFvPatchVectorField(p, iF), fixedValueFvPatchVectorField(p, iF),
phiName_("phi"), phiName_("phi"),
rhoName_("rho"), rhoName_("rho"),
deltafName_("deltaf") deltafName_("delta")
{} {}
@ -71,7 +71,7 @@ filmHeightInletVelocityFvPatchVectorField
fixedValueFvPatchVectorField(p, iF, dict), fixedValueFvPatchVectorField(p, iF, dict),
phiName_(dict.lookupOrDefault<word>("phi", "phi")), phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho")), rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
deltafName_(dict.lookupOrDefault<word>("deltaf", "deltaf")) deltafName_(dict.lookupOrDefault<word>("delta", "delta"))
{} {}
@ -134,7 +134,7 @@ void Foam::filmHeightInletVelocityFvPatchVectorField::write(Ostream& os) const
fvPatchVectorField::write(os); fvPatchVectorField::write(os);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
writeEntryIfDifferent<word>(os, "deltaf", "deltaf", deltafName_); writeEntryIfDifferent<word>(os, "delta", "delta", deltafName_);
writeEntry(os, "value", *this); writeEntry(os, "value", *this);
} }

View File

@ -40,6 +40,7 @@ SourceFiles
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "fvMatrices.H" #include "fvMatrices.H"
#include "pimpleControl.H"
#include "injectionModelList.H" #include "injectionModelList.H"
#include "transferModelList.H" #include "transferModelList.H"
@ -66,23 +67,14 @@ class kinematicSingleLayer
: :
public surfaceFilmRegionModel public surfaceFilmRegionModel
{ {
protected: protected:
// Protected data // Protected data
// Solution parameters // Solution parameters
//- Momentum predictor pimpleControl pimple_;
Switch momentumPredictor_;
//- Number of outer correctors
label nOuterCorr_;
//- Number of PISO-like correctors
label nCorr_;
//- Number of non-orthogonal correctors
label nNonOrthCorr_;
//- Cumulative continuity error //- Cumulative continuity error
scalar cumulativeContErr_; scalar cumulativeContErr_;
@ -113,7 +105,7 @@ protected:
//- Film thickness [m] //- Film thickness [m]
volScalarField delta_; volScalarField delta_;
//- Film coverage indicator, 1 = covered, 0 = uncovered [] //- Film volume fraction in the cell layer []
volScalarField alpha_; volScalarField alpha_;
//- Velocity - mean [m/s] //- Velocity - mean [m/s]
@ -125,12 +117,18 @@ protected:
//- Velocity - wall [m/s] //- Velocity - wall [m/s]
volVectorField Uw_; volVectorField Uw_;
//- Film thickness*density (helper field) [kg/m^2] //- Mass flux [kg m/s]
volScalarField deltaRho_;
//- Mass flux (includes film thickness) [kg m/s]
surfaceScalarField phi_; surfaceScalarField phi_;
//- Film velocity flux [m^3/s]
surfaceScalarField phiU_;
//- Current continuity error caused by delta_ bounding
volScalarField::Internal continuityErr_;
//- Film coverage indicator, 1 = covered, 0 = uncovered []
volScalarField coverage_;
// Transfer fields // Transfer fields
@ -150,28 +148,28 @@ protected:
// Note: need boundary value mapped from primary region, and then // Note: need boundary value mapped from primary region, and then
// pushed into the patch internal field // pushed into the patch internal field
//- Mass [kg/m^2/s]
volScalarField::Internal rhoSp_;
//- Momentum [kg/m/s^2] //- Momentum [kg/m/s^2]
volVectorField USp_; volVectorField::Internal USp_;
//- Pressure [Pa] //- Pressure [Pa]
volScalarField pSp_; volScalarField::Internal pSp_;
//- Mass [kg/m^2/s]
volScalarField rhoSp_;
// Primary region - registered to the primary region mesh // Primary region - registered to the primary region mesh
// Internal use only - not read-in // Internal use only - not read-in
//- Momentum [kg/m/s^2] //- Primary region mass source [kg]
volScalarField rhoSpPrimary_;
//- Primary region tangential momentum source [kg m/s]
volVectorField USpPrimary_; volVectorField USpPrimary_;
//- Pressure [Pa] //- Primary region normal momentum source (pressure) [kg m/s]
volScalarField pSpPrimary_; volScalarField pSpPrimary_;
//- Mass [kg/m^2/s]
volScalarField rhoSpPrimary_;
// Fields mapped from primary region - registered to the film region // Fields mapped from primary region - registered to the film region
// Note: need both boundary AND patch internal fields to be mapped // Note: need both boundary AND patch internal fields to be mapped
@ -240,11 +238,14 @@ protected:
virtual tmp<volScalarField> pp(); virtual tmp<volScalarField> pp();
//- Correct film coverage field //- Correct film coverage field
virtual void correctAlpha(); virtual void correctCoverage();
//- Update the film sub-models //- Update the film sub-models
virtual void updateSubmodels(); virtual void updateSubmodels();
// Update continuity error
virtual void updateContinuityErr();
//- Continuity check //- Continuity check
virtual void continuityCheck(); virtual void continuityCheck();
@ -254,17 +255,17 @@ protected:
//- Constrain a film region master/slave boundaries of a field to a //- Constrain a film region master/slave boundaries of a field to a
// given value // given value
template<class Type> template<class Type>
void constrainFilmField tmp<Type> constrainFilmField
( (
Type& field, const tmp<Type>& field,
const typename Type::cmptType& value const typename Type::cmptType& value
); );
// Equations // Equations
//- Solve continuity equation //- Predict delta_ from the continuity equation
virtual void solveContinuity(); virtual void predictDelta();
//- Solve for film velocity //- Solve for film velocity
virtual tmp<fvVectorMatrix> solveMomentum virtual tmp<fvVectorMatrix> solveMomentum
@ -273,8 +274,8 @@ protected:
const volScalarField& pp const volScalarField& pp
); );
//- Solve coupled velocity-thickness equations //- Solve for film volume fraction and thickness
virtual void solveThickness virtual void solveAlpha
( (
const volScalarField& pu, const volScalarField& pu,
const volScalarField& pp, const volScalarField& pp,
@ -315,18 +316,6 @@ public:
//- Courant number evaluation //- Courant number evaluation
virtual scalar CourantNumber() const; virtual scalar CourantNumber() const;
//- Return the momentum predictor
inline const Switch& momentumPredictor() const;
//- Return the number of outer correctors
inline label nOuterCorr() const;
//- Return the number of PISO correctors
inline label nCorr() const;
//- Return the number of non-orthogonal correctors
inline label nNonOrthCorr() const;
//- Return small delta //- Return small delta
inline const dimensionedScalar& deltaSmall() const; inline const dimensionedScalar& deltaSmall() const;
@ -345,44 +334,32 @@ public:
//- Return const access to the film thickness [m] //- Return const access to the film thickness [m]
inline const volScalarField& delta() const; inline const volScalarField& delta() const;
//- Return the film coverage, 1 = covered, 0 = uncovered [] //- Return const access to the film volume fraction []
inline const volScalarField& alpha() const; inline const volScalarField& alpha() const;
//- Return the film density [kg/m^3]
inline const volScalarField& rho() const;
//- Return the film velocity [m/s] //- Return the film velocity [m/s]
virtual const volVectorField& U() const; inline const volVectorField& U() const;
//- Return the film surface velocity [m/s] //- Return the film surface velocity [m/s]
virtual const volVectorField& Us() const; inline const volVectorField& Us() const;
//- Return the film wall velocity [m/s] //- Return the film wall velocity [m/s]
virtual const volVectorField& Uw() const; inline const volVectorField& Uw() const;
//- Return the film thickness*density (helper field) [kg/m^3]
virtual const volScalarField& deltaRho() const;
//- Return the film flux [kg m/s] //- Return the film flux [kg m/s]
virtual const surfaceScalarField& phi() const; inline const surfaceScalarField& phi() const;
//- Return the film density [kg/m^3] //- Return the film velocity flux [m^3/s]
virtual const volScalarField& rho() const; inline const surfaceScalarField& phiU() const;
//- Return the film mean temperature [K] //- Return the current continuity error
virtual const volScalarField& T() const; inline const volScalarField::Internal& continuityErr() const;
//- Return the film surface temperature [K] //- Return the film coverage, 1 = covered, 0 = uncovered []
virtual const volScalarField& Ts() const; inline const volScalarField& coverage() const;
//- Return the film wall temperature [K]
virtual const volScalarField& Tw() const;
//- Return the film surface enthalpy [J/kg]
virtual const volScalarField& hs() const;
//- Return the film specific heat capacity [J/kg/K]
virtual const volScalarField& Cp() const;
//- Return the film thermal conductivity [W/m/K]
virtual const volScalarField& kappa() const;
// Transfer fields - to the primary region // Transfer fields - to the primary region
@ -428,22 +405,22 @@ public:
// Film region // Film region
//- Momentum [kg/m/s^2] //- Momentum [kg/m/s^2]
inline volVectorField& USp(); inline volVectorField::Internal& USp();
//- Pressure [Pa] //- Pressure [Pa]
inline volScalarField& pSp(); inline volScalarField::Internal& pSp();
//- Mass [kg/m^2/s] //- Mass [kg/m^2/s]
inline volScalarField& rhoSp(); inline volScalarField::Internal& rhoSp();
//- Momentum [kg/m/s^2] //- Momentum [kg/m/s^2]
inline const volVectorField& USp() const; inline const volVectorField::Internal& USp() const;
//- Pressure [Pa] //- Pressure [Pa]
inline const volScalarField& pSp() const; inline const volScalarField::Internal& pSp() const;
//- Mass [kg/m^2/s] //- Mass [kg/m^2/s]
inline const volScalarField& rhoSp() const; inline const volScalarField::Internal& rhoSp() const;
// Fields mapped from primary region // Fields mapped from primary region
@ -479,10 +456,10 @@ public:
// Helper functions // Helper functions
//- Return the current film mass //- Return the current film mass
inline tmp<volScalarField> mass() const; inline tmp<volScalarField::Internal> mass() const;
//- Return the change in film mass due to sources/sinks //- Return the change in film mass due to sources/sinks
inline tmp<volScalarField> deltaMass() const; inline tmp<volScalarField::Internal> deltaMass() const;
//- Return the gravity normal-to-patch component contribution //- Return the gravity normal-to-patch component contribution
inline tmp<volScalarField> gNorm() const; inline tmp<volScalarField> gNorm() const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -38,30 +38,6 @@ namespace surfaceFilmModels
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const Switch& kinematicSingleLayer::momentumPredictor() const
{
return momentumPredictor_;
}
inline label kinematicSingleLayer::nOuterCorr() const
{
return nOuterCorr_;
}
inline label kinematicSingleLayer::nCorr() const
{
return nCorr_;
}
inline label kinematicSingleLayer::nNonOrthCorr() const
{
return nNonOrthCorr_;
}
inline const dimensionedScalar& kinematicSingleLayer::deltaSmall() const inline const dimensionedScalar& kinematicSingleLayer::deltaSmall() const
{ {
return deltaSmall_; return deltaSmall_;
@ -92,6 +68,55 @@ inline const volScalarField& kinematicSingleLayer::alpha() const
} }
inline const volScalarField& kinematicSingleLayer::rho() const
{
return rho_;
}
inline const volVectorField& kinematicSingleLayer::U() const
{
return U_;
}
inline const volVectorField& kinematicSingleLayer::Us() const
{
return Us_;
}
inline const volVectorField& kinematicSingleLayer::Uw() const
{
return Uw_;
}
inline const surfaceScalarField& kinematicSingleLayer::phi() const
{
return phi_;
}
inline const surfaceScalarField& kinematicSingleLayer::phiU() const
{
return phiU_;
}
inline const volScalarField::Internal&
kinematicSingleLayer::continuityErr() const
{
return continuityErr_;
}
inline const volScalarField& kinematicSingleLayer::coverage() const
{
return coverage_;
}
inline volVectorField& kinematicSingleLayer::USpPrimary() inline volVectorField& kinematicSingleLayer::USpPrimary()
{ {
return USpPrimary_; return USpPrimary_;
@ -110,37 +135,37 @@ inline volScalarField& kinematicSingleLayer::rhoSpPrimary()
} }
inline volVectorField& kinematicSingleLayer::USp() inline volVectorField::Internal& kinematicSingleLayer::USp()
{ {
return USp_; return USp_;
} }
inline volScalarField& kinematicSingleLayer::pSp() inline volScalarField::Internal& kinematicSingleLayer::pSp()
{ {
return pSp_; return pSp_;
} }
inline volScalarField& kinematicSingleLayer::rhoSp() inline volScalarField::Internal& kinematicSingleLayer::rhoSp()
{ {
return rhoSp_; return rhoSp_;
} }
inline const volVectorField& kinematicSingleLayer::USp() const inline const volVectorField::Internal& kinematicSingleLayer::USp() const
{ {
return USp_; return USp_;
} }
inline const volScalarField& kinematicSingleLayer::pSp() const inline const volScalarField::Internal& kinematicSingleLayer::pSp() const
{ {
return pSp_; return pSp_;
} }
inline const volScalarField& kinematicSingleLayer::rhoSp() const inline const volScalarField::Internal& kinematicSingleLayer::rhoSp() const
{ {
return rhoSp_; return rhoSp_;
} }
@ -194,13 +219,13 @@ inline const filmTurbulenceModel& kinematicSingleLayer::turbulence() const
} }
inline tmp<volScalarField> kinematicSingleLayer::mass() const inline tmp<volScalarField::Internal> kinematicSingleLayer::mass() const
{ {
return rho_*delta_*magSf(); return rho_()*delta_()*magSf();
} }
inline tmp<volScalarField> kinematicSingleLayer::deltaMass() const inline tmp<volScalarField::Internal> kinematicSingleLayer::deltaMass() const
{ {
return rhoSp_*magSf()*time().deltaT(); return rhoSp_*magSf()*time().deltaT();
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -37,37 +37,39 @@ namespace surfaceFilmModels
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class Type> template<class Type>
void kinematicSingleLayer::constrainFilmField tmp<Type> kinematicSingleLayer::constrainFilmField
( (
Type& field, const tmp<Type>& tfield,
const typename Type::cmptType& value const typename Type::cmptType& value
) )
{ {
typename Type::Boundary& fieldBf = field.boundaryFieldRef(); tmp<Type> tresult(tfield);
Type& result = tresult.ref();
typename Type::Boundary& fieldBf = result.boundaryFieldRef();
forAll(intCoupledPatchIDs_, i) forAll(intCoupledPatchIDs_, i)
{ {
label patchi = intCoupledPatchIDs_[i]; const label patchi = intCoupledPatchIDs_[i];
fieldBf[patchi] = value; fieldBf[patchi] = value;
if (debug)
{ DebugInFunction
Info<< "Constraining " << field.name() << "Constraining " << tfield().name()
<< " boundary " << field.boundaryField()[patchi].patch().name() << " boundary " << tfield().boundaryField()[patchi].patch().name()
<< " to " << value << endl; << " to " << value << endl;
} }
}
forAll(passivePatchIDs_, i) forAll(passivePatchIDs(), i)
{ {
label patchi = passivePatchIDs_[i]; const label patchi = passivePatchIDs()[i];
fieldBf[patchi] = value; fieldBf[patchi] = value;
if (debug) DebugInFunction
{ << "Constraining " << tfield().name()
Info<< "Constraining " << field.name() << " boundary " << tfield().boundaryField()[patchi].patch().name()
<< " boundary " << field.boundaryField()[patchi].patch().name()
<< " to " << value << endl; << " to " << value << endl;
} }
}
return tresult;
} }

View File

@ -74,7 +74,7 @@ tmp<volVectorField> laminar::Us() const
( (
volVectorField::New volVectorField::New
( (
typeName + ":Us", IOobject::modelName("Us", typeName),
filmModel_.regionMesh(), filmModel_.regionMesh(),
dimensionedVector(dimVelocity, Zero), dimensionedVector(dimVelocity, Zero),
extrapolatedCalculatedFvPatchVectorField::typeName extrapolatedCalculatedFvPatchVectorField::typeName
@ -95,7 +95,7 @@ tmp<volScalarField> laminar::mut() const
( (
volScalarField::New volScalarField::New
( (
typeName + ":mut", IOobject::modelName("mut", typeName),
filmModel_.regionMesh(), filmModel_.regionMesh(),
dimensionedScalar(dimMass/dimLength/dimTime, 0) dimensionedScalar(dimMass/dimLength/dimTime, 0)
) )
@ -114,16 +114,23 @@ tmp<fvVectorMatrix> laminar::Su(volVectorField& U) const
static_cast<const kinematicSingleLayer&>(filmModel_); static_cast<const kinematicSingleLayer&>(filmModel_);
// local references to film fields // local references to film fields
const volScalarField& mu = film.mu(); const volScalarField::Internal& mu = film.mu();
const volVectorField& Uw = film.Uw(); const volVectorField::Internal& Uw = film.Uw();
const volScalarField& delta = film.delta(); const volScalarField::Internal& delta = film.delta();
const volVectorField& Up = film.UPrimary(); const volVectorField::Internal& Up = film.UPrimary();
const volScalarField& rhop = film.rhoPrimary(); const volScalarField::Internal& rhop = film.rhoPrimary();
const volScalarField::Internal& VbyA = film.VbyA();
// employ simple coeff-based model // Employ simple coeff-based model
volScalarField Cs("Cs", Cf_*rhop*mag(Up - U)); volScalarField::Internal Cs("Cs", Cf_*rhop*mag(Up - U)/VbyA);
volScalarField Cw("Cw", mu/((1.0/3.0)*(delta + film.deltaSmall()))); volScalarField::Internal Cw
Cw.min(5000.0); (
"Cw",
mu/((1.0/3.0)*VbyA*(delta + film.deltaSmall()))
);
// This hack needs to be fixed
Cw.field() = min(Cw.field(), 5000/VbyA.field());
return return
( (

View File

@ -105,7 +105,7 @@ contactAngleForce::contactAngleForce
( (
IOobject IOobject
( (
typeName + ":contactForceMask", IOobject::modelName("contactForceMask", typeName),
filmModel_.time().timeName(), filmModel_.time().timeName(),
filmModel_.regionMesh(), filmModel_.regionMesh(),
IOobject::NO_READ, IOobject::NO_READ,
@ -133,9 +133,9 @@ tmp<fvVectorMatrix> contactAngleForce::correct(volVectorField& U)
( (
volVectorField::New volVectorField::New
( (
typeName + ":contactForce", IOobject::modelName("contactForce", typeName),
filmModel_.regionMesh(), filmModel_.regionMesh(),
dimensionedVector(dimForce/dimArea, Zero) dimensionedVector(dimForce/dimVolume, Zero)
) )
); );
@ -143,16 +143,15 @@ tmp<fvVectorMatrix> contactAngleForce::correct(volVectorField& U)
const labelUList& own = filmModel_.regionMesh().owner(); const labelUList& own = filmModel_.regionMesh().owner();
const labelUList& nbr = filmModel_.regionMesh().neighbour(); const labelUList& nbr = filmModel_.regionMesh().neighbour();
const scalarField& V = filmModel_.regionMesh().V();
const scalarField& magSf = filmModel_.magSf(); const volScalarField& coverage = filmModel_.coverage();
const volScalarField& alpha = filmModel_.alpha();
const volScalarField& sigma = filmModel_.sigma(); const volScalarField& sigma = filmModel_.sigma();
const tmp<volScalarField> ttheta = theta(); const tmp<volScalarField> ttheta = theta();
const volScalarField& theta = ttheta(); const volScalarField& theta = ttheta();
const volVectorField gradAlpha(fvc::grad(alpha)); const volVectorField gradCoverage(fvc::grad(coverage));
forAll(nbr, facei) forAll(nbr, facei)
{ {
@ -160,11 +159,11 @@ tmp<fvVectorMatrix> contactAngleForce::correct(volVectorField& U)
const label cellN = nbr[facei]; const label cellN = nbr[facei];
label celli = -1; label celli = -1;
if ((alpha[cellO] > 0.5) && (alpha[cellN] < 0.5)) if ((coverage[cellO] > 0.5) && (coverage[cellN] < 0.5))
{ {
celli = cellO; celli = cellO;
} }
else if ((alpha[cellO] < 0.5) && (alpha[cellN] > 0.5)) else if ((coverage[cellO] < 0.5) && (coverage[cellN] > 0.5))
{ {
celli = cellN; celli = cellN;
} }
@ -173,34 +172,36 @@ tmp<fvVectorMatrix> contactAngleForce::correct(volVectorField& U)
{ {
const scalar invDx = filmModel_.regionMesh().deltaCoeffs()[facei]; const scalar invDx = filmModel_.regionMesh().deltaCoeffs()[facei];
const vector n = const vector n =
gradAlpha[celli]/(mag(gradAlpha[celli]) + rootVSmall); gradCoverage[celli]/(mag(gradCoverage[celli]) + rootVSmall);
const scalar cosTheta = cos(degToRad(theta[celli])); const scalar cosTheta = cos(degToRad(theta[celli]));
force[celli] += Ccf_*n*sigma[celli]*(1 - cosTheta)/invDx; force[celli] += Ccf_*n*sigma[celli]*(1 - cosTheta)/invDx;
} }
} }
forAll(alpha.boundaryField(), patchi) forAll(coverage.boundaryField(), patchi)
{ {
if (!filmModel_.isCoupledPatch(patchi)) if (!filmModel_.isCoupledPatch(patchi))
{ {
const fvPatchField<scalar>& alphaPf = alpha.boundaryField()[patchi]; const fvPatchField<scalar>& coveragePf =
coverage.boundaryField()[patchi];
const fvPatchField<scalar>& maskPf = mask_.boundaryField()[patchi]; const fvPatchField<scalar>& maskPf = mask_.boundaryField()[patchi];
const fvPatchField<scalar>& sigmaPf = sigma.boundaryField()[patchi]; const fvPatchField<scalar>& sigmaPf = sigma.boundaryField()[patchi];
const fvPatchField<scalar>& thetaPf = theta.boundaryField()[patchi]; const fvPatchField<scalar>& thetaPf = theta.boundaryField()[patchi];
const scalarField& invDx = alphaPf.patch().deltaCoeffs(); const scalarField& invDx = coveragePf.patch().deltaCoeffs();
const labelUList& faceCells = alphaPf.patch().faceCells(); const labelUList& faceCells = coveragePf.patch().faceCells();
forAll(alphaPf, facei) forAll(coveragePf, facei)
{ {
if (maskPf[facei] > 0.5) if (maskPf[facei] > 0.5)
{ {
label cellO = faceCells[facei]; const label cellO = faceCells[facei];
if ((alpha[cellO] > 0.5) && (alphaPf[facei] < 0.5)) if ((coverage[cellO] > 0.5) && (coveragePf[facei] < 0.5))
{ {
const vector n = const vector n =
gradAlpha[cellO] gradCoverage[cellO]
/(mag(gradAlpha[cellO]) + rootVSmall); /(mag(gradCoverage[cellO]) + rootVSmall);
const scalar cosTheta = cos(degToRad(thetaPf[facei])); const scalar cosTheta = cos(degToRad(thetaPf[facei]));
force[cellO] += force[cellO] +=
Ccf_*n*sigmaPf[facei]*(1 - cosTheta)/invDx[facei]; Ccf_*n*sigmaPf[facei]*(1 - cosTheta)/invDx[facei];
@ -210,7 +211,7 @@ tmp<fvVectorMatrix> contactAngleForce::correct(volVectorField& U)
} }
} }
force /= magSf; force /= V;
if (filmModel_.regionMesh().time().writeTime()) if (filmModel_.regionMesh().time().writeTime())
{ {
@ -219,7 +220,7 @@ tmp<fvVectorMatrix> contactAngleForce::correct(volVectorField& U)
tmp<fvVectorMatrix> tfvm tmp<fvVectorMatrix> tfvm
( (
new fvVectorMatrix(U, dimForce/dimArea*dimVolume) new fvVectorMatrix(U, dimForce)
); );
tfvm.ref() += tForce; tfvm.ref() += tForce;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -58,7 +58,17 @@ distributionContactAngleForce::distributionContactAngleForce
coeffDict_.subDict("distribution"), coeffDict_.subDict("distribution"),
rndGen_ rndGen_
) )
),
theta_
(
volScalarField::New
(
IOobject::modelName("theta", typeName),
filmModel_.regionMesh(),
dimensionedScalar(dimless, 0)
) )
),
curTimeIndex_(-1)
{} {}
@ -72,40 +82,35 @@ distributionContactAngleForce::~distributionContactAngleForce()
tmp<volScalarField> distributionContactAngleForce::theta() const tmp<volScalarField> distributionContactAngleForce::theta() const
{ {
tmp<volScalarField> ttheta if (curTimeIndex_ != filmModel_.time().timeIndex())
( {
volScalarField::New volScalarField::Internal& thetai = theta_;
(
typeName + ":theta",
filmModel_.regionMesh(),
dimensionedScalar(dimless, 0)
)
);
volScalarField& theta = ttheta.ref();
volScalarField::Internal& thetai = theta.ref();
forAll(thetai, celli) forAll(thetai, celli)
{ {
thetai[celli] = distribution_->sample(); thetai[celli] = distribution_->sample();
} }
forAll(theta.boundaryField(), patchi) forAll(theta_.boundaryField(), patchi)
{ {
if (!filmModel_.isCoupledPatch(patchi)) if (!filmModel_.isCoupledPatch(patchi))
{ {
fvPatchField<scalar>& thetaf = theta.boundaryFieldRef()[patchi]; scalarField& thetap = theta_.boundaryFieldRef()[patchi];
forAll(thetaf, facei) forAll(thetap, facei)
{ {
thetaf[facei] = distribution_->sample(); thetap[facei] = distribution_->sample();
} }
} }
} }
return ttheta; curTimeIndex_ = filmModel_.time().timeIndex();
} }
return theta_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels } // End namespace surfaceFilmModels

View File

@ -68,6 +68,12 @@ class distributionContactAngleForce
//- Parcel size PDF model //- Parcel size PDF model
const autoPtr<distributionModel> distribution_; const autoPtr<distributionModel> distribution_;
//- Cached contact angle field
mutable volScalarField theta_;
//- Current time index (used for updating)
mutable label curTimeIndex_;
protected: protected:

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "perturbedTemperatureDependentContactAngleForce.H" #include "perturbedTemperatureDependentContactAngleForce.H"
#include "thermoSingleLayer.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -85,7 +86,7 @@ perturbedTemperatureDependentContactAngleForce::theta() const
( (
volScalarField::New volScalarField::New
( (
typeName + ":theta", IOobject::modelName("theta", typeName),
filmModel_.regionMesh(), filmModel_.regionMesh(),
dimensionedScalar(dimless, 0) dimensionedScalar(dimless, 0)
) )
@ -94,7 +95,9 @@ perturbedTemperatureDependentContactAngleForce::theta() const
volScalarField& theta = ttheta.ref(); volScalarField& theta = ttheta.ref();
volScalarField::Internal& thetai = theta.ref(); volScalarField::Internal& thetai = theta.ref();
const volScalarField& T = filmModel_.T(); const thermoSingleLayer& film = filmType<thermoSingleLayer>();
const volScalarField& T = film.T();
// Initialize with the function of temperature // Initialize with the function of temperature
thetai.field() = thetaPtr_->value(T()); thetai.field() = thetaPtr_->value(T());

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "temperatureDependentContactAngleForce.H" #include "temperatureDependentContactAngleForce.H"
#include "thermoSingleLayer.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -73,7 +74,7 @@ tmp<volScalarField> temperatureDependentContactAngleForce::theta() const
( (
volScalarField::New volScalarField::New
( (
typeName + ":theta", IOobject::modelName("theta", typeName),
filmModel_.regionMesh(), filmModel_.regionMesh(),
dimensionedScalar(dimless, 0) dimensionedScalar(dimless, 0)
) )
@ -81,7 +82,9 @@ tmp<volScalarField> temperatureDependentContactAngleForce::theta() const
volScalarField& theta = ttheta.ref(); volScalarField& theta = ttheta.ref();
const volScalarField& T = filmModel_.T(); const thermoSingleLayer& film = filmType<thermoSingleLayer>();
const volScalarField& T = film.T();
theta.ref().field() = thetaPtr_->value(T()); theta.ref().field() = thetaPtr_->value(T());

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -79,7 +79,7 @@ tmp<fvVectorMatrix> forceList::correct(volVectorField& U)
{ {
tmp<fvVectorMatrix> tResult tmp<fvVectorMatrix> tResult
( (
new fvVectorMatrix(U, dimForce/dimArea*dimVolume) new fvVectorMatrix(U, dimForce)
); );
fvVectorMatrix& result = tResult.ref(); fvVectorMatrix& result = tResult.ref();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -66,9 +66,9 @@ tmp<fvVectorMatrix> thermocapillaryForce::correct(volVectorField& U)
const volScalarField& sigma = filmModel_.sigma(); const volScalarField& sigma = filmModel_.sigma();
tmp<fvVectorMatrix> tmp<fvVectorMatrix>
tfvm(new fvVectorMatrix(U, dimForce/dimArea*dimVolume)); tfvm(new fvVectorMatrix(U, dimForce));
tfvm.ref() += fvc::grad(sigma); tfvm.ref() += fvc::grad(sigma)/filmModel_.VbyA();
return tfvm; return tfvm;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "transferModel.H" #include "transferModel.H"
#include "thermoSingleLayer.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -94,10 +95,12 @@ void transferModel::correct
scalarField& energyToTransfer scalarField& energyToTransfer
) )
{ {
const thermoSingleLayer& film = filmType<thermoSingleLayer>();
scalarField massToTransfer0(massToTransfer.size(), scalar(0)); scalarField massToTransfer0(massToTransfer.size(), scalar(0));
correct(availableMass, massToTransfer0); correct(availableMass, massToTransfer0);
massToTransfer += massToTransfer0; massToTransfer += massToTransfer0;
energyToTransfer += massToTransfer0*film().hs(); energyToTransfer += massToTransfer0*film.h();
} }
scalar transferModel::transferredMassTotal() const scalar transferModel::transferredMassTotal() const

View File

@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "constantRadiation.H" #include "constantRadiation.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -60,7 +59,7 @@ constantRadiation::constantRadiation
( (
IOobject IOobject
( (
typeName + ":qrConst", IOobject::modelName("qrConst", typeName),
film.time().timeName(), film.time().timeName(),
film.regionMesh(), film.regionMesh(),
IOobject::MUST_READ, IOobject::MUST_READ,
@ -72,7 +71,7 @@ constantRadiation::constantRadiation
( (
IOobject IOobject
( (
typeName + ":mask", IOobject::modelName("mask", typeName),
film.time().timeName(), film.time().timeName(),
film.regionMesh(), film.regionMesh(),
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
@ -101,30 +100,27 @@ void constantRadiation::correct()
{} {}
tmp<volScalarField> constantRadiation::Shs() tmp<volScalarField::Internal> constantRadiation::Shs()
{ {
tmp<volScalarField> tShs
(
volScalarField::New
(
typeName + ":Shs",
film().regionMesh(),
dimensionedScalar(dimMass/pow3(dimTime), 0)
)
);
const scalar time = film().time().value(); const scalar time = film().time().value();
if ((time >= timeStart_) && (time <= timeStart_ + duration_)) if ((time >= timeStart_) && (time <= timeStart_ + duration_))
{ {
scalarField& Shs = tShs.ref(); return volScalarField::Internal::New
const scalarField& qr = qrConst_; (
const scalarField& alpha = filmModel_.alpha(); IOobject::modelName("Shs", typeName),
mask_*qrConst_*filmModel_.coverage()*absorptivity_
Shs = mask_*qr*alpha*absorptivity_; );
}
else
{
return volScalarField::Internal::New
(
IOobject::modelName("Shs", typeName),
film().regionMesh(),
dimensionedScalar(dimMass/pow3(dimTime), 0)
);
} }
return tShs;
} }

View File

@ -108,7 +108,7 @@ public:
//- Return the radiation sensible enthalpy source //- Return the radiation sensible enthalpy source
// Also updates qrNet // Also updates qrNet
virtual tmp<volScalarField> Shs(); virtual tmp<volScalarField::Internal> Shs();
// Member Operators // Member Operators

View File

@ -115,7 +115,7 @@ public:
virtual void correct() = 0; virtual void correct() = 0;
//- Return the radiation sensible enthalpy source //- Return the radiation sensible enthalpy source
virtual tmp<volScalarField> Shs() = 0; virtual tmp<volScalarField::Internal> Shs() = 0;
// Member Operators // Member Operators

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -71,11 +71,11 @@ void noRadiation::correct()
{} {}
tmp<volScalarField> noRadiation::Shs() tmp<volScalarField::Internal> noRadiation::Shs()
{ {
return volScalarField::New return volScalarField::Internal::New
( (
typeName + ":Shs", IOobject::modelName("Shs", typeName),
film().regionMesh(), film().regionMesh(),
dimensionedScalar(dimMass/pow3(dimTime), 0) dimensionedScalar(dimMass/pow3(dimTime), 0)
); );

View File

@ -86,7 +86,7 @@ public:
virtual void correct(); virtual void correct();
//- Return the radiation sensible enthalpy source //- Return the radiation sensible enthalpy source
virtual tmp<volScalarField> Shs(); virtual tmp<volScalarField::Internal> Shs();
// Member Operators // Member Operators

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "primaryRadiation.H" #include "primaryRadiation.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -56,21 +55,22 @@ primaryRadiation::primaryRadiation
) )
: :
filmRadiationModel(typeName, film, dict), filmRadiationModel(typeName, film, dict),
qinPrimary_ qinFilm_
( (
IOobject IOobject
( (
"qin", // same name as qin on primary region to enable mapping "qin",
film.time().timeName(), film.time().timeName(),
film.regionMesh(), film.regionMesh(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
film.regionMesh(), film.regionMesh(),
dimensionedScalar(dimMass/pow3(dimTime), 0), dimensionedScalar(dimMass/pow3(dimTime), 0)
film.mappedPushedFieldPatchTypes<scalar>()
) )
{} {
correct();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
@ -83,30 +83,23 @@ primaryRadiation::~primaryRadiation()
void primaryRadiation::correct() void primaryRadiation::correct()
{ {
// Transfer qin from primary region const volScalarField& qinPrimary
qinPrimary_.correctBoundaryConditions(); (
film().primaryMesh().lookupObject<volScalarField>("qin")
);
// Map the primary-side radiative flux to the region internal field
film().toRegion(qinFilm_, qinPrimary.boundaryField());
} }
tmp<volScalarField> primaryRadiation::Shs() tmp<volScalarField::Internal> primaryRadiation::Shs()
{ {
tmp<volScalarField> tShs return volScalarField::Internal::New
( (
volScalarField::New IOobject::modelName("Shs", typeName),
( qinFilm_*filmModel_.coverage()
typeName + ":Shs",
film().regionMesh(),
dimensionedScalar(dimMass/pow3(dimTime), 0)
)
); );
scalarField& Shs = tShs.ref();
const scalarField& qinP = qinPrimary_;
const scalarField& alpha = filmModel_.alpha();
Shs = qinP*alpha;
return tShs;
} }

View File

@ -58,8 +58,8 @@ class primaryRadiation
{ {
// Private Data // Private Data
//- Incident radiative flux mapped from the primary region / [kg/s^3] //- Incident radiative flux mapped from the primary region [kg/s^3]
volScalarField qinPrimary_; volScalarField::Internal qinFilm_;
public: public:
@ -94,7 +94,7 @@ public:
//- Return the radiation sensible enthalpy source //- Return the radiation sensible enthalpy source
// Also updates qrNet // Also updates qrNet
virtual tmp<volScalarField> Shs(); virtual tmp<volScalarField::Internal> Shs();
// Member Operators // Member Operators

View File

@ -24,9 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "standardRadiation.H" #include "standardRadiation.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -57,37 +55,24 @@ standardRadiation::standardRadiation
) )
: :
filmRadiationModel(typeName, film, dict), filmRadiationModel(typeName, film, dict),
qinPrimary_ qinFilm_
( (
IOobject IOobject
( (
"qin", // same name as qin on primary region to enable mapping "qin",
film.time().timeName(), film.time().timeName(),
film.regionMesh(), film.regionMesh(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
film.regionMesh(), film.regionMesh(),
dimensionedScalar(dimMass/pow3(dimTime), 0), dimensionedScalar(dimMass/pow3(dimTime), 0)
film.mappedPushedFieldPatchTypes<scalar>()
),
qrNet_
(
IOobject
(
"qrNet",
film.time().timeName(),
film.regionMesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
film.regionMesh(),
dimensionedScalar(dimMass/pow3(dimTime), 0),
zeroGradientFvPatchScalarField::typeName
), ),
beta_(coeffDict_.lookup<scalar>("beta")), beta_(coeffDict_.lookup<scalar>("beta")),
kappaBar_(coeffDict_.lookup<scalar>("kappaBar")) kappaBar_(coeffDict_.lookup<scalar>("kappaBar"))
{} {
correct();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
@ -100,35 +85,24 @@ standardRadiation::~standardRadiation()
void standardRadiation::correct() void standardRadiation::correct()
{ {
// Transfer qr from primary region const volScalarField& qinPrimary
qinPrimary_.correctBoundaryConditions(); (
film().primaryMesh().lookupObject<volScalarField>("qin")
);
// Map the primary-side radiative flux to the region internal field
film().toRegion(qinFilm_, qinPrimary.boundaryField());
} }
tmp<volScalarField> standardRadiation::Shs() tmp<volScalarField::Internal> standardRadiation::Shs()
{ {
tmp<volScalarField> tShs return volScalarField::Internal::New
( (
volScalarField::New IOobject::modelName("Shs", typeName),
( beta_*qinFilm_*filmModel_.coverage()
typeName + ":Shs", *(1 - exp(-kappaBar_*filmModel_.delta()()))
film().regionMesh(),
dimensionedScalar(dimMass/pow3(dimTime), 0)
)
); );
scalarField& Shs = tShs.ref();
const scalarField& qinP = qinPrimary_;
const scalarField& delta = filmModel_.delta();
const scalarField& alpha = filmModel_.alpha();
Shs = beta_*qinP*alpha*(1.0 - exp(-kappaBar_*delta));
// Update net qr on local region
qrNet_.primitiveFieldRef() = qinP - Shs;
qrNet_.correctBoundaryConditions();
return tShs;
} }

View File

@ -57,11 +57,8 @@ class standardRadiation
{ {
// Private Data // Private Data
//- Radiative incident flux mapped from the primary region / [kg/s^3] //- Radiative incident flux mapped from the primary region [kg/s^3]
volScalarField qinPrimary_; volScalarField::Internal qinFilm_;
//- Remaining radiative flux after removing local contribution
volScalarField qrNet_;
// Model coefficients // Model coefficients
@ -105,7 +102,7 @@ public:
//- Return the radiation sensible enthalpy source //- Return the radiation sensible enthalpy source
// Also updates qrNet // Also updates qrNet
virtual tmp<volScalarField> Shs(); virtual tmp<volScalarField::Internal> Shs();
// Member Operators // Member Operators

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -74,7 +74,7 @@ thixotropicViscosity::thixotropicViscosity
( (
IOobject IOobject
( (
typeName + ":lambda", IOobject::modelName("lambda", typeName),
film.regionMesh().time().timeName(), film.regionMesh().time().timeName(),
film.regionMesh(), film.regionMesh(),
IOobject::MUST_READ, IOobject::MUST_READ,
@ -111,16 +111,16 @@ void thixotropicViscosity::correct
const volVectorField& U = film.U(); const volVectorField& U = film.U();
const volVectorField& Uw = film.Uw(); const volVectorField& Uw = film.Uw();
const volScalarField& delta = film.delta(); const volScalarField& delta = film.delta();
const volScalarField& deltaRho = film.deltaRho(); const volScalarField deltaRho = delta*film.rho();
const surfaceScalarField& phi = film.phi(); const surfaceScalarField& phiU = film.phiU();
const volScalarField& alpha = film.alpha(); const volScalarField& coverage = film.coverage();
const Time& runTime = this->film().regionMesh().time(); const Time& runTime = this->film().regionMesh().time();
// Shear rate // Shear rate
const volScalarField gDot const volScalarField gDot
( (
"gDot", "gDot",
alpha*mag(U - Uw)/(delta + film.deltaSmall()) coverage*mag(U - Uw)/(delta + film.deltaSmall())
); );
if (debug && runTime.writeTime()) if (debug && runTime.writeTime())
@ -135,8 +135,6 @@ void thixotropicViscosity::correct
rootVSmall rootVSmall
); );
const surfaceScalarField phiU(phi/fvc::interpolate(deltaRho + deltaRho0));
const dimensionedScalar c0("c0", dimless/dimTime, rootVSmall); const dimensionedScalar c0("c0", dimless/dimTime, rootVSmall);
const volScalarField coeff("coeff", -c_*pow(gDot, d_) + c0); const volScalarField coeff("coeff", -c_*pow(gDot, d_) + c0);
@ -156,7 +154,7 @@ void thixotropicViscosity::correct
( (
-film.rhoSp(), -film.rhoSp(),
dimensionedScalar(film.rhoSp().dimensions(), 0) dimensionedScalar(film.rhoSp().dimensions(), 0)
)/(deltaRho + deltaRho0), )/(deltaRho() + deltaRho0),
lambda_ lambda_
) )
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -59,7 +59,7 @@ void waxSolventViscosity::correctMu()
( (
film.regionMesh().lookupObject<uniformDimensionedScalarField> film.regionMesh().lookupObject<uniformDimensionedScalarField>
( (
waxSolventEvaporation::typeName + ":Wwax" IOobject::modelName("Wwax", waxSolventEvaporation::typeName)
) )
); );
@ -67,7 +67,7 @@ void waxSolventViscosity::correctMu()
( (
film.regionMesh().lookupObject<uniformDimensionedScalarField> film.regionMesh().lookupObject<uniformDimensionedScalarField>
( (
waxSolventEvaporation::typeName + ":Wsolvent" IOobject::modelName("Wsolvent", waxSolventEvaporation::typeName)
) )
); );
@ -75,7 +75,7 @@ void waxSolventViscosity::correctMu()
( (
film.regionMesh().lookupObject<uniformDimensionedScalarField> film.regionMesh().lookupObject<uniformDimensionedScalarField>
( (
waxSolventEvaporation::typeName + ":Ysolvent0" IOobject::modelName("Ysolvent0", waxSolventEvaporation::typeName)
) )
); );
@ -83,7 +83,7 @@ void waxSolventViscosity::correctMu()
( (
film.regionMesh().lookupObject<volScalarField> film.regionMesh().lookupObject<volScalarField>
( (
waxSolventEvaporation::typeName + ":Ysolvent" IOobject::modelName("Ysolvent", waxSolventEvaporation::typeName)
) )
); );
@ -116,7 +116,7 @@ waxSolventViscosity::waxSolventViscosity
( (
IOobject IOobject
( (
typeName + ":muWax", IOobject::modelName("muWax", typeName),
film.regionMesh().time().timeName(), film.regionMesh().time().timeName(),
film.regionMesh(), film.regionMesh(),
IOobject::NO_READ, IOobject::NO_READ,
@ -139,7 +139,7 @@ waxSolventViscosity::waxSolventViscosity
( (
IOobject IOobject
( (
typeName + ":muSolvent", IOobject::modelName("muSolvent", typeName),
film.regionMesh().time().timeName(), film.regionMesh().time().timeName(),
film.regionMesh(), film.regionMesh(),
IOobject::NO_READ, IOobject::NO_READ,

View File

@ -72,9 +72,9 @@ void constantHeatTransfer::correct()
{} {}
tmp<volScalarField> constantHeatTransfer::h() const tmp<volScalarField::Internal> constantHeatTransfer::h() const
{ {
return volScalarField::New return volScalarField::Internal::New
( (
"htc", "htc",
filmModel_.regionMesh(), filmModel_.regionMesh(),

View File

@ -92,7 +92,7 @@ public:
virtual void correct(); virtual void correct();
//- Return the heat transfer coefficient [W/m^2/K] //- Return the heat transfer coefficient [W/m^2/K]
virtual tmp<volScalarField> h() const; virtual tmp<volScalarField::Internal> h() const;
// Member Operators // Member Operators

View File

@ -116,7 +116,7 @@ public:
virtual void correct() = 0; virtual void correct() = 0;
//- Return the heat transfer coefficient [W/m^2/K] //- Return the heat transfer coefficient [W/m^2/K]
virtual tmp<volScalarField> h() const = 0; virtual tmp<volScalarField::Internal> h() const = 0;
// Member Operators // Member Operators

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -73,22 +73,17 @@ mappedConvectiveHeatTransfer::mappedConvectiveHeatTransfer
( (
IOobject IOobject
( (
htcConvPrimary_.name(), // must have same name as above for mapping htcConvPrimary_.name(),
film.time().timeName(), film.time().timeName(),
film.regionMesh(), film.regionMesh(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
film.regionMesh(), film.regionMesh(),
dimensionedScalar(dimMass/pow3(dimTime)/dimTemperature, 0), dimensionedScalar(dimMass/pow3(dimTime)/dimTemperature, 0)
film.mappedPushedFieldPatchTypes<scalar>()
) )
{ {
// Update the primary-side convective heat transfer coefficient correct();
htcConvPrimary_.correctBoundaryConditions();
// Pull the data from the primary region via direct mapped BCs
htcConvFilm_.correctBoundaryConditions();
} }
@ -105,12 +100,13 @@ void mappedConvectiveHeatTransfer::correct()
// Update the primary-side convective heat transfer coefficient // Update the primary-side convective heat transfer coefficient
htcConvPrimary_.correctBoundaryConditions(); htcConvPrimary_.correctBoundaryConditions();
// Pull the data from the primary region via direct mapped BCs // Map the primary-side convective heat transfer coefficient
htcConvFilm_.correctBoundaryConditions(); // to the region internal field
film().toRegion(htcConvFilm_, htcConvPrimary_.boundaryField());
} }
tmp<volScalarField> mappedConvectiveHeatTransfer::h() const tmp<volScalarField::Internal> mappedConvectiveHeatTransfer::h() const
{ {
return htcConvFilm_; return htcConvFilm_;
} }

View File

@ -62,9 +62,7 @@ class mappedConvectiveHeatTransfer
volScalarField htcConvPrimary_; volScalarField htcConvPrimary_;
//- Heat transfer coefficient - film region [W/m^2/K] //- Heat transfer coefficient - film region [W/m^2/K]
// Assumes that the primary region to film region boundaries are volScalarField::Internal htcConvFilm_;
// described as mappedPushed types
volScalarField htcConvFilm_;
public: public:
@ -101,7 +99,7 @@ public:
virtual void correct(); virtual void correct();
//- Return the heat transfer coefficient [W/m^2/K] //- Return the heat transfer coefficient [W/m^2/K]
virtual tmp<volScalarField> h() const; virtual tmp<volScalarField::Internal> h() const;
// Member Operators // Member Operators

View File

@ -75,29 +75,27 @@ solidification::solidification
( (
IOobject IOobject
( (
typeName + ":mass", IOobject::modelName("mass", typeName),
film.regionMesh().time().timeName(), film.regionMesh().time().timeName(),
film.regionMesh(), film.regionMesh(),
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
film.regionMesh(), film.regionMesh(),
dimensionedScalar(dimMass, 0), dimensionedScalar(dimMass, 0)
zeroGradientFvPatchScalarField::typeName
), ),
thickness_ thickness_
( (
IOobject IOobject
( (
typeName + ":thickness", IOobject::modelName("thickness", typeName),
film.regionMesh().time().timeName(), film.regionMesh().time().timeName(),
film.regionMesh(), film.regionMesh(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
film.regionMesh(), film.regionMesh(),
dimensionedScalar(dimLength, 0), dimensionedScalar(dimLength, 0)
zeroGradientFvPatchScalarField::typeName
) )
{} {}
@ -121,8 +119,8 @@ void solidification::correctModel
const thermoSingleLayer& film = filmType<thermoSingleLayer>(); const thermoSingleLayer& film = filmType<thermoSingleLayer>();
const scalarField& T = film.T(); const scalarField& T = film.T();
const scalarField& hs = film.hs(); const scalarField& h = film.h();
const scalarField& alpha = film.alpha(); const scalarField& coverage = film.coverage();
const scalar rateLimiter = min const scalar rateLimiter = min
( (
@ -133,9 +131,9 @@ void solidification::correctModel
).value() ).value()
); );
forAll(alpha, celli) forAll(coverage, celli)
{ {
if (alpha[celli] > 0.5) if (coverage[celli] > 0.5)
{ {
if (T[celli] < T0_) if (T[celli] < T0_)
{ {
@ -146,7 +144,7 @@ void solidification::correctModel
// Heat is assumed to be removed by heat-transfer to the wall // Heat is assumed to be removed by heat-transfer to the wall
// so the energy remains unchanged by the phase-change. // so the energy remains unchanged by the phase-change.
dEnergy[celli] += dm*hs[celli]; dEnergy[celli] += dm*h[celli];
} }
} }
} }

View File

@ -72,10 +72,10 @@ protected:
dimensionedScalar maxSolidificationRate_; dimensionedScalar maxSolidificationRate_;
//- Accumulated solid mass [kg] //- Accumulated solid mass [kg]
volScalarField mass_; volScalarField::Internal mass_;
//- Accumulated solid thickness [m] //- Accumulated solid thickness [m]
volScalarField thickness_; volScalarField::Internal thickness_;
public: public:

View File

@ -112,7 +112,7 @@ void standardPhaseChange::correctModel
const scalarField& delta = film.delta(); const scalarField& delta = film.delta();
const scalarField& pInf = film.pPrimary(); const scalarField& pInf = film.pPrimary();
const scalarField& T = film.T(); const scalarField& T = film.T();
const scalarField& hs = film.hs(); const scalarField& h = film.h();
const scalarField& rho = film.rho(); const scalarField& rho = film.rho();
const scalarField& rhoInf = film.rhoPrimary(); const scalarField& rhoInf = film.rhoPrimary();
const scalarField& muInf = film.muPrimary(); const scalarField& muInf = film.muPrimary();
@ -193,8 +193,8 @@ void standardPhaseChange::correctModel
// Heat is assumed to be removed by heat-transfer to the wall // Heat is assumed to be removed by heat-transfer to the wall
// so the energy remains unchanged by the phase-change. // so the energy remains unchanged by the phase-change.
dEnergy[celli] += dm*hs[celli]; dEnergy[celli] += dm*h[celli];
// dEnergy[celli] += dm*(hs[celli] + hVap); // dEnergy[celli] += dm*(h[celli] + hVap);
} }
} }
} }

View File

@ -85,7 +85,7 @@ waxSolventEvaporation::waxSolventEvaporation
( (
IOobject IOobject
( (
typeName + ":Wwax", IOobject::modelName("Wwax", typeName),
film.regionMesh().time().constant(), film.regionMesh().time().constant(),
film.regionMesh() film.regionMesh()
), ),
@ -95,7 +95,7 @@ waxSolventEvaporation::waxSolventEvaporation
( (
IOobject IOobject
( (
typeName + ":Wsolvent", IOobject::modelName("Wsolvent", typeName),
film.regionMesh().time().constant(), film.regionMesh().time().constant(),
film.regionMesh() film.regionMesh()
), ),
@ -105,7 +105,7 @@ waxSolventEvaporation::waxSolventEvaporation
( (
IOobject IOobject
( (
typeName + ":Ysolvent0", IOobject::modelName("Ysolvent0", typeName),
film.regionMesh().time().constant(), film.regionMesh().time().constant(),
film.regionMesh(), film.regionMesh(),
IOobject::MUST_READ, IOobject::MUST_READ,
@ -116,7 +116,7 @@ waxSolventEvaporation::waxSolventEvaporation
( (
IOobject IOobject
( (
typeName + ":Ysolvent", IOobject::modelName("Ysolvent", typeName),
film.regionMesh().time().timeName(), film.regionMesh().time().timeName(),
film.regionMesh(), film.regionMesh(),
IOobject::MUST_READ, IOobject::MUST_READ,
@ -155,8 +155,9 @@ void waxSolventEvaporation::correctModel
{ {
const thermoSingleLayer& film = filmType<thermoSingleLayer>(); const thermoSingleLayer& film = filmType<thermoSingleLayer>();
const volScalarField& alpha = film.alpha();
const volScalarField& delta = film.delta(); const volScalarField& delta = film.delta();
const volScalarField& deltaRho = film.deltaRho(); const volScalarField& rho = film.rho();
const surfaceScalarField& phi = film.phi(); const surfaceScalarField& phi = film.phi();
// Set local thermo properties // Set local thermo properties
@ -167,11 +168,12 @@ void waxSolventEvaporation::correctModel
// Retrieve fields from film model // Retrieve fields from film model
const scalarField& pInf = film.pPrimary(); const scalarField& pInf = film.pPrimary();
const scalarField& T = film.T(); const scalarField& T = film.T();
const scalarField& hs = film.hs(); const scalarField& h = film.h();
const scalarField& rho = film.rho();
const scalarField& rhoInf = film.rhoPrimary(); const scalarField& rhoInf = film.rhoPrimary();
const scalarField& muInf = film.muPrimary(); const scalarField& muInf = film.muPrimary();
const scalarField& V = film.regionMesh().V();
const scalarField& magSf = film.magSf(); const scalarField& magSf = film.magSf();
const scalarField& VbyA = film.VbyA();
const vectorField dU(film.UPrimary() - film.Us()); const vectorField dU(film.UPrimary() - film.Us());
const scalarField limMass const scalarField limMass
( (
@ -188,7 +190,7 @@ void waxSolventEvaporation::correctModel
( (
IOobject IOobject
( (
typeName + ":evapRateCoeff", IOobject::modelName("evapRateCoeff", typeName),
film.regionMesh().time().timeName(), film.regionMesh().time().timeName(),
film.regionMesh(), film.regionMesh(),
IOobject::NO_READ, IOobject::NO_READ,
@ -196,14 +198,14 @@ void waxSolventEvaporation::correctModel
false false
), ),
film.regionMesh(), film.regionMesh(),
dimensionedScalar(dimDensity*dimVelocity, 0) dimensionedScalar(dimDensity/dimTime, 0)
); );
volScalarField::Internal evapRateInf volScalarField::Internal evapRateInf
( (
IOobject IOobject
( (
typeName + ":evapRateInf", IOobject::modelName("evapRateInf", typeName),
film.regionMesh().time().timeName(), film.regionMesh().time().timeName(),
film.regionMesh(), film.regionMesh(),
IOobject::NO_READ, IOobject::NO_READ,
@ -211,7 +213,7 @@ void waxSolventEvaporation::correctModel
false false
), ),
film.regionMesh(), film.regionMesh(),
dimensionedScalar(dimDensity*dimVelocity, 0) dimensionedScalar(evapRateCoeff.dimensions(), 0)
); );
bool filmPresent = false; bool filmPresent = false;
@ -283,15 +285,16 @@ void waxSolventEvaporation::correctModel
// Sherwood number // Sherwood number
const scalar Sh = this->Sh(Re, Sc); const scalar Sh = this->Sh(Re, Sc);
// Mass transfer coefficient [m/s] // Mass transfer coefficient [kg/m^3 s]
evapRateCoeff[celli] = rhoInfc*Sh*Dab/(L_ + rootVSmall); evapRateCoeff[celli] =
rhoInfc*Sh*Dab/(VbyA[celli]*(L_ + rootVSmall));
// Solvent mass transfer // Solvent mass transfer
const scalar dm const scalar dm
( (
max max
( (
dt*magSf[celli] dt*V[celli]
*evapRateCoeff[celli]*(YsCoeff*Ysolvent - YInf[celli]), *evapRateCoeff[celli]*(YsCoeff*Ysolvent - YInf[celli]),
0 0
) )
@ -309,10 +312,10 @@ void waxSolventEvaporation::correctModel
} }
} }
const dimensionedScalar deltaRho0Bydt const dimensionedScalar rho0Bydt
( (
"deltaRho0", "rho0Bydt",
deltaRho.dimensions()/dimTime, dimDensity/dimTime,
rootVSmall/dt rootVSmall/dt
); );
@ -320,7 +323,7 @@ void waxSolventEvaporation::correctModel
( (
max max
( (
-film.rhoSp()(), -film.rhoSp(),
dimensionedScalar(film.rhoSp().dimensions(), 0) dimensionedScalar(film.rhoSp().dimensions(), 0)
) )
); );
@ -330,10 +333,10 @@ void waxSolventEvaporation::correctModel
// Solve for the solvent mass fraction // Solve for the solvent mass fraction
fvScalarMatrix YsolventEqn fvScalarMatrix YsolventEqn
( (
fvm::ddt(deltaRho, Ysolvent_) fvm::ddt(alpha, rho, Ysolvent_) + fvm::div(phi, Ysolvent_)
+ fvm::div(phi, Ysolvent_) - fvm::Sp(film.continuityErr(), Ysolvent_)
== ==
deltaRho0Bydt*Ysolvent_() rho0Bydt*Ysolvent_()
+ evapRateInf + evapRateInf
@ -343,9 +346,9 @@ void waxSolventEvaporation::correctModel
- fvm::Sp - fvm::Sp
( (
deltaRho0Bydt rho0Bydt
+ evapRateCoeff + evapRateCoeff
+ film.rhoSp()() + film.rhoSp()
+ impingementRate, + impingementRate,
Ysolvent_ Ysolvent_
) )
@ -359,17 +362,17 @@ void waxSolventEvaporation::correctModel
scalarField dm scalarField dm
( (
dt*magSf*rhoInf*(evapRateCoeff*Ysolvent_ + evapRateInf) dt*V*rhoInf*(evapRateCoeff*Ysolvent_ + evapRateInf)
); );
dMass += dm; dMass += dm;
// Heat is assumed to be removed by heat-transfer to the wall // Heat is assumed to be removed by heat-transfer to the wall
// so the energy remains unchanged by the phase-change. // so the energy remains unchanged by the phase-change.
dEnergy += dm*hs; dEnergy += dm*h;
// Latent heat [J/kg] // Latent heat [J/kg]
// dEnergy += dm*(hs[celli] + hVap); // dEnergy += dm*(h[celli] + hVap);
} }
} }

View File

@ -120,7 +120,7 @@ public:
virtual const volScalarField& delta() const = 0; virtual const volScalarField& delta() const = 0;
//- Return the film coverage, 1 = covered, 0 = uncovered / [] //- Return the film coverage, 1 = covered, 0 = uncovered / []
virtual const volScalarField& alpha() const = 0; virtual const volScalarField& coverage() const = 0;
//- Return the film velocity [m/s] //- Return the film velocity [m/s]
virtual const volVectorField& U() const = 0; virtual const volVectorField& U() const = 0;
@ -134,24 +134,6 @@ public:
//- Return the film density [kg/m^3] //- Return the film density [kg/m^3]
virtual const volScalarField& rho() const = 0; virtual const volScalarField& rho() const = 0;
//- Return the film mean temperature [K]
virtual const volScalarField& T() const = 0;
//- Return the film surface temperature [K]
virtual const volScalarField& Ts() const = 0;
//- Return the film wall temperature [K]
virtual const volScalarField& Tw() const = 0;
//- Return the film surface temperature [J/kg]
virtual const volScalarField& hs() const = 0;
//- Return the film specific heat capacity [J/kg/K]
virtual const volScalarField& Cp() const = 0;
//- Return the film thermal conductivity [W/m/K]
virtual const volScalarField& kappa() const = 0;
//- Return the film surface tension [N/m] //- Return the film surface tension [N/m]
virtual const volScalarField& sigma() const = 0; virtual const volScalarField& sigma() const = 0;

View File

@ -24,10 +24,15 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "thermoSingleLayer.H" #include "thermoSingleLayer.H"
#include "fvcDdt.H"
#include "fvcDiv.H" #include "fvcDiv.H"
#include "fvcLaplacian.H"
#include "fvcFlux.H" #include "fvcFlux.H"
#include "fvm.H"
#include "fvmDdt.H"
#include "fvmDiv.H"
#include "fvmSup.H"
#include "zeroGradientFvPatchFields.H" #include "zeroGradientFvPatchFields.H"
#include "mixedFvPatchFields.H" #include "mixedFvPatchFields.H"
#include "mappedFieldFvPatchField.H" #include "mappedFieldFvPatchField.H"
@ -54,12 +59,11 @@ namespace surfaceFilmModels
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(thermoSingleLayer, 0); defineTypeNameAndDebug(thermoSingleLayer, 0);
addToRunTimeSelectionTable(surfaceFilmRegionModel, thermoSingleLayer, mesh); addToRunTimeSelectionTable(surfaceFilmRegionModel, thermoSingleLayer, mesh);
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
wordList thermoSingleLayer::hsBoundaryTypes() wordList thermoSingleLayer::hBoundaryTypes()
{ {
wordList bTypes(T_.boundaryField().types()); wordList bTypes(T_.boundaryField().types());
forAll(bTypes, patchi) forAll(bTypes, patchi)
@ -90,14 +94,11 @@ bool thermoSingleLayer::read()
void thermoSingleLayer::resetPrimaryRegionSourceTerms() void thermoSingleLayer::resetPrimaryRegionSourceTerms()
{ {
if (debug) DebugInFunction << endl;
{
InfoInFunction << endl;
}
kinematicSingleLayer::resetPrimaryRegionSourceTerms(); kinematicSingleLayer::resetPrimaryRegionSourceTerms();
hsSpPrimary_ == dimensionedScalar(hsSp_.dimensions(), 0); hSpPrimary_ == dimensionedScalar(hSp_.dimensions(), 0);
} }
@ -110,18 +111,18 @@ void thermoSingleLayer::correctThermoFields()
} }
void thermoSingleLayer::correctHsForMappedT() void thermoSingleLayer::correctHforMappedT()
{ {
T_.correctBoundaryConditions(); T_.correctBoundaryConditions();
volScalarField::Boundary& hsBf = hs_.boundaryFieldRef(); volScalarField::Boundary& hBf = h_.boundaryFieldRef();
forAll(hsBf, patchi) forAll(hBf, patchi)
{ {
const fvPatchField<scalar>& Tp = T_.boundaryField()[patchi]; const fvPatchField<scalar>& Tp = T_.boundaryField()[patchi];
if (isA<mappedFieldFvPatchField<scalar>>(Tp)) if (isA<mappedFieldFvPatchField<scalar>>(Tp))
{ {
hsBf[patchi] == hs(Tp, patchi); hBf[patchi] == h(Tp, patchi);
} }
} }
} }
@ -129,7 +130,7 @@ void thermoSingleLayer::correctHsForMappedT()
void thermoSingleLayer::updateSurfaceTemperatures() void thermoSingleLayer::updateSurfaceTemperatures()
{ {
correctHsForMappedT(); correctHforMappedT();
// Push boundary film temperature into wall temperature internal field // Push boundary film temperature into wall temperature internal field
for (label i=0; i<intCoupledPatchIDs_.size(); i++) for (label i=0; i<intCoupledPatchIDs_.size(); i++)
@ -149,10 +150,7 @@ void thermoSingleLayer::updateSurfaceTemperatures()
void thermoSingleLayer::transferPrimaryRegionThermoFields() void thermoSingleLayer::transferPrimaryRegionThermoFields()
{ {
if (debug) DebugInFunction << endl;
{
InfoInFunction << endl;
}
kinematicSingleLayer::transferPrimaryRegionThermoFields(); kinematicSingleLayer::transferPrimaryRegionThermoFields();
@ -168,71 +166,61 @@ void thermoSingleLayer::transferPrimaryRegionThermoFields()
void thermoSingleLayer::transferPrimaryRegionSourceFields() void thermoSingleLayer::transferPrimaryRegionSourceFields()
{ {
if (debug) DebugInFunction << endl;
{
InfoInFunction << endl;
}
kinematicSingleLayer::transferPrimaryRegionSourceFields(); kinematicSingleLayer::transferPrimaryRegionSourceFields();
volScalarField::Boundary& hsSpPrimaryBf = volScalarField::Boundary& hSpPrimaryBf = hSpPrimary_.boundaryFieldRef();
hsSpPrimary_.boundaryFieldRef();
// Convert accumulated source terms into per unit area per unit time // Convert accumulated source terms into per unit area per unit time
const scalar deltaT = time_.deltaTValue(); const scalar deltaT = time_.deltaTValue();
forAll(hsSpPrimaryBf, patchi) forAll(hSpPrimaryBf, patchi)
{ {
scalarField rpriMagSfdeltaT scalarField rpriMagSfdeltaT
( (
(1.0/deltaT)/primaryMesh().magSf().boundaryField()[patchi] (1/deltaT)/primaryMesh().magSf().boundaryField()[patchi]
); );
hsSpPrimaryBf[patchi] *= rpriMagSfdeltaT; hSpPrimaryBf[patchi] *= rpriMagSfdeltaT;
} }
// Retrieve the source fields from the primary region via direct mapped // Retrieve the source fields from the primary region
// (coupled) boundary conditions toRegion(hSp_, hSpPrimaryBf);
// - fields require transfer of values for both patch AND to push the hSp_.field() /= VbyA();
// values into the first layer of internal cells
hsSp_.correctBoundaryConditions();
} }
void thermoSingleLayer::correctAlpha() void thermoSingleLayer::correctCoverage()
{ {
if (hydrophilic_) if (hydrophilic_)
{ {
const scalar hydrophilicDry = hydrophilicDryScale_*deltaWet_; const scalar hydrophilicDry = hydrophilicDryScale_*deltaWet_;
const scalar hydrophilicWet = hydrophilicWetScale_*deltaWet_; const scalar hydrophilicWet = hydrophilicWetScale_*deltaWet_;
forAll(alpha_, i) forAll(coverage_, i)
{ {
if ((alpha_[i] < 0.5) && (delta_[i] > hydrophilicWet)) if ((coverage_[i] < 0.5) && (delta_[i] > hydrophilicWet))
{ {
alpha_[i] = 1.0; coverage_[i] = 1;
} }
else if ((alpha_[i] > 0.5) && (delta_[i] < hydrophilicDry)) else if ((coverage_[i] > 0.5) && (delta_[i] < hydrophilicDry))
{ {
alpha_[i] = 0.0; coverage_[i] = 0;
} }
} }
alpha_.correctBoundaryConditions(); coverage_.correctBoundaryConditions();
} }
else else
{ {
alpha_ == coverage_ == pos(delta_ - dimensionedScalar(dimLength, deltaWet_));
pos0(delta_ - dimensionedScalar(dimLength, deltaWet_));
} }
} }
void thermoSingleLayer::updateSubmodels() void thermoSingleLayer::updateSubmodels()
{ {
if (debug) DebugInFunction << endl;
{
InfoInFunction << endl;
}
// Update heat transfer coefficient sub-models // Update heat transfer coefficient sub-models
htcs_->correct(); htcs_->correct();
@ -252,58 +240,67 @@ void thermoSingleLayer::updateSubmodels()
primaryEnergyTrans_ primaryEnergyTrans_
); );
const volScalarField rMagSfDt((1/time().deltaT())/magSf()); const volScalarField::Internal rMagSfDt((1/time().deltaT())/magSf());
const volScalarField::Internal rVDt
(
1/(time().deltaT()*regionMesh().V())
);
// Vapour recoil pressure // Vapour recoil pressure
pSp_ -= sqr(rMagSfDt*primaryMassTrans_)/(2*rhoPrimary_); pSp_ -= sqr(rMagSfDt*primaryMassTrans_())/(2*rhoPrimary_());
// Update transfer model - mass returned is mass available for transfer // Update transfer model - mass returned is mass available for transfer
transfer_.correct(availableMass_, primaryMassTrans_, primaryEnergyTrans_); transfer_.correct(availableMass_, primaryMassTrans_, primaryEnergyTrans_);
// Update source fields // Update source fields
rhoSp_ += rMagSfDt*(cloudMassTrans_ + primaryMassTrans_); rhoSp_ += rVDt*(cloudMassTrans_() + primaryMassTrans_());
hsSp_ += rMagSfDt*(cloudMassTrans_*hs_ + primaryEnergyTrans_); hSp_ += rVDt*(cloudMassTrans_()*h_() + primaryEnergyTrans_());
turbulence_->correct(); turbulence_->correct();
} }
tmp<fvScalarMatrix> thermoSingleLayer::q(volScalarField& hs) const tmp<fvScalarMatrix> thermoSingleLayer::q(volScalarField& h) const
{ {
const volScalarField alpha(pos(delta_ - deltaSmall_)); const volScalarField::Internal coverage(pos(delta_() - deltaSmall_));
return return
( (
// Heat-transfer to the primary region // Heat-transfer to the primary region
- fvm::Sp(htcs_->h()/Cp_, hs) - fvm::Sp((htcs_->h()/VbyA())/Cp_, h)
+ htcs_->h()*(hs/Cp_ + alpha*(TPrimary_ - T_)) + (htcs_->h()/VbyA())*(h()/Cp_ + coverage*(TPrimary_() - T_()))
// Heat-transfer to the wall // Heat-transfer to the wall
- fvm::Sp(htcw_->h()/Cp_, hs) - fvm::Sp((htcw_->h()/VbyA())/Cp_, h)
+ htcw_->h()*(hs/Cp_ + alpha*(Tw_- T_)) + (htcw_->h()/VbyA())*(h()/Cp_ + coverage*(Tw_()- T_()))
); );
} }
void thermoSingleLayer::solveEnergy() void thermoSingleLayer::solveEnergy()
{ {
if (debug) DebugInFunction << endl;
{
InfoInFunction << endl;
}
updateSurfaceTemperatures(); updateSurfaceTemperatures();
solve fvScalarMatrix hEqn
( (
fvm::ddt(deltaRho_, hs_) fvm::ddt(alpha_, rho_, h_) + fvm::div(phi_, h_)
+ fvm::div(phi_, hs_) - fvm::Sp(continuityErr_, h_)
== ==
- hsSp_ - hSp_
+ q(hs_) + q(h_)
+ radiation_->Shs() + radiation_->Shs()/VbyA()
); );
hEqn.relax();
hEqn.solve();
// Update temperature using latest h_
T_ == T(h_);
correctThermoFields(); correctThermoFields();
// Evaluate viscosity from user-model // Evaluate viscosity from user-model
@ -324,6 +321,7 @@ thermoSingleLayer::thermoSingleLayer
: :
kinematicSingleLayer(modelType, mesh, g, regionType, false), kinematicSingleLayer(modelType, mesh, g, regionType, false),
thermo_(mesh.lookupObject<SLGThermo>("SLGThermo")), thermo_(mesh.lookupObject<SLGThermo>("SLGThermo")),
Cp_ Cp_
( (
IOobject IOobject
@ -338,6 +336,7 @@ thermoSingleLayer::thermoSingleLayer
dimensionedScalar(dimEnergy/dimMass/dimTemperature, 0), dimensionedScalar(dimEnergy/dimMass/dimTemperature, 0),
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
), ),
kappa_ kappa_
( (
IOobject IOobject
@ -357,7 +356,7 @@ thermoSingleLayer::thermoSingleLayer
( (
IOobject IOobject
( (
"Tf", "T",
time().timeName(), time().timeName(),
regionMesh(), regionMesh(),
IOobject::MUST_READ, IOobject::MUST_READ,
@ -365,11 +364,12 @@ thermoSingleLayer::thermoSingleLayer
), ),
regionMesh() regionMesh()
), ),
Ts_ Ts_
( (
IOobject IOobject
( (
"Tsf", "Ts",
time().timeName(), time().timeName(),
regionMesh(), regionMesh(),
IOobject::NO_READ, IOobject::NO_READ,
@ -378,11 +378,12 @@ thermoSingleLayer::thermoSingleLayer
T_, T_,
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
), ),
Tw_ Tw_
( (
IOobject IOobject
( (
"Twf", "Tw",
time().timeName(), time().timeName(),
regionMesh(), regionMesh(),
IOobject::NO_READ, IOobject::NO_READ,
@ -391,11 +392,12 @@ thermoSingleLayer::thermoSingleLayer
T_, T_,
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
), ),
hs_
h_
( (
IOobject IOobject
( (
"hf", "h",
time().timeName(), time().timeName(),
regionMesh(), regionMesh(),
IOobject::NO_READ, IOobject::NO_READ,
@ -403,7 +405,7 @@ thermoSingleLayer::thermoSingleLayer
), ),
regionMesh(), regionMesh(),
dimensionedScalar(dimEnergy/dimMass, 0), dimensionedScalar(dimEnergy/dimMass, 0),
hsBoundaryTypes() hBoundaryTypes()
), ),
primaryEnergyTrans_ primaryEnergyTrans_
@ -423,36 +425,35 @@ thermoSingleLayer::thermoSingleLayer
deltaWet_(coeffs_.lookup<scalar>("deltaWet")), deltaWet_(coeffs_.lookup<scalar>("deltaWet")),
hydrophilic_(readBool(coeffs_.lookup("hydrophilic"))), hydrophilic_(readBool(coeffs_.lookup("hydrophilic"))),
hydrophilicDryScale_(0.0), hydrophilicDryScale_(0),
hydrophilicWetScale_(0.0), hydrophilicWetScale_(0),
hsSp_ hSp_
( (
IOobject IOobject
( (
"hsSp", "hSp",
time().timeName(), time().timeName(),
regionMesh(), regionMesh(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
regionMesh(), regionMesh(),
dimensionedScalar(dimEnergy/dimArea/dimTime, 0), dimensionedScalar(dimEnergy/dimVolume/dimTime, 0)
this->mappedPushedFieldPatchTypes<scalar>()
), ),
hsSpPrimary_ hSpPrimary_
( (
IOobject IOobject
( (
hsSp_.name(), // Must have same name as hSp_ to enable mapping hSp_.name(),
time().timeName(), time().timeName(),
primaryMesh(), primaryMesh(),
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
primaryMesh(), primaryMesh(),
dimensionedScalar(hsSp_.dimensions(), 0) dimensionedScalar(hSp_.dimensions(), 0)
), ),
TPrimary_ TPrimary_
@ -473,14 +474,17 @@ thermoSingleLayer::thermoSingleLayer
YPrimary_(), YPrimary_(),
viscosity_(filmViscosityModel::New(*this, coeffs(), mu_)), viscosity_(filmViscosityModel::New(*this, coeffs(), mu_)),
htcs_ htcs_
( (
heatTransferModel::New(*this, coeffs().subDict("upperSurfaceModels")) heatTransferModel::New(*this, coeffs().subDict("upperSurfaceModels"))
), ),
htcw_ htcw_
( (
heatTransferModel::New(*this, coeffs().subDict("lowerSurfaceModels")) heatTransferModel::New(*this, coeffs().subDict("lowerSurfaceModels"))
), ),
phaseChange_(phaseChangeModel::New(*this, coeffs())), phaseChange_(phaseChangeModel::New(*this, coeffs())),
radiation_(filmRadiationModel::New(*this, coeffs())), radiation_(filmRadiationModel::New(*this, coeffs())),
Tmin_(-vGreat), Tmin_(-vGreat),
@ -517,7 +521,7 @@ thermoSingleLayer::thermoSingleLayer
), ),
regionMesh(), regionMesh(),
dimensionedScalar(dimless, 0), dimensionedScalar(dimless, 0),
pSp_.boundaryField().types() this->mappedFieldAndInternalPatchTypes<scalar>()
) )
); );
} }
@ -533,16 +537,14 @@ thermoSingleLayer::thermoSingleLayer
{ {
transferPrimaryRegionThermoFields(); transferPrimaryRegionThermoFields();
correctAlpha(); correctCoverage();
correctThermoFields(); correctThermoFields();
// Update derived fields // Update derived fields
hs_ == hs(T_); h_ == h(T_);
deltaRho_ == delta_*rho_; surfaceScalarField phi
surfaceScalarField phi0
( (
IOobject IOobject
( (
@ -553,10 +555,10 @@ thermoSingleLayer::thermoSingleLayer
IOobject::AUTO_WRITE, IOobject::AUTO_WRITE,
false false
), ),
fvc::flux(deltaRho_*U_) fvc::flux(alpha_*rho_*U_)
); );
phi_ == phi0; phi_ == phi;
// Evaluate viscosity from user-model // Evaluate viscosity from user-model
viscosity_->correct(pPrimary_, T_); viscosity_->correct(pPrimary_, T_);
@ -592,21 +594,15 @@ void thermoSingleLayer::addSources
energySource energySource
); );
if (debug) DebugInFunction << " energy = " << energySource << endl;
{
Info<< " energy = " << energySource << nl << endl;
}
hsSpPrimary_.boundaryFieldRef()[patchi][facei] -= energySource; hSpPrimary_.boundaryFieldRef()[patchi][facei] -= energySource;
} }
void thermoSingleLayer::preEvolveRegion() void thermoSingleLayer::preEvolveRegion()
{ {
if (debug) DebugInFunction << endl;
{
InfoInFunction << endl;
}
kinematicSingleLayer::preEvolveRegion(); kinematicSingleLayer::preEvolveRegion();
primaryEnergyTrans_ == dimensionedScalar(dimEnergy, 0); primaryEnergyTrans_ == dimensionedScalar(dimEnergy, 0);
@ -615,13 +611,10 @@ void thermoSingleLayer::preEvolveRegion()
void thermoSingleLayer::evolveRegion() void thermoSingleLayer::evolveRegion()
{ {
if (debug) DebugInFunction << endl;
{
InfoInFunction << endl;
}
// Update film coverage indicator // Update film coverage indicator
correctAlpha(); correctCoverage();
// Update film wall and surface velocities // Update film wall and surface velocities
updateSurfaceVelocities(); updateSurfaceVelocities();
@ -629,43 +622,36 @@ void thermoSingleLayer::evolveRegion()
// Update film wall and surface temperatures // Update film wall and surface temperatures
updateSurfaceTemperatures(); updateSurfaceTemperatures();
// Solve continuity for deltaRho_ // Predict delta_ from continuity
solveContinuity(); predictDelta();
// Update sub-models to provide updated source contributions // Update sub-models to provide updated source contributions
updateSubmodels(); updateSubmodels();
// Solve continuity for deltaRho_ // Predict delta_ from continuity with updated source
solveContinuity(); predictDelta();
for (int oCorr=1; oCorr<=nOuterCorr_; oCorr++) // Implicit pressure source coefficient - constant
const volScalarField pp(this->pp());
while (pimple_.loop())
{ {
// Explicit pressure source contribution // Explicit pressure source contribution - varies with delta
tmp<volScalarField> tpu(this->pu()); const volScalarField pu(this->pu());
// Implicit pressure source coefficient
tmp<volScalarField> tpp(this->pp());
// Solve for momentum for U_ // Solve for momentum for U_
tmp<fvVectorMatrix> UEqn = solveMomentum(tpu(), tpp()); const fvVectorMatrix UEqn(solveMomentum(pu, pp));
// Solve energy for hs_ - also updates thermo // Solve energy for h_ - also updates thermo
solveEnergy(); solveEnergy();
// Film thickness correction loop // Film thickness correction loop
for (int corr=1; corr<=nCorr_; corr++) while (pimple_.correct())
{ {
// Solve thickness for delta_ solveAlpha(pu, pp, UEqn);
solveThickness(tpu(), tpp(), UEqn());
} }
} }
// Update deltaRho_ with new delta_
deltaRho_ == delta_*rho_;
// Update temperature using latest hs_
T_ == T(hs_);
// Reset source terms for next time integration // Reset source terms for next time integration
resetPrimaryRegionSourceTerms(); resetPrimaryRegionSourceTerms();
} }
@ -701,9 +687,9 @@ const volScalarField& thermoSingleLayer::Tw() const
} }
const volScalarField& thermoSingleLayer::hs() const const volScalarField& thermoSingleLayer::h() const
{ {
return hs_; return h_;
} }

View File

@ -70,7 +70,7 @@ class thermoSingleLayer
// Private Member Functions // Private Member Functions
//- Return boundary types for sensible enthalpy field //- Return boundary types for sensible enthalpy field
wordList hsBoundaryTypes(); wordList hBoundaryTypes();
protected: protected:
@ -101,7 +101,7 @@ protected:
volScalarField Tw_; volScalarField Tw_;
//- Sensible enthalpy [J/kg] //- Sensible enthalpy [J/kg]
volScalarField hs_; volScalarField h_;
// Transfer fields - to the primary region // Transfer fields - to the primary region
@ -135,14 +135,14 @@ protected:
// pushed into the patch internal field // pushed into the patch internal field
//- Energy [J/m2/s] //- Energy [J/m2/s]
volScalarField hsSp_; volScalarField::Internal hSp_;
// Primary region - registered to the primary region mesh // Primary region - registered to the primary region mesh
// Internal use only - not read-in // Internal use only - not read-in
//- Energy [J/m2/s] //- Energy [J/m2/s]
volScalarField hsSpPrimary_; volScalarField hSpPrimary_;
// Fields mapped from primary region - registered to the film region // Fields mapped from primary region - registered to the film region
@ -192,7 +192,7 @@ protected:
virtual void correctThermoFields(); virtual void correctThermoFields();
//- Correct sensible enthalpy for mapped temperature fields //- Correct sensible enthalpy for mapped temperature fields
virtual void correctHsForMappedT(); virtual void correctHforMappedT();
//- Correct the film surface and wall temperatures //- Correct the film surface and wall temperatures
virtual void updateSurfaceTemperatures(); virtual void updateSurfaceTemperatures();
@ -207,13 +207,13 @@ protected:
virtual void transferPrimaryRegionSourceFields(); virtual void transferPrimaryRegionSourceFields();
//- Correct film coverage field //- Correct film coverage field
virtual void correctAlpha(); virtual void correctCoverage();
//- Update the film sub-models //- Update the film sub-models
virtual void updateSubmodels(); virtual void updateSubmodels();
//- Return the wall/surface heat transfer term for the enthalpy equation //- Return the wall/surface heat transfer term for the enthalpy equation
virtual tmp<fvScalarMatrix> q(volScalarField& hs) const; virtual tmp<fvScalarMatrix> q(volScalarField& h) const;
// Equations // Equations
@ -274,21 +274,21 @@ public:
virtual const volScalarField& Tw() const; virtual const volScalarField& Tw() const;
//- Return the film sensible enthalpy [J/kg] //- Return the film sensible enthalpy [J/kg]
virtual const volScalarField& hs() const; virtual const volScalarField& h() const;
// Helper functions // Helper functions
//- Return sensible enthalpy as a function of temperature //- Return sensible enthalpy as a function of temperature
// for a patch // for a patch
inline tmp<scalarField> hs inline tmp<scalarField> h
( (
const scalarField& T, const scalarField& T,
const label patchi const label patchi
) const; ) const;
//- Return sensible enthalpy as a function of temperature //- Return sensible enthalpy as a function of temperature
inline tmp<volScalarField> hs inline tmp<volScalarField> h
( (
const volScalarField& T const volScalarField& T
) const; ) const;
@ -296,7 +296,7 @@ public:
//- Return temperature as a function of sensible enthalpy //- Return temperature as a function of sensible enthalpy
inline tmp<volScalarField> T inline tmp<volScalarField> T
( (
const volScalarField& hs const volScalarField& h
) const; ) const;
@ -319,13 +319,13 @@ public:
// Film region // Film region
//- Energy [J/m2/s] //- Energy [J/m2/s]
inline const volScalarField& hsSp() const; inline const volScalarField::Internal& hSp() const;
// Primary region // Primary region
//- Energy [J/m2/s] //- Energy [J/m2/s]
inline const volScalarField& hsSpPrimary() const; inline const volScalarField& hSpPrimary() const;
// Fields mapped from the primary region // Fields mapped from the primary region
@ -353,15 +353,6 @@ public:
inline const filmRadiationModel& radiation() const; inline const filmRadiationModel& radiation() const;
// Derived fields (calculated on-the-fly)
//- Return the convective heat energy from film to wall
inline tmp<scalarField> Qconvw(const label patchi) const;
//- Return the convective heat energy from primary region to film
inline tmp<scalarField> Qconvp(const label patchi) const;
// Evolution // Evolution
//- Pre-evolve film hook //- Pre-evolve film hook

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -45,7 +45,7 @@ inline const SLGThermo& thermoSingleLayer::thermo() const
} }
inline tmp<scalarField> thermoSingleLayer::hs inline tmp<scalarField> thermoSingleLayer::h
( (
const scalarField& T, const scalarField& T,
const label patchi const label patchi
@ -56,14 +56,14 @@ inline tmp<scalarField> thermoSingleLayer::hs
} }
inline tmp<volScalarField> thermoSingleLayer::hs inline tmp<volScalarField> thermoSingleLayer::h
( (
const volScalarField& T const volScalarField& T
) const ) const
{ {
return volScalarField::New return volScalarField::New
( (
"hs(" + T.name() + ")", "h(" + T.name() + ")",
Cp_*(T - Tref) Cp_*(T - Tref)
); );
} }
@ -71,12 +71,12 @@ inline tmp<volScalarField> thermoSingleLayer::hs
inline tmp<volScalarField> thermoSingleLayer::T inline tmp<volScalarField> thermoSingleLayer::T
( (
const volScalarField& hs const volScalarField& h
) const ) const
{ {
tmp<volScalarField> tT tmp<volScalarField> tT
( (
volScalarField::New("T(" + hs.name() + ")", hs/Cp_ + Tref) volScalarField::New("T(" + h.name() + ")", h/Cp_ + Tref)
); );
tT.ref().min(Tmax_); tT.ref().min(Tmax_);
@ -86,15 +86,15 @@ inline tmp<volScalarField> thermoSingleLayer::T
} }
inline const volScalarField& thermoSingleLayer::hsSp() const inline const volScalarField::Internal& thermoSingleLayer::hSp() const
{ {
return hsSp_; return hSp_;
} }
inline const volScalarField& thermoSingleLayer::hsSpPrimary() const inline const volScalarField& thermoSingleLayer::hSpPrimary() const
{ {
return hsSpPrimary_; return hSpPrimary_;
} }
@ -134,26 +134,6 @@ inline const filmRadiationModel& thermoSingleLayer::radiation() const
} }
inline tmp<scalarField> thermoSingleLayer::Qconvw(const label patchi) const
{
const scalarField htc(htcw_->h()().boundaryField()[patchi]);
const scalarField& Tp = T_.boundaryField()[patchi];
const scalarField& Twp = Tw_.boundaryField()[patchi];
return htc*(Tp - Twp);
}
inline tmp<scalarField> thermoSingleLayer::Qconvp(const label patchi) const
{
const scalarField htc(htcs_->h()().boundaryField()[patchi]);
const scalarField& Tp = T_.boundaryField()[patchi];
const scalarField& Tpp = TPrimary_.boundaryField()[patchi];
return htc*(Tp - Tpp);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels } // End namespace surfaceFilmModels

View File

@ -66,10 +66,7 @@ bool thermalBaffle::read(const dictionary& dict)
void thermalBaffle::solveEnergy() void thermalBaffle::solveEnergy()
{ {
if (debug) DebugInFunction << endl;
{
InfoInFunction << endl;
}
const polyBoundaryMesh& rbm = regionMesh().boundaryMesh(); const polyBoundaryMesh& rbm = regionMesh().boundaryMesh();

View File

@ -11,7 +11,7 @@ FoamFile
format ascii; format ascii;
class volScalarField; class volScalarField;
location "0/wallFilmRegion"; location "0/wallFilmRegion";
object Tf; object T;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -11,7 +11,7 @@ FoamFile
format ascii; format ascii;
class volVectorField; class volVectorField;
location "0/wallFilmRegion"; location "0/wallFilmRegion";
object Uf; object U;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -11,7 +11,7 @@ FoamFile
format ascii; format ascii;
class volScalarField; class volScalarField;
location "0/wallFilmRegion"; location "0/wallFilmRegion";
object deltaf; object delta;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -17,48 +17,33 @@ FoamFile
ddtSchemes ddtSchemes
{ {
default none; default Euler;
ddt(deltaf*rhof) Euler; }
ddt(rhof,deltaf) Euler;
ddt(deltaf*rhof,Uf) Euler; gradSchemes
ddt(deltaf*rhof,hf) Euler; {
default Gauss linear;
} }
divSchemes divSchemes
{ {
default none; default none;
div(phi,Uf) Gauss upwind;
div(phid,deltaf) Gauss upwind; div(phid,alpha) Gauss upwind;
div(phi,hf) Gauss upwind; div(phi,U) Gauss upwind;
div(phi,h) Gauss upwind;
div(nHat) Gauss linear; div(nHat) Gauss linear;
div(grad(nHat)) Gauss linear;
}
gradSchemes
{
default none;
grad(pL) Gauss linear;
grad(sigmaf) Gauss linear;
snGradCorr(deltaf) Gauss linear;
snGradCorr(pp) Gauss linear;
snGradCorr(pu) Gauss linear;
grad(radius) Gauss linear;
grad(nHat) Gauss linear;
} }
laplacianSchemes laplacianSchemes
{ {
default none; default Gauss linear uncorrected;
laplacian(sigmaf,deltaf) Gauss linear uncorrected;
laplacian(deltaCoeff,deltaf) Gauss linear uncorrected;
} }
snGradSchemes snGradSchemes
{ {
snGrad(p) uncorrected; default uncorrected;
snGrad(deltaf) uncorrected;
} }

View File

@ -17,14 +17,15 @@ FoamFile
solvers solvers
{ {
"(Uf|hf|deltaf\*rhof)" "alpha.*"
{ {
solver smoothSolver; solver smoothSolver;
smoother symGaussSeidel; smoother symGaussSeidel;
tolerance 1e-10; tolerance 1e-10;
relTol 0; relTol 0;
} }
deltaf
"(U|h).*"
{ {
solver smoothSolver; solver smoothSolver;
smoother symGaussSeidel; smoother symGaussSeidel;
@ -33,20 +34,21 @@ solvers
} }
} }
PIMPLE
PISO
{ {
momentumPredictor yes; momentumPredictor yes;
nCorr 1; nOuterCorrectors 1;
nNonOrthCorr 0; nCorrectors 1;
nNonOrthogonalCorrectors 0;
} }
relaxationFactors relaxationFactors
{ {
equations equations
{ {
".*" 1;
} }
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -30,7 +30,7 @@ boundaryField
"(region0_to.*)" "(region0_to.*)"
{ {
type mapped; type mapped;
field Tsf; field Ts;
average 300; average 300;
setAverage no; setAverage no;
value uniform 300; value uniform 300;

View File

@ -32,7 +32,7 @@ boundaryField
type mapped; type mapped;
uniformValue constant (0 0 0); uniformValue constant (0 0 0);
value uniform (0 0 0); value uniform (0 0 0);
field Usf; field Us;
average (0 0 0); average (0 0 0);
setAverage no; setAverage no;
} }

View File

@ -10,8 +10,8 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volScalarField; class volScalarField;
location "0/region0_to_"(region0_to.*)"Region_masterRegion"; location "0/wallFilmRegion";
object Tf; object T;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -21,12 +21,6 @@ internalField uniform 300;
boundaryField boundaryField
{ {
// cyclic boundaries between film patches
"(cube[0-9][0-9]_side[0-9]_to_cube[0-9][0-9]_side[0-9])"
{
type nonuniformTransformCyclic;
}
// top film surface // top film surface
"(.*top)" "(.*top)"
{ {

View File

@ -10,8 +10,8 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volVectorField; class volVectorField;
location "0/region0_to_"(region0_to.*)"Region_masterRegion"; location "0/wallFilmRegion";
object Uf; object U;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -21,12 +21,6 @@ internalField uniform (0 0 0);
boundaryField boundaryField
{ {
// cyclic boundaries between film patches
"(cube[0-9][0-9]_side[0-9]_to_cube[0-9][0-9]_side[0-9])"
{
type nonuniformTransformCyclic;
}
// top film surface // top film surface
"(.*top)" "(.*top)"
{ {

View File

@ -10,8 +10,8 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volScalarField; class volScalarField;
location "0/region0_to_"(region0_to.*)"Region_masterRegion"; location "0/wallFilmRegion";
object deltaf; object delta;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -21,12 +21,6 @@ internalField uniform 0.0;
boundaryField boundaryField
{ {
// cyclic boundaries between film patches
"(cube[0-9][0-9]_side[0-9]_to_cube[0-9][0-9]_side[0-9])"
{
type nonuniformTransformCyclic;
}
// top film surface // top film surface
"(.*top)" "(.*top)"
{ {

View File

@ -6,9 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory
cleanCase cleanCase
rm -rf system/wallFilmRegion
rm -rf constant/wallFilmRegion rm -rf constant/wallFilmRegion
rm -rf 0
rm -f *.obj rm -f *.obj
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,8 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
rm -rf 0
# Create the underlying block mesh # Create the underlying block mesh
runApplication blockMesh runApplication blockMesh
@ -21,10 +19,6 @@ runApplication ./patchifyObstacles
# Create the wall film region via extrusion # Create the wall film region via extrusion
runApplication extrudeToRegionMesh -overwrite runApplication extrudeToRegionMesh -overwrite
# Copy the system settings over to the wall film region
rm -rf system/wallFilmRegion
cp -r system/wallFilmRegion.orig system/wallFilmRegion
paraFoam -touch paraFoam -touch
paraFoam -touch -region wallFilmRegion paraFoam -touch -region wallFilmRegion

View File

@ -4,12 +4,9 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions # Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions . $WM_PROJECT_DIR/bin/tools/RunFunctions
./Allmesh
cp -rf 0.orig 0
application=$(getApplication) application=$(getApplication)
./Allmesh
runApplication $application runApplication $application
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

Some files were not shown because too many files have changed in this diff Show More