CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Tensor in cylindrical coordinate system

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 1, 2020, 12:58
Default Tensor in cylindrical coordinate system
  #1
New Member
 
Bruno
Join Date: Jul 2018
Posts: 6
Rep Power: 8
Onurb is on a distinguished road
Hello,

I am solving the following equation:

\frac{\partial c}{\partial t} +\nabla \cdot ( \textbf{u}c) - \nabla (\textbf{D}\cdot \nabla c) = 0

with \textbf{D} given by

\textbf{D}_{xyz} = \left[ \stackrel{D_{xx}}{\stackrel{0}{0}} \quad \stackrel{0}{\stackrel{D_{yy}}{0}} \quad \stackrel{0}{\stackrel{0}{D_{zz}}}\right]

Using OpenFOAM I defined the tensor \textbf{D} as
Code:
volScalarField Dxx( Dm + lxx*mag(U) );
volScalarField Dyy( Dm + lyy*mag(U) );
volScalarField Dyy( Dm + lzz*mag(U) );

symmTensor Txx(1,0,0,0,0,0);
symmTensor Tyy(0,0,0,1,0,0);
symmTensor Tzz(0,0,0,0,0,1);

  volSymmTensorField D = Dxx*Txx + Dyy*Tyy + Dzz*Tzz;
However, I'm in doubt about how to handle the problem with tensor in the cylindrical coordinate system (attached figure)

\textbf{D}_{r\theta z} = \left[ \stackrel{D_{rr}}{\stackrel{0}{0}} \quad  \stackrel{0}{\stackrel{D_{\theta\theta}}{0}} \quad  \stackrel{0}{\stackrel{0}{D_{zz}}}\right]


I would like to know how implement in OF the transformation \textbf{D}_{r\theta z} \quad to \quad \textbf{D}_{xyz}, in other words, I use as input D_{rr}, D_{\theta\theta}, D_{zz} and internally OF transform to D_{xx}, D_{yy}, D_{zz}
Attached Images
File Type: jpg geometry.jpg (54.9 KB, 1 views)
Onurb is offline   Reply With Quote

Old   December 5, 2020, 04:19
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
You should take a look at the coordinate system classes,but make sure you are using OpenFOAM-v1812 or newer.
To have the correct result, in cylindrical coordinates you will also need to provide the locations where the transformation occurs. You can have a single tensor transformed at all of the locations, or supply locations and tensors. The field of positions can also be an indirect list etc, so only for a zone etc.
Unfortunately, since there are so many variants of transforms the corresponding methods in coordinateSystem are wrapped in macros - better for code maintenance (ie, programmer sanity), but horrible to read as a user. Probably best to look at the extracted documentation when picking your method.

https://www.openfoam.com/documentati...ateSystem.html
olesen is offline   Reply With Quote

Reply

Tags
coordinate transformation, cylindrical coordinate, tensor


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ANSYS Meshing] Coordinate system Import to Fluent superduke1200 ANSYS Meshing & Geometry 4 December 16, 2018 03:41
Local cylindrical coordinate system dniem FLUENT 2 July 9, 2018 12:43
Problem with exporting solution data concerning the coordinate System elbi_ente Structural Mechanics 0 October 9, 2015 01:49
Define a cylindrical Coordinate System in CFX!!! mohammad CFX 0 September 10, 2014 02:27
CFD Software with Cylindrical and Spherical Coordinate cfd2010 Main CFD Forum 0 June 9, 2010 21:55


All times are GMT -4. The time now is 20:00.