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

Problems to implement a coordinate change

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 21, 2011, 22:04
Default Problems to implement a coordinate change
  #1
New Member
 
Mateus Palharini Schwalbert
Join Date: May 2011
Posts: 22
Rep Power: 15
mateusps is on a distinguished road
Hello.

I'm trying to implement a "coordinate contraction", and I got many problems (I'm newbie in OpenFOAM).

My mesh is a very long tube, so what I wanna do is implement a coordinate change to "compress" the axial coordinate, so that the aspect ratio gets better. I'm trying to do this in nonNewtonianIcoFoam.

Mathematically, what I must do is pre-multiply (innerly) the operators div, grad, and so on, in the equations, by an anisotropic tensor that shrinks the axial dimension. But I don't know how to do this in OpenFOAM.

I tryed to simply define the tensors and multiply them, but the operators (+, - and ==) didn't accept to operate a fvm::div(phi,U) class with a tensor class, and so on.

How can I do this (insert a tensor pre-multiplying all the "\nabla"s)? Help, please.
mateusps is offline   Reply With Quote

Old   September 22, 2011, 04:08
Default
  #2
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21
tomislav_maric is on a distinguished road
Quote:
Originally Posted by mateusps View Post
Hello.

I'm trying to implement a "coordinate contraction", and I got many problems (I'm newbie in OpenFOAM).

My mesh is a very long tube, so what I wanna do is implement a coordinate change to "compress" the axial coordinate, so that the aspect ratio gets better. I'm trying to do this in nonNewtonianIcoFoam.

Mathematically, what I must do is pre-multiply (innerly) the operators div, grad, and so on, in the equations, by an anisotropic tensor that shrinks the axial dimension. But I don't know how to do this in OpenFOAM.

I tryed to simply define the tensors and multiply them, but the operators (+, - and ==) didn't accept to operate a fvm::div(phi,U) class with a tensor class, and so on.

How can I do this (insert a tensor pre-multiplying all the "\nabla"s)? Help, please.
Operators work on top of fields and a finite volume mesh: the resulting coefficient matrices are built based on the geometric (FVM related) mesh information, from one side.

The dimensions and shape (sparsity) of the Foam::fvm::fvMatrix will depend on the mesh + discretisation scheme used + linear combination and type of operators in the equation, and it will not be a tensor definitely, so multiplication with a tensor (a direct one) is out of the question... just my 2 cents...

Why not just make a better mesh?

Tomislav
tomislav_maric is offline   Reply With Quote

Old   September 22, 2011, 06:16
Default
  #3
New Member
 
Mateus Palharini Schwalbert
Join Date: May 2011
Posts: 22
Rep Power: 15
mateusps is on a distinguished road
My point is to make a coordinate transformation, not just make a better mesh. It's not just to run better, but to make it easy to visualise as well.

But I don't know if I understood. I know the Foam::fvm::fvMatrix isn't a tensor.

What I wanna do (mathmatically) is multiply the div(UU), grad(p), laplacian(nu,U), etc, by a tensor that performs the coordinate change. But I don't know how to implement this in OpenFOAM. I noticed that I can't just multiply the objects fvm::div(phi,U), fvc::grad(p), etc. But so how can I program to solve the equation:

dU/dt + A & div(UU) - A & A & laplacian(nu,U) = - A & grad(p)

where A is a tensor?

Thanks for the reply!
mateusps is offline   Reply With Quote

Old   September 22, 2011, 14:20
Default
  #4
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21
tomislav_maric is on a distinguished road
Hi,

again: fvm::fvMatrix has not just geometrical information of the mesh but all other information related to the solution variable coefficients of the discretized (non)linear algebraic system.

Ask yourself this:

How am I to discretize the

\int_V_P A & div(UU) dv

using a Gauss divergence theorem when A is a tensor? Is this possible at all?

I personally believe that this is not possible at all within the finite volume framework, as explained for example in many theses related to FVM on arbitrary unstructured meshes, all of which you can find here:

http://powerlab.fsb.hr/ped/kturbo/OpenFOAM/docs/

If you prove this to be wrong, please post the result, I'm always happy to learn new stuff.

Tomislav

Quote:
Originally Posted by mateusps View Post
My point is to make a coordinate transformation, not just make a better mesh. It's not just to run better, but to make it easy to visualise as well.

But I don't know if I understood. I know the Foam::fvm::fvMatrix isn't a tensor.

What I wanna do (mathmatically) is multiply the div(UU), grad(p), laplacian(nu,U), etc, by a tensor that performs the coordinate change. But I don't know how to implement this in OpenFOAM. I noticed that I can't just multiply the objects fvm::div(phi,U), fvc::grad(p), etc. But so how can I program to solve the equation:

dU/dt + A & div(UU) - A & A & laplacian(nu,U) = - A & grad(p)

where A is a tensor?

Thanks for the reply!

Last edited by tomislav_maric; September 22, 2011 at 14:22. Reason: grammar
tomislav_maric is offline   Reply With Quote

Reply


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
cylindrical coordinate vs cartesian coordinate Lam FLUENT 10 May 11, 2013 14:05
CFD Software with Cylindrical and Spherical Coordinate cfd2010 Main CFD Forum 0 June 9, 2010 22:55
no enthalpy change across the momentum source Atit Koonsrisuk CFX 2 December 19, 2005 03:33
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12
liquid/solide phase change problems mehdi fteity Main CFD Forum 3 September 14, 2000 22:44


All times are GMT -4. The time now is 01:02.