surfaceNormalFixedValueFvPatchVectorField: Update fixedValue field to handle mesh-motion

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1667
This commit is contained in:
Henry 2015-04-27 20:22:01 +01:00
parent 6b0d3634d1
commit a7ec2f7fd4
3 changed files with 27 additions and 18 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -26,15 +26,10 @@ License
#include "fixedMeanFvPatchField.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
Foam::fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
@ -46,7 +41,7 @@ fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
template<class Type>
fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
Foam::fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
(
const fixedMeanFvPatchField<Type>& ptf,
const fvPatch& p,
@ -60,7 +55,7 @@ fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
template<class Type>
fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
Foam::fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
@ -73,7 +68,7 @@ fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
template<class Type>
fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
Foam::fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
(
const fixedMeanFvPatchField<Type>& ptf
)
@ -84,7 +79,7 @@ fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
template<class Type>
fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
Foam::fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
(
const fixedMeanFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
@ -98,7 +93,7 @@ fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void fixedMeanFvPatchField<Type>::updateCoeffs()
void Foam::fixedMeanFvPatchField<Type>::updateCoeffs()
{
if (this->updated())
{
@ -127,7 +122,7 @@ void fixedMeanFvPatchField<Type>::updateCoeffs()
template<class Type>
void fixedMeanFvPatchField<Type>::write(Ostream& os) const
void Foam::fixedMeanFvPatchField<Type>::write(Ostream& os) const
{
fvPatchField<Type>::write(os);
os.writeKeyword("meanValue") << meanValue_ << token::END_STATEMENT << nl;
@ -135,8 +130,4 @@ void fixedMeanFvPatchField<Type>::write(Ostream& os) const
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -132,6 +132,18 @@ void Foam::surfaceNormalFixedValueFvPatchVectorField::rmap
}
void Foam::surfaceNormalFixedValueFvPatchVectorField::updateCoeffs()
{
if (updated())
{
return;
}
fvPatchVectorField::operator=(refValue_*patch().nf());
fvPatchVectorField::updateCoeffs();
}
void Foam::surfaceNormalFixedValueFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);

View File

@ -175,6 +175,12 @@ public:
);
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};