|
[Sponsors] |
patchToPatchInterpolation doesn't work properly |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 19, 2022, 06:44 |
patchToPatchInterpolation doesn't work properly
|
#1 |
New Member
pardoa
Join Date: May 2018
Posts: 29
Rep Power: 7 |
Hello,
I have successfully coupled two solvers to solve several fields on two separate meshes. Both meshes have the same resolution and share one patch which works as coupling interface. The flow solution from each mesh at the coupling interface is mapped on the other mesh at each timestep. This means, e.g, the U field resulting at the interface patch of one mesh is mapped on the the same patch of the second mesh at each timestep. To achieve this, I have used the function PatchToPatchInterpolation. However, the mapping doesn't work properly. The solution is correct at most of the faces, but somehow, the values are not transferred at some. Since, initially, the nodes are at the same location for both meshes at the interface patch, I assume that the lack of mapping at some faces could be the result of rounding errors? I am just guessing here. Else I don't see why the faces are not correctly mapped from one patch to the other, as their location is exactly the same. This is the piece of code I am using for the mapping: Code:
PatchToPatchInterpolation<primitivePatch,primitivePatch> bottomToTopInter ( bottomPatchMesh1, //fromPatch topPatchMesh2 //toPatch ); PatchToPatchInterpolation<primitivePatch, primitivePatch> topToBottomInter ( topPatchMesh2, //fromPatch bottomPatchMesh1 //toPatch ); U2.boundaryFieldRef()[topPatchMesh2ID] == bottomToTopInter.faceInterpolate<scalar>(U1.boundaryField([bottomPatchMesh1ID]); U1.boundaryFieldRef()[bottomPatchMesh1ID] == topToBottomInter.faceInterpolate<vector>(U2.boundaryField([topPatchMesh2ID]); Alvaro |
|
July 22, 2022, 07:21 |
|
#2 |
New Member
pardoa
Join Date: May 2018
Posts: 29
Rep Power: 7 |
Hello again,
I tried to directly assign the values from one patch to the other based on the face center coordinates, but some faces remained unmapped. This is the piece of code that I implemented: Code:
forAll (faceCtr_meshSub,i) { forAll (faceCtr_mesh,j) { if (round(mag(faceCtr_mesh[j])*10e6) == round(mag(faceCtr_meshSub[i])*10e6)) { hSub.boundaryFieldRef()[topPatchMesh2ID][i] = hSur.boundaryField()[bottomPatchMesh1ID][j]; } } } By doing this, the differences between both patches decrease dramatically, but the mismatch persists at some cells. I really have no idea why this happens, as now the assignment is straight. There is no interpolation. Any help will be very welcome! Alvaro |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Companies that lease software & hardware for cloud-based work? | Catthan | ANSYS | 0 | June 18, 2014 10:53 |
Do all CFD analysts have to do some hands-on work except PhDs? | e13drd | Main CFD Forum | 2 | March 17, 2014 14:56 |
OpenFOAM does not work any more! | kiddmax | OpenFOAM Installation | 12 | June 25, 2013 02:56 |
Why do the Plant library cases don't work? | Alumna | Phoenics | 6 | June 22, 2004 12:08 |
why my In-Form doesn't work? | green | Phoenics | 2 | May 27, 2004 21:03 |