CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   GGIInterpolation (http://www.cfd-online.com/Forums/openfoam/66463-ggiinterpolation.html)

r2d2 July 16, 2009 04:18

GGIInterpolation
 
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

brent_craven January 5, 2011 17:05

GGIInterpolation
 
Hi Radu,
Did you ever get this to work? I am trying to do something similar.

Thanks!

hjasak January 7, 2011 07:20

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

brent_craven January 7, 2011 09:19

Thanks for the reply - that is quite useful. Thanks, Hrv!

Brent

brent_craven January 11, 2011 00:15

ggiInterpolation Problem
 
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"

hjasak January 11, 2011 04:27

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

Peter Müller November 14, 2011 05:44

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


All times are GMT -4. The time now is 12:50.