|
[Sponsors] |
May 18, 2011, 08:35 |
what happened to pointVolInterpolation?
|
#1 |
New Member
Oskar
Join Date: May 2011
Posts: 6
Rep Power: 15 |
How can I interpolate a pointScalarField to a volScalarField?
The forum thread http://www.cfd-online.com/Forums/ope...alarfield.html and http://openfoamwiki.net/index.php/PointVolInterpolation say that the pointVolInterpolation class can be used. But I can't find pointVolInterpolation in OpenFoam 1.6. Oskar |
|
May 19, 2011, 05:49 |
|
#2 |
New Member
Oskar
Join Date: May 2011
Posts: 6
Rep Power: 15 |
As there seems to be no reply on this issue, I think I will mark pointVolInterpolation as broken for versions newer than 1.5 in http://openfoamwiki.net/index.php/Op...%28OpenFOAM%29 and http://openfoamwiki.net/index.php/Op...lInterpolation. Any objections?
I do appreciate recommendations how to replace the pointVolInterpolation functionality. thx Oskar |
|
May 19, 2011, 18:43 |
|
#3 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33 |
Works beautifully in 1.6-ext.
Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
June 1, 2012, 15:43 |
How does it work?
|
#4 |
New Member
Jorge Meneses
Join Date: Feb 2012
Posts: 6
Rep Power: 14 |
Good Morning Dr. Jasak
I know it's been a while since you answered this thread, however since you've used pointVolInterpolation I'm sure you can help me. I've been reading thoroughly pointVolInterpolation.H, pointVolInterpolation.C and pointVolInterpolate.C and, unfortunately I'm still unable to use the function. Possibly is a silly mistake due to my lack of knowledge but still is giving me a hard time. What I'm trying to do is to interpolate a volVectorField to points, change the values with simple arithmetic and interpolate them back to a volVectorField (whether the same or a different one). What I have this far is: Code:
pointField alphaP = interpVolPoint.interpolate(alpha); point& pt = alphaP[pointI] forAll(alphaP, pointI) { double px=3.0*pt.x()+15; double py=2.0pt.y()+16; double pz=pt.z()+14; } pointField pt = pointVolInterpolation interpPointVol (mesh); beta = interpPointVol.interpolate(pt); In an attempt to make it work, I wrote: Code:
const pointMesh pMesh(mesh); const volMesh vMesh(mesh); pointField betaP (mesh.points()); pointVolInterpolation pointToVol (pMesh,mesh); **beta=pointToVol.interpolate(betaP); Code:
no matching function for call to ‘Foam::pointVolInterpolation::interpolate(Foam::pointField&)’ simpleRBCFoam.C:180:30: note: candidates are: pointVolInterpolation.H:142:14: note: template<class Type> void Foam::pointVolInterpolation::interpolate(const Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>&, Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) const pointVolInterpolation.H:151:59: note: template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > Foam::pointVolInterpolation::interpolate(const Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh>&) const pointVolInterpolation.H:159:59: note: template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > Foam::pointVolInterpolation::interpolate(const Foam::tmp<Foam::GeometricField<Type, Foam::pointPatchField, Foam::pointMesh> >&) const make: *** [Make/linux64GccDPOpt/simpleRBCFoam.o] Error 1 Thank you very much. Jorge. |
|
June 5, 2012, 08:49 |
|
#5 | |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34 |
Quote:
pointVolInterpolation interpolates values from mesh points to mesh cell centres. I think you should use volPointInterpolation which interpolates from cell centres to points. You can use volPointInterpolation like this: Code:
// Create point mesh pointMesh pMesh(mesh); // Create point interpolation volPointInterpolation pointInterpolation(mesh); pointVectorField pointField ( IOobject ( "pointDU", runTime.timeName(), mesh ), pMesh, dimensionedVector("zero", dimLength, vector::zero) ); // Calculate mesh points displacement pointInterpolation.interpolate(volField, pointField); Best regards, Philip |
||
June 5, 2012, 09:11 |
Fantastic
|
#6 |
New Member
Jorge Meneses
Join Date: Feb 2012
Posts: 6
Rep Power: 14 |
Hello Philip,
Thank you so much for you reply, I was getting worried. Regarding volPointInterpolation, I agree with you, that was the first part of my problem and I had it almost solved, of course, what you sent me will help me to enhance my solution, however, my real problem is with pointVolInterpolation, as you said, to interpolate mesh points to mesh cells. Hope you know and can help me. Regards, Jorge |
|
September 8, 2012, 17:56 |
|
#7 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 17 |
Hi Jorge,
I ran into the same trouble when trying to interpolate from point to volume values. As your last post is rather old, you might already have found the solution. If not, here we go: Your "betaP" is defined as a pointField, but is has to be a pointScalarField or pointVectorField, defined in the way already described by bigphil. Then you can use it in the same way as the volume->point interpolation - although I had to use a "temporary" copy field as the solver otherwise complained about incompatible meshes. The following snippet interpolates vol->points and back points->vol. Code:
scalarField gP = interpolateVolToPoints.interpolate(gammaM); gammaP.internalField() = gP; gammaM = interpolatePointsToVol.interpolate(gammaP); Arne |
|
November 20, 2014, 09:53 |
|
#8 | |
Member
Fei Fan
Join Date: Jun 2013
Location: NanJing, China
Posts: 54
Rep Power: 12 |
Quote:
I want to interpolated from face to point . when i create point mesh with pointMesh pMesh(mesh); the error occured as below: pFoam.C:141:31: error: variable ‘const Foam:ointMesh pMesh’ has initializer but incomplete type const pointMesh pMesh(mesh); what's the matter with it? Best regards Fan Fei |
||
November 24, 2014, 04:28 |
|
#9 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34 |
Hi Fan Fei,
You must include the pointMesh.H header file at the top of your solver in order to use it: Code:
#include "fvCFD.H" // put it here #include "pointMesh.H" You may have to write your own interpolator. Philip |
|
November 24, 2014, 04:45 |
|
#10 | |
Member
Fei Fan
Join Date: Jun 2013
Location: NanJing, China
Posts: 54
Rep Power: 12 |
Quote:
Thank you for your reply, this problem has been solved now. I use primitivePatchInterpolation for interpolated from face to point. As i set pointScalarFiled. There're some errors as /home/administrator/foam/foam-extend-3.1/src/foam/lnInclude/GeometricField.H: In constructor ‘Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensioned<Type>&, const Foam::word&) [with Type = Foam::Vector<double>; PatchField = Foam:ointPatchField; GeoMesh = Foam:ointMesh; Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam:ointMesh]’: /home/administrator/foam/foam-extend-3.1/src/foam/lnInclude/GeometricField.H:304:73: error: incomplete type ‘Foam:ointPatchField<Foam::Vector<double> >’ used in nested name specifier const word& patchFieldType=PatchField<Type>::calculatedType() ^ pFoam.C:154:5: note: when instantiating default argument for call to Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensioned<Type>&, const Foam::word&) [with Type = Foam::Vector<double>; PatchField = Foam:ointPatchField; GeoMesh = Foam:ointMesh; Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam:ointMesh] ); ^ Is it lack of the pointFields.H, or some another mistake? [/SIZE] Best regards Fan Fei |
||
November 24, 2014, 04:59 |
|
#11 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34 |
Hi Fan Fei,
Can you post your code segment that does not compile and then post the compilation error, please. Also be careful of the format of your post; you can use Code:
... code here ... Philip Last edited by bigphil; November 24, 2014 at 05:00. Reason: Added link |
|
November 24, 2014, 06:16 |
|
#12 | |
Member
Fei Fan
Join Date: Jun 2013
Location: NanJing, China
Posts: 54
Rep Power: 12 |
Quote:
Code ---------------------------------- pointMesh pMesh(mesh); pointVectorField pointField ( IOobject ( "wallpoint", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), pMesh, dimensionedVector("q_bed",sqr(dimLength)/sqr(dimTime),vector::zero) ); ----------------------------------------------------- the error is too long, it's about 502KB, and it can't be upload. ---------------------------------- GeometricField.H: In constructor ‘Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField(const Foam::IOobject&, const Mesh&, const Foam::dimensioned<Type>&, const Foam::word&) [with Type = Foam::Vector<double>; PatchField = Foam:ointPatchField; GeoMesh = Foam:ointMesh; Foam::GeometricField<Type, PatchField, GeoMesh>::Mesh = Foam:ointMesh]’ GeometricField.H:304:73: error: incomplete type ‘Foam:ointPatchField<Foam::Vector<double> >’ used in nested name specifier const word& patchFieldType=PatchField<Type>::calculatedType() ------------------------------------------------------------- Best regards FanFei |
||
November 26, 2014, 04:06 |
|
#13 | |
Member
Fei Fan
Join Date: Jun 2013
Location: NanJing, China
Posts: 54
Rep Power: 12 |
Quote:
The problem has solved now. it's need to added the # include "pointFields.H" after the # include "fvCFD.H". Best Regards Fanfei |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
patch: nothing happened..! | sheila | FLUENT | 4 | October 26, 2007 00:13 |
What happened to Nekton? | jefe | Main CFD Forum | 0 | July 31, 2005 20:39 |
SOS why this happened? | whai | FLUENT | 0 | June 27, 2003 11:38 |
What happened to Fluent??! | moiami | FLUENT | 0 | July 23, 2002 00:53 |
What happened to EXA | Dr. Hrvoje Jasak | Main CFD Forum | 0 | February 29, 2000 05:28 |