View Issue Details

IDProjectCategoryView StatusLast Update
0003083OpenFOAMFeaturepublic2018-10-09 08:22
Reporterykanani Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Summary0003083: Writting field values in the fixedGradient patches
DescriptionIn the fixedGradient boundary condition, the patch values are not written in the stored field data files. Although this is not necessary for simulations to run properly, it brings confusion in the post processing step (i.e. using .foam reader of the ParaView). For any fixedGradient patch, ParaView assumes zeroGradient which produces wrong values at the patch.

To avoid this issue and eliminate any possible misinterpretation in the postprocessing step, I suggest writing the patch values by adding "this->writeEntry("value", os);" to the write method of the fixedGradientFvPatchField.C

template<class Type>
void Foam::fixedGradientFvPatchField<Type>::write(Ostream& os) const
{
    fvPatchField<Type>::write(os);
    gradient_.writeEntry("gradient", os);
    this->writeEntry("value", os); //Added to write the values at the patch
}

We have been using the fixedGradient boundary condition for the heated walls and just realized that ParaView does not recognize the fixedGradient boundary condition and assumes zero gradient which gives wrong values at the patch during post processing.
 
TagsNo tags attached.

Activities

henry

2018-10-08 22:48

manager   ~0010089

The read constructor evaluates the boundary values:

template<class Type>
Foam::fixedGradientFvPatchField<Type>::fixedGradientFvPatchField
(
    const fvPatch& p,
    const DimensionedField<Type, volMesh>& iF,
    const dictionary& dict
)
:
    fvPatchField<Type>(p, iF, dict, false),
    gradient_("gradient", dict, p.size())
{
    evaluate();
}

so ParaView correctly displays the values and there is no need for the value field read or written.

ykanani

2018-10-09 00:26

reporter   ~0010090

Thanks for the prompt response.
I confirm that Paraview, started with the Openfoam libraries (i.e. paraFoam), correctly displays values. However, in some cases post processing are done without access to Openfoam libraries (e.g. ParaView in windows). In those situation, the default reader provided by Kitware does not/cannot evaluate the patch values and hence displays wrong values.

I totally understand that this might be out of the scope of the Openfoam code since the provided post processing tool (paraFoam) is working properly, however, since we faced this issue and were looking at wrong values for a while, we thought this might help other user's if they use ParaView without Openfoam libraries. Anyway, I agree that reader provided by OpenFOAM is working fine.

henry

2018-10-09 08:22

manager   ~0010091

This appears to be a bug in ParaView rather then OpenFOAM and should be reported to the maintainers of ParaView.

Issue History

Date Modified Username Field Change
2018-10-08 21:45 ykanani New Issue
2018-10-08 22:48 henry Note Added: 0010089
2018-10-09 00:26 ykanani Note Added: 0010090
2018-10-09 08:22 henry Assigned To => henry
2018-10-09 08:22 henry Status new => closed
2018-10-09 08:22 henry Resolution open => no change required
2018-10-09 08:22 henry Note Added: 0010091