Difference between internalField and setFields
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?
|
Hi
internalFields are your fields like pressure field velocity field and etc. setFields is a function that initialize your requested fields. |
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?
|
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 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> |
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. |
setFields to set non uniform list for internal Field?
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! |
Quote:
You can use funkySetFields that comes with swak4Foam. |
Hi Ata,
Did you see my message concerning interFoam with smoother. Thanks. |
1 Attachment(s)
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! |
Quote:
|
Set fields dict bubble column water height
Quote:
I used salome for the geometry. Could it be because of that? |
Hello
I'd like to fill a cylinder halfway with charcoal. Can you help me with the setFieldDict tool? |
Greetings
What does $internalField mean. Can someone please explain function of $. Thanks |
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. |
Quote:
|
All times are GMT -4. The time now is 19:29. |