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

Open Foam /Setfields

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree19Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 28, 2010, 03:11
Default Open Foam /Setfields
  #1
Member
 
Mohammad Zakerzadeh
Join Date: Dec 2009
Location: Aachen, Germany
Posts: 40
Rep Power: 15
moh1367 is on a distinguished road
Hi!
I want to use VOF solver and need to set the field in an exact manner. for example set in a circular region or other more complicated shapes. Can anyone help me?
moh1367 is offline   Reply With Quote

Old   January 28, 2010, 14:51
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,224
Rep Power: 49
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by moh1367 View Post
Hi!
I want to use VOF solver and need to set the field in an exact manner. for example set in a circular region or other more complicated shapes. Can anyone help me?
http://openfoamwiki.net/index.php/Co...funkySetFields would be a possibility. Or write your own custom utility for your application
songwukong and aow like this.
gschaider is offline   Reply With Quote

Old   January 28, 2010, 15:43
Default
  #3
Member
 
Mohammad Zakerzadeh
Join Date: Dec 2009
Location: Aachen, Germany
Posts: 40
Rep Power: 15
moh1367 is on a distinguished road
Thanks alot but can my reason satisfied simpler for example is there a substitution for ?Box to cell" in the Foam?
moh1367 is offline   Reply With Quote

Old   March 22, 2012, 07:09
Default
  #4
New Member
 
muhammad El-nashash'ee
Join Date: Aug 2011
Posts: 4
Rep Power: 13
mu.e.nash is on a distinguished road
there is a list for available types
Valid topoSetSource types :

39
(
boundaryToFace
boxToCell
boxToFace
boxToPoint
cellToCell
cellToFace
cellToPoint
cylinderAnnulusToCell
cylinderToCell
faceToCell
faceToFace
faceToPoint
faceZoneToCell
faceZoneToFaceZone
fieldToCell
labelToCell
labelToFace
labelToPoint
nbrToCell
nearestToCell
nearestToPoint
normalToFace
patchToFace
pointToCell
pointToFace
pointToPoint
regionToCell
rotatedBoxToCell
setToCellZone
setToFaceZone
setToPointZone
setsToFaceZone
shapeToCell
sphereToCell
surfaceToCell
surfaceToPoint
zoneToCell
zoneToFace
zoneToPoint
)
mu.e.nash is offline   Reply With Quote

Old   November 27, 2012, 10:12
Default
  #5
Member
 
Join Date: May 2012
Posts: 55
Rep Power: 13
styleworker is on a distinguished road
Two examples of selecting specific region & faces(setFieldsDict):

regions
(
/*cylinderToCell
{
p1 (0 0 -0.025); //Min
p2 (0 0 0.05); //Max
radius 0.098;

fieldValues
(
volScalarFieldValue alpha1 1
);
}*/
patchToFace
{
name sym1;
fieldValues
(
volScalarFieldValue alpha1 1
);
}


);
dokeun and ms.hashempour like this.
styleworker is offline   Reply With Quote

Old   January 7, 2013, 11:02
Default
  #6
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,677
Blog Entries: 6
Rep Power: 49
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

is it possible to set the cell values of alpha1 (i.e) to 1 in a given STL file?
Therefor I want to use the "surfaceToCell" method. Is that method for that ?

Thanks tobi
jiejie and thunde47 like this.
Tobi is offline   Reply With Quote

Old   October 7, 2015, 06:08
Default
  #7
Member
 
sandy
Join Date: Mar 2013
Location: Cardiff, UK
Posts: 74
Rep Power: 11
sandy13 is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi all,

is it possible to set the cell values of alpha1 (i.e) to 1 in a given STL file?
Therefor I want to use the "surfaceToCell" method. Is that method for that ?

Thanks tobi
Dear Tobi,
I am looking for the same thing you asked about.. did you find the answer for this question? can we import STL under a certain name and give it liquid properties and how to do the setting in setFields? if this possible.. do we need any extra dictionary to define?
Thanks in advance,
Sandy13,
sandy13 is offline   Reply With Quote

Old   November 19, 2015, 15:12
Default
  #8
New Member
 
