# Problems to implement a coordinate change

 Register Blogs Members List Search Today's Posts Mark Forums Read

 September 21, 2011, 21:04 Problems to implement a coordinate change #1 New Member   Mateus Palharini Schwalbert Join Date: May 2011 Posts: 13 Rep Power: 6 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.

September 22, 2011, 03:08
#2
Senior Member

Tomislav Maric
Join Date: Mar 2009
Posts: 259
Blog Entries: 5
Rep Power: 11
Quote:
 Originally Posted by mateusps 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

 September 22, 2011, 05:16 #3 New Member   Mateus Palharini Schwalbert Join Date: May 2011 Posts: 13 Rep Power: 6 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!

September 22, 2011, 13:20
#4
Senior Member

Tomislav Maric
Join Date: Mar 2009
Posts: 259
Blog Entries: 5
Rep Power: 11
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.

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 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 13:22. Reason: grammar

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Lam FLUENT 10 May 11, 2013 13:05 cfd2010 Main CFD Forum 0 June 9, 2010 21:55 Atit Koonsrisuk CFX 2 December 19, 2005 03:33 Andrea CFX 2 October 11, 2004 05:12 mehdi fteity Main CFD Forum 3 September 14, 2000 21:44

All times are GMT -4. The time now is 13:44.