epfl-ecps / channelflow

Channelflow is a software system for numerical analysis of the incompressible fluid flow in channel geometries, written in C++ and MPI-parallelized.
GNU General Public License v2.0
65 stars 29 forks source link

fieldprops printing nonzero dPdx when running with -dPds 0 option #27

Closed burakbudanur closed 1 year ago

burakbudanur commented 3 years ago

[Edit following the discussion: Our initial "expected result" turns out to be wrong. Although, perhaps, it should be made clear to the user that the dpds = 0 condition wouldn't be visible in the output of fieldprops, even when it is imposed.]

Describe the bug

(reporting on behalf of E. Marensi) We are trying to simulate plane-Couette flow in the HKW cell at Re=400. However, we realised that the data generated had nonzero streamwise pressure gradient and mean flows.

Expected Result

0 pressure gradient.

Actual Result

nonzero pressure gradient

Steps to reproduce the issue

$ srun simulateflow -R 400 -bf linear -Uwall 1 -mc gradp -Ubulk 0.0 -dPds 0.0 -T 2000 -dT 0.1 -s 10 -dt 0.01 -e 0.000001 -CFLmin 0.15 -CFLmax 0.3 -np0 1 -np1 16 initial.nc 
$ fieldprops data/u1.nc 

running with different flags

$ srun simulateflow -R 400 -bf linear -Uwall 1 -mc gradp -dPds 0.0 -T 2000 -dT 0.1 -s 10 -dt 0.01 -e 0.000001 -CFLmin 0.15 -CFLmax 0.3 -np0 1 -np1 16 initial.nc
$ fieldprops data/u1.nc 

also resulted in states with nonzero pressure gradients. I could also reproduce it by running examples/couette, the states that are generated by this had nonzero streamwise pressure gradient and mean flow.

Information on your system

We are running on IST HPC Cluster which is a Debian Linux system. processinfo file in the run folder reads

Git rev:  e9209c9e71db8561bac719244603e8d817e05fc5
Compiler: GNU 8.3.0
sajjadazimi commented 3 years ago

When you impose zero gradient pressure, bulk velocity becomes zero only on average, and vice versa. Also, the mean pressure gradient that is calculated by fieldprop is only correct if the field is a fixed point (or travelling wave). In fieldprops, the mean pressure gradient is computed based on an integral force balance in the box, and by computing velocity slopes at the walls. This force balance is valid only if the field is not changing in time. However, if you consider a long time then the force balance is also valid on average, which means that the mean pressure gradient computed by fieldprops should also be zero on average. In conclusion, the mean pressure gradient computed in fieldprops is not actually the true imposed pressure gradient for a turbulent state. And the mean velocity should be zero on average.

burakbudanur commented 3 years ago

I see. I was naively expecting for Couette case both the mean pressure gradient and bulk velocity to be always 0 but I guess the issue is more subtle than I thought. So we should disregard the dpds in the output of fieldprops for turbulent states. I guess the example/couette is also run with 0 pressure gradient constraint and that's the reason why Ubulk fluctuates?

sajjadazimi commented 3 years ago

Yes, that's right. In example/couette zero pressure gradient is imposed.

johnfgibson commented 3 years ago

Only one of the pressure gradient or bulk velocity constraints can apply. If you turn on both via command-line args, one takes precedence over the other. I can't remember which right now. It would be good to check if both are turned on and warn the user.

Of course you can get both simultaneously with an initial condition that satisfies a sigma_xy symmetry.

On Wed, Jun 23, 2021 at 5:31 PM Sajjad Azimi @.***> wrote:

Yes, that's right

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/epfl-ecps/channelflow/issues/27#issuecomment-867173406, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADRUQW76X77GX3K2HP326HTTUJHDNANCNFSM47GBLP7A .

-- John F. Gibson Associate Professor Department of Mathematics and Statistics Integrated Applied Mathematics Program University of New Hampshire Durham, NH 03824

Kingsbury Hall N309E, 603-862-2681

burakbudanur commented 3 years ago

Thanks!