Olivier Rouch
Join Date: Jul 2009
Location: Montreal, Canada
Posts: 8
Rep Power: 15
roucho is on a distinguished road
Send a message via MSN to roucho
Hi Sandy,
I used this code as a setSet batch of commands, to define a porous region inside a tunnel:
Code:
pointSet tempSet new surfaceToPoint "./constant/triSurface/vehicles.stl" 0.1 true false
cellSet vehiclesSet new pointToCell tempSet any

pointSet tempSet remove
cellZoneSet vehiclesZone new setToCellZone vehiclesSet
Using the resulting cellZone (vehiclesZone) in setFields should be straightforward.
Happy FOAMing!
jiejie and kostnermo like this.
roucho is offline   Reply With Quote

Old   March 10, 2016, 15:26
Default
  #9
New Member
 
Alpha Beta
Join Date: Mar 2016
Posts: 28
Rep Power: 8
xoitx is on a distinguished road
Quote:
Originally Posted by mu.e.nash View Post
there is a list for available types
Valid topoSetSource types :

39
(
boundaryToFace
boxToCell
boxToFace
boxToPoint
cellToCell
cellToFace
cellToPoint
cylinderAnnulusToCell
cylinderToCell
faceToCell
faceToFace
faceToPoint
faceZoneToCell
faceZoneToFaceZone
fieldToCell
labelToCell
labelToFace
labelToPoint
nbrToCell
nearestToCell
nearestToPoint
normalToFace
patchToFace
pointToCell
pointToFace
pointToPoint
regionToCell
rotatedBoxToCell
setToCellZone
setToFaceZone
setToPointZone
setsToFaceZone
shapeToCell
sphereToCell
surfaceToCell
surfaceToPoint
zoneToCell
zoneToFace
zoneToPoint
)
Where did you get this from and what do they mean? All of them are min max type?
xoitx is offline   Reply With Quote

Old   April 20, 2016, 08:20
Default
  #10
New Member
 
Daniel Duque
Join Date: Jan 2011
Location: ETSIN, Madrid
Posts: 28
Rep Power: 13
dduque is on a distinguished road
Quote:
Originally Posted by xoitx View Post
Where did you get this from and what do they mean? All of them are min max type?
It's easy to get this sort of output, simply type some impossible name on setFieldsDict (instead of, say, "boxToCell", type "which" or anything), and you will get this list. It works in all sorts of places, it's a convenient way to get the options of some parameter.
chunming and xoitx like this.
dduque is offline   Reply With Quote

Old   August 28, 2016, 13:21
Default multiple regions
  #11
New Member
 
Marco Grippa
Join Date: Aug 2016
Posts: 3
Rep Power: 8
marcociccio is on a distinguished road
Similar question: is it possible to set multiple regions? I typed 2 cylinderToCell, 1 boxToCell and 1 boxToFace but not all are highlighted when I check in paraView.
How come?
Thanks a lot in advance
marcociccio is offline   Reply With Quote

Old   February 14, 2017, 12:30
Default
  #12
Member
 
Sebastian Trunk
Join Date: Mar 2015
Location: Erlangen, Germany
Posts: 60
Rep Power: 9
sisetrun is on a distinguished road
Hello everybody,

I found this thread while I was searching for my question on how to assign the field values permanently...?
Lets say like a BC!

I want to do some tracer simulations with scalarTransportFoam. Since my interesting region starts away from the inlet, I would loose a lot of time by calculating the flow to the interesting region...

I had a solution by adding a forAll loop in the scalarTransportFoam solver where I select all cells at a given z-position and set their value to 1. Worked fine on one core, but when I moved to the cluster and parallel run, things do not work as they should.

Thanks for your help.

Best regards,

Sebastian
sisetrun is offline   Reply With Quote

Old   January 2, 2018, 07:21
Default
  #13
Member
 
Emad Tandis
Join Date: Sep 2010
Posts: 77
Rep Power: 14
EmadTandis is on a distinguished road
Hello everyone
I just saw this thread
I want to implement an algorithm in which there is a need to define some volField and surfaceField on a mesh with different zones, e.g. viscosity on cellZones and flux on faceZones that have different values at different zones. These fields also need to be updated through solution. I want to do this in my code rather than topoSet or setSet utilities. in a nutshell, I am wondering if there is any way to define a field which has different values at different zones
Any help will be appreciated
EmadTandis is offline   Reply With Quote

