|
[Sponsors] |
October 22, 2024, 02:21 |
Cylindrical Coordinates Conversion
|
#1 |
Senior Member
A. Min
Join Date: Mar 2015
Posts: 308
Rep Power: 12 |
Hi guys
I defined the stress tensor as a volScalarField in createFields.H. Then I calculated it as: Code:
volTensorField gradU = fvc::grad(U); tauS = etaS*twoSymm(gradU); Code:
const volVectorField C = mesh.C(); // Initial Coordinates const volVectorField CT = C-origin_; // Transfomed Coordinates forAll(C,i) { scalar teta = std::atan2(CT[i].y(), CT[i].x()); if (teta < 0) { teta += 2*PI; } scalar sin = Foam::sin(teta); scalar cos = Foam::cos(teta); // velocity field UC[i].x() = U[i].x()*cos + U[i].y()*sin; // R component UC[i].y() = -U[i].x()*sin + U[i].y()*cos; // theta component UC[i].z() = U[i].z(); // Z component // Solvent Stress Tensor tauSRT[i].xx() = tauS[i].xx()*pow(cos,2) + tauS[i].yy()*pow(sin,2) + 2 * tauS[i].xy()*cos*sin; // TauS_rr tauSRT[i].xy() = ( tauS[i].yy() - tauS[i].xx() )*cos*sin + tauS[i].xy() * ( pow(cos,2) - pow(sin,2) ); // TauS_rt tauSRT[i].xz() = tauS[i].xz()*cos + tauS[i].yz()*sin; // TauS_rz tauSRT[i].yy() = tauS[i].xx()*pow(sin,2) + tauS[i].yy()*pow(cos,2) - 2 * tauS[i].xy()*cos*sin; // TauS_tt tauSRT[i].yz() = -tauS[i].xz()*sin + tauS[i].yz()*cos; // TauS_tz tauSRT[i].zz() = tauS[i].zz(); // TauS_zz } Code:
#include "cylindricalCoordinates.H" Do you know what the problem is? |
|
Tags |
cartesian, cylindrical coordinates, openfoam 9.0, stress tensor |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Finite Volume Method For Cylindrical Coordinates | falopsy | Main CFD Forum | 45 | August 14, 2023 22:14 |
CFD by anderson, chp 10.... supersonic flow over flat plate | varunjain89 | Main CFD Forum | 18 | May 11, 2018 08:31 |
SIMPLE algorithm in 3D cylindrical coordinates | zouchu | Main CFD Forum | 1 | January 20, 2014 18:02 |
Cylindrical coordinates ? | T.D. | OpenFOAM Running, Solving & CFD | 17 | September 26, 2010 16:37 |
Calculation in cylindrical coordinates | Franz Wingelhofer | CFX | 0 | December 28, 1999 08:46 |