|
[Sponsors] |
Difference between internalField and setFields |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 10, 2013, 02:19 |
Difference between internalField and setFields
|
#1 |
Senior Member
Join Date: Jul 2011
Posts: 120
Rep Power: 14 |
Hi all, I am new here. Following the guide on shallowWaterFoam, I am not sure why at the start we have included the internalFields, which I assume is the initial conditions, and we still have to run setFields before running foam? Can anyone enlighten me?
|
|
January 14, 2013, 01:59 |
|
#2 |
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 17 |
Hi
internalFields are your fields like pressure field velocity field and etc. setFields is a function that initialize your requested fields. |
|
January 14, 2013, 02:24 |
|
#3 |
Senior Member
Join Date: Jul 2011
Posts: 120
Rep Power: 14 |
Hi, could you please elaborate further with examples? I.e. for the shallowwaterfoam, if we did not use setfields, wouldn't it be the same as it would take the field values initially?
|
|
January 15, 2013, 07:24 |
|
#4 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28 |
When you want to define an internal field with internalField you have two options:
Either define a uniform value for the whole domain, or use a list to assign each cell its own value. setFields is a utility which you can use to define geometric regions with different field values. Example: You want to initialize a half empty water glass. The two-phase solvers use a scalar field - the volume fraction alpha1 - to quantify how much water/air a cell contains. In the case of the water glass alpha1=0 means only water and alpha1=1 means only air. This is a setFieldsDict entry to initialize a partly filled vessel. Code:
defaultFieldValues ( volScalarFieldValue alpha1 1 ); // alpha1 = 0 <=> no air, only water regions ( // Set cell values // (does zerogradient on boundaries) boxToCell { box (-0.3 -0.3 0) (0.3 0.3 0.39); fieldValues ( volScalarFieldValue alpha1 0 ); } ); The following is a part of the 0/alpha1 file of the bubble column tutorial of twoPhaseEulerFoam. There the internal field is defined using the internalField keyword. In this case you have 1875 cells. Consequently, the list has to be 1875 entries long. Code:
internalField nonuniform List<scalar> 1875 ( 0.0548304 0.0623421 // and so on .... Last edited by GerhardHolzinger; January 15, 2013 at 07:26. Reason: added more explanation |
|
January 15, 2013, 07:39 |
|
#5 | |
Senior Member
Join Date: Jul 2011
Posts: 120
Rep Power: 14 |
Quote:
Thanks for the explanation, thus am I right to say that in the shalloWaterFoam example the results will be the same even if setFields isn't used? Since it has been described in internalfield in each cell at the start? No alpha1 is used there. Last edited by haze_1986; January 15, 2013 at 10:37. |
||
September 21, 2013, 09:12 |
setFields to set non uniform list for internal Field?
|
#6 |
Senior Member
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 13 |
Hi,
can I use setFields to set a non uniform Temperature field like T = Ax+By in the internal Field in a simple geometry like a cavity? If yes, what should the setFieldsDict contain? Thank you in advance!
__________________
Regards, Srivaths |
|
September 21, 2013, 11:02 |
|
#7 | |
Senior Member
Mohammad Shakil Ahmmed
Join Date: Oct 2012
Location: AUS
Posts: 137
Rep Power: 14 |
Quote:
You can use funkySetFields that comes with swak4Foam. |
||
January 13, 2014, 21:02 |
|
#8 |
Member
Olabanji
Join Date: Jan 2013
Location: U.S.A
Posts: 31
Rep Power: 13 |
Hi Ata,
Did you see my message concerning interFoam with smoother. Thanks. |
|
July 10, 2017, 04:32 |
|
#9 |
New Member
Alice
Join Date: Jun 2017
Posts: 26
Rep Power: 8 |
Hi,
Why my setFields is not work. My setFields is that. defaultFieldValues ( volScalarFieldValue alpha.water 0 ); regions ( boxToCell { box (0 0 0) (0.5 0.1 0.1); fieldValues ( volScalarFieldValue alpha.water 1 ); } ); This case is a channel od dimensions 1.00m*0.10m*0.15m(length, width, height). No matter how to change the boxToCell, there is nothing to change. Only the inlet is water. But i want a half water and the rest is air. I really nead help. Thank you! |
|
August 11, 2017, 11:28 |
|
#10 | |
Senior Member
Elham
Join Date: Oct 2009
Posts: 184
Rep Power: 16 |
Quote:
|
||
April 18, 2018, 15:14 |
Set fields dict bubble column water height
|
#11 |
New Member
Join Date: Apr 2018
Posts: 2
Rep Power: 0 |
||
May 13, 2020, 15:10 |
|
#12 |
New Member
sante junior
Join Date: Oct 2016
Posts: 11
Rep Power: 9 |
Hello
I'd like to fill a cylinder halfway with charcoal. Can you help me with the setFieldDict tool? |
|
January 19, 2021, 18:42 |
|
#13 |
Senior Member
starter
Join Date: Sep 2012
Posts: 125
Rep Power: 15 |
Greetings
What does $internalField mean. Can someone please explain function of $. Thanks |
|
January 19, 2021, 21:47 |
|
#14 | |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,674
Rep Power: 66 |
Quote:
$internalField is a pointer used on boundaries to point to the internal field and use this as the boundary field value. The boundary faces take on the value of the adjacent cells at runtime. You use this when you don't want to specify explicitly the boundary values but just want to use whatever is available from the internal field. A very common situation where it is used is at outlets since it makes sense to use whatever is variable that has arrived at the outlet rather than setting an arbitrary fixed value. |
||
September 17, 2021, 04:55 |
|
#15 | |
Member
Honza Höll
Join Date: Mar 2016
Location: Brno, CZ
Posts: 34
Rep Power: 10 |
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
setFields not working | dsanza | OpenFOAM | 4 | October 18, 2018 09:43 |
non-uniform internalField | shash | OpenFOAM Pre-Processing | 8 | January 4, 2017 12:30 |