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

3D semisphere in openfoam

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By guin
  • 1 Post By guin
  • 1 Post By guin

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 23, 2019, 19:01
Default 3D semisphere in openfoam
  #1
Member
 
FaRa
Join Date: Jul 2019
Posts: 33
Rep Power: 7
Fahmida is on a distinguished road
Hello everyone. I am new to OpenFOAM. I have used cylinderToCell to define a semi-sphere in 2 dimension. Now I want to make a 3 dimensional semi-sphere. Any idea would be appreciated. Thank you.
Fahmida is offline   Reply With Quote

Old   July 24, 2019, 17:18
Default
  #2
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16
guin is on a distinguished road
sphereToCell


PS: You can make use of boolean operations in topoSet in order to customize your cellSet (e.g. a "sphereToCell" minus a "boxToCell" )
Fahmida likes this.

Last edited by guin; July 24, 2019 at 17:19. Reason: typo
guin is offline   Reply With Quote

Old   July 24, 2019, 17:26
Default
  #3
Member
 
FaRa
Join Date: Jul 2019
Posts: 33
Rep Power: 7
Fahmida is on a distinguished road
Thank you so much for your reply. I will give it a try.

Also I want to show this semi-sphere at the bottom plane of a cube. Is there any way to show this like keeping the side walls transparent and only the sphere colorful in Paraview?
Fahmida is offline   Reply With Quote

Old   July 24, 2019, 17:56
Default
  #4
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16
guin is on a distinguished road
Sure, there is an "opacity" variable for every filter you set in ParaView. It is a question of doing the right hierarchical selection of objects. For that, the best is to play a little bit with ParaView until getting something satisfactory. I recommend you to "google" for some video tutorials of ParaView. You'll get familiar quite fast with it.
Fahmida likes this.
guin is offline   Reply With Quote

Old   July 24, 2019, 20:05
Default
  #5
Member
 
FaRa
Join Date: Jul 2019
Posts: 33
Rep Power: 7
Fahmida is on a distinguished road
I've tried to create the sphere as the way you have mentioned. The simulation ran without any error. but the sphere is not showing in paraview. Is there any reason behind this? I have also reduced the opacity to see this. but nothing was there.
Fahmida is offline   Reply With Quote

Old   July 25, 2019, 03:59
Wink
  #6
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16
guin is on a distinguished road
Quote:
Originally Posted by Fahmida View Post
I've tried to create the sphere as the way you have mentioned. The simulation ran without any error. but the sphere is not showing in paraview. Is there any reason behind this? I have also reduced the opacity to see this. but nothing was there.
It is difficult to help without knowing further details. Please, take a look at following thread first to see what I mean: How to give enough info to get help

In addition, you may want to post this question at the "OpenFOAM Post-Processing" sub-forum instead, since it is more related with your problem.
guin is offline   Reply With Quote

Old   July 25, 2019, 04:21
Default
  #7
Member
 
FaRa
Join Date: Jul 2019
Posts: 33
Rep Power: 7
Fahmida is on a distinguished road
Thank you for your reply.

Since I am new in this forum and field too so i am just still learning. I am trying to simulate nucleate boiling in 3D with VOF and also I am at my initial stage. Initially I wanted to create a bubble at the bottom plane of a cube.
Here is my blockMesh file:

Code:
convertToMeters 1;

vertices
(
    (0 0 0)
    (0.031 0 0)
    (0.031 0.031 0)
    (0 0.031 0)
    (0 0 0.031)
    (0.031 0 0.031)
    (0.031 0.031 0.031)
    (0 0.031 0.031)
);

blocks
(
     hex (0 1 2 3 4 5 6 7) (10 10 10) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    bottom
    {
        type wall;
        faces
        (
            (1 5 4 0)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (3 7 6 2)
        );
    }
    walls
    {
        type wall;
        faces
        (
            (0 4 7 3)
            (2 6 5 1)
        );
    }
);

mergePatchPairs
(
);
and here is my toposetDict:

Code:
actions
(
    {
        name c0;
        type cellSet;
        action new;
        source sphereToCell;
        sourceInfo
        {
            centre (0.0155 0.0155 0);
            radius 0.001;
        }
    }

    {
        name c0;
        type cellSet;
        action delete;
        source boxToCell;
        sourceInfo
        {
           
              box (0.0145 0.0145 -0.001) (0.0165 0.0165 0);
        }
    }

);
Also here is the setFieldDict file:

Code:
defaultFieldValues
(
        volScalarFieldValue alpha1 1
        volScalarFieldValue T 559.95
        volVectorFieldValue U (0 0 0)
);

regions
(

    boxToCell
    {
        box (0 0.026 0) (0.031 0.031 .031);
        fieldValues
        (
            volScalarFieldValue alpha1 0
            volScalarFieldValue T 559.95
            volVectorFieldValue U (0 0 0)
        );
    }
   
    cellToCell
    {
        set c0;

        fieldValues
        (
            volScalarFieldValue alpha1 0
            volScalarFieldValue T 559.95
            volVectorFieldValue U (0 0 0)
        );
    }
);
the simulation ran properly but I really do not know where the bubble has gone when I visualize this in paraview
Fahmida is offline   Reply With Quote

Old   July 25, 2019, 04:50
Default
  #8
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16
guin is on a distinguished road
Your mesh is way too coarse for resolving the bubble you try to generate. Your mesh elements should be considerably smaller. The reason is that topoSet is not an analogic tool. It simply adds cells to the set depending on whether their cell center is or not contained in the shape you passed. Similarly, setFields will only switch the values of the selected cells from the default one to the newly specified, so you can expect at the end a kind of Mindcraft-like / Lego-like sphere.... By the way, I may have something useful in this regard... provided you work with a refined mesh: https://github.com/dolphguin/adjustVoFScalarFields

To sum up your options:
- Increase the sphere radius
- Reduce the size of your cells so that at least you have about 10 cells within the radial length (if you want to obtain something that starts looking like an sphere). The link I passed you may be of help to interpolate the values of alpha1 afterwards. In order to avoid dealing with millions of elements, I recommend you to take a look at a pre-processing tool called "refineMesh" in order to pre-refine only a certain part of your mesh (you can call it several times if more than one refinement is needed).

Good luck!
Fahmida likes this.
guin is offline   Reply With Quote

Old   July 25, 2019, 05:45
Default
  #9
Member
 
FaRa
Join Date: Jul 2019
Posts: 33
Rep Power: 7
Fahmida is on a distinguished road
Thank you so much for your help. I am going to try this.
Fahmida is offline   Reply With Quote

Reply

Tags
3 dimension, semi-sphere, setfields


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
Frequently Asked Questions about Installing OpenFOAM wyldckat OpenFOAM Installation 3 November 14, 2023 12:58
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 cfd.direct OpenFOAM Announcements from Other Sources 2 August 31, 2015 14:36
OpenFOAM Foundation Releases OpenFOAM v2.3.0 opencfd OpenFOAM Announcements from OpenFOAM Foundation 3 December 23, 2014 04:43
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 04:52
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 19:07


All times are GMT -4. The time now is 16:48.