Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry Weller
2023-02-28 15:49:11 +00:00
59 changed files with 1019 additions and 608 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -633,14 +633,13 @@ scalarInterfaces() const
template<class Type, template<class> class PatchField, class GeoMesh> template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::reset void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::reset
( (
const DimensionedField<Type, GeoMesh>& field,
const GeometricBoundaryField<Type, PatchField, GeoMesh>& btf const GeometricBoundaryField<Type, PatchField, GeoMesh>& btf
) )
{ {
// Reset the number of patches in case the decomposition changed // Reset the number of patches in case the decomposition changed
this->setSize(btf.size()); this->setSize(btf.size());
const polyBoundaryMesh& pbm = field.mesh()().boundaryMesh(); const polyBoundaryMesh& pbm = bmesh_.mesh().boundaryMesh();
forAll(*this, patchi) forAll(*this, patchi)
{ {
@ -648,7 +647,15 @@ void Foam::GeometricBoundaryField<Type, PatchField, GeoMesh>::reset
// changed // changed
if (isA<processorPolyPatch>(pbm[patchi])) if (isA<processorPolyPatch>(pbm[patchi]))
{ {
this->set(patchi, btf[patchi].clone(bmesh_[patchi], field)); this->set
(
patchi,
btf[patchi].clone
(
bmesh_[patchi],
this->operator[](0).internalField()
)
);
} }
else else
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -169,11 +169,7 @@ public:
//- Reset the boundary field contents to the given field //- Reset the boundary field contents to the given field
// Used for mesh to mesh mapping // Used for mesh to mesh mapping
void reset void reset(const GeometricBoundaryField<Type, PatchField, GeoMesh>&);
(
const Internal&,
const GeometricBoundaryField<Type, PatchField, GeoMesh>&
);
//- Write boundary field as dictionary entry //- Write boundary field as dictionary entry
void writeEntry(const word& keyword, Ostream& os) const; void writeEntry(const word& keyword, Ostream& os) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -1296,7 +1296,7 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::reset
const GeometricField<Type, PatchField, GeoMesh>& gf = tgf(); const GeometricField<Type, PatchField, GeoMesh>& gf = tgf();
Internal::reset(gf); Internal::reset(gf);
boundaryField_.reset(*this, gf.boundaryField()); boundaryField_.reset(gf.boundaryField());
tgf.clear(); tgf.clear();
} }

View File

@ -258,7 +258,6 @@ $(fvsPatchFields)/fvsPatchField/fvsPatchFields.C
basicFvsPatchFields = $(fvsPatchFields)/basic basicFvsPatchFields = $(fvsPatchFields)/basic
$(basicFvsPatchFields)/calculated/calculatedFvsPatchFields.C $(basicFvsPatchFields)/calculated/calculatedFvsPatchFields.C
$(basicFvsPatchFields)/nonConformalCalculated/nonConformalCalculatedFvsPatchFields.C
$(basicFvsPatchFields)/coupled/coupledFvsPatchFields.C $(basicFvsPatchFields)/coupled/coupledFvsPatchFields.C
$(basicFvsPatchFields)/fixedValue/fixedValueFvsPatchFields.C $(basicFvsPatchFields)/fixedValue/fixedValueFvsPatchFields.C
$(basicFvsPatchFields)/sliced/slicedFvsPatchFields.C $(basicFvsPatchFields)/sliced/slicedFvsPatchFields.C
@ -277,6 +276,10 @@ $(constraintFvsPatchFields)/nonConformalCyclic/nonConformalCyclicFvsPatchFields.
$(constraintFvsPatchFields)/nonConformalError/nonConformalErrorFvsPatchFields.C $(constraintFvsPatchFields)/nonConformalError/nonConformalErrorFvsPatchFields.C
$(constraintFvsPatchFields)/nonConformalProcessorCyclic/nonConformalProcessorCyclicFvsPatchFields.C $(constraintFvsPatchFields)/nonConformalProcessorCyclic/nonConformalProcessorCyclicFvsPatchFields.C
derivedFvsPatchFields = $(fvsPatchFields)/derived
$(derivedFvsPatchFields)/polyFaces/polyFacesFvsPatchLabelField.C
$(derivedFvsPatchFields)/nonConformalPolyFaces/nonConformalPolyFacesFvsPatchLabelField.C
fields/volFields/volFields.C fields/volFields/volFields.C
fields/surfaceFields/surfaceFields.C fields/surfaceFields/surfaceFields.C

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,7 +26,6 @@ License
#include "basicSymmetryFvPatchField.H" #include "basicSymmetryFvPatchField.H"
#include "symmTransformField.H" #include "symmTransformField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type> template<class Type>

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,7 @@ License
#include "coupledFvPatchField.H" #include "coupledFvPatchField.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type> template<class Type>
Foam::coupledFvPatchField<Type>::coupledFvPatchField Foam::coupledFvPatchField<Type>::coupledFvPatchField

View File

@ -26,7 +26,7 @@ License
#include "fixedGradientFvPatchField.H" #include "fixedGradientFvPatchField.H"
#include "dictionary.H" #include "dictionary.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type> template<class Type>
Foam::fixedGradientFvPatchField<Type>::fixedGradientFvPatchField Foam::fixedGradientFvPatchField<Type>::fixedGradientFvPatchField

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,7 @@ License
#include "fixedValueFvPatchField.H" #include "fixedValueFvPatchField.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type> template<class Type>
Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField

View File

@ -25,7 +25,7 @@ License
#include "mixedFvPatchField.H" #include "mixedFvPatchField.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type> template<class Type>
Foam::mixedFvPatchField<Type>::mixedFvPatchField Foam::mixedFvPatchField<Type>::mixedFvPatchField

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,7 @@ License
#include "slicedFvPatchField.H" #include "slicedFvPatchField.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type> template<class Type>
Foam::slicedFvPatchField<Type>::slicedFvPatchField Foam::slicedFvPatchField<Type>::slicedFvPatchField
@ -71,19 +71,7 @@ Foam::slicedFvPatchField<Type>::slicedFvPatchField
} }
template<class Type> // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::tmp<Foam::fvPatchField<Type>>
Foam::slicedFvPatchField<Type>::clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type>>
(
new slicedFvPatchField<Type>(*this, iF)
);
}
template<class Type> template<class Type>
Foam::slicedFvPatchField<Type>::~slicedFvPatchField() Foam::slicedFvPatchField<Type>::~slicedFvPatchField()

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -99,7 +99,13 @@ public:
virtual tmp<fvPatchField<Type>> clone virtual tmp<fvPatchField<Type>> clone
( (
const DimensionedField<Type, volMesh>& iF const DimensionedField<Type, volMesh>& iF
) const; ) const
{
return tmp<fvPatchField<Type>>
(
new slicedFvPatchField<Type>(*this, iF)
);
};
//- Destructor //- Destructor

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -27,7 +27,7 @@ License
#include "IOstreams.H" #include "IOstreams.H"
#include "transformField.H" #include "transformField.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type> template<class Type>
Foam::transformFvPatchField<Type>::transformFvPatchField Foam::transformFvPatchField<Type>::transformFvPatchField

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,7 +26,7 @@ License
#include "zeroGradientFvPatchField.H" #include "zeroGradientFvPatchField.H"
#include "fvPatchFieldMapper.H" #include "fvPatchFieldMapper.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type> template<class Type>
Foam::zeroGradientFvPatchField<Type>::zeroGradientFvPatchField Foam::zeroGradientFvPatchField<Type>::zeroGradientFvPatchField

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -34,6 +34,7 @@ const Foam::word& Foam::fvsPatchField<Type>::calculatedType()
return calculatedFvsPatchField<Type>::typeName; return calculatedFvsPatchField<Type>::typeName;
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type> template<class Type>
@ -127,4 +128,14 @@ Foam::fvsPatchField<Type>::NewCalculatedType
} }
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::calculatedFvsPatchField<Type>::write(Ostream& os) const
{
fvsPatchField<Type>::write(os);
writeEntry(os, "value", *this);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -105,6 +105,11 @@ public:
new calculatedFvsPatchField<Type>(*this, iF) new calculatedFvsPatchField<Type>(*this, iF)
); );
} }
// Member Functions
//- Write
virtual void write(Ostream&) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,7 @@ License
#include "coupledFvsPatchField.H" #include "coupledFvsPatchField.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type> template<class Type>
Foam::coupledFvsPatchField<Type>::coupledFvsPatchField Foam::coupledFvsPatchField<Type>::coupledFvsPatchField
@ -86,4 +86,14 @@ Foam::coupledFvsPatchField<Type>::coupledFvsPatchField
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::coupledFvsPatchField<Type>::write(Ostream& os) const
{
fvsPatchField<Type>::write(os);
writeEntry(os, "value", *this);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -120,6 +120,9 @@ public:
{ {
return true; return true;
} }
//- Write
virtual void write(Ostream&) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,7 @@ License
#include "fixedValueFvsPatchField.H" #include "fixedValueFvsPatchField.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type> template<class Type>
Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField
@ -77,43 +77,10 @@ Foam::fixedValueFvsPatchField<Type>::fixedValueFvsPatchField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type> template<class Type>
Foam::tmp<Foam::Field<Type>> void Foam::fixedValueFvsPatchField<Type>::write(Ostream& os) const
Foam::fixedValueFvsPatchField<Type>::valueInternalCoeffs
(
const tmp<scalarField>&
) const
{ {
return tmp<Field<Type>> fvsPatchField<Type>::write(os);
( writeEntry(os, "value", *this);
new Field<Type>(this->size(), Zero)
);
}
template<class Type>
Foam::tmp<Foam::Field<Type>>
Foam::fixedValueFvsPatchField<Type>::valueBoundaryCoeffs
(
const tmp<scalarField>&
) const
{
return *this;
}
template<class Type>
Foam::tmp<Foam::Field<Type>>
Foam::fixedValueFvsPatchField<Type>::gradientInternalCoeffs() const
{
return -pTraits<Type>::one*this->patch().deltaCoeffs();
}
template<class Type>
Foam::tmp<Foam::Field<Type>>
Foam::fixedValueFvsPatchField<Type>::gradientBoundaryCoeffs() const
{
return this->patch().deltaCoeffs()*(*this);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -124,29 +124,8 @@ public:
} }
// Evaluation functions //- Write
virtual void write(Ostream&) const;
//- Return the matrix diagonal coefficients corresponding to the
// evaluation of the value of this patchField with given weights
virtual tmp<Field<Type>> valueInternalCoeffs
(
const tmp<scalarField>&
) const;
//- Return the matrix source coefficients corresponding to the
// evaluation of the value of this patchField with given weights
virtual tmp<Field<Type>> valueBoundaryCoeffs
(
const tmp<scalarField>&
) const;
//- Return the matrix diagonal coefficients corresponding to the
// evaluation of the gradient of this patchField
virtual tmp<Field<Type>> gradientInternalCoeffs() const;
//- Return the matrix source coefficients corresponding to the
// evaluation of the gradient of this patchField
virtual tmp<Field<Type>> gradientBoundaryCoeffs() const;
// Member Operators // Member Operators

View File

@ -1,44 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "nonConformalCalculatedFvsPatchFields.H"
#include "fvsPatchFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeTemplateFvsPatchTypeField(label, nonConformalCalculated);
makeFvsPatchFields(nonConformalCalculated);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,50 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef nonConformalCalculatedFvsPatchFields_H
#define nonConformalCalculatedFvsPatchFields_H
#include "nonConformalCalculatedFvsPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeFvsPatchTypeFieldTypedef(label, nonConformalCalculated);
makeFvsPatchTypeFieldTypedefs(nonConformalCalculated);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,56 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
InClass
Foam::nonConformalCalculatedFvsPatchField
Description
\*---------------------------------------------------------------------------*/
#ifndef nonConformalCalculatedFvsPatchFieldsFwd_H
#define nonConformalCalculatedFvsPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class nonConformalCalculatedFvsPatchField;
makeFvsPatchTypeFieldTypedef(label, nonConformalCalculated);
makeFvsPatchTypeFieldTypedefs(nonConformalCalculated);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,7 @@ License
#include "slicedFvsPatchField.H" #include "slicedFvsPatchField.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type> template<class Type>
Foam::slicedFvsPatchField<Type>::slicedFvsPatchField Foam::slicedFvsPatchField<Type>::slicedFvsPatchField
@ -85,6 +85,8 @@ Foam::slicedFvsPatchField<Type>::clone
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type> template<class Type>
Foam::slicedFvsPatchField<Type>::~slicedFvsPatchField() Foam::slicedFvsPatchField<Type>::~slicedFvsPatchField()
{ {
@ -94,4 +96,14 @@ Foam::slicedFvsPatchField<Type>::~slicedFvsPatchField()
} }
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::slicedFvsPatchField<Type>::write(Ostream& os) const
{
fvsPatchField<Type>::write(os);
writeEntry(os, "value", *this);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -116,6 +116,10 @@ public:
} }
//- Write
virtual void write(Ostream&) const;
// Member Operators // Member Operators
virtual void operator=(const UList<Type>&) {} virtual void operator=(const UList<Type>&) {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -96,4 +96,14 @@ Foam::internalFvsPatchField<Type>::internalFvsPatchField
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::internalFvsPatchField<Type>::write(Ostream& os) const
{
fvsPatchField<Type>::write(os);
writeEntry(os, "value", *this);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation \\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -107,6 +107,12 @@ public:
new internalFvsPatchField<Type>(*this, iF) new internalFvsPatchField<Type>(*this, iF)
); );
} }
// Member Functions
//- Write
virtual void write(Ostream&) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -97,4 +97,14 @@ Foam::nonConformalErrorFvsPatchField<Type>::nonConformalErrorFvsPatchField
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::nonConformalErrorFvsPatchField<Type>::write(Ostream& os) const
{
fvsPatchField<Type>::write(os);
writeEntry(os, "value", *this);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -111,6 +111,12 @@ public:
new nonConformalErrorFvsPatchField<Type>(*this, iF) new nonConformalErrorFvsPatchField<Type>(*this, iF)
); );
} }
// Member Functions
//- Write
virtual void write(Ostream&) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -94,4 +94,14 @@ Foam::symmetryFvsPatchField<Type>::symmetryFvsPatchField
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::symmetryFvsPatchField<Type>::write(Ostream& os) const
{
fvsPatchField<Type>::write(os);
writeEntry(os, "value", *this);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -106,6 +106,12 @@ public:
new symmetryFvsPatchField<Type>(*this, iF) new symmetryFvsPatchField<Type>(*this, iF)
); );
} }
// Member Functions
//- Write
virtual void write(Ostream&) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -94,4 +94,14 @@ Foam::symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::symmetryPlaneFvsPatchField<Type>::write(Ostream& os) const
{
fvsPatchField<Type>::write(os);
writeEntry(os, "value", *this);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -110,6 +110,12 @@ public:
new symmetryPlaneFvsPatchField<Type>(*this, iF) new symmetryPlaneFvsPatchField<Type>(*this, iF)
); );
} }
// Member Functions
//- Write
virtual void write(Ostream&) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -94,4 +94,14 @@ Foam::wedgeFvsPatchField<Type>::wedgeFvsPatchField
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::wedgeFvsPatchField<Type>::write(Ostream& os) const
{
fvsPatchField<Type>::write(os);
writeEntry(os, "value", *this);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -106,6 +106,12 @@ public:
new wedgeFvsPatchField<Type>(*this, iF) new wedgeFvsPatchField<Type>(*this, iF)
); );
} }
// Member Functions
//- Write
virtual void write(Ostream&) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -23,75 +23,83 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "nonConformalCalculatedFvsPatchField.H" #include "nonConformalPolyFacesFvsPatchLabelField.H"
#include "fvPatchFieldMapper.H" #include "fvPatchFieldMapper.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type> Foam::nonConformalPolyFacesFvsPatchLabelField::
Foam::nonConformalCalculatedFvsPatchField<Type>:: nonConformalPolyFacesFvsPatchLabelField
nonConformalCalculatedFvsPatchField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF const DimensionedField<label, surfaceMesh>& iF
) )
: :
fvsPatchField<Type>(p, iF) fvsPatchLabelField(p, iF)
{} {}
template<class Type> Foam::nonConformalPolyFacesFvsPatchLabelField::
Foam::nonConformalCalculatedFvsPatchField<Type>:: nonConformalPolyFacesFvsPatchLabelField
nonConformalCalculatedFvsPatchField
( (
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF, const DimensionedField<label, surfaceMesh>& iF,
const dictionary& dict const dictionary& dict
) )
: :
fvsPatchField<Type> fvsPatchLabelField(p, iF, dict, false)
{
labelField::operator=
( (
p, labelField("value", dict, dict.lookup<label>("size"))
iF, );
Field<Type>("value", dict, dict.lookup<label>("size")) }
)
{}
template<class Type> Foam::nonConformalPolyFacesFvsPatchLabelField::
Foam::nonConformalCalculatedFvsPatchField<Type>:: nonConformalPolyFacesFvsPatchLabelField
nonConformalCalculatedFvsPatchField
( (
const nonConformalCalculatedFvsPatchField<Type>& ptf, const nonConformalPolyFacesFvsPatchLabelField& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF, const DimensionedField<label, surfaceMesh>& iF,
const fvPatchFieldMapper& mapper const fvPatchFieldMapper& mapper
) )
: :
fvsPatchField<Type>(ptf, p, iF, mapper) fvsPatchLabelField(ptf, p, iF, mapper)
{} {}
template<class Type> Foam::nonConformalPolyFacesFvsPatchLabelField::
Foam::nonConformalCalculatedFvsPatchField<Type>:: nonConformalPolyFacesFvsPatchLabelField
nonConformalCalculatedFvsPatchField
( (
const nonConformalCalculatedFvsPatchField<Type>& ptf, const nonConformalPolyFacesFvsPatchLabelField& ptf,
const DimensionedField<Type, surfaceMesh>& iF const DimensionedField<label, surfaceMesh>& iF
) )
: :
fvsPatchField<Type>(ptf, iF) fvsPatchLabelField(ptf, iF)
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type> void Foam::nonConformalPolyFacesFvsPatchLabelField::write(Ostream& os) const
void Foam::nonConformalCalculatedFvsPatchField<Type>::write(Ostream& os) const
{ {
fvsPatchField<Type>::write(os); fvsPatchLabelField::write(os);
writeEntry(os, "size", this->size()); writeEntry(os, "size", this->size());
writeEntry(os, "value", *this);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeFvsPatchTypeField
(
fvsPatchLabelField,
nonConformalPolyFacesFvsPatchLabelField
);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,20 +22,17 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::nonConformalCalculatedFvsPatchField Foam::nonConformalPolyFacesFvsPatchLabelField
Description
Foam::nonConformalCalculatedFvsPatchField
SourceFiles SourceFiles
nonConformalCalculatedFvsPatchField.C nonConformalPolyFacesFvsPatchLabelField.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef nonConformalCalculatedFvsPatchField_H #ifndef nonConformalPolyFacesFvsPatchLabelField_H
#define nonConformalCalculatedFvsPatchField_H #define nonConformalPolyFacesFvsPatchLabelField_H
#include "fvsPatchField.H" #include "fvsPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,86 +40,74 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class nonConformalCalculatedFvsPatch Declaration Class nonConformalPolyFacesFvsPatchLabel Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class Type> class nonConformalPolyFacesFvsPatchLabelField
class nonConformalCalculatedFvsPatchField
: :
public fvsPatchField<Type> public fvsPatchLabelField
{ {
public: public:
//- Runtime type information //- Runtime type information
TypeName("nonConformalCalculated"); TypeName("nonConformalPolyFaces");
// Constructors // Constructors
//- Construct from patch and internal field //- Construct from patch and internal field
nonConformalCalculatedFvsPatchField nonConformalPolyFacesFvsPatchLabelField
( (
const fvPatch&, const fvPatch&,
const DimensionedField<Type, surfaceMesh>& const DimensionedField<label, surfaceMesh>&
); );
//- Construct from patch, internal field and dictionary //- Construct from patch, internal field and dictionary
nonConformalCalculatedFvsPatchField nonConformalPolyFacesFvsPatchLabelField
( (
const fvPatch&, const fvPatch&,
const DimensionedField<Type, surfaceMesh>&, const DimensionedField<label, surfaceMesh>&,
const dictionary& const dictionary&
); );
//- Construct by mapping given patchField<Type> onto a new patch //- Construct by mapping given patchField<Type> onto a new patch
nonConformalCalculatedFvsPatchField nonConformalPolyFacesFvsPatchLabelField
( (
const nonConformalCalculatedFvsPatchField<Type>&, const nonConformalPolyFacesFvsPatchLabelField&,
const fvPatch&, const fvPatch&,
const DimensionedField<Type, surfaceMesh>&, const DimensionedField<label, surfaceMesh>&,
const fvPatchFieldMapper& const fvPatchFieldMapper&
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference
nonConformalCalculatedFvsPatchField nonConformalPolyFacesFvsPatchLabelField
( (
const nonConformalCalculatedFvsPatchField<Type>& const nonConformalPolyFacesFvsPatchLabelField&
) = delete; ) = delete;
//- Copy constructor setting internal field reference //- Copy constructor setting internal field reference
nonConformalCalculatedFvsPatchField nonConformalPolyFacesFvsPatchLabelField
( (
const nonConformalCalculatedFvsPatchField<Type>&, const nonConformalPolyFacesFvsPatchLabelField&,
const DimensionedField<Type, surfaceMesh>& const DimensionedField<label, surfaceMesh>&
); );
//- Construct and return a clone setting internal field reference //- Construct and return a clone setting internal field reference
virtual tmp<fvsPatchField<Type>> clone virtual tmp<fvsPatchLabelField> clone
( (
const DimensionedField<Type, surfaceMesh>& iF const DimensionedField<label, surfaceMesh>& iF
) const ) const
{ {
return tmp<fvsPatchField<Type>> return tmp<fvsPatchLabelField>
( (
new nonConformalCalculatedFvsPatchField<Type>(*this, iF) new nonConformalPolyFacesFvsPatchLabelField(*this, iF)
); );
} }
// Member Functions // Member Functions
// Attributes
//- Return true if this patch field fixes a value.
// Needed to check if a level has to be specified while solving
// Poissons equations.
virtual bool fixesValue() const
{
return true;
}
//- Write //- Write
virtual void write(Ostream&) const; virtual void write(Ostream&) const;
}; };
@ -134,12 +119,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "nonConformalCalculatedFvsPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,103 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "polyFacesFvsPatchLabelField.H"
#include "fvPatchFieldMapper.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::polyFacesFvsPatchLabelField::init()
{
labelField::operator=(identityMap(patch().size()) + patch().start());
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::polyFacesFvsPatchLabelField::polyFacesFvsPatchLabelField
(
const fvPatch& p,
const DimensionedField<label, surfaceMesh>& iF
)
:
fvsPatchLabelField(p, iF)
{
init();
}
Foam::polyFacesFvsPatchLabelField::polyFacesFvsPatchLabelField
(
const fvPatch& p,
const DimensionedField<label, surfaceMesh>& iF,
const dictionary& dict
)
:
fvsPatchLabelField(p, iF, dict, false)
{
init();
}
Foam::polyFacesFvsPatchLabelField::polyFacesFvsPatchLabelField
(
const polyFacesFvsPatchLabelField& ptf,
const fvPatch& p,
const DimensionedField<label, surfaceMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fvsPatchLabelField(ptf, p, iF, mapper, false)
{
init();
}
Foam::polyFacesFvsPatchLabelField::polyFacesFvsPatchLabelField
(
const polyFacesFvsPatchLabelField& ptf,
const DimensionedField<label, surfaceMesh>& iF
)
:
fvsPatchLabelField(ptf, iF)
{
init();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeFvsPatchTypeField
(
fvsPatchLabelField,
polyFacesFvsPatchLabelField
);
}
// ************************************************************************* //

View File

@ -0,0 +1,125 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::polyFacesFvsPatchLabelField
SourceFiles
polyFacesFvsPatchLabelField.C
\*---------------------------------------------------------------------------*/
#ifndef polyFacesFvsPatchLabelField_H
#define polyFacesFvsPatchLabelField_H
#include "fvsPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class polyFacesFvsPatchLabelField Declaration
\*---------------------------------------------------------------------------*/
class polyFacesFvsPatchLabelField
:
public fvsPatchLabelField
{
private:
// Private Member Functions
//- Initialise
void init();
public:
//- Runtime type information
TypeName("polyFaces");
// Constructors
//- Construct from patch and internal field
polyFacesFvsPatchLabelField
(
const fvPatch&,
const DimensionedField<label, surfaceMesh>&
);
//- Construct from patch, internal field and dictionary
polyFacesFvsPatchLabelField
(
const fvPatch&,
const DimensionedField<label, surfaceMesh>&,
const dictionary&
);
//- Construct by mapping given patchField<Type> onto a new patch
polyFacesFvsPatchLabelField
(
const polyFacesFvsPatchLabelField&,
const fvPatch&,
const DimensionedField<label, surfaceMesh>&,
const fvPatchFieldMapper&
);
//- Disallow copy without setting internal field reference
polyFacesFvsPatchLabelField
(
const polyFacesFvsPatchLabelField&
) = delete;
//- Copy constructor setting internal field reference
polyFacesFvsPatchLabelField
(
const polyFacesFvsPatchLabelField&,
const DimensionedField<label, surfaceMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvsPatchLabelField> clone
(
const DimensionedField<label, surfaceMesh>& iF
) const
{
return tmp<fvsPatchLabelField>
(
new polyFacesFvsPatchLabelField(*this, iF)
);
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -60,33 +60,21 @@ Foam::fvsPatchField<Type>::fvsPatchField
template<class Type> template<class Type>
Foam::fvsPatchField<Type>::fvsPatchField Foam::fvsPatchField<Type>::fvsPatchField
( (
const fvsPatchField<Type>& ptf,
const fvPatch& p, const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF, const DimensionedField<Type, surfaceMesh>& iF,
const fvPatchFieldMapper& mapper const dictionary& dict,
) const bool valueRequired
:
Field<Type>(mapper(ptf)),
patch_(p),
internalField_(iF)
{}
template<class Type>
Foam::fvsPatchField<Type>::fvsPatchField
(
const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF,
const dictionary& dict
) )
: :
Field<Type>(p.size()), Field<Type>(p.size()),
patch_(p), patch_(p),
internalField_(iF) internalField_(iF)
{
if (valueRequired)
{ {
if (dict.found("value")) if (dict.found("value"))
{ {
fvsPatchField<Type>::operator= Field<Type>::operator=
( (
Field<Type>("value", dict, p.size()) Field<Type>("value", dict, p.size())
); );
@ -100,6 +88,28 @@ Foam::fvsPatchField<Type>::fvsPatchField
<< exit(FatalIOError); << exit(FatalIOError);
} }
} }
}
template<class Type>
Foam::fvsPatchField<Type>::fvsPatchField
(
const fvsPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF,
const fvPatchFieldMapper& mapper,
const bool mappingRequired
)
:
Field<Type>(p.size()),
patch_(p),
internalField_(iF)
{
if (mappingRequired)
{
mapper(*this, ptf);
}
}
template<class Type> template<class Type>
@ -163,8 +173,6 @@ void Foam::fvsPatchField<Type>::write(Ostream& os) const
{ {
writeEntry(os, "patchType", patch().type()); writeEntry(os, "patchType", patch().type());
} }
writeEntry(os, "value", *this);
} }

View File

@ -167,7 +167,8 @@ public:
( (
const fvPatch&, const fvPatch&,
const DimensionedField<Type, surfaceMesh>&, const DimensionedField<Type, surfaceMesh>&,
const dictionary& const dictionary&,
const bool valueRequired=true
); );
//- Construct by mapping the given fvsPatchField onto a new patch //- Construct by mapping the given fvsPatchField onto a new patch
@ -176,7 +177,8 @@ public:
const fvsPatchField<Type>&, const fvsPatchField<Type>&,
const fvPatch&, const fvPatch&,
const DimensionedField<Type, surfaceMesh>&, const DimensionedField<Type, surfaceMesh>&,
const fvPatchFieldMapper& const fvPatchFieldMapper&,
const bool mappingRequired=true
); );
//- Disallow copy without setting internal field reference //- Disallow copy without setting internal field reference

View File

@ -67,11 +67,17 @@ void Foam::fvCellSet::writeFileHeader
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fvCellSet::fvCellSet Foam::fvCellSet::fvCellSet(const fvMesh& mesh)
( :
const fvMesh& mesh, polyCellSet(mesh),
const dictionary& dict mesh_(mesh),
) V_(NaN)
{
setV();
}
Foam::fvCellSet::fvCellSet(const fvMesh& mesh, const dictionary& dict)
: :
polyCellSet(mesh, dict), polyCellSet(mesh, dict),
mesh_(mesh), mesh_(mesh),

View File

@ -118,12 +118,11 @@ public:
// Constructors // Constructors
//- Construct from mesh. Will select all.
fvCellSet(const fvMesh& mesh);
//- Construct from mesh and dictionary //- Construct from mesh and dictionary
fvCellSet fvCellSet(const fvMesh& mesh, const dictionary& dict);
(
const fvMesh& mesh,
const dictionary& dict
);
//- Destructor //- Destructor

View File

@ -37,7 +37,8 @@ License
#include "fvMeshMover.H" #include "fvMeshMover.H"
#include "fvMeshStitcher.H" #include "fvMeshStitcher.H"
#include "nonConformalFvPatch.H" #include "nonConformalFvPatch.H"
#include "nonConformalCalculatedFvsPatchFields.H" #include "polyFacesFvsPatchLabelField.H"
#include "nonConformalPolyFacesFvsPatchLabelField.H"
#include "polyTopoChangeMap.H" #include "polyTopoChangeMap.H"
#include "MapFvFields.H" #include "MapFvFields.H"
#include "fvMeshMapper.H" #include "fvMeshMapper.H"
@ -287,7 +288,7 @@ Foam::wordList Foam::fvMesh::polyFacesPatchTypes() const
wordList wantedPatchTypes wordList wantedPatchTypes
( (
boundary().size(), boundary().size(),
calculatedFvsPatchLabelField::typeName polyFacesFvsPatchLabelField::typeName
); );
forAll(boundary(), patchi) forAll(boundary(), patchi)
@ -297,7 +298,7 @@ Foam::wordList Foam::fvMesh::polyFacesPatchTypes() const
if (isA<nonConformalFvPatch>(fvp)) if (isA<nonConformalFvPatch>(fvp))
{ {
wantedPatchTypes[patchi] = wantedPatchTypes[patchi] =
nonConformalCalculatedFvsPatchLabelField::typeName; nonConformalPolyFacesFvsPatchLabelField::typeName;
} }
} }
@ -929,13 +930,6 @@ const Foam::surfaceLabelField::Boundary& Foam::fvMesh::polyFacesBf() const
polyFacesPatchTypes(), polyFacesPatchTypes(),
boundaryMesh().types() boundaryMesh().types()
); );
forAll(boundary(), patchi)
{
const polyPatch& pp = boundaryMesh()[patchi];
(*polyFacesBfPtr_)[patchi] =
labelList(identityMap(pp.size()) + pp.start());
}
} }
return *polyFacesBfPtr_; return *polyFacesBfPtr_;
@ -1681,8 +1675,8 @@ bool Foam::fvMesh::writeObject
if (!conformal()) if (!conformal())
{ {
// Create a full surface field with the polyFacesBf boundary field then // Create a full surface field with the polyFacesBf boundary field to
// overwrite all conformal faces with an index of -1 to save disk space // write to disk. Make the internal field uniform to save disk space.
surfaceLabelField polyFaces surfaceLabelField polyFaces
( (
@ -1693,15 +1687,6 @@ bool Foam::fvMesh::writeObject
*polyFacesBfPtr_ *polyFacesBfPtr_
); );
forAll(boundary(), patchi)
{
const fvPatch& fvp = boundary()[patchi];
if (!isA<nonConformalFvPatch>(fvp))
{
polyFaces.boundaryFieldRef()[patchi] = -1;
}
}
ok = ok & polyFaces.write(write); ok = ok & polyFaces.write(write);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -1302,23 +1302,12 @@ bool Foam::fvMeshStitcher::connect
if (fileHandler().isFile(polyFacesBfIO.objectPath(false))) if (fileHandler().isFile(polyFacesBfIO.objectPath(false)))
{ {
haveTopology = true; polyFacesBf.reset
// Read the boundary field but then set default values for conformal
// patches as these patches will have had a uniform invalid index
// set in order to save disk space
surfaceLabelField::Boundary polyFacesBfRead
( (
surfaceLabelField::null(),
surfaceLabelField(polyFacesBfIO, mesh_).boundaryField() surfaceLabelField(polyFacesBfIO, mesh_).boundaryField()
); );
forAll(mesh_.boundary(), patchi)
{ haveTopology = true;
if (isA<nonConformalFvPatch>(mesh_.boundary()[patchi]))
{
polyFacesBf[patchi] = polyFacesBfRead[patchi];
}
}
} }
} }

