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

View File

@ -35,8 +35,6 @@ Description
- if extruding boundary faces:
- convert boundary faces to mappedWall patches
- 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
if flipMap is false)
@ -123,7 +121,6 @@ Notes:
#include "syncTools.H"
#include "cyclicPolyPatch.H"
#include "wedgePolyPatch.H"
#include "nonuniformTransformCyclicPolyPatch.H"
#include "extrudeModel.H"
#include "faceSet.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
(
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
// interprocessor or cyclic patches if necessary.
labelList sidePatchID;

View File

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

View File

@ -473,7 +473,6 @@ $(constraintPolyPatches)/cyclic/cyclicPolyPatch.C
$(constraintPolyPatches)/cyclicSlip/cyclicSlipPolyPatch.C
$(constraintPolyPatches)/oldCyclic/oldCyclicPolyPatch.C
$(constraintPolyPatches)/empty/emptyPolyPatch.C
$(constraintPolyPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C
$(constraintPolyPatches)/processorCyclic/processorCyclicPolyPatch.C
$(constraintPolyPatches)/processor/processorPolyPatch.C
$(constraintPolyPatches)/symmetryPlane/symmetryPlanePolyPatch.C
@ -595,7 +594,6 @@ constraintPointPatches = $(pointPatches)/constraint
$(constraintPointPatches)/cyclic/cyclicPointPatch.C
$(constraintPointPatches)/cyclicSlip/cyclicSlipPointPatch.C
$(constraintPointPatches)/empty/emptyPointPatch.C
$(constraintPointPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatch.C
$(constraintPointPatches)/processor/processorPointPatch.C
$(constraintPointPatches)/processorCyclic/processorCyclicPointPatch.C
$(constraintPointPatches)/symmetryPlane/symmetryPlanePointPatch.C
@ -670,7 +668,6 @@ constraintPointPatchFields = $(pointPatchFields)/constraint
$(constraintPointPatchFields)/cyclic/cyclicPointPatchFields.C
$(constraintPointPatchFields)/cyclicSlip/cyclicSlipPointPatchFields.C
$(constraintPointPatchFields)/empty/emptyPointPatchFields.C
$(constraintPointPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchFields.C
$(constraintPointPatchFields)/processor/processorPointPatchFields.C
$(constraintPointPatchFields)/processorCyclic/processorCyclicPointPatchFields.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)/cyclicSlip/cyclicSlipFvPatch.C
$(constraintFvPatches)/empty/emptyFvPatch.C
$(constraintFvPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatch.C
$(constraintFvPatches)/cyclicRepeatAMI/cyclicRepeatAMIFvPatch.C
$(constraintFvPatches)/processor/processorFvPatch.C
$(constraintFvPatches)/processorCyclic/processorCyclicFvPatch.C
@ -120,7 +119,6 @@ $(constraintFvPatchFields)/cyclicSlip/cyclicSlipFvPatchFields.C
$(constraintFvPatchFields)/empty/emptyFvPatchFields.C
$(constraintFvPatchFields)/jumpCyclic/jumpCyclicFvPatchFields.C
$(constraintFvPatchFields)/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.C
$(constraintFvPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFields.C
$(constraintFvPatchFields)/cyclicRepeatAMI/cyclicRepeatAMIFvPatchFields.C
$(constraintFvPatchFields)/processor/processorFvPatchFields.C
$(constraintFvPatchFields)/processor/processorFvPatchScalarField.C
@ -159,7 +157,6 @@ $(derivedFvPatchFields)/inletOutlet/inletOutletFvPatchFields.C
$(derivedFvPatchFields)/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C
$(derivedFvPatchFields)/mappedField/mappedFieldFvPatchFields.C
$(derivedFvPatchFields)/mappedFixedInternalValue/mappedFixedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/mappedFixedValue/mappedFixedValueFvPatchFields.C
$(derivedFvPatchFields)/mappedFlowRate/mappedFlowRateFvPatchVectorField.C
$(derivedFvPatchFields)/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C
@ -231,7 +228,6 @@ $(constraintFvsPatchFields)/cyclicAMI/cyclicAMIFvsPatchFields.C
$(constraintFvsPatchFields)/cyclicACMI/cyclicACMIFvsPatchFields.C
$(constraintFvsPatchFields)/cyclicSlip/cyclicSlipFvsPatchFields.C
$(constraintFvsPatchFields)/empty/emptyFvsPatchFields.C
$(constraintFvsPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchFields.C
$(constraintFvsPatchFields)/cyclicRepeatAMI/cyclicRepeatAMIFvsPatchFields.C
$(constraintFvsPatchFields)/processor/processorFvsPatchFields.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 "thermoSingleLayer.H"
#include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H"
#include "Pstream.H"
@ -618,10 +619,16 @@ void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields
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_);
CpFilmPatch_ = filmModel.Cp().boundaryField()[filmPatchi];
CpFilmPatch_ = thermalFilmModel.Cp().boundaryField()[filmPatchi];
filmModel.toPrimary(filmPatchi, CpFilmPatch_);
}

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,6 +23,10 @@ License
\*---------------------------------------------------------------------------*/
#include "mappedPatchFieldBase.H"
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type>>
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>
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
(
const label regionPatchi,
List<Type>& primaryField,
const CombineOp& cop
List<Type>& primaryField
) const
{
forAll(intCoupledPatchIDs_, i)
@ -255,7 +231,7 @@ void Foam::regionModels::regionModel::toRegion
(
regionMesh().boundaryMesh()[regionPatchi]
);
mpb.distribute(primaryField, cop);
mpb.distribute(primaryField);
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
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -60,10 +60,7 @@ void Foam::regionModels::regionModel1D::constructMeshObjects()
void Foam::regionModels::regionModel1D::initialise()
{
if (debug)
{
Pout<< "regionModel1D::initialise()" << endl;
}
DebugInFunction << endl;
// Calculate boundaryFaceFaces and boundaryFaceCells

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,7 +26,6 @@ License
#include "singleLayerRegion.H"
#include "zeroGradientFvPatchFields.H"
#include "mappedFixedInternalValueFvPatchFields.H"
#include "mappedFixedPushedInternalValueFvPatchFields.H"
// * * * * * * * * * * * 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),
phiName_("phi"),
rhoName_("rho"),
deltafName_("deltaf")
deltafName_("delta")
{}
@ -71,7 +71,7 @@ filmHeightInletVelocityFvPatchVectorField
fixedValueFvPatchVectorField(p, iF, dict),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
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);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
writeEntryIfDifferent<word>(os, "deltaf", "deltaf", deltafName_);
writeEntryIfDifferent<word>(os, "delta", "delta", deltafName_);
writeEntry(os, "value", *this);
}

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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
{
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()
{
return USpPrimary_;
@ -110,37 +135,37 @@ inline volScalarField& kinematicSingleLayer::rhoSpPrimary()
}
inline volVectorField& kinematicSingleLayer::USp()
inline volVectorField::Internal& kinematicSingleLayer::USp()
{
return USp_;
}
inline volScalarField& kinematicSingleLayer::pSp()
inline volScalarField::Internal& kinematicSingleLayer::pSp()
{
return pSp_;
}
inline volScalarField& kinematicSingleLayer::rhoSp()
inline volScalarField::Internal& kinematicSingleLayer::rhoSp()
{
return rhoSp_;
}
inline const volVectorField& kinematicSingleLayer::USp() const
inline const volVectorField::Internal& kinematicSingleLayer::USp() const
{
return USp_;
}
inline const volScalarField& kinematicSingleLayer::pSp() const
inline const volScalarField::Internal& kinematicSingleLayer::pSp() const
{
return pSp_;
}
inline const volScalarField& kinematicSingleLayer::rhoSp() const
inline const volScalarField::Internal& kinematicSingleLayer::rhoSp() const
{
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();
}

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,7 +58,17 @@ distributionContactAngleForce::distributionContactAngleForce
coeffDict_.subDict("distribution"),
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> ttheta
(
volScalarField::New
(
typeName + ":theta",
filmModel_.regionMesh(),
dimensionedScalar(dimless, 0)
)
);
volScalarField& theta = ttheta.ref();
volScalarField::Internal& thetai = theta.ref();
if (curTimeIndex_ != filmModel_.time().timeIndex())
{
volScalarField::Internal& thetai = theta_;
forAll(thetai, celli)
{
thetai[celli] = distribution_->sample();
}
forAll(theta.boundaryField(), patchi)
forAll(theta_.boundaryField(), 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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "constantRadiation.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -60,7 +59,7 @@ constantRadiation::constantRadiation
(
IOobject
(
typeName + ":qrConst",
IOobject::modelName("qrConst", typeName),
film.time().timeName(),
film.regionMesh(),
IOobject::MUST_READ,
@ -72,7 +71,7 @@ constantRadiation::constantRadiation
(
IOobject
(
typeName + ":mask",
IOobject::modelName("mask", typeName),
film.time().timeName(),
film.regionMesh(),
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();
if ((time >= timeStart_) && (time <= timeStart_ + duration_))
{
scalarField& Shs = tShs.ref();
const scalarField& qr = qrConst_;
const scalarField& alpha = filmModel_.alpha();
Shs = mask_*qr*alpha*absorptivity_;
return volScalarField::Internal::New
(
IOobject::modelName("Shs", typeName),
mask_*qrConst_*filmModel_.coverage()*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
// Also updates qrNet
virtual tmp<volScalarField> Shs();
virtual tmp<volScalarField::Internal> Shs();
// Member Operators

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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(),
dimensionedScalar(dimMass/pow3(dimTime), 0)
);

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "primaryRadiation.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -56,21 +55,22 @@ primaryRadiation::primaryRadiation
)
:
filmRadiationModel(typeName, film, dict),
qinPrimary_
qinFilm_
(
IOobject
(
"qin", // same name as qin on primary region to enable mapping
"qin",
film.time().timeName(),
film.regionMesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
film.regionMesh(),
dimensionedScalar(dimMass/pow3(dimTime), 0),
film.mappedPushedFieldPatchTypes<scalar>()
dimensionedScalar(dimMass/pow3(dimTime), 0)
)
{}
{
correct();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
@ -83,30 +83,23 @@ primaryRadiation::~primaryRadiation()
void primaryRadiation::correct()
{
// Transfer qin from primary region
qinPrimary_.correctBoundaryConditions();
const volScalarField& qinPrimary
(
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
(
typeName + ":Shs",
film().regionMesh(),
dimensionedScalar(dimMass/pow3(dimTime), 0)
)
IOobject::modelName("Shs", typeName),
qinFilm_*filmModel_.coverage()
);
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
//- Incident radiative flux mapped from the primary region / [kg/s^3]
volScalarField qinPrimary_;
//- Incident radiative flux mapped from the primary region [kg/s^3]
volScalarField::Internal qinFilm_;
public:
@ -94,7 +94,7 @@ public:
//- Return the radiation sensible enthalpy source
// Also updates qrNet
virtual tmp<volScalarField> Shs();
virtual tmp<volScalarField::Internal> Shs();
// Member Operators

View File

@ -24,9 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "standardRadiation.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -57,37 +55,24 @@ standardRadiation::standardRadiation
)
:
filmRadiationModel(typeName, film, dict),
qinPrimary_
qinFilm_
(
IOobject
(
"qin", // same name as qin on primary region to enable mapping
"qin",
film.time().timeName(),
film.regionMesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
film.regionMesh(),
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
dimensionedScalar(dimMass/pow3(dimTime), 0)
),
beta_(coeffDict_.lookup<scalar>("beta")),
kappaBar_(coeffDict_.lookup<scalar>("kappaBar"))
{}
{
correct();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
@ -100,35 +85,24 @@ standardRadiation::~standardRadiation()
void standardRadiation::correct()
{
// Transfer qr from primary region
qinPrimary_.correctBoundaryConditions();
const volScalarField& qinPrimary
(
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
(
typeName + ":Shs",
film().regionMesh(),
dimensionedScalar(dimMass/pow3(dimTime), 0)
)
IOobject::modelName("Shs", typeName),
beta_*qinFilm_*filmModel_.coverage()
*(1 - exp(-kappaBar_*filmModel_.delta()()))
);
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
//- Radiative incident flux mapped from the primary region / [kg/s^3]
volScalarField qinPrimary_;
//- Remaining radiative flux after removing local contribution
volScalarField qrNet_;
//- Radiative incident flux mapped from the primary region [kg/s^3]
volScalarField::Internal qinFilm_;
// Model coefficients
@ -105,7 +102,7 @@ public:
//- Return the radiation sensible enthalpy source
// Also updates qrNet
virtual tmp<volScalarField> Shs();
virtual tmp<volScalarField::Internal> Shs();
// Member Operators

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -75,29 +75,27 @@ solidification::solidification
(
IOobject
(
typeName + ":mass",
IOobject::modelName("mass", typeName),
film.regionMesh().time().timeName(),
film.regionMesh(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
film.regionMesh(),
dimensionedScalar(dimMass, 0),
zeroGradientFvPatchScalarField::typeName
dimensionedScalar(dimMass, 0)
),
thickness_
(
IOobject
(
typeName + ":thickness",
IOobject::modelName("thickness", typeName),
film.regionMesh().time().timeName(),
film.regionMesh(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
film.regionMesh(),
dimensionedScalar(dimLength, 0),
zeroGradientFvPatchScalarField::typeName
dimensionedScalar(dimLength, 0)
)
{}
@ -121,8 +119,8 @@ void solidification::correctModel
const thermoSingleLayer& film = filmType<thermoSingleLayer>();
const scalarField& T = film.T();
const scalarField& hs = film.hs();
const scalarField& alpha = film.alpha();
const scalarField& h = film.h();
const scalarField& coverage = film.coverage();
const scalar rateLimiter = min
(
@ -133,9 +131,9 @@ void solidification::correctModel
).value()
);
forAll(alpha, celli)
forAll(coverage, celli)
{
if (alpha[celli] > 0.5)
if (coverage[celli] > 0.5)
{
if (T[celli] < T0_)
{
@ -146,7 +144,7 @@ void solidification::correctModel
// Heat is assumed to be removed by heat-transfer to the wall
// 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_;
//- Accumulated solid mass [kg]
volScalarField mass_;
volScalarField::Internal mass_;
//- Accumulated solid thickness [m]
volScalarField thickness_;
volScalarField::Internal thickness_;
public:

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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 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
{
return volScalarField::New
(
"hs(" + T.name() + ")",
"h(" + T.name() + ")",
Cp_*(T - Tref)
);
}
@ -71,12 +71,12 @@ inline tmp<volScalarField> thermoSingleLayer::hs
inline tmp<volScalarField> thermoSingleLayer::T
(
const volScalarField& hs
const volScalarField& h
) const
{
tmp<volScalarField> tT
(
volScalarField::New("T(" + hs.name() + ")", hs/Cp_ + Tref)
volScalarField::New("T(" + h.name() + ")", h/Cp_ + Tref)
);
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

View File

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

View File

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

View File

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

View File

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

View File

@ -17,48 +17,33 @@ FoamFile
ddtSchemes
{
default none;
ddt(deltaf*rhof) Euler;
ddt(rhof,deltaf) Euler;
ddt(deltaf*rhof,Uf) Euler;
ddt(deltaf*rhof,hf) Euler;
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,Uf) Gauss upwind;
div(phid,deltaf) Gauss upwind;
div(phi,hf) Gauss upwind;
div(phid,alpha) Gauss upwind;
div(phi,U) Gauss upwind;
div(phi,h) Gauss upwind;
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
{
default none;
laplacian(sigmaf,deltaf) Gauss linear uncorrected;
laplacian(deltaCoeff,deltaf) Gauss linear uncorrected;
default Gauss linear uncorrected;
}
snGradSchemes
{
snGrad(p) uncorrected;
snGrad(deltaf) uncorrected;
default uncorrected;
}

View File

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

View File

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

View File

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

View File

@ -10,8 +10,8 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0/region0_to_"(region0_to.*)"Region_masterRegion";
object Tf;
location "0/wallFilmRegion";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -21,12 +21,6 @@ internalField uniform 300;
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)"
{

View File

@ -10,8 +10,8 @@ FoamFile
version 2.0;
format ascii;
class volVectorField;
location "0/region0_to_"(region0_to.*)"Region_masterRegion";
object Uf;
location "0/wallFilmRegion";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -21,12 +21,6 @@ internalField uniform (0 0 0);
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)"
{

View File

@ -10,8 +10,8 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0/region0_to_"(region0_to.*)"Region_masterRegion";
object deltaf;
location "0/wallFilmRegion";
object delta;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -21,12 +21,6 @@ internalField uniform 0.0;
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)"
{

View File

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

View File

@ -4,8 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
rm -rf 0
# Create the underlying block mesh
runApplication blockMesh
@ -21,10 +19,6 @@ runApplication ./patchifyObstacles
# Create the wall film region via extrusion
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 -region wallFilmRegion

View File

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

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