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

Cylinder tutorial

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 13, 2008, 05:07
Default If the pressure equation that
  #21
New Member
 
Roberto
Join Date: Mar 2009
Posts: 17
Rep Power: 17
robbo is on a distinguished road
If the pressure equation that potentialFoam solves is not laplacian(p)=0 then the manual should be corrected!

From the relation I've posted after some rearrangements it turns:

laplacian(p)=-rho*(d^2(phi)/(d(x_i)d(x_k)))^2

wich is different from the equation that you have posted. Also laplacian(p)=div(phi) is not dimensionally correct! and also: is it possible to define the divergence of a scalar field?

nice weekend to you!

Roberto
robbo is offline   Reply With Quote

Old   June 13, 2008, 10:14
Default Hi I am wondering if we are
  #22
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi

I am wondering if we are chasing something which is not present in the solution. Have found the analytical solution of the potential around a cylinder, and it writes:

phi = -u_0 x (1 + R^2 / (x^2 + y^2))

Thus in increases for decreasing x and varies linearly in the farfield of the cylinder. Could it be that the solution is actual for phi and not p?

/ Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   June 13, 2008, 14:18
Default The pressure field shown varie
  #23
New Member
 
Roberto
Join Date: Mar 2009
Posts: 17
Rep Power: 17
robbo is on a distinguished road
The pressure field shown varies linearly in the whole field, not only in the farfield. I don't know exactly what is the solution for the potential flow but if it is the one that you write you can write it in polar coordinates as:

phi=-u_o*(1+R^2/r^2)

where r^2 is the generical radius far from the cylinder. In this way the potential contours must be concentrical circles around the cylinder... and this is not the case of the field shown. So the pressure field shown is not the potential field...

Roberto
robbo is offline   Reply With Quote

Old   June 14, 2008, 03:56
Default Please note the 'x' after u_0.
  #24
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Please note the 'x' after u_0.

- Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   June 14, 2008, 05:22
Default i missed that parsicular! i've
  #25
New Member
 
Roberto
Join Date: Mar 2009
Posts: 17
Rep Power: 17
robbo is on a distinguished road
i missed that parsicular! i've plotted the function you posted and it shows good agreement with the pressure field shown... but why potentialFoam plots the potential field instead of the pressure field?

Roberto
robbo is offline   Reply With Quote

Old   March 10, 2010, 11:38
Default
  #26
Senior Member
 
Kevin Smith
Join Date: Mar 2009
Posts: 104
Rep Power: 17
kev4573 is on a distinguished road
Did this issue ever get resolved? Both tutorials for potentialFoam seem to give incorrect pressure distributions if you run the simulation with the '-writep' argument. It does seem the pressure field resembles phi more than anything.
kev4573 is offline   Reply With Quote

Old   March 10, 2010, 11:42
Default
  #27
Senior Member
 
Kevin Smith
Join Date: Mar 2009
Posts: 104
Rep Power: 17
kev4573 is on a distinguished road
Also, the field phi is a scalar field - taking divergence of that field seems nonsensical.. What am I missing?
kev4573 is offline   Reply With Quote

Old   March 17, 2010, 07:55
Default Modeling the flow inside an annulus?!
  #28
New Member
 
Sawi
Join Date: Mar 2010
Posts: 7
Rep Power: 16
Aelsawis is on a distinguished road
I' am trying to model the behavior of a non newtonian fluid inside an eccentric annulus. I need to get a profile of the annular velocity of the fluid for the whole cross section. I just discovered the OpenFoam and i was wondering if the "nonNewtonianIcoFoam" solver would manage a problem like this? Since i am new in this area any further help or suggestions is appreciated. What should i read to get started? Is there another solver that is more specialized in Annular flow? Will i need a mesh generation program(Boundary conforming grid generator) or Will the Openfoam handle the whole problem?

Really appreciate any help
Aelsawis is offline   Reply With Quote

Old   March 17, 2010, 15:25
Default
  #29
Senior Member
 
sega's Avatar
 
Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 20
sega is on a distinguished road
Quote:
Originally Posted by Aelsawis View Post
I' am trying to model the behavior of a non newtonian fluid inside an eccentric annulus. I need to get a profile of the annular velocity of the fluid for the whole cross section. I just discovered the OpenFoam and i was wondering if the "nonNewtonianIcoFoam" solver would manage a problem like this? Since i am new in this area any further help or suggestions is appreciated. What should i read to get started? Is there another solver that is more specialized in Annular flow? Will i need a mesh generation program(Boundary conforming grid generator) or Will the Openfoam handle the whole problem?

Really appreciate any help
I'm pretty sure your question is in not related to this thread.
Open you own discussion!
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"
sega is offline   Reply With Quote