View File

@ -44,5 +44,6 @@ zeroDimensional/zeroDimensionalFvModel/zeroDimensionalFvModel.C
zeroDimensional/constraintSource/constraintSource.C zeroDimensional/constraintSource/constraintSource.C
zeroDimensional/densityConstraintSource/densityConstraintSource.C zeroDimensional/densityConstraintSource/densityConstraintSource.C
zeroDimensional/pressureConstraintSource/pressureConstraintSource.C zeroDimensional/pressureConstraintSource/pressureConstraintSource.C
zeroDimensional/zeroDimensionalMassSource/zeroDimensionalMassSource.C
LIB = $(FOAM_LIBBIN)/libfvModels LIB = $(FOAM_LIBBIN)/libfvModels

View File

@ -40,7 +40,7 @@ namespace fv
} }
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::fv::massSource::readCoeffs() void Foam::fv::massSource::readCoeffs()
{ {
@ -85,6 +85,12 @@ void Foam::fv::massSource::readCoeffs()
} }
Foam::scalar Foam::fv::massSource::massFlowRate() const
{
return massFlowRate_->value(mesh().time().userTimeValue());
}
template<class Type> template<class Type>
void Foam::fv::massSource::addGeneralSupType void Foam::fv::massSource::addGeneralSupType
( (
@ -92,9 +98,9 @@ void Foam::fv::massSource::addGeneralSupType
const word& fieldName const word& fieldName
) const ) const
{ {
const scalar t = mesh().time().userTimeValue(); const scalar massFlowRate = this->massFlowRate();
const scalar massFlowRate = massFlowRate_->value(t); const Type value =
const Type value = fieldValues_[fieldName]->value<Type>(t); fieldValues_[fieldName]->value<Type>(mesh().time().userTimeValue());
const labelUList cells = set_.cells(); const labelUList cells = set_.cells();
@ -127,8 +133,7 @@ void Foam::fv::massSource::addSupType
if (fieldName == rhoName_) if (fieldName == rhoName_)
{ {
const scalar t = mesh().time().userTimeValue(); const scalar massFlowRate = this->massFlowRate();
const scalar massFlowRate = massFlowRate_->value(t);
forAll(cells, i) forAll(cells, i)
{ {
@ -146,9 +151,9 @@ void Foam::fv::massSource::addSupType
<< endl; << endl;
} }
const scalar t = mesh().time().userTimeValue(); const scalar massFlowRate = this->massFlowRate();
const scalar massFlowRate = massFlowRate_->value(t); const scalar T =
const scalar T = fieldValues_[TName_]->value<scalar>(t); fieldValues_[TName_]->value<scalar>(mesh().time().userTimeValue());
const basicThermo& thermo = const basicThermo& thermo =
mesh().lookupObject<basicThermo> mesh().lookupObject<basicThermo>
( (
@ -204,11 +209,12 @@ Foam::fv::massSource::massSource
const word& name, const word& name,
const word& modelType, const word& modelType,
const fvMesh& mesh, const fvMesh& mesh,
const dictionary& dict const dictionary& dict,
const bool all
) )
: :
fvModel(name, modelType, mesh, dict), fvModel(name, modelType, mesh, dict),
set_(mesh, coeffs()), set_(all ? fvCellSet(mesh) : fvCellSet(mesh, coeffs())),
phaseName_(), phaseName_(),
rhoName_(), rhoName_(),
heName_(), heName_(),

View File

@ -83,7 +83,9 @@ class massSource
: :
public fvModel public fvModel
{ {
// Private Data protected:
// Protected Data
//- The set of cells the fvConstraint applies to //- The set of cells the fvConstraint applies to
fvCellSet set_; fvCellSet set_;
@ -107,11 +109,14 @@ class massSource
HashPtrTable<unknownTypeFunction1> fieldValues_; HashPtrTable<unknownTypeFunction1> fieldValues_;
// Private Member Functions // Protected Member Functions
//- Non-virtual read //- Non-virtual read
void readCoeffs(); void readCoeffs();
//- Return the mass flow rate
virtual scalar massFlowRate() const;
// Sources // Sources
@ -164,7 +169,8 @@ public:
const word& name, const word& name,
const word& modelType, const word& modelType,
const fvMesh& mesh, const fvMesh& mesh,
const dictionary& dict const dictionary& dict,
const bool all=false
); );
//- Disallow default bitwise copy construction //- Disallow default bitwise copy construction

View File

@ -0,0 +1,130 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-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 "zeroDimensionalMassSource.H"
#include "basicThermo.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(zeroDimensionalMassSource, 0);
addToRunTimeSelectionTable(fvModel, zeroDimensionalMassSource, dictionary);
}
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::fv::zeroDimensionalMassSource::readCoeffs()
{
const basicThermo& thermo =
mesh().lookupObject<basicThermo>
(
IOobject::groupName(physicalProperties::typeName, phaseName_)
);
rho0Ptr_.reset
(
new volScalarField::Internal
(
IOobject
(
typedName("rho0"),
mesh().time().timeName(),
mesh(),
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
thermo.rho()().internalField()
)
);
}
Foam::scalar Foam::fv::zeroDimensionalMassSource::massFlowRate() const
{
const scalar t = mesh().time().userTimeValue();
const scalar t0 = mesh().time().beginTime().value();
const scalar mDot = massFlowRate_->value(t);
const scalar sumMDot = massFlowRate_->integral(t0, t);
const basicThermo& thermo =
mesh().lookupObject<basicThermo>
(
IOobject::groupName(physicalProperties::typeName, phaseName_)
);
return mDot*thermo.rho()()[0]/(rho0Ptr_()[0] + sumMDot/mesh().V()[0]);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fv::zeroDimensionalMassSource::zeroDimensionalMassSource
(
const word& name,
const word& modelType,
const fvMesh& mesh,
const dictionary& dict
)
:
massSource(name, modelType, mesh, dict, true),
rho0Ptr_()
{
if (mesh.nGeometricD() != 0)
{
FatalIOErrorInFunction(dict)
<< "Zero-dimensional fvModel applied to a "
<< mesh.nGeometricD() << "-dimensional mesh"
<< exit(FatalIOError);
}
readCoeffs();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::fv::zeroDimensionalMassSource::read(const dictionary& dict)
{
if (fvModel::read(dict))
{
massSource::readCoeffs();
readCoeffs();
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,135 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021-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::fv::zeroDimensionalMassSource
Description
This fvModel applies a mass source to the continuity equation and to all
field equations, in a zero-dimensional case. Correction is made to account
for the mass that exits the domain due to expansion in space, so that the
model correctly applies a total mass flow rate.
Usage
Example usage:
\verbatim
zeroDimensionalMassSource
{
type zeroDimensionalMassSource;
massFlowRate 1e-4;
fieldValues
{
U (10 0 0);
T 300;
k 0.375;
epsilon 14.855;
}
}
\endverbatim
Values should be provided for all solved for fields. Warnings will be
issued if values are not provided for fields for which transport equations
are solved. Warnings will also be issued if values are provided for fields
which are not solved for.
SourceFiles
zeroDimensionalMassSource.C
\*---------------------------------------------------------------------------*/
#ifndef zeroDimensionalMassSource_H
#define zeroDimensionalMassSource_H
#include "massSource.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class zeroDimensionalMassSource Declaration
\*---------------------------------------------------------------------------*/
class zeroDimensionalMassSource
:
public massSource
{
protected:
// Protected Data
//- Cached initial density field
autoPtr<volScalarField::Internal> rho0Ptr_;
// Protected Member Functions
//- Non-virtual read
void readCoeffs();
//- Return the mass flow rate
virtual scalar massFlowRate() const;
public:
//- Runtime type information
TypeName("zeroDimensionalMassSource");
// Constructors
//- Construct from explicit source name and mesh
zeroDimensionalMassSource
(
const word& name,
const word& modelType,
const fvMesh& mesh,
const dictionary& dict
);
// Member Functions
// IO
//- Read source dictionary
virtual bool read(const dictionary& dict);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -266,6 +266,6 @@ nonConformal/pointPatchFields/nonConformalCyclic/nonConformalCyclicPointPatchFie
nonConformal/pointPatchFields/nonConformalError/nonConformalErrorPointPatchFields.C nonConformal/pointPatchFields/nonConformalError/nonConformalErrorPointPatchFields.C
nonConformal/pointPatchFields/nonConformalProcessorCyclic/nonConformalProcessorCyclicPointPatchFields.C nonConformal/pointPatchFields/nonConformalProcessorCyclic/nonConformalProcessorCyclicPointPatchFields.C
nonConformalBoundary/nonConformalBoundary.C nonConformal/boundary/nonConformalBoundary.C
LIB = $(FOAM_LIBBIN)/libmeshTools LIB = $(FOAM_LIBBIN)/libmeshTools

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -37,7 +37,57 @@ namespace Foam
} }
// * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::mappedInternalPolyPatch::initCalcGeometry(PstreamBuffers& pBufs)
{
polyPatch::initCalcGeometry(pBufs);
}
void Foam::mappedInternalPolyPatch::calcGeometry(PstreamBuffers& pBufs)
{
polyPatch::calcGeometry(pBufs);
mappedInternalPatchBase::clearOut();
}
void Foam::mappedInternalPolyPatch::initMovePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
polyPatch::initMovePoints(pBufs, p);
}
void Foam::mappedInternalPolyPatch::movePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
polyPatch::movePoints(pBufs, p);
mappedInternalPatchBase::clearOut();
}
void Foam::mappedInternalPolyPatch::initTopoChange(PstreamBuffers& pBufs)
{
polyPatch::initTopoChange(pBufs);
}
void Foam::mappedInternalPolyPatch::topoChange(PstreamBuffers& pBufs)
{
polyPatch::topoChange(pBufs);
mappedInternalPatchBase::clearOut();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::mappedInternalPolyPatch::mappedInternalPolyPatch Foam::mappedInternalPolyPatch::mappedInternalPolyPatch
( (
@ -111,53 +161,6 @@ Foam::mappedInternalPolyPatch::~mappedInternalPolyPatch()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::mappedInternalPolyPatch::initCalcGeometry(PstreamBuffers& pBufs)
{
polyPatch::initCalcGeometry(pBufs);
}
void Foam::mappedInternalPolyPatch::calcGeometry(PstreamBuffers& pBufs)
{
polyPatch::calcGeometry(pBufs);
mappedInternalPatchBase::clearOut();
}
void Foam::mappedInternalPolyPatch::initMovePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
polyPatch::initMovePoints(pBufs, p);
}
void Foam::mappedInternalPolyPatch::movePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
polyPatch::movePoints(pBufs, p);
mappedInternalPatchBase::clearOut();
}
void Foam::mappedInternalPolyPatch::initTopoChange(PstreamBuffers& pBufs)
{
polyPatch::initTopoChange(pBufs);
}
void Foam::mappedInternalPolyPatch::topoChange(PstreamBuffers& pBufs)
{
polyPatch::topoChange(pBufs);
mappedInternalPatchBase::clearOut();
}
void Foam::mappedInternalPolyPatch::write(Ostream& os) const void Foam::mappedInternalPolyPatch::write(Ostream& os) const
{ {
polyPatch::write(os); polyPatch::write(os);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -216,7 +216,7 @@ Foam::mappedExtrudedWallPolyPatch::patchLocalPoints() const
} }
// * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::mappedExtrudedWallPolyPatch::mappedExtrudedWallPolyPatch Foam::mappedExtrudedWallPolyPatch::mappedExtrudedWallPolyPatch
( (

View File

@ -37,7 +37,59 @@ namespace Foam
} }
// * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::mappedPolyPatch::initCalcGeometry(PstreamBuffers& pBufs)
{
polyPatch::initCalcGeometry(pBufs);
}
void Foam::mappedPolyPatch::calcGeometry(PstreamBuffers& pBufs)
{
polyPatch::calcGeometry(pBufs);
mappedPatchBase::clearOut();
}
void Foam::mappedPolyPatch::initMovePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
polyPatch::initMovePoints(pBufs, p);
}
void Foam::mappedPolyPatch::movePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
polyPatch::movePoints(pBufs, p);
if (reMapAfterMove_)
{
mappedPatchBase::clearOut();
}
}
void Foam::mappedPolyPatch::initTopoChange(PstreamBuffers& pBufs)
{
polyPatch::initTopoChange(pBufs);
}
void Foam::mappedPolyPatch::topoChange(PstreamBuffers& pBufs)
{
polyPatch::topoChange(pBufs);
mappedPatchBase::clearOut();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::mappedPolyPatch::mappedPolyPatch Foam::mappedPolyPatch::mappedPolyPatch
( (
@ -117,56 +169,6 @@ Foam::mappedPolyPatch::~mappedPolyPatch()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::mappedPolyPatch::initCalcGeometry(PstreamBuffers& pBufs)
{
polyPatch::initCalcGeometry(pBufs);
}
void Foam::mappedPolyPatch::calcGeometry(PstreamBuffers& pBufs)
{
polyPatch::calcGeometry(pBufs);
mappedPatchBase::clearOut();
}
void Foam::mappedPolyPatch::initMovePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
polyPatch::initMovePoints(pBufs, p);
}
void Foam::mappedPolyPatch::movePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
polyPatch::movePoints(pBufs, p);
if (reMapAfterMove_)
{
mappedPatchBase::clearOut();
}
}
void Foam::mappedPolyPatch::initTopoChange(PstreamBuffers& pBufs)
{
polyPatch::initTopoChange(pBufs);
}
void Foam::mappedPolyPatch::topoChange(PstreamBuffers& pBufs)
{
polyPatch::topoChange(pBufs);
mappedPatchBase::clearOut();
}
void Foam::mappedPolyPatch::write(Ostream& os) const void Foam::mappedPolyPatch::write(Ostream& os) const
{ {
polyPatch::write(os); polyPatch::write(os);

View File

@ -42,8 +42,59 @@ namespace Foam
); );
} }
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * // void Foam::mappedWallPolyPatch::initCalcGeometry(PstreamBuffers& pBufs)
{
wallPolyPatch::initCalcGeometry(pBufs);
}
void Foam::mappedWallPolyPatch::calcGeometry(PstreamBuffers& pBufs)
{
wallPolyPatch::calcGeometry(pBufs);
mappedPatchBase::clearOut();
}
void Foam::mappedWallPolyPatch::initMovePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
wallPolyPatch::initMovePoints(pBufs, p);
}
void Foam::mappedWallPolyPatch::movePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
wallPolyPatch::movePoints(pBufs, p);
if (reMapAfterMove_)
{
mappedPatchBase::clearOut();
}
}
void Foam::mappedWallPolyPatch::initTopoChange(PstreamBuffers& pBufs)
{
wallPolyPatch::initTopoChange(pBufs);
}
void Foam::mappedWallPolyPatch::topoChange(PstreamBuffers& pBufs)
{
wallPolyPatch::topoChange(pBufs);
mappedPatchBase::clearOut();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::mappedWallPolyPatch::mappedWallPolyPatch Foam::mappedWallPolyPatch::mappedWallPolyPatch
( (
@ -146,56 +197,6 @@ Foam::mappedWallPolyPatch::~mappedWallPolyPatch()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::mappedWallPolyPatch::initCalcGeometry(PstreamBuffers& pBufs)
{
wallPolyPatch::initCalcGeometry(pBufs);
}
void Foam::mappedWallPolyPatch::calcGeometry(PstreamBuffers& pBufs)
{
wallPolyPatch::calcGeometry(pBufs);
mappedPatchBase::clearOut();
}
void Foam::mappedWallPolyPatch::initMovePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
wallPolyPatch::initMovePoints(pBufs, p);
}
void Foam::mappedWallPolyPatch::movePoints
(
PstreamBuffers& pBufs,
const pointField& p
)
{
wallPolyPatch::movePoints(pBufs, p);
if (reMapAfterMove_)
{
mappedPatchBase::clearOut();
}
}
void Foam::mappedWallPolyPatch::initTopoChange(PstreamBuffers& pBufs)
{
wallPolyPatch::initTopoChange(pBufs);
}
void Foam::mappedWallPolyPatch::topoChange(PstreamBuffers& pBufs)
{
wallPolyPatch::topoChange(pBufs);
mappedPatchBase::clearOut();
}
void Foam::mappedWallPolyPatch::write(Ostream& os) const void Foam::mappedWallPolyPatch::write(Ostream& os) const
{ {
wallPolyPatch::write(os); wallPolyPatch::write(os);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -145,11 +145,15 @@ Foam::labelUList Foam::polyCellSet::identityMap(const label len) const
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::polyCellSet::polyCellSet Foam::polyCellSet::polyCellSet(const polyMesh& mesh)
( :
const polyMesh& mesh, mesh_(mesh),
const dictionary& dict selectionType_(selectionTypes::all),
) cellSetName_(word::null)
{}
Foam::polyCellSet::polyCellSet(const polyMesh& mesh, const dictionary& dict)
: :
mesh_(mesh), mesh_(mesh),
selectionType_(selectionTypes::all), selectionType_(selectionTypes::all),

View File

@ -131,12 +131,11 @@ public:
// Constructors // Constructors
//- Construct from mesh. Will select all.
polyCellSet(const polyMesh& mesh);
//- Construct from mesh and dictionary //- Construct from mesh and dictionary
polyCellSet polyCellSet(const polyMesh& mesh, const dictionary& dict);
(
const polyMesh& mesh,
const dictionary& dict
);
//- Destructor //- Destructor

View File

@ -16,7 +16,7 @@ FoamFile
VoFCavitation VoFCavitation
{ {
type VoFCavitation; type compressible::VoFCavitation;
libs ("libcompressibleVoFCavitation.so"); libs ("libcompressibleVoFCavitation.so");