CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   How to calculate free-surface distance,velocity,etc... (https://www.cfd-online.com/Forums/openfoam-post-processing/94638-how-calculate-free-surface-distance-velocity-etc.html)

 deifobe November 22, 2011 00:23

How to calculate free-surface distance,velocity,etc...

1 Attachment(s)
Hi,
I'm triyng simulate droplet formation through a t-junction (using interFoam), but now i have to compute the average inter-drop distance, drops velocity and their lenght.
For the lenght i have found a temporary solution using paraFoam contour->clip->slice, for the plot alpha1 vs time I use probe in controlDict and for others measurements the sample utility but for the inter-drop distance or drops velocity i have no idea.
Attachment 10169

 Bernhard November 22, 2011 03:19

Maybe you can sample the value of alpha1 over the centerline of the channel. Then you need to write a small script to process the [x, alpha1] data, but I suppose you get the point.

 stealth May 30, 2012 06:22

Hello OpenFoam User,

I am a new to openFoam and currently interested in simulating droplet formation through a T Junction. The image you posted for droplet formation looks really nice. It will be of great help if you can suggest me how to proceed with interFoam to study droplet formation.

Sincerely,

as

Quote:
 Originally Posted by deifobe (Post 333000) Hi, I'm triyng simulate droplet formation through a t-junction (using interFoam), but now i have to compute the average inter-drop distance, drops velocity and their lenght. For the lenght i have found a temporary solution using paraFoam contour->clip->slice, for the plot alpha1 vs time I use probe in controlDict and for others measurements the sample utility but for the inter-drop distance or drops velocity i have no idea. Thanks in advance. Attachment 10169

 deifobe May 30, 2012 20:50

yes, i have hardly worked on this and i'm happy that may be useful for someone.
what are your problems? boundary conditions, geometry, results analysis....?

 stealth May 31, 2012 03:04

Hello deifobe,

Many thanks for your response. I am using the example "damBreak" to create my system. So I created a T Junction Geometry, uses the similar files for "system" as in the damBreak example (I hope they are correct for this). I think the major problem I get is in defining the boundary conditions for two phase flow. It will be of great help if you can explain how you have defined the boundary conditions for two inlets and one outlet or if possible you may give me a demo file for them.

Thanks a lot,

as

Quote:
 Originally Posted by deifobe (Post 363937) yes, i have hardly worked on this and i'm happy that may be useful for someone. what are your problems? boundary conditions, geometry, results analysis....?

 deifobe May 31, 2012 17:43

1 Attachment(s)
Attachment 13498
This is an exemplary case, remember to use setFields command, if don't understand something ask me ;)

 stealth June 5, 2012 09:38

1 Attachment(s)
Hello,

Thanks you very much for such a useful file. I was trying to improve the geometry but I stuck with a problem. For Eg:

If I try to change some variables of your file :

InletOil -> InletA
InletWater -> InletB,

I make the changes at the following places :-

1) blockMeshDict
2) alpha1.org
3) alpha
4) p_rgh
5) U

and then I tried :

blockMesh
setFields
interFoam,

simulation starts fine but min(alpha1) in my simulation goes negative. And I observe something different in paraFoam. What is the expected problem or some important point I am missing ?

Please have a look at the attached file.

Thanking You,

Sincerely,

as

 deifobe June 5, 2012 09:55

Hi guy,
it's ok that min(alpha1) is negative, what you observe different in paraFoam? Please, post a n image of your result.

 stealth June 5, 2012 10:10

1 Attachment(s)
Hello,

Here is the Image after first time step. I am surprised as in your case minAlpha is approx zero (even negative but almost zero). And, just by changing the variable names, I get different values (negative that too increases with time). I think I am doing some blunder while defining the initial conditions.

Thanx

as

Quote:
 Originally Posted by deifobe (Post 364842) Hi guy, it's ok that min(alpha1) is negative, what you observe different in paraFoam? Please, post a n image of your result.

 deifobe June 5, 2012 10:45

the inlet in which you set alpha1=1
(from alpha1 file:
inletA
{
type fixedValue;
value uniform 1;
})
is the the inlet of the dispersed (droplet) phase (e.g. water). Then you are wrong in the blockMeshDict file, you must exchange in this file inletA with inletB, to understand this you can draw the geometry on a paper with vertices numbers.

 stealth June 11, 2012 12:53

