CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] wired result of initialization water phase with funkySetFields (https://www.cfd-online.com/Forums/openfoam-community-contributions/115815-wired-result-initialization-water-phase-funkysetfields.html)

liguifan April 7, 2013 15:15

wired result of initialization water phase with funkySetFields
 
3 Attachment(s)
Dear Foamers,

What I want to do is to initialize a cylinder mesh with half water and half air. My cylinder is 0.04 m in height and with a radius of 0.1.

I use
Quote:

funkySetFields -time 0 -keepPatches -field alphawater -expression 1 -condition "pow(pos().x,2)+pow(pos().z,2)<=0.1 && pos().y<=0.02"
The result is quite suprizingk, the lower part of the cylinder is water with red color as showed with air phase formed in the center in which part I use a different way of mesh for structured mesh result.

Can anyone explain why this can happens if possible?

Regards,

gschaider April 7, 2013 17:17

Quote:

Originally Posted by liguifan (Post 418929)
Dear Foamers,

What I want to do is to initialize a cylinder mesh with half water and half air. My cylinder is 0.04 m in height and with a radius of 0.1.

I use

The result is quite suprizingk, the lower part of the cylinder is water with red color as showed with air phase formed in the center in which part I use a different way of mesh for structured mesh result.

Can anyone explain why this can happens if possible?

Regards,

This is for the multiphaseInterFoam, right? (information like this is alway quite interesting, as the others don't have to guess what the fields in your example means)

Your funkySetFields-expression only set the fraction of the water phase but doesn't touch alphas at all (how should it know about the physical connection between alphawater and alphas: it is even more slow-witted than I am and doesn't even try to GUESS what the physical meaning of the fields is).

Where the concrete values of alphas in your pictures come from I have no idea: probably values you somehow set before

liguifan April 7, 2013 17:57

Thanks for the reply, I am currently using multiphaseEulerFoam. I am not sure what alphas plays in the multiphase simulation and that why I don't know how to deal with alphas. In this simulation, there are three phases, water, air and oil. Could you please suggest me what is alphas and what do you mean by physical connection?

How does the alphas relate to the physical connection?

Sorry for the slow-witted question and look forward to hearing from you.

Regards,


Quote:

Originally Posted by gschaider (Post 418940)
This is for the multiphaseInterFoam, right? (information like this is alway quite interesting, as the others don't have to guess what the fields in your example means)

Your funkySetFields-expression only set the fraction of the water phase but doesn't touch alphas at all (how should it know about the physical connection between alphawater and alphas: it is even more slow-witted than I am and doesn't even try to GUESS what the physical meaning of the fields is).

Where the concrete values of alphas in your pictures come from I have no idea: probably values you somehow set before


gschaider April 8, 2013 04:34

Quote:

Originally Posted by liguifan (Post 418947)
Thanks for the reply, I am currently using multiphaseEulerFoam. I am not sure what alphas plays in the multiphase simulation and that why I don't know how to deal with alphas. In this simulation, there are three phases, water, air and oil. Could you please suggest me what is alphas and what do you mean by physical connection?

How does the alphas relate to the physical connection?

Sorry for the slow-witted question and look forward to hearing from you.

Regards,

No idea what alphas is (guess the sum of the alphas). Look at the source or run the tutorial and check the values to find out.

Concerning your pictures: it's hard to tell what is actually going on without knowing what values blue and red refer to: always add colorbars. Also: to check results always use the cell values. Point values are only for "pretty pictures"

General: best strategy will probably be to set the fractions of N-1 phases and then calculate the fraction of the last phase with "1-alphawater-alphaX ..."

kwardle April 30, 2013 15:28

alphas is simply the sum of the individual phases to give you a simple way to visualize and color all the phases at once. It will have a value in the range of 0 to Nphases-1. For example, if you have three phases water, oil, and air (defined this order in transportProperties). Then alpha = 0 is water, alpha = 1 is oil, and alpha = 2 is air. This field is calculated by the solver and you do not need to have this file in your 0 directory or do anything to get it.

Bernhard is right--you are considering only alphawater, but multiphaseEulerFoam is set up for an arbitrary number of phases and so it does not assume on its own that if you specify only two phases and give a volume fraction for one of them, then the other is 1-alphawater. So you need to explicitly initialize the volume fraction for each phase in this case.
-Kent


All times are GMT -4. The time now is 17:54.