mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add finite-area extrapolatedCalculated BC
This commit is contained in:
@ -44,6 +44,7 @@ $(faPatchFields)/faPatchField/faPatchFields.C
|
||||
basicFaPatchFields = $(faPatchFields)/basic
|
||||
$(basicFaPatchFields)/basicSymmetry/basicSymmetryFaPatchFields.C
|
||||
$(basicFaPatchFields)/calculated/calculatedFaPatchFields.C
|
||||
$(basicFaPatchFields)/extrapolatedCalculated/extrapolatedCalculatedFaPatchFields.C
|
||||
$(basicFaPatchFields)/coupled/coupledFaPatchFields.C
|
||||
$(basicFaPatchFields)/zeroGradient/zeroGradientFaPatchFields.C
|
||||
$(basicFaPatchFields)/fixedValue/fixedValueFaPatchFields.C
|
||||
|
||||
@ -0,0 +1,117 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016 OpenFOAM Foundation
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "extrapolatedCalculatedFaPatchField.H"
|
||||
#include "faPatchFieldMapper.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::extrapolatedCalculatedFaPatchField<Type>::
|
||||
extrapolatedCalculatedFaPatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
)
|
||||
:
|
||||
calculatedFaPatchField<Type>(p, iF)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::extrapolatedCalculatedFaPatchField<Type>::
|
||||
extrapolatedCalculatedFaPatchField
|
||||
(
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
calculatedFaPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
|
||||
{
|
||||
calculatedFaPatchField<Type>::operator==(this->patchInternalField());
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::extrapolatedCalculatedFaPatchField<Type>::
|
||||
extrapolatedCalculatedFaPatchField
|
||||
(
|
||||
const extrapolatedCalculatedFaPatchField<Type>& ptf,
|
||||
const faPatch& p,
|
||||
const DimensionedField<Type, areaMesh>& iF,
|
||||
const faPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
calculatedFaPatchField<Type>(ptf, p, iF, mapper)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::extrapolatedCalculatedFaPatchField<Type>::
|
||||
extrapolatedCalculatedFaPatchField
|
||||
(
|
||||
const extrapolatedCalculatedFaPatchField<Type>& ptf
|
||||
)
|
||||
:
|
||||
calculatedFaPatchField<Type>(ptf)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::extrapolatedCalculatedFaPatchField<Type>::
|
||||
extrapolatedCalculatedFaPatchField
|
||||
(
|
||||
const extrapolatedCalculatedFaPatchField<Type>& ptf,
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
)
|
||||
:
|
||||
calculatedFaPatchField<Type>(ptf, iF)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
void Foam::extrapolatedCalculatedFaPatchField<Type>::evaluate
|
||||
(
|
||||
const Pstream::commsTypes
|
||||
)
|
||||
{
|
||||
if (!this->updated())
|
||||
{
|
||||
this->updateCoeffs();
|
||||
}
|
||||
|
||||
// Set to the internal field
|
||||
faPatchField<Type>::patchInternalField(*this);
|
||||
calculatedFaPatchField<Type>::evaluate();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,163 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016 OpenFOAM Foundation
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::extrapolatedCalculatedFaPatchField
|
||||
|
||||
Group
|
||||
grpGenericBoundaryConditions
|
||||
|
||||
Description
|
||||
This boundary condition applies a zero-gradient condition from the patch
|
||||
internal field onto the patch faces when \c evaluated but may also be
|
||||
assigned. \c snGrad returns the patch gradient evaluated from the current
|
||||
internal and patch field values rather than returning zero.
|
||||
|
||||
Usage
|
||||
Example of the boundary condition specification:
|
||||
\verbatim
|
||||
<patchName>
|
||||
{
|
||||
type extrapolatedCalculated;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
extrapolatedCalculatedFaPatchField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Foam_extrapolatedCalculatedFaPatchField_H
|
||||
#define Foam_extrapolatedCalculatedFaPatchField_H
|
||||
|
||||
#include "calculatedFaPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class extrapolatedCalculatedFaPatchField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class extrapolatedCalculatedFaPatchField
|
||||
:
|
||||
public calculatedFaPatchField<Type>
|
||||
{
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("extrapolatedCalculated");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
extrapolatedCalculatedFaPatchField
|
||||
(
|
||||
const faPatch&,
|
||||
const DimensionedField<Type, areaMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
extrapolatedCalculatedFaPatchField
|
||||
(
|
||||
const faPatch&,
|
||||
const DimensionedField<Type, areaMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given patchField onto a new patch
|
||||
extrapolatedCalculatedFaPatchField
|
||||
(
|
||||
const extrapolatedCalculatedFaPatchField<Type>&,
|
||||
const faPatch&,
|
||||
const DimensionedField<Type, areaMesh>&,
|
||||
const faPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
extrapolatedCalculatedFaPatchField
|
||||
(
|
||||
const extrapolatedCalculatedFaPatchField<Type>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<faPatchField<Type>> clone() const
|
||||
{
|
||||
return tmp<faPatchField<Type>>
|
||||
(
|
||||
new extrapolatedCalculatedFaPatchField<Type>(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
extrapolatedCalculatedFaPatchField
|
||||
(
|
||||
const extrapolatedCalculatedFaPatchField<Type>&,
|
||||
const DimensionedField<Type, areaMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<faPatchField<Type>> clone
|
||||
(
|
||||
const DimensionedField<Type, areaMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<faPatchField<Type>>
|
||||
(
|
||||
new extrapolatedCalculatedFaPatchField<Type>(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType=Pstream::commsTypes::blocking
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "extrapolatedCalculatedFaPatchField.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,46 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "extrapolatedCalculatedFaPatchFields.H"
|
||||
#include "faPatchFields.H"
|
||||
#include "areaFaMesh.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makeFaPatchFields(extrapolatedCalculated);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,50 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 Foam_extrapolatedCalculatedFaPatchFields_H
|
||||
#define Foam_extrapolatedCalculatedFaPatchFields_H
|
||||
|
||||
#include "extrapolatedCalculatedFaPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeFaPatchTypeFieldTypedefs(extrapolatedCalculated);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -54,7 +54,7 @@ extrapolatedCalculatedFvPatchField
|
||||
:
|
||||
calculatedFvPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
|
||||
{
|
||||
evaluate();
|
||||
calculatedFvPatchField<Type>::operator==(this->patchInternalField());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user