Replies: 3 comments 3 replies
-
What´s the BC for your tensor? |
Beta Was this translation helpful? Give feedback.
-
Why would you expect to get equal values from the two approaches (in the general case)? |
Beta Was this translation helpful? Give feedback.
-
Lets assume your wall boundaries, where the zero-gradient BC is applied. Lets assume a given cell contiguous to the wall. In your approach (2), what you are likely doing is to make the transform of the tensor components at the cell center position and then just copy that cell value to the face (wall), because this is what a zero-gradient BC means. In your approach (1), you transform that same Cartesian tensor components directly at the face location. In general, you should not expect the two approaches to behave the same. Note: as far as I remember there are dedicated classes in openfoam that do coordinates transforms. This wont fix your 'problem', but will save you some time doing component-wise transforms. |
Beta Was this translation helpful? Give feedback.
-
Hi
I want to calculate the value of the stress tensor in cylindrical coordinates on a boundary surface. I did it in 2 ways:
List<symmTensor> tet30 = tet3.boundaryField()[patchI]; List<symmTensor> tet3RT1 = Tau0; // Initialization tet3RT1[i].xx() = tet30[i].xx()*pow(CS,2) + tet30[i].yy()*pow(SIN,2) + 2 * tet30[i].xy()*CS*SIN; // TauS_rr tet3RT1[i].yy() = tet30[i].xx()*pow(SIN,2) + tet30[i].yy()*pow(CS,2) - 2 * tet30[i].xy()*CS*SIN; // TauS_tt tet3RT1[i].xy() = (tet30[i].yy()-tet30[i].xx() )*CS*SIN + tet30[i].xy() * ( pow(CS,2)-pow(SIN,2) );
List<symmTensor> tet3RT2 = tet3RT.boundaryField()[patchI];
The obtained values are a little different (between 1%-20% difference in different points)! But I don't expect to see even this small difference, because there is no reason for that! I don't know which of them is the exact value!
Do you have any idea?
Note: I know that this problem may be for OpenFOAM and it's not specifically for this solver, but I faced it, when I used this solver, so I decided to ask here. I will appreciate it if you answer me.
Beta Was this translation helpful? Give feedback.
All reactions