CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

How to Add STL file in setFieldsDict file to initialise water phase in multiphase

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 15, 2024, 14:33
Default How to Add STL file in setFieldsDict file to initialise water phase in multiphase
  #1
New Member
 
BabuG
Join Date: May 2024
Posts: 13
Rep Power: 2
papaji is on a distinguished road
dears,
I am simulating a multiphase case. It is a square box with a complex shape region which is to be set a water. The complex shape is a combination of a cylinder with a cone.
I was trying to add the STL file in the "setFieldsDict" file saved in folder constant.
The corresponding STL (phase.STL) file is saved in working directory as suggested in one of the posts in this forum.
However, the cell region within the phase.STL is not getting initialised properly. I played with different values for parameters "near distance" and "curvature"
Kindly suggest better method.
By the way I am using OpenFoam-12 version. I started with the tutorial dambreak3d case as base case.
Further there is a file "topoSetDict". I have no idea if this file is to be modified.

+++++++++++++++++File: setFieldsDict+++++++
defaultFieldValues
(
volScalarFieldValue alpha.water 0
volVectorFieldValue U (0 0 0)
);

regions // Select based on surface
(
surfaceToCell
// VOF initialization with a STL file (closed volume)
{
file "phase.stl";
outsidePoints ((0.0 0.0 0.13)); // definition of volume outside
includeCut false; // cells cut by surface
includeInside yes; // include cells inside surface
includeOutside no; // exclude cells outside surface
useSurfaceOrientation true; // use surface normals
nearDistance -1; // cells with centre near surface
curvature 0; // cells within nearDistance

fieldValues
(
volScalarFieldValue alpha.water 1
volVectorFieldValue U (0 0 0)
);
}
);
++++++++++++++++++++++++++++++++++++++++++++
papaji is offline   Reply With Quote

Old   September 16, 2024, 03:36
Default
  #2
Senior Member
 
M
Join Date: Dec 2017
Posts: 694
Rep Power: 12
AtoHM is on a distinguished road
You are on the right path and the definition seems correct at first glance. Can you record and post the output of the command setFields here?

You can forget about topoSetDict for now, it is not relevant for the issue at hand.
AtoHM is offline   Reply With Quote

Old   Today, 04:29
Default
  #3
New Member
 
BabuG
Join Date: May 2024
Posts: 13
Rep Power: 2
papaji is on a distinguished road
Dear AtoHM,

Thank you for your response.
Based on your response I modified the CylinderCone STL file. Actually I just compounded the two geometries in SALOME and used it. After your comment, I got the confidence on procedure and doubted STL file. So I converted the geometry to Solid using sewing option in SALOME. Now the setFieldsDict is working fine and water region is also correctly initiated.
The correct setFieldsDict is:

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

defaultFieldValues
(
volScalarFieldValue alpha.water 0
volVectorFieldValue U (0 0 0)
);

regions // Select based on surface
(
surfaceToCell
// VOF initialization with a STL file (closed volume)
{
file "filename.stl";
outsidePoints ((0.0 0.0 0.13)); // definition of volume outside
includeCut false; // cells cut by surface
includeInside yes; // include cells inside surface
includeOutside no; // exclude cells outside surface
useSurfaceOrientation true; // use surface normals
nearDistance -1; // cells with centre near surface
curvature 0; // cells within nearDistance

fieldValues
(
volScalarFieldValue alpha.water 1
volVectorFieldValue U (0 0 0)
);
}
);
//NOTE: if "includeCut" is true, then "useSurfaceOrientation" should be false // and vice-versa.
// One can play with values of "nearDistance" and "curvature".


Thank you very much
regards
papaji
papaji 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
Using PengRobinsonGas EoS with sprayFoam Jabo OpenFOAM Running, Solving & CFD 36 July 16, 2024 03:52
[swak4Foam] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 14 November 25, 2020 03:30
OpenFoam "Permission denied" and "command not found" problems. iyidaniel@yahoo.co.uk OpenFOAM Running, Solving & CFD 11 January 2, 2018 06:47
polynomial BC srv537 OpenFOAM Pre-Processing 4 December 3, 2016 09:07
Trouble compiling utilities using source-built OpenFOAM Artur OpenFOAM Programming & Development 14 October 29, 2013 10:59


All times are GMT -4. The time now is 23:20.