CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Cylindrical coordinates ? (http://www.cfd-online.com/Forums/openfoam-solving/80108-cylindrical-coordinates.html)

 T.D. September 15, 2010 11:51

Cylindrical coordinates ?

Hi Guys, i am new to openfoam, my question is that:

If i want to the solve the Navier-Stokes equations in cylindrical coordinates, i must just define my coordinates system to cylindrical one (r, theta,z)?

if so, what about the operators like "laplacian","divergence", for example: div(phi), they will be automatically used in cylindrical coordinates? or we must write new definitions for them in cylind. coord.?

thanks a lot

 herbert September 16, 2010 10:05

Hi T.D.,

please search the forum before opening a new thread. I think you will get more than 100 matches on this topic.

 T.D. September 16, 2010 10:42

Hi Herbert,

yes indeed i searched and found many matches, but they were not clear.
I wish i will get a clear answer to my question.
at least if you know, can you help me? i will be so thankful to you

thanks a lot

 ata September 17, 2010 02:01

Cylindrical coordinates?

Hi T.D.
I hope you are doing very well.
As I know in OF equations are discretised in Cartesian coordinate. Would you please tell me why you are so interested in cylindrical coordinate? May be you can solve your problem in Cartesian coordinate.
Best regards
Good luck

Ata

 T.D. September 17, 2010 04:29

Hi

1 Attachment(s)
Hi ata,
this is my model in the attached image
yes indeed i just need to solve it in (r,z) only
because it is a flow between two parallel disks, one is rotating and the other is stationary.(axisymmetric)

Can you help me how to do that?

Thanks a lot for you

 ata September 18, 2010 01:54

Hi T.D.
How are you?
I hope you are doing very well.
As I know you can solve your problem in Cartesian coordinate with rotating BC on walls. If you want an analytical solution then cylindrical coordinate is proper for you but in numerical solution it is no matter.
Are you agree with me?
Best regards

Ata

 T.D. September 18, 2010 14:00

Hi ata

1 Attachment(s)
Hi ata,
thanks a lot, you are so kindful
how are you,
i attached an image , if you see you will understand what i need exactly.
can you help me exactly what to do?

thanks a lot my brother

rk: i am new to openfoam

 ata September 20, 2010 02:51

Hi T.D.
How are you? I hope you are doing very well. Excuse me for delay.
I think i can help you. As I see you can use Cartesian coordinate and for wall 1 must use rotating wall. As I know rotating wall boundary condition has been implemented in OpenFOAM previously. For wall 3 you can use stationary wall as boundary condition and there is no need to cylindrical coordinate. In your picture boundary conditions for walls 2 and 4 are not clear. But if they are rotating or stationary there is no problem.
You can see
http://www.cfd-online.com/Forums/ope...-cylinder.html
may be it was useful for you.
Best regards
Good luck bro.

Ata

 T.D. September 20, 2010 05:07

Hi ata

Hi ata,
How are you?
Thank you so much, yes indeed 2, and 4 are also rotating.
But I still have a question, what about the Value [V_setta = Omega * r]?
How can i put that value for the boundary condition at rotating wall(1)? since it is equal to a constant Omega times the spatial coordinates r?

Another Question, i want to compute the strain tensor E:
i found in programmers guide that it is: symm(fvc::grad(U))
but when i write in my .C file
i get this error:
error: 'symm' is not a member of 'Foam::fvm'

by the way i defined also E as a VolTensorField

Thanks a lot

 ata September 20, 2010 06:55

Hi T.D.
I'm fine and I hope you are too.
About your first question. In rotating wall BC you give omega, axis of rotation and its origin not linear velocity. It will be computed by the solver.
I hope this works.
Good luck
Be happy
Best regards

Ata

 T.D. September 20, 2010 09:44

Hi ata,
thanks a lot, but E is not aqual to grad(U) as you said
and i saw in guide that there exists already a functions that computes (grad(U)+transpose(grad(U))) and is called "symm"

but when i use it like

i get error:
error: error: 'symm' is not a member of 'Foam::fvm'

so i think i have a problem calling the already installed functions in openfoam like sqrt, or mag, you see
i hope you understood me now

thanks a lot
you are so kind

T.D.

 ata September 21, 2010 01:03

Hi T.D.
How are you? I hope you are doing very well.
You are true. Examine:
volSymmTensorField E = symm(Gr);
volTensorField GrTr=Gr.T();
volSymmTensorField Tr = symm(GrTr);
E=E+Tr;
Good luck
Best regards

Ata

 T.D. September 21, 2010 07:20

U r Great

Hi ata,
i am fine, you, how are you?

thanks a lot, yes it works now, but
if symm(Gr) is = 1/2 (Gr + Gr.T() )
then why you defined and added Tr tensor, i don't understand why ?

it will be suffiecient at line E=symm(Gr) only , no?

I have a question please, later how can i view E values in paraView, how to export them?

thanks a lot for your patience and help

yours,

T.D.

 ata September 21, 2010 08:29

Hi T.D.
If you did not get error it is true. Use it.
For your second question. Beside any solver source code (i.e. icoFoam) there is a file createFields. In it pressure. velocity and other things creates. You can use it. May this is true for your case:
Info<< "Reading field E\n" << endl;
volSymmTensorField E
(
IOobject
(
"E",
runTime.timeName(),
mesh,
IOobject::AUTO_WRITE
),
mesh
);

Add it to the end of your createFields file of your solver. Then at your case (problem) in folder "0" similar to file "U" build a file. Name it "E". With contents like this:
dimensions [0 0 -1 0 0 0 0];

internalField uniform (0 0 0 0 0 0);

boundaryField
{
inlet
{
type fixedValue;
value uniform (0 0 0 0 0 0);
}
fixedWalls
{
}
outlet
{
}
simetry
{
type symmetryPlane;
}
frontAndBack
{
type empty;
}
}
Maybe there is better ways but I know this way.
Good luck
Bets regards

Ata

 T.D. September 21, 2010 08:52

Thanks

hi
thanks brother
yes it worked fine

thank you so much

see you later

yours,

T.D.

 T.D. September 22, 2010 04:56

to simlify last message

1 Attachment(s)
Hi to simlify my last message

here is My model
what i need to write is the syntax for the last term
at write of equation 2

see attached file

 ata September 25, 2010 03:08

Hi T.D.
I'm fine. How are you? hope you are doing very well.
For your first question define nu_new in the create field as a volscalerfield and calcaulate it before using it in the code.
For your second question see the boundary conditions for pressure in one tutorial.
For your third question it is not clear for me. Please explain more.
Good luck
Best regards

Ata

 T.D. September 26, 2010 15:37

Thanks

Hi ata,
how are you?
i am fine, and thank you so much
i will try what you told me,
you can forget about the third question , its ok

thank you so much

T.D.

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