Old   January 2, 2018, 08:22
Default
  #14
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,224
Rep Power: 49
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by EmadTandis View Post
Hello everyone
I just saw this thread
I want to implement an algorithm in which there is a need to define some volField and surfaceField on a mesh with different zones, e.g. viscosity on cellZones and flux on faceZones that have different values at different zones. These fields also need to be updated through solution. I want to do this in my code rather than topoSet or setSet utilities. in a nutshell, I am wondering if there is any way to define a field which has different values at different zones
Any help will be appreciated
If you don't want to code in C++ then swak4Foam might help you: especially the expressionField-functionObject (or manipulateField) that creates a field according to an expression and updates it at every time-step
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   January 18, 2018, 10:05
Default Setfield for Semi-circular-cylindrical region
  #15
Member
 
Shafik Walakaka
Join Date: Oct 2017
Posts: 38
Rep Power: 7
walakaka is on a distinguished road
Hi guys!

I am trying to run a two-phase flow of air-water.

The system initializes the cylinder as completely containing air. I am have having difficulty trying to setField half of my cylinder to contain water.

Could anyone assist me in this matter please?

Kind regards
Shafik
walakaka is offline   Reply With Quote

Old   January 18, 2018, 23:32
Default
  #16
Senior Member
 
Taher Chegini
Join Date: Nov 2014
Location: Houston, Texas
Posts: 125
Rep Power: 11
Taataa is on a distinguished road
Quote:
Originally Posted by walakaka View Post
Hi guys!

I am trying to run a two-phase flow of air-water.

The system initializes the cylinder as completely containing air. I am have having difficulty trying to setField half of my cylinder to contain water.

Could anyone assist me in this matter please?

Kind regards
Shafik
The region doesn't necessarily have to match the geometry. You can use a boxToCell in a way that one side passes through the center of the cylinder and the other side should just be more than the radius of the cylinder.
Taataa is offline   Reply With Quote

Old   April 15, 2019, 08:23
Default
  #17
Member
 
Join Date: Apr 2018
Location: UK
Posts: 71
Rep Power: 6
JM27 is on a distinguished road
Quote:
Originally Posted by gschaider View Post
If you don't want to code in C++ then swak4Foam might help you: especially the expressionField-functionObject (or manipulateField) that creates a field according to an expression and updates it at every time-step
Hi there,


I want to try something similar but I am using OF version 5 and it seems that swak4Foam is not supported with this version.


Any alternative suggestions/ideas on how this can be done?


Specifically, I am simulating bubble oscillations and want to implement a smoothing function on alpha1 to eliminate parasitic currents at the interface...



Thanks!
JM27 is offline   Reply With Quote

Old   April 15, 2019, 08:47
Default
  #18
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,224
Rep Power: 49
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by JM27 View Post
Hi there,


I want to try something similar but I am using OF version 5 and it seems that swak4Foam is not supported with this version.


Any alternative suggestions/ideas on how this can be done?


Specifically, I am simulating bubble oscillations and want to implement a smoothing function on alpha1 to eliminate parasitic currents at the interface...



Thanks!

Version 0.4.2 from December supports 5.0 (in addition to v6, 1806 and 1812). Seems that I didn't advertise it too aggressively at the time
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 17, 2019, 06:09
Default
  #19
Member
 
Join Date: Apr 2018
Location: UK
Posts: 71
Rep Power: 6
JM27 is on a distinguished road
That's great! Last time I checked was November to it was not available at the time..good to hear it is now supported also in the newer OF versions, thanks for this
JM27 is offline   Reply With Quote

Old   April 17, 2019, 10:45
Default
  #20
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,224
Rep Power: 49
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by JM27 View Post
That's great! Last time I checked was November to it was not available at the time..good to hear it is now supported also in the newer OF versions, thanks for this

Usually the development-branch of the repository supports new OF versions a couple of weeks after their release (ESI-releases usually when they are released as ESI supplies me with patches for swak before the release)
I only do releases rarely because they have to be tested against the different distros. But I plan to do them more often (based on the ESI-release cycle as that is the distro I currently use most and they have a release schedule that allows me to plan)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Reply

Tags
openfoam, setfields, vof

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 15:11
Problem installing on Ubuntu 9.10 -> 'Cannot open : No such file or directory' mfiandor OpenFOAM Installation 2 January 25, 2010 10:50
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 09:19


All times are GMT -4. The time now is 22:02.