CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Open Foam /Setfields (https://www.cfd-online.com/Forums/openfoam-solving/72187-open-foam-setfields.html)

moh1367 January 28, 2010 02:11

Open Foam /Setfields
 
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?

gschaider January 28, 2010 13:51

Quote:

Originally Posted by moh1367 (Post 244008)
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

moh1367 January 28, 2010 14:43

Thanks alot but can my reason satisfied simpler for example is there a substitution for ?Box to cell" in the Foam?

mu.e.nash March 22, 2012 06:09

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
)

styleworker November 27, 2012 09:12

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
);
}


);

Tobi January 7, 2013 10:02

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

sandy13 October 7, 2015 05:08

Quote:

Originally Posted by Tobi (Post 400503)
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,

roucho November 19, 2015 14:12

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!

xoitx March 10, 2016 14:26

Quote:

Originally Posted by mu.e.nash (Post 350858)
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?

dduque April 20, 2016 07:20

Quote:

Originally Posted by xoitx (Post 589059)
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.

marcociccio August 28, 2016 12:21

multiple regions
 
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

sisetrun February 14, 2017 11:30

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

EmadTandis January 2, 2018 06:21

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

gschaider January 2, 2018 07:22

Quote:

Originally Posted by EmadTandis (Post 676664)
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

walakaka January 18, 2018 09:05

Setfield for Semi-circular-cylindrical region
 
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

Taataa January 18, 2018 22:32

Quote:

Originally Posted by walakaka (Post 678574)
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.

JM27 April 15, 2019 07:23

Quote:

Originally Posted by gschaider (Post 676675)
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!

gschaider April 15, 2019 07:47

Quote:

Originally Posted by JM27 (Post 730811)
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

JM27 April 17, 2019 05:09

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 :)

gschaider April 17, 2019 09:45

Quote:

Originally Posted by JM27 (Post 731053)
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)


All times are GMT -4. The time now is 08:03.