Dear Basilisk users,
I am dealing with a 2D two-phase flow simulation under viscous, intertial, gravitational and surface tension effects.
The physical scenario is the following: a liquid jet (directed along x direction) injected into still air.
I was wondering if there is a way to extract, at every iteration, a 1D flow in the liquid jet from the simulation.
In particular, I would like to calculate, at every x, the mean value of a generic quantity (e.g. u.x) inside the liquid jet and then print the values into a file,
obtaining in such a way a 1D equivalent flow field of the liquid jet.
With the following code:
float avg =0;
int N = 1;
foreach() {
(if f[] > 0 && x == x_current)
avg += u.x;
N +=1;
}
avg=avg/N;
I should be able to evaluate the mean u.x value at x_current.
But how to save this value into a vector?
And, moreover, I think that run this code for every "x_current" and for every iteration will be absolutely not efficient.
Do you know if there is any function in BASILISK that can help me? Or do you have any suggestions?
Thanks a lot for your help.
Alessandro