|
[Sponsors] |
understanding interpolatedFaces.H in pEqn.H of the overset mesh |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 29, 2022, 08:04 |
understanding interpolatedFaces.H in pEqn.H of the overset mesh
|
#1 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
Hello all,
I'm trying to understand the source in the file interpolatedFaces.H located in pEqn.H of the solver overPimpleDyMFaom. I understood that the code loops over of all faces. If a face is adjacent to a calculated and an interpolated cell if first look for the closest cell in the different mesh parts (the overlapping meshes in the overset approach). After that it uses all neighbors of the latter closest cell to interpolated the H/A field to the face. After that it does some transformations before assigning the H/A field to the cell center of the interpolated cell. What I do not understand is why transform the interpolated vectorField H/A before transferring it to the center of the interpolated cell? The Part of the code I do not understand is the following: Code:
if (cellId != -1) { const vector& n = faceNormals[faceI]; vector n1(Zero); // 2-D cases if (mesh.nSolutionD() == 2) { for (direction cmpt=0; cmpt<vector::nComponents; cmpt++) { if (mesh.geometricD()[cmpt] == -1) { switch (cmpt) { case vector::X: { n1 = vector(0, n.z(), -n.y()); break; } case vector::Y: { n1 = vector(n.z(), 0, -n.x()); break; } case vector::Z: { n1 = vector(n.y(), -n.x(), 0); break; } } } } } else if (mesh.nSolutionD() == 3) { //Determine which is the primary direction if (mag(n.x()) > mag(n.y()) && mag(n.x()) > mag(n.z())) { n1 = vector(n.y(), -n.x(), 0); } else if (mag(n.y()) > mag(n.z())) { n1 = vector(0, n.z(), -n.y()); } else { n1 = vector(-n.z(), 0, n.x()); } } n1.normalise(); const vector n2 = normalised(n ^ n1); tensor rot = tensor ( n.x() ,n.y(), n.z(), n1.x() ,n1.y(), n1.z(), n2.x() ,n2.y(), n2.z() ); // tensor rot = // tensor // ( // n & x ,n & y, n & z, // n1 & x ,n1 & y, n1 & z, // n2 & x ,n2 & y, n2 & z // ); U1Contrav[faceI].x() = 2*transform(rot, UIntFaces[faceI]).x() - transform(rot, HbyA[receptorNeigCell[faceI]]).x(); U1Contrav[faceI].y() = transform(rot, HbyA[cellId]).y(); U1Contrav[faceI].z() = transform(rot, HbyA[cellId]).z(); HbyA[cellId] = transform(inv(rot), U1Contrav[faceI]); Any idea why the transformation is performed. Maybe one has to consider that an interpolated face can have more than one neighbor which cell is calculated? Best Michael |
|
April 16, 2022, 06:21 |
|
#2 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
Hello all
I continued analyzing the code. Let's say we have a face normal vector pointing in x-direction. Then the vectors n, n1 and n2 look like this: The rotation matrix looks like this: For this case the application of the rotation matrix to a vector we get Last edited by mAlletto; April 17, 2022 at 04:46. |
|
April 18, 2022, 05:42 |
|
#3 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
Let's analyze the code chunk
Code:
U1Contrav[faceI].x() = 2*transform(rot, UIntFaces[faceI]).x() - transform(rot, HbyA[receptorNeigCell[faceI]]).x(); U1Contrav[faceI].y() = transform(rot, HbyA[cellId]).y(); U1Contrav[faceI].z() = transform(rot, HbyA[cellId]).z(); HbyA[cellId] = transform(inv(rot), U1Contrav[faceI]); For a face normal pointing in x-direction we get: and after applying the backward transformation: It seem that for a face pointing in x-direction the twice the difference between Hbya and the interpolated velocity at the face is added. Last edited by mAlletto; April 23, 2022 at 02:26. |
|
April 23, 2022, 02:30 |
|
#4 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
sliding mesh problem in CFX | Saima | CFX | 46 | September 11, 2021 07:38 |
foam-extend-4.1 release | hjasak | OpenFOAM Announcements from Other Sources | 19 | July 16, 2021 05:02 |
Overset simulation fails when using 2 close together overset + background mesh | quarkz | OpenFOAM Running, Solving & CFD | 0 | January 7, 2021 02:36 |
Overset MESH problem DFBI 6DOF | Ale85 | STAR-CCM+ | 0 | October 1, 2013 12:25 |
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! | sc298 | OpenFOAM Meshing & Mesh Conversion | 2 | March 27, 2011 21:11 |