|
[Sponsors] |
July 16, 2009, 05:18 |
GGIInterpolation
|
#1 |
Member
Radu Mustata
Join Date: Mar 2009
Location: Zaragoza, Spain
Posts: 99
Rep Power: 17 |
Hi All,
I am trying to use the GGI interpolation tools to do a better job at interpolating scalar/vector fields inbetween two non-conformal patches. I am stuck with the syntax. Before I did,( e.g in a two mesh case setup). label label1 = mesh1.boundaryMesh().findPatchID("patch1"); vectorField &Up1 = U1.boundaryField()[label1]; label label2 = mesh2.boundaryMesh().findPatchID("patch2"); vectorField &Up2 = U2.boundaryField()[label2]; patchToPatchInterpolation p1_to_p2 ( mesh1.boundaryMesh()[label1], mesh2.boundaryMesh()[label2] ); vectorField Uinterp_p1_to_P2 = p1_to_p2.faceInterpolate(Up1); ...etc (say compare with Up2...and do other stuff) What would be the equivalent using GGIInterpolation? It doesn´t seem to like: GGIInterpolation p1_to_p2 ( mesh1.boundaryMesh()[label1], mesh2.boundaryMesh()[label2] ); vectorField Uinterp_p1_to_P2 = p1_to_p2.masterToSlave(Up1); Thanks Radu |
|
January 5, 2011, 17:05 |
GGIInterpolation
|
#2 |
New Member
Brent Craven
Join Date: Mar 2009
Location: University Park, PA, USA
Posts: 21
Rep Power: 17 |
Hi Radu,
Did you ever get this to work? I am trying to do something similar. Thanks! |
|
January 7, 2011, 07:20 |
|
#3 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
Hello Radu,
Just like in PatchToPatch, GGI has also got 2 levels: - a template level, with the patch type as argument (capital letters) - a typedef for patches This allows me to do the interpolation either between stand-alone patches (which are face lists) or between boundary patches (which are slices). Thus, if you do: ggiInterpolation p1_to_p2 ( mesh1.boundaryMesh()[label1], mesh2.boundaryMesh()[label2] ); vectorField Uinterp_p1_to_P2 = p1_to_p2.masterToSlave(Up1); it will work. Watch out for lowercase. Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
January 7, 2011, 09:19 |
|
#4 |
New Member
Brent Craven
Join Date: Mar 2009
Location: University Park, PA, USA
Posts: 21
Rep Power: 17 |
Thanks for the reply - that is quite useful. Thanks, Hrv!
Brent |
|
January 11, 2011, 00:15 |
ggiInterpolation Problem
|
#5 |
New Member
Brent Craven
Join Date: Mar 2009
Location: University Park, PA, USA
Posts: 21
Rep Power: 17 |
Hi Hrv,
There is something wrong here. In 1.6-ext I am implementing GGI interpolation (as you suggest above) in a boundary condition as follows: const fvMesh& neighbourMesh = db().lookupObject<fvMesh>("Mesh2"); const label& neightbourPatchID = neighbourMesh.boundaryMesh().findPatchID("iPatch") ; const fvMesh& thisMesh = db().lookupObject<fvMesh>("Mesh1"); const label& thisPatchID = thisMesh.boundaryMesh().findPatchID("iPatch"); ggiInterpolation neighbourToThisPatch ( neighbourMesh.boundaryMesh()[neightbourPatchID], thisMesh.boundaryMesh()[thisPatchID] ); Note that if I replace "ggiInterpolation" with "patchToPatchInterpolation" it works. I have also tried the templated form of "GGIInterpolation" with no more success. For example: GGIInterpolation<polyPatch,polyPatch> neighbourToThisPatch ( neighbourMesh.boundaryMesh()[neightbourPatchID], thisMesh.boundaryMesh()[thisPatchID] ); Note that this also works if I replace "GGIInterpolation" with "PatchToPatchInterpolation" |
|
January 11, 2011, 04:27 |
|
#6 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
You are missing half of the arguments of the constructor - have a look at GGIInterpolation.H:
//- Construct from components GGIInterpolation ( const MasterPatch& masterPatch, const SlavePatch& slavePatch, const tensorField& forwardT, const tensorField& reverseT, const vectorField& forwardSep, const scalar masterFaceNonOverlapFaceTol = 0.0, const scalar slaveFaceNonOverlapFaceTol = 0.0, const bool rescaleGGIWeightingFactors = true, const quickReject reject = AABB ); or the way ggiPolyPatch does it: // Create interpolation for zones patchToPatchPtr_ = new ggiZoneInterpolation ( zone()(), shadow().zone()(), forwardT(), reverseT(), shadow().separation(), // Slave-to-master separation. Bug fix 0, // Non-overlapping face tolerances 0, // HJ, 24/Oct/2008 true, // Rescale weighting factors. Bug fix, MB. ggiInterpolation::AABB ); I would have thought this is an obvious place to look (find-grep?). Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
November 14, 2011, 05:44 |
|
#7 |
Member
Join Date: Oct 2011
Posts: 37
Rep Power: 15 |
Hello together
I try to instantiate an object of the class ggiZoneInterpolation. Until now I created a new polyPatch, called mpPolyPatch, derived from polyPatch. Inside of this mpPolyPatch I created an algorithm which is able to generate a structured mesh inside of the surrounding edges of the existing boundary patch. Based on this new vertexes and a corresponding list of faces I created an object of the class primitivePatch, called virtualPrimitivePatch. Until here everthing works and I can see that the algorithm worked properly by using the writeVTK function and opening the two meshes with pvFoam. I now tried to create an object of ggiZoneInterpolation with: ggiZoneInterpolation myGgiZoneInterpolation((*this),virtualPrimitivePat ch); But this gave me the error that there is no matching function to my call. I'm quite new in OpenFoam. I thought ggiZoneInterpolation only needs two primitivePatches to calculate the weightings. Thanks a lot Peter Last edited by Peter Müller; November 14, 2011 at 06:00. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Any update on mixerGgiFvMesh | jaswi | OpenFOAM Running, Solving & CFD | 69 | April 20, 2013 13:22 |