|
[Sponsors] |
April 2, 2021, 18:51 |
setFields problems
|
#1 |
New Member
Join Date: Mar 2021
Posts: 4
Rep Power: 5 |
Dear all,
To simulate the air flow in a tank I use the OpenFoam program. The tank contains water and particles. As you can see from the attached pictures, the tank is cylindrical and half of it is full with water. For this reason I decided to use an stl file to set the water region in the setFields. I attached the setFields and the STL texts. To program setFields I use the command surfaceToCell. My question is how can I program the setFields text in order to set a portion of the tank to be water. I have also attached the results. Thank you in advance for your help. With Kind Regards, Konstantinos |
|
April 10, 2021, 18:30 |
|
#2 |
Senior Member
Claudio Boezio
Join Date: May 2020
Location: Europe
Posts: 137
Rep Power: 7 |
Hello Konstantinos,
As far as I know it is not necessary that in the setFieldsDict the volume matches exactly the one of your geometry file. I assume that in your case the domain has the shape of the tank's interior. In that case you can more simply define a box that is bigger than the domain and intersects it at the desired fluid level for setting the liquid phase. In essence, the boolean union between the box and the domain will get the cells in the field set to 1. See my suggestion below. I hope I got the coordinates right, I'm used to having z pointing upwards. With this in mind, make sure that g also points in the right direction. Code:
... FoamFile { version 2.0; format ascii; class dictionary; location "system"; object setFieldsDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // defaultFieldValues ( //volScalarFieldValue alpha.air 1 // It is typical to define this the other way around, // air = 0 and water = 1. // First set the entire domain to 0. volScalarFieldValue alpha.water 0 ); // Then only set to 1 what needs to be filled with the liquid phase. regions ( boxToCell { box (-5 -10 -5) (5 0 5); fieldValues ( volScalarFieldValue alpha.water 1 ); } // If needed for the boundary conditions, do the same with faces boxToFace { box (-5 -10 -5) (5 0 5); fieldValues ( volScalarFieldValue alpha.water 1 ); } ); // ************************************************************************* // Cheers, Claudio |
|
April 18, 2021, 06:25 |
|
#3 |
New Member
Join Date: Mar 2021
Posts: 4
Rep Power: 5 |
Dear Claudio,
Thank you for your help. With Kind Regards, Konstantinos |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wierd results after running setFields without getting an error in terminal | vava10 | OpenFOAM Pre-Processing | 3 | January 15, 2021 12:12 |
[ICEM] Problems with coedge curves and surfaces | tommymoose | ANSYS Meshing & Geometry | 6 | December 1, 2020 12:12 |
Problems with setFields | pbOPEN | OpenFOAM Pre-Processing | 2 | March 26, 2019 11:23 |
rhoSimplecFoam with setFields | sino75 | OpenFOAM Pre-Processing | 0 | March 11, 2015 05:08 |
Needed Benchmark Problems for FSI | Mechstud | Main CFD Forum | 4 | July 26, 2011 13:13 |