Small Time Step

2 Attachment(s)
Hello deifobe,

Thanks for pointing out my mistake. I used your file to create little bit complex setup (as shown in fig. attached). In this case when I run the same, deltaT becomes very small of the order of 1e-11. Is this usual or problematic ? Please let me know if you have encountered this type of problem. I expect this due to mesh I created, which effects the Courant number. It will be be great help if you can suggest me how to solve this problem ?

A. Sharma

Quote:
 Originally Posted by deifobe (Post 364859) the inlet in which you set alpha1=1 (from alpha1 file: inletA { type fixedValue; value uniform 1; }) is the the inlet of the dispersed (droplet) phase (e.g. water). Then you are wrong in the blockMeshDict file, you must exchange in this file inletA with inletB, to understand this you can draw the geometry on a paper with vertices numbers.

 giack April 20, 2013 13:04

Hi to all
I have a similar problem. My geometry is an horizontal pipe completely filled with liquid. At initial time the air can enter into the pipe and form a bubble that move forward into the pipe. I want to calculate the velocity and the position of the front of the bubbles over pipe channel length and the height of the bubble over time. You have any suggestion?

Thanks a lot

 deifobe April 20, 2013 15:02

Hello,
you can use the probes for U and alpha1 in controlDict file choosing a line that passes through the middle of your channel. After, you can elaborate the output probe file for alpha1 by octave or matlab to find the positions of the front of the bubble vs time finding the points in which the value of alpha1 is about 1 (has a maximum).
I hope this will help.

 giack April 21, 2013 17:57

I already completed simulations so I look for a way to post-process without restart their.
Moreover I don't know the position of the bubble front so I don't know where place probes...

 deifobe April 23, 2013 06:35

You can use the sample utility but you will obtain, the values of alpha1 and U split in time directories, in my opinion in this manner is more complicated to extract the data that you need.
This is an example of sampleDict:

interpolationScheme cell;
setFormat gnuplot;
sets
(
centerPatch
{
type uniform;
axis xyz; //line in the middle of horizontal channel
start (-0.00046 5e-05 25e-06);
end (0.00041 5e-05 25e-06);
nPoints 100;
}
);

surfaces
();

fields
(
alpha1
);
I suggest you to use the probes choosing a set of equally spaced points on the line in the middle of horizontal channel.;)

 giack April 23, 2013 07:10

thank you,I'll try it. but in this way I calculate alpha and U in middle of channel?I need U of the front of bubble that isn't in pipeline center.
I tried this procedure:
-contour of alpha=0.5
-slice normal to x at 0,0,0
-slice normal to y at 0,0.0175,0
-plot selection over time

the result are ok but the problem is the follow: the front bubble is not at a constant y but vary between 0.015 and 0.0175 so I must view manually when the y bubble front change and merge two graphics.
After set contour of alpha=0.5 there is a way to choose the minimum value of a coordinates (z in my case)? In this way would be all automatic

 gschaider April 23, 2013 19:56

Quote:
 Originally Posted by giack (Post 422546) thank you,I'll try it. but in this way I calculate alpha and U in middle of channel?I need U of the front of bubble that isn't in pipeline center. I tried this procedure: -contour of alpha=0.5 -slice normal to x at 0,0,0 -slice normal to y at 0,0.0175,0 -plot selection over time the result are ok but the problem is the follow: the front bubble is not at a constant y but vary between 0.015 and 0.0175 so I must view manually when the y bubble front change and merge two graphics. After set contour of alpha=0.5 there is a way to choose the minimum value of a coordinates (z in my case)? In this way would be all automatic
I'd suggest swak4Foam (as I usually do): you can do calculations on sampledSurfaces and there is a isoSurface-sampledSurface. In your case if I gather you correctly the expression you want is "min(pos().z)". The capillaryRise in the Examples is doing something similar. For doing these calculations in postprocessing you can use funkyDoCalc (although I must admit that I haven't used it yet with an isosurface)

 All times are GMT -4. The time now is 11:59.