CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Interpolation between faces and points of a polyPatch (https://www.cfd-online.com/Forums/openfoam-solving/60190-interpolation-between-faces-points-polypatch.html)

hartinger May 2, 2005 14:49

Hello, for the calculation
 
Hello,

for the calculation of the movement of some boundary points I am doing some calulations on a polyPatch, and I would like to store that data(scalar) somewhere.
I guess, a "surfaceScalarField" would be appropriate, although I only need to store the data for that patch. A "surfaceScalarField" stores the data at the face centres, right?

From there I'd like to interplate those values to the points of the boundary and store that data as well. What is the class to use to store data in boundary points? And how do I do the interpolation, if it's already implemented?

Thank you
markus

henry May 2, 2005 16:36

If you are storing data for a
 
If you are storing data for a single patch and are not concerned about the patch field type fvPatchField should be used for face-centre data and pointPatchField for vertex data. Both are templated on the type but there are also convenient typedefs for the common types e.g. fvPatchScalarField and pointPatchScalarField.

hartinger May 3, 2005 07:55

If I am using a fvPatchScalarF
 
If I am using a fvPatchScalarField it would be constructed with a fvPatch and an internal Field. Where do I get the internal Field from and why does it need one anyways?
thanks
markus

henry May 3, 2005 08:00

A patch field needs an interna
 
A patch field needs an internal field from which to evaluate the boundary condition. If you do not have a corresponding internal field then you probably should be using scalarField rather than fvPatchScalarField to store your patch data.

hartinger May 3, 2005 08:37

Ah, I don't have an correspond
 
Ah, I don't have an corresponding internal field, then I'll use a scalarField for the face centered values.
I could use another scalarField for the corresponding point values and do the interpolation myself. But I would obviously prefer an existing solution for the interpolation. Is there something?
thanks
markus

hjasak May 3, 2005 08:41

All done for you and ready to
 
All done for you and ready to use - isn't FOAM wonderful! :-)

Make an object of type primitivePatchInterpolation (or templated PrimitivePatchInterpolation). The functions are in:

~/OpenFOAM/OpenFOAM-1.1/src/OpenFOAM/lnInclude/PrimitivePatchInterpolation.H

and you've got:

//- Interpolate from faces to points
template<class>
tmp<field<type> > faceToPointInterpolate
(
const Field<type>& ff
) const;


//- Interpolate from points to faces
template<class>
tmp<field<type> > pointToFaceInterpolate
(
const Field<type>& pf
) const;

//- Interpolate from faces to edges
template<class>
tmp<field<type> > faceToEdgeInterpolate
(
const Field<type>& ff
) const;

Enjoy (in enery sense of the word!),

Hrv

hartinger May 3, 2005 09:24

I'll try that thank you mark
 
I'll try that
thank you
markus

Tobi January 27, 2015 06:33

Quote:

Originally Posted by hjasak (Post 201431)
//- Interpolate from faces to points
template<class>
tmp<field<type> > faceToPointInterpolate
(
const Field<type>& ff
) const;

Hello Jasak,

just one question. Is there some publication of how to interpolate from faces to points? Otherwise I will check it out in the source code but a reference would be very nice.

Kind regards
Tobi

Tobi January 27, 2015 18:55

Hello all, I figured it out myself from the source code

Chrisi1984 March 3, 2016 17:01

Hi,

can you please explain how to do the interpolation?

Kind regards
Chrisi

Tobi March 3, 2016 17:35

Yes, o can publish it in monday

Chrisi1984 March 6, 2016 11:24

Oh that's nice!

So my idea is to write a utility that interpolates a volScalarField to the patches (bc: zeroGradient) writing out the node values on every patch.

Kind regards
Chrisi

Tobi March 7, 2016 14:08

Hi Chris and all other,

here you find the face-to-point interpolation that is used by OpenFOAM: http://holzmann-cfd.de/index.php/en/publications


All times are GMT -4. The time now is 19:44.