|
[Sponsors] |
May 20, 2016, 12:00 |
OpenFoam 3D cases
|
#1 |
Member
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10 |
Hi,
Is there any basic tutorial available for 3D cases? The tutorial contains 2D cases, I am not aware if there is any 3D case. I am looking basic setup for creating my own model. Thanks. |
|
May 21, 2016, 18:15 |
|
#2 |
Senior Member
|
Hi,
tutorials/basic/laplacianFoam/flange looks quite 3D. What exactly you are looking for? |
|
May 21, 2016, 18:47 |
|
#3 | |
Member
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10 |
Quote:
I created a geometry with dimension 1 x 1 x 0.5. I initialized the bottom part with a rectangular box in center and with field value 0.2. After running blockMesh and setFields, i visualized it in paraview. I can see 3D mesh, but I don't see rectangular box in center. Instead it appears as a 2D rectangle but not a box. |
||
May 21, 2016, 19:04 |
|
#4 |
Senior Member
|
So, do I get it right: you are quite happy with generated 3D mesh, and not satisfied with setFields results? Could you post setFieldsDict file (and maybe screenshots of your visualization, to be sure words in message and picture are the same, to avoid misunderstanding)?
|
|
May 21, 2016, 19:20 |
|
#5 | |
Member
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10 |
Quote:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v3.0+ | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object setFieldsDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // defaultFieldValues ( volVectorFieldValue U (0 0 0) volScalarFieldValue T 0); regions ( boxToCell { box (0.04 0.04 0) (0.06 0.06 0.04) ; fieldValues ( volScalarFieldValue T 0.2) ; } ); // ************************************************** *********************** // |
||
May 22, 2016, 04:58 |
|
#6 |
Senior Member
|
Well, it is not setFields, it is the way you visualize the field. On the picture it looks like you selected "Surface" representation in paraview and then set opacity of the surface (but it still remain surface, i.e. something 2D). To look inside your mesh, you need to cut it with Clip filter (see attached screenshot for example) or use Volume representation.
|
|
May 22, 2016, 12:16 |
|
#7 | |
Member
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10 |
Quote:
Edit: I was able to use clip filter as you mentioned. But it only shows shape as a slice. How can I see my whole object as 3D? Like a 3D dambreak example in youtube? Edit: I also managed to visualize using volume representation. Now I need to do more fine tuning and need more technique to visualize it properly. I would like to do the following and looking for answer: 1. How to make side walls as transparent with bottom part as one color say black? Opacity make the whole box non-visible. But I need bottom part. 2. What color map should I select? My initial value is 0.2 and growing but has different values in different part of the object? 2. Last edited by cute; May 22, 2016 at 13:03. Reason: Found somethng: |
||
May 23, 2016, 01:50 |
|
#8 |
Senior Member
|
It would be easier if you illustrate what you need. Concerning your questions:
1. Open case in paraview twice, second time you select only bottom patch in the list of parts to import and draw it with solid color. 2. Question is beyond my comprehension. You can select colormap your like and set custom range of values. Also in recent versions of paraview it can go through time steps and rescale colormap to span over whole range of values. |
|
May 23, 2016, 10:55 |
|
#9 |
Member
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10 |
Thanks alexeym for your reply.
I am simulating biomass growth in my simulations. When I change the opacity value of the grid, it also changes for biomass. It looks transparent. 1. I would like to visualize biomass growth as solid while the box invisible. 2. How can I set lighting effect to visualize it better? 3. As I am new, I used BoxToCell method to initialize my data. I don't know, how to setup initial data with semisphere at the center of bottom part. Thanks in advance. |
|
May 24, 2016, 02:30 |
|
#10 |
Senior Member
|
Well,
2. To understand your "better" one have to see what you have now. 3. Since setFields utility uses topoSets to select cells, you can check $FOAM_UTILITIES/mesh/manipulation/topoSet/topoSetDict for possible ways to specify selection (there is sphereToCell for example). |
|
May 26, 2016, 11:35 |
|
#11 |
Member
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10 |
How to use sphereToCell, so it produce semisphere?
|
|
May 26, 2016, 16:44 |
|
#12 |
Senior Member
|
1. Since your semi-sphere is at the bottom of domain, place center of the sphere on the edge of domain. Half of the sphere will be outside of simulation domain and you get just semi-sphere inside.
2. If you need more general solution, you have to use topoSet and setFields together. With topoSet you create hemispherical cellSet and them use cellToCell topoSet in setFieldsDict. Here is an example: imagine, you need hemisphere with centre (0 0 0.1) and 5 cm radius. You create cellSet c0 with topoSet: Code:
FoamFile { version 2.0; format ascii; class dictionary; object topoSetDict; } actions ( { name c0; type cellSet; action new; source sphereToCell; sourceInfo { centre (0 0 0.1); radius 0.05; } } { name c0; type cellSet; action delete; source boxToCell; sourceInfo { box (-1 -1 -1) (1 1 0.1); } } ); // vim: set ft=foam et sw=4 ts=4 sts=4: Code:
FoamFile { version 2.0; format ascii; class dictionary; location "system"; object setFieldsDict; } defaultFieldValues ( volScalarFieldValue gl 0.0 ); regions ( cellToCell { set c0; fieldValues ( volScalarFieldValue gl 1.0 ); } ); // vim: set ft=foam et sw=4 ts=4 sts=4: |
|
May 27, 2016, 12:49 |
|
#13 |
Member
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10 |
Thanks for the reply. I have little problem understanding the above procedure. Please let me know, if I understand correctly.
1. Copy Cod1 in a file "toposetDict" and store it in system directory 2. Copy code 2 in setFieldsDict and store in system directory 3. Then run setFields Am I right? Is there any good tutorial regarding this? This might be helpful in understanding the concept. |
|
May 27, 2016, 13:10 |
|
#14 |
Senior Member
|
Almost, before running setFields you need to run topoSet to create cell set c0. Also you need to adjust geometry in dictionaries for your case.
Unfortunately I do not know much about OpenFOAM tutorials. |
|
May 27, 2016, 13:37 |
|
#15 |
Member
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10 |
Thanks, I will try today sometime.
|
|
May 27, 2016, 15:46 |
|
#16 |
Member
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10 |
I tried as you suggested, but I don't see sphere. Is there any specific filtersI need to apply. I visualized for t=0, loaded into paraview, applied clip filter but don't see anything.
My box dimension is 1 x 1 x 0.5 m^3 with blocks ( hex (0 1 2 3 4 5 6 7) (20 20 20) simpleGrading (1 1 1) ); I used in topoSetDict actions ( { name c0; type cellSet; action new; source sphereToCell; sourceInfo { centre (0.5 0.5 0); radius 0.2; } } { name c0; type cellSet; action delete; source boxToCell; sourceInfo { box (0 0 0) (1 1 0.5); } } ); when I ran topoSet command it produces // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create polyMesh for time = 0 Reading topoSetDict Time = 0 mesh not changed. Created cellSet c0 Applying source sphereToCell Adding cells with centre within sphere, with centre = (0.5 0.5 0) and radius = 0.2 cellSet c0 now size 0 Read set cellSet c0 with size 0 Applying source boxToCell Removing cells with center within boxes 1((0 0 0) (1 1 0.5)) cellSet c0 now size 0 End I don't know, what is wrong? BTW: how do you submit code inside rectangle on this site? As you posted above. |
|
May 27, 2016, 16:41 |
|
#17 |
Senior Member
|
Well, this one is quite obvious, as you just delete created sphere. You create sphere with centre (0.5 0.5 0) and radius 0.2, so it lies within (0.3 0.3 -0.2)-(0.7 0.7 0.2) and then you delete box (0 0 0)-(1 1 0.5), box overlaps sphere, so you deleted everything you have created during first step.
There is [CODE] tag. Marked as # in toolbar. |
|
May 27, 2016, 17:01 |
|
#18 |
Member
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10 |
Yes, I realized and figured out. Thanks for quick reply.
In my previous post, I was asking about toposet Guide. If it is available some where. Not about tutorial cases. Sorry, my toolbar does not show any hash tag like #. |
|
May 27, 2016, 17:56 |
|
#19 |
Member
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10 |
Thanks for your help. I was able to run my application with 4 semi-spheres in the domain. As you can see in picture, they will grow and then merge at some time,i.e. outer surface merge. Now I need some post-processing:
(1) Is there any better option to visualize more clearly. I used only clip filter. (2) I also would like to extract and visualize only the outer-surfaces of all semi-spheres as they grow. How can I do this? I wanted to upload animation, but It could not. In my previous post, I was asking about toposet Guide. If it is available some where. Not about tutorial cases. |
|
May 29, 2016, 15:28 |
|
#20 |
Senior Member
|
Since it is your simulation and process you know, it is YOU who decide what to do. For example...
- There is threshold filter. If your hemispheres have certain property than distinguishes them from other space, use it. The filter can be used to select cell with liquid in VOF. Sometimes I use the filter to select liquid pool cells. - There is iso-surface filter. It can be used to visualize surfaces defined by certain value of field variable. It is used to draw liquid surface in VOF simulations (alpha = 0.5). I use it for visualization of solidification front (gl = 0.5). Concerning your second question, as I said earlier, I do not know much about tutorials. topoSetDict supplied with sources of topoSet utility has plenty of examples. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 | cfd.direct | OpenFOAM Announcements from Other Sources | 2 | August 31, 2015 13:36 |
OpenFoam - Vof verification with standard cases | P Sharma | OpenFOAM Running, Solving & CFD | 4 | December 1, 2014 00:25 |
Suggestion for a new sub-forum at OpenFOAM's Forum | wyldckat | Site Help, Feedback & Discussions | 20 | October 28, 2014 09:04 |
OpenFOAM tests cases | cfdivan | OpenFOAM Installation | 2 | August 14, 2013 15:33 |
Convertation axisymmetric cases from Fluent to OpenFOAM | Svensson | OpenFOAM | 0 | April 19, 2011 06:08 |