Old   March 17, 2010, 17:33
Default
  #30
New Member
 
Sawi
Join Date: Mar 2010
Posts: 7
Rep Power: 16
Aelsawis is on a distinguished road
yeah maybe ur right i am sorry for the disturbance.i just thought since the discussion began with the cylinder example ..that maybe someone would know something about the annular flow between two cylinders...
Aelsawis is offline   Reply With Quote

Old   March 17, 2010, 18:44
Default
  #31
Senior Member
 
Cean
Join Date: Feb 2010
Posts: 128
Rep Power: 16
shirazbj is on a distinguished road
The p in the program has a dimension of m^2/s^2, so it is not simple a pressure. I think it is p/density. Becasue:

p - kg/(ms^2)
density - (kg/m^3)

p/density=kg/(ms^2)/(kg/m^3)=m^2/s^2

For potential flow, usually we start from solving phi, then get U by differentiation of phi. Then get pressure from Bernolli's equation. The U is correct here, so we could try to get pressure from it.

BTW, There is an analyticalFoam folder under the cylinder tutorial folder. Where this output is saved?

Cean

Last edited by shirazbj; March 18, 2010 at 22:45.
shirazbj is offline   Reply With Quote

Old   March 25, 2010, 11:32
Default
  #32
Senior Member
 
Kevin Smith
Join Date: Mar 2009
Posts: 104
Rep Power: 17
kev4573 is on a distinguished road
Cean - That's what I ended up doing - since my case had a uniform free stream velocity it was relatively trivial to modify the potentialFoam solver to calculate pressure.
kev4573 is offline   Reply With Quote

Old   April 2, 2010, 08:43
Default
  #33
Senior Member
 
Cean
Join Date: Feb 2010
Posts: 128
Rep Power: 16
shirazbj is on a distinguished road
Quote:
Originally Posted by kev4573 View Post
Did this issue ever get resolved? Both tutorials for potentialFoam seem to give incorrect pressure distributions if you run the simulation with the '-writep' argument. It does seem the pressure field resembles phi more than anything.
phi is the flux through the cell surface.

Does the equation means flux due to pressure change in the cell?
shirazbj is offline   Reply With Quote

Old   April 6, 2010, 09:25
Default
  #34
Senior Member
 
Kevin Smith
Join Date: Mar 2009
Posts: 104
Rep Power: 17
kev4573 is on a distinguished road
By phi I really meant potential, sorry for the confusion.
kev4573 is offline   Reply With Quote

Old   May 11, 2010, 01:52
Default Cylindrical boundary condition
  #35
New Member
 
Joseph
Join Date: Mar 2010
Posts: 14
Rep Power: 15
tamsilian is an unknown quantity at this point
Hi
Could you send me your code about cylindrical boundary condition?
TANX
Joseph
tamsilian is offline   Reply With Quote

Old   May 11, 2010, 02:58
Default Hi
  #36
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 17
ata is on a distinguished road
Hi
I think that in that file which I have send for you, is a link to cylindrical B.C.
Best regards
ata is offline   Reply With Quote

Old   June 1, 2018, 09:41
Default mapping a cylinder in OpenFoam
  #37
Member
 
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 8
Ben UWIHANGANYE is on a distinguished road
Quote:
Originally Posted by ngj View Post
Hi Roberto

You need to program a new boundary condition (at least that is what I think). The programming is rather simple, and I have something at another computer, which might help you. The short story is, that you know the point on the surface, x_S, and the center of the cylinder, x_0. Then specify

v = x_S - x_0.

Say that the angular frequency is omega, then the boundary condition for the velocity for the cylinder surface in any given point is given as (assume 2D)

U = - omega * vector(-v_2,v_1,0)

where v_1 and v_2 are the first and second component of v. Assumed that the cylinder rotates clockwise, if anti-clockwise just remove the minus in front.

Have fun, and if you need my source, just send me an email.

- Niels





Hello Niels,


I want to map a cylinder in OpenFoam with the following boundary conditions:


n(x,y,t)={n=1, when (x-xt)^2 -(y-yt)^2 <= R^2

n=0, when (x-xt)^2 -(y-yt)^2 > R^2 }


where: x,y are the Cartesian coordinate of the computational cell center
and xt, yt are the center of the cylinder at time t. R is the radius of the cylinder.

It means that the cylinder will be oscillating as n alternate from 0 to 1.
I am using OF 4.1.


May you advise how i can do that ?


I would appreciate!
Ben UWIHANGANYE is offline   Reply With Quote

Old   June 1, 2018, 11:20
Default
  #38
Member
 
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 8
Ben UWIHANGANYE is on a distinguished road
Quote:
Originally Posted by ngj View Post
Hi Roberto

As you said in the email, you are not completely sure how to compile, so I will make a small walk-through:

First here is the boundary condition.

rotatingCylinder.tar.gz

Unpack the archive and from the command-line you go into the directory and type:


This creates a dynamic library which is placed in the folder $FOAM_LIBBIN. The library is called librotatingCylinderFvPatchVectorField.so.

Then unpack the following

viscosityTest.tar.gz

which is a small test case with to concentric circles, where the large one rotates with a given cyclic frequency. The frequency and the center of the rotating cylinder is given in case/0/U. The library is only for 2D-case in the xy-plane, as I have not extended the code. Notice that the linking of the new boundary condition to icoFoam happens through /case/system/controlDict, where the library is added at the bottom.

Hope it works, otherwise to not hesitate to ask.

/ Niels

BTW: The setup is actually how viscosity was measured, because the flow is a couette-type of flow for large radii and small gaps. Thus the velocity profile is known, and therefore by measuring the force acting on the still cylinder, the viscosity can be determined as the velocity of the 'lid' is known.



wmake libso



Dear Niels,


I have tried to go through this exercises and when i run icoFoam got the following fatal error:


--> FOAM FATAL IO ERROR:
keyword pFinal is undefined in dictionary "/home/ben/OpenFOAM/ben-4.1/run/visicosity/system/fvSolution.solvers"

file: /home/ben/OpenFOAM/ben-4.1/run/visicosity/system/fvSolution.solvers from line 0 to line 38.

From function const Foam::dictionary& Foam::dictionary::subDict(const Foam::word&) const
in file db/dictionary/dictionary.C at line 642.

FOAM exiting


Can you help to correct that error?


I would appreciate your help



I would appreciate you support.!
Ben UWIHANGANYE is offline   Reply With Quote

Old   June 7, 2018, 05:24
Default
  #39
Member
 
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 8
Ben UWIHANGANYE is on a distinguished road
Quote:
Originally Posted by ngj View Post
Hi Roberto

You need to program a new boundary condition (at least that is what I think). The programming is rather simple, and I have something at another computer, which might help you. The short story is, that you know the point on the surface, x_S, and the center of the cylinder, x_0. Then specify

v = x_S - x_0.

Say that the angular frequency is omega, then the boundary condition for the velocity for the cylinder surface in any given point is given as (assume 2D)

U = - omega * vector(-v_2,v_1,0)

where v_1 and v_2 are the first and second component of v. Assumed that the cylinder rotates clockwise, if anti-clockwise just remove the minus in front.

Have fun, and if you need my source, just send me an email.

- Niels



Hello Niels,


May you help to know where this program should be written?


Indeed I want to map a cylinder on a Cartesian grid and move it with a simple program.
I have been advised to learn about vector form programming in Open Foam but i don't know where to start.


Thank you!
Ben UWIHANGANYE is offline   Reply With Quote

Old   June 7, 2018, 07:07
Default
  #40
Member
 
Ben 017
Join Date: Nov 2017
Posts: 70
Rep Power: 8
Ben UWIHANGANYE is on a distinguished road
Quote:
Originally Posted by Ben UWIHANGANYE View Post
wmake libso



Dear Niels,


I have tried to go through this exercises and when i run icoFoam got the following fatal error:


--> FOAM FATAL IO ERROR:
keyword pFinal is undefined in dictionary "/home/ben/OpenFOAM/ben-4.1/run/visicosity/system/fvSolution.solvers"

file: /home/ben/OpenFOAM/ben-4.1/run/visicosity/system/fvSolution.solvers from line 0 to line 38.

From function const Foam::dictionary& Foam::dictionary::subDict(const Foam::word&) const
in file db/dictionary/dictionary.C at line 642.

FOAM exiting


Can you help to correct that error?


I would appreciate your help



I would appreciate you support.!



Solved.


Thank you!
Ben UWIHANGANYE 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
3-d mesh gambit (cylinder within a cylinder) Jason ANSYS Meshing & Geometry 29 October 30, 2015 08:59
tutorial for solving oscillating cylinder problem CH FLUENT 8 April 2, 2014 10:56
tutorial 6 in Fluent 6.2 tutorial and Mesh pilli4u FLUENT 2 April 2, 2007 05:09
tutorial for 3D CYLINDER-PISTON ARRANGEMENT sachin bhalerao FLUENT 0 February 28, 2006 03:05
Help meeee: Wave cylinder (sine cylinder) Ngoctq FLUENT 0 December 29, 2005 20:46


All times are GMT -4. The time now is 22:27.