Equations in Cylinder Coordinates
Hi,
I just started learning OpenFOAM and somewhere on the first manual pages it is mentioned, that OpenFOAM uses the carthesian coordinate system by default. I want to simulate the flow through a cylinder and so want to set up my equations in cylindrical coordinates... can I "teach" OpenFOAM to use another system than the cathesian one? Thanks a lot Greez Steffen P.S. is there a good source for learning how to develop a simulation case by hand? = not take an example and change the settings but develop a case by myself... Thanks |
additional question
Hi again,
it seems to me that icoFOAM bases on the Navier-Stokes Equation, which I need. But... ... is the continuity equation also included there? ... how can I set up additional boundary and starting conditions? Do I need to write them into any part of the C Code and recompile the Files or is it possible to set them up into the "normal" config files? ... again - how can I make OpenFOAM use cylindrical Coordinates? So I have to change and recompile the code for that or can I set that up in any of the config files? ... If I have to change so many things on an existing project, will it be better/ easier to built a project by myself? Thanks a lot - I am a little "overextended" because of the huge power and possibilities of the program. Greez Steffen |
Quote:
|
Quote:
Quote:
Quote:
Have a look at Fig. 5.4 in the User Guide. Quote:
|
Boundaries:
For solving a DiffEq one needs boundary and starting conditions, like e.g. U(t=0)=0 or p(x=0)=0; How and where are such conditions set up in a simulation (=project) (as e.g. icoFOAM)? And If I want to change such conditions in an existing project, where can I do so? Do I have to touch the C code or can it be realized via changing parameters in the already compiled files (as one can find in the tutorials folder). Sorry if my questions are not posed very precisely, but it is because I just started with OpenFOAM. Thanks a lot Greez Steffen |
Quote:
Initial and boundary conditions for each fields are stored within the case directory's subdirectory '0' (corresponsing to time = 0). Like: 0/U (Velocity) or 0/p (Pressure) You don't have to touch the OpenFOAM code, but simply run the icoFoam on a case. But if you haven't figured that out yet I supposed you haven't had a look into the User Guide. I suggest you do that in the next step. |
Quote:
|
As a first approxomation for my diploma thesis I want to simulate the flow through a pipe (=cylinder), which has specific properties. When using a cylindrical coordinate system, the equations look much easier than in carthesian coordinates. For sure I could use the carthesian one, but then the equations become quite ugly...
@ Mark: Do you think it makes sense to make OpenFOAM use another coordinate system? (I found this: http://openfoamwiki.net/index.php/Si...ry_/_Tutorials). If I used the carthesian system, my boundary conditions become quite complicated (e.g. describe a condition on the wall of the cylinder...) @ Sebastian: I read the user guide's chapters about boundaries, but it is still unclear how to handle them. Now I know that somehow the "boundary" file and the "p" and "U" files correspond, but I still dont understand in which way... e.g. If I simply wanted to say: "U_x(x=0,y,z,t)=0" or "p(t=0,x,y,z)=p_start", how could I set this up? Perhaps one can explain my problem with a little example: "boundary file": movingWall { type wall; nFaces 20; startFace 760; } "/0/p file": movingWall { type zeroGradient; } Does that mean that the moving wall (specified in polyMeshDict) has a zeroGradient (in what?) for all the time? And what does nFaces and startFaces mean? Sorry for this huge postings - but I am really interested in OpenFOAM and this unclearity in my brain drives me crazy :confused: Thank you! |
Quote:
... not even considering how something like the Reynolds' stresses would look like in cylindrical coordinates! Also consider that the code would internally need different definitions for the gradient, divergence, laplacian etc. operators, as well as cell positions, volume calculations etc. And of course, your cylindrical domain would always need to be exactly coincide with the global coordinates .... I hope you can see why Cartesian coordinates are used for general purpose CFD codes (commercial or open source). If you wish to solve your problem with OpenFOAM, STAR-CD, Fluent, CFX, etc. just get used to the idea that you need to solve in Cartesian coordinates. Of course you are still free to transform your final results back into cylindrical if that's what you need. |
Oh all right - I see the problem... thanks for advice :-)
At the moment I am trying to simulate a simple Hagen-Poisseuilles Flow in a cylindrical tube - just for Practice... If I wanted to extend this first test to a non-rigid (= extesible tube), how do I have to build up my mesh? Does it have to be variable in size? Or is there any "common" technique for that? Thx and Greez Steffen |
Quote:
First of all you mesh with the blockMesh tool. This is where you specify the boundary conditions, like wall in you example. blockMesh writes the boundary file which should not be touched by you at this moment. All you have to do is to manipulate the 0/U file! Code:
movingWall Well, at least for such a simple boundary condition this may be true. Wall corresponds to U=0 at this boundary. If you have specified wall as boundary condition in the blockMesh file zeroGradient (velocity gradient normal to the boundary) would not be possible as it is allready set to U=0 from blockMesh and written to the boundary file. Still with me? Make sure you understand that you specify the boundaries within the blockMeshDict and in the field file as well and they have to correspond. Example (besides the many in the tutorial cases): To set up a Neuman boundary condition, select patch in the blockMeshDict file and select zeroGradient in the field file. To select a moving Wall, select patch in the blockMeshDict file and select type fixedValue; value uniform(0 1 0) corresponding to the velocity direction you wall is moving. |
Advantage of cylindrical coordinates
The main advantage of cylindrical coordinates as I see it is that you can more easily exploit rotational symmetry in your problem to make it more computationally tractable.
For example, if your 3D geometry is axisymmetric, you could write your equations in cylindrical coordinates and reduce it to a 2D problem. A 2D simulation domain is likely to run orders of magnitude faster than the same thing modelled in 3D. I'm not sure if OpenFOAM supports it, but even with your mesh in cartesian coordinates you could effectively solve it in a 2D domain if the solver implements angular cyclic boundary conditions. In this case your mesh dimension in the theta direction could be 1 cell, effectively turning it into a 2D problem. |
Quote:
It's all 3D cartesian! |
Quote:
It's all 3D cartesian, but it is possible to specify a wedge boundary condition (angular cyclic) as amedlin described to effectively reduce your computation to 2D. |
1 Attachment(s)
Hi Foamers,
can't somebody give me a hint? I have done a sketch of my problem which I appended as an attachment. I have already constructed a grid using wedge boundary conditions. Which can be found in this Thread http://www.cfd-online.com/Forums/ope...wo-blocks.html as I read in multiple Threads I can't use equations in cylindrical symetry, right? (please answer) So I have to transform my equations. But as my grid is only 2D I see no point in giving an expression for the symmetric Coordinate. If that is so can I simply replace r->x and z->z? Or dose the wedge boundary internally need the full equation? The continuity equation is straightforward but I have trouble with the momentum equation... I also could really need some help for the construction of the corresponding field from the equation above. I found some useful code in the tutorial "Flow around a cylinder" from the programmers guide: Code:
Info<< "\nEvaluating analytical solution" << endl; From the http://openfoamwiki.net/index.php/Si...ry_/_Tutorials I learn that it is at least possible to introduce a Cylindrical Coordinate Systems... Thanks in advance. Philipp |
All times are GMT -4. The time now is 01:15. |