Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mappedFilmPressureFvPatchScalarField: New film BC to map the neighbou…
…ring fluid pressure to the film mappedFilmPressureFvPatchScalarField is derived from the new mappedFvPatchField base-class for mapped patch fields including mappedValueFvPatchField. Class Foam::mappedFilmPressureFvPatchScalarField Description Film pressure boundary condition which maps the neighbouring fluid patch pressure to both the surface patch and internal film pressure field.
- Loading branch information
Henry Weller
committed
Mar 3, 2023
1 parent
9df3600
commit 12decc0
Showing
16 changed files
with
817 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
145 changes: 145 additions & 0 deletions
145
...hermalFilm/derivedFvPatchFields/mappedFilmPressure/mappedFilmPressureFvPatchScalarField.C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
/*---------------------------------------------------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Copyright (C) 2023 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 "mappedFilmPressureFvPatchScalarField.H" | ||
#include "volFields.H" | ||
#include "addToRunTimeSelectionTable.H" | ||
|
||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // | ||
|
||
Foam::mappedFilmPressureFvPatchScalarField::mappedFilmPressureFvPatchScalarField | ||
( | ||
const fvPatch& p, | ||
const DimensionedField<scalar, volMesh>& iF | ||
) | ||
: | ||
zeroGradientFvPatchField<scalar>(p, iF), | ||
mappedFvPatchField<scalar>(p, iF) | ||
{} | ||
|
||
|
||
Foam::mappedFilmPressureFvPatchScalarField::mappedFilmPressureFvPatchScalarField | ||
( | ||
const fvPatch& p, | ||
const DimensionedField<scalar, volMesh>& iF, | ||
const dictionary& dict | ||
) | ||
: | ||
zeroGradientFvPatchField<scalar>(p, iF, dict), | ||
mappedFvPatchField<scalar>(p, iF, dict) | ||
{} | ||
|
||
|
||
Foam::mappedFilmPressureFvPatchScalarField::mappedFilmPressureFvPatchScalarField | ||
( | ||
const mappedFilmPressureFvPatchScalarField& ptf, | ||
const fvPatch& p, | ||
const DimensionedField<scalar, volMesh>& iF, | ||
const fvPatchFieldMapper& mapper | ||
) | ||
: | ||
zeroGradientFvPatchField<scalar>(ptf, p, iF, mapper), | ||
mappedFvPatchField<scalar>(ptf, p, iF, mapper) | ||
{} | ||
|
||
|
||
Foam::mappedFilmPressureFvPatchScalarField::mappedFilmPressureFvPatchScalarField | ||
( | ||
const mappedFilmPressureFvPatchScalarField& ptf, | ||
const DimensionedField<scalar, volMesh>& iF | ||
) | ||
: | ||
zeroGradientFvPatchField<scalar>(ptf, iF), | ||
mappedFvPatchField<scalar>(ptf, iF) | ||
{} | ||
|
||
|
||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // | ||
|
||
void Foam::mappedFilmPressureFvPatchScalarField::map | ||
( | ||
const fvPatchField<scalar>& ptf, | ||
const fvPatchFieldMapper& mapper | ||
) | ||
{ | ||
zeroGradientFvPatchField<scalar>::map(ptf, mapper); | ||
mappedFvPatchField<scalar>::clearOut(); | ||
} | ||
|
||
|
||
void Foam::mappedFilmPressureFvPatchScalarField::reset | ||
( | ||
const fvPatchField<scalar>& ptf | ||
) | ||
{ | ||
zeroGradientFvPatchField<scalar>::reset(ptf); | ||
mappedFvPatchField<scalar>::clearOut(); | ||
} | ||
|
||
|
||
void Foam::mappedFilmPressureFvPatchScalarField::updateCoeffs() | ||
{ | ||
if (this->updated()) | ||
{ | ||
return; | ||
} | ||
|
||
// Map the neighbouring fluid patch pressure field to this patch | ||
this->operator==(this->mappedValues(this->nbrPatchField())); | ||
|
||
// Map the patch pressure to the internal field | ||
UIndirectList<scalar> | ||
( | ||
const_cast<Field<scalar>&>(this->primitiveField()), | ||
this->patch().faceCells() | ||
) = *this; | ||
|
||
zeroGradientFvPatchField<scalar>::updateCoeffs(); | ||
} | ||
|
||
|
||
void Foam::mappedFilmPressureFvPatchScalarField::write(Ostream& os) const | ||
{ | ||
fvPatchField<scalar>::write(os); | ||
|
||
mappedFvPatchField<scalar>::write(os); | ||
|
||
writeEntry(os, "value", *this); | ||
} | ||
|
||
|
||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
namespace Foam | ||
{ | ||
makePatchTypeField | ||
( | ||
fvPatchScalarField, | ||
mappedFilmPressureFvPatchScalarField | ||
); | ||
} | ||
|
||
|
||
// ************************************************************************* // |
151 changes: 151 additions & 0 deletions
151
...hermalFilm/derivedFvPatchFields/mappedFilmPressure/mappedFilmPressureFvPatchScalarField.H
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
/*---------------------------------------------------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | Website: https://openfoam.org | ||
\\ / A nd | Copyright (C) 2023 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::mappedFilmPressureFvPatchScalarField | ||
Description | ||
Film pressure boundary condition which maps the neighbouring fluid patch | ||
pressure to both the surface patch and internal film pressure field. | ||
SourceFiles | ||
mappedFilmPressureFvPatchScalarField.C | ||
\*---------------------------------------------------------------------------*/ | ||
|
||
#ifndef mappedFilmPressureFvPatchScalarField_H | ||
#define mappedFilmPressureFvPatchScalarField_H | ||
|
||
#include "zeroGradientFvPatchFields.H" | ||
#include "mappedFvPatchField.H" | ||
|
||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
namespace Foam | ||
{ | ||
|
||
/*---------------------------------------------------------------------------*\ | ||
Class mappedFilmPressureFvPatchScalarField Declaration | ||
\*---------------------------------------------------------------------------*/ | ||
|
||
class mappedFilmPressureFvPatchScalarField | ||
: | ||
public zeroGradientFvPatchField<scalar>, | ||
public mappedFvPatchField<scalar> | ||
{ | ||
|
||
public: | ||
|
||
//- Runtime type information | ||
TypeName("mappedFilmPressure"); | ||
|
||
|
||
// Constructors | ||
|
||
//- Construct from patch and internal field | ||
mappedFilmPressureFvPatchScalarField | ||
( | ||
const fvPatch&, | ||
const DimensionedField<scalar, volMesh>& | ||
); | ||
|
||
//- Construct from patch, internal field and dictionary | ||
mappedFilmPressureFvPatchScalarField | ||
( | ||
const fvPatch&, | ||
const DimensionedField<scalar, volMesh>&, | ||
const dictionary& | ||
); | ||
|
||
//- Construct by mapping given mappedFilmPressureFvPatchScalarField | ||
// onto a new patch | ||
mappedFilmPressureFvPatchScalarField | ||
( | ||
const mappedFilmPressureFvPatchScalarField&, | ||
const fvPatch&, | ||
const DimensionedField<scalar, volMesh>&, | ||
const fvPatchFieldMapper& | ||
); | ||
|
||
//- Disallow copy without setting internal field reference | ||
mappedFilmPressureFvPatchScalarField | ||
( | ||
const mappedFilmPressureFvPatchScalarField& | ||
) = delete; | ||
|
||
//- Copy constructor setting internal field reference | ||
mappedFilmPressureFvPatchScalarField | ||
( | ||
const mappedFilmPressureFvPatchScalarField&, | ||
const DimensionedField<scalar, volMesh>& | ||
); | ||
|
||
//- Construct and return a clone setting internal field reference | ||
virtual tmp<fvPatchField<scalar>> clone | ||
( | ||
const DimensionedField<scalar, volMesh>& iF | ||
) const | ||
{ | ||
return tmp<fvPatchField<scalar>> | ||
( | ||
new mappedFilmPressureFvPatchScalarField(*this, iF) | ||
); | ||
} | ||
|
||
|
||
// Member Functions | ||
|
||
// Mapping functions | ||
|
||
//- Map the given fvPatchField onto this fvPatchField | ||
virtual void map | ||
( | ||
const fvPatchField<scalar>&, | ||
const fvPatchFieldMapper& | ||
); | ||
|
||
//- Reset the fvPatchField to the given fvPatchField | ||
// Used for mesh to mesh mapping | ||
virtual void reset(const fvPatchField<scalar>&); | ||
|
||
|
||
// Evaluation functions | ||
|
||
//- Update the coefficients associated with the patch field | ||
virtual void updateCoeffs(); | ||
|
||
|
||
//- Write | ||
virtual void write(Ostream&) const; | ||
}; | ||
|
||
|
||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
} // End namespace Foam | ||
|
||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
#endif | ||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.