/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 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 .
Class
Foam::zeroGradientFvPatchField
Group
grpGenericBoundaryConditions
Description
This boundary condition applies a zero-gradient condition from the patch
internal field onto the patch faces.
Usage
Example of the boundary condition specification:
\verbatim
{
type zeroGradient;
}
\endverbatim
SourceFiles
zeroGradientFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef zeroGradientFvPatchField_H
#define zeroGradientFvPatchField_H
#include "fvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class zeroGradientFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template
class zeroGradientFvPatchField
:
public fvPatchField
{
public:
//- Runtime type information
TypeName("zeroGradient");
// Constructors
//- Construct from patch and internal field
zeroGradientFvPatchField
(
const fvPatch&,
const DimensionedField&
);
//- Construct from patch, internal field and dictionary
zeroGradientFvPatchField
(
const fvPatch&,
const DimensionedField&,
const dictionary&
);
//- Construct by mapping the given zeroGradientFvPatchField
// onto a new patch
zeroGradientFvPatchField
(
const zeroGradientFvPatchField&,
const fvPatch&,
const DimensionedField&,
const fvPatchFieldMapper&
);
//- Construct as copy
zeroGradientFvPatchField
(
const zeroGradientFvPatchField&
);
//- Construct and return a clone
virtual tmp> clone() const
{
return tmp>
(
new zeroGradientFvPatchField(*this)
);
}
//- Construct as copy setting internal field reference
zeroGradientFvPatchField
(
const zeroGradientFvPatchField&,
const DimensionedField&
);
//- Construct and return a clone setting internal field reference
virtual tmp> clone
(
const DimensionedField& iF
) const
{
return tmp>
(
new zeroGradientFvPatchField(*this, iF)
);
}
// Member functions
// Evaluation functions
//- Return gradient at boundary
virtual tmp> snGrad() const
{
return tmp>
(
new Field(this->size(), Zero)
);
}
//- Evaluate the patch field
virtual void evaluate
(
const Pstream::commsTypes commsType =
Pstream::commsTypes::blocking
);
//- Return the matrix diagonal coefficients corresponding to the
// evaluation of the value of this patchField with given weights
virtual tmp> valueInternalCoeffs
(
const tmp&
) const;
//- Return the matrix source coefficients corresponding to the
// evaluation of the value of this patchField with given weights
virtual tmp> valueBoundaryCoeffs
(
const tmp&
) const;
//- Return the matrix diagonal coefficients corresponding to the
// evaluation of the gradient of this patchField
virtual tmp> gradientInternalCoeffs() const;
//- Return the matrix source coefficients corresponding to the
// evaluation of the gradient of this patchField
virtual tmp> gradientBoundaryCoeffs() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "zeroGradientFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //