CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   How many boundary conditions do we need for the pressure? (https://www.cfd-online.com/Forums/main/245524-how-many-boundary-conditions-do-we-need-pressure.html)

shawnldavison October 24, 2023 02:44

I'm still confused. As a Sitecore developer, I think it's too hard for me.

Winston Virtaus October 27, 2023 23:11

1 Attachment(s)
Quote:

Originally Posted by FMDenaro (Post 858096)
You should do the test at constant dt/h ratio, that could solve your issue.

I made some modifications and bugfixes to the code and improved the test setup for the proper constant deltaT/h ratio.

It seems that the divergence error now scales approximately with respect to O(deltaT*h^2) with some small variance. Is this the expected result for APM?

The plot is from one of the Poisseule flow test runs (Re = 3) with constant deltaT/h = 0.6 ratio and the results are taken at t = 2.0s.

FMDenaro October 28, 2023 04:29

Quote:

Originally Posted by Winston Virtaus (Post 858989)
I made some modifications and bugfixes to the code and improved the test setup for the proper constant deltaT/h ratio.

It seems that the divergence error now scales approximately with respect to O(deltaT*h^2) with some small variance. Is this the expected result for APM?

The plot is from one of the Poisseule flow test runs (Re = 3) with constant deltaT/h = 0.6 ratio and the results are taken at t = 2.0s.




COuld you superimpose the ideal slop on the figure? Hae you used the max norm on the error?

Winston Virtaus October 28, 2023 14:31

1 Attachment(s)
Quote:

Originally Posted by FMDenaro (Post 858997)
COuld you superimpose the ideal slop on the figure? Hae you used the max norm on the error?


Here's the version with the ideal slope.

Yes, maximum error was used (L infinity norm).

FMDenaro October 28, 2023 14:38

Quote:

Originally Posted by Winston Virtaus (Post 859031)
Here's the version with the ideal slope.

Yes, maximum error was used (L infinity norm).




That seems fine, you can check your solver for a full unsteady analytical solution (Taylor) to further check for any bugs.

Winston Virtaus October 28, 2023 14:55

Quote:

Originally Posted by FMDenaro (Post 859032)
That seems fine, you can check your solver for a full unsteady analytical solution (Taylor) to further check for any bugs.

Thanks for the comments, much appreciated!

I'll see what kind of bugs i can find from the unsteady vortex case.

Just as a side note, is there a way to know when the divergence error can be considered small enough?
I've seen suggestions from 1e-3 to 1e-8 being used as a criterion but i dont think i've seen any guidelines if the criterion should be case specific.

FMDenaro October 28, 2023 16:10

Quote:

Originally Posted by Winston Virtaus (Post 859033)
Thanks for the comments, much appreciated!

I'll see what kind of bugs i can find from the unsteady vortex case.

Just as a side note, is there a way to know when the divergence error can be considered small enough?
I've seen suggestions from 1e-3 to 1e-8 being used as a criterion but i dont think i've seen any guidelines if the criterion should be case specific.




Working in non-dimensional form, that is with a velocity field =O(1), getting 10^-5-10^-6 is good. That level of errors is easy in the exact projection, not so easy in the approximate one.


If you have a dimensional form, scale the values with the proper lenght and velocity.

Winston Virtaus October 28, 2023 23:16

Quote:

Originally Posted by FMDenaro (Post 859035)
Working in non-dimensional form, that is with a velocity field =O(1), getting 10^-5-10^-6 is good. That level of errors is easy in the exact projection, not so easy in the approximate one.


If you have a dimensional form, scale the values with the proper lenght and velocity.


The strategy seems helpful, i didn't think of using length and velocity scaling before! :)

Yes dimensional form is being used.

Thus, having 0.2 m channel height and 0.66 m/s bulk velocity, this would then give me a O(1) normalization factor which would mean that final two meshes would produce the error in the 1e-5 to 1e-6 range indicating decent incompressibility.

This method would make order of magnitude estimation of incompressibility fairly straightforward

Winston Virtaus December 21, 2023 14:10

3 Attachment(s)
After alot of code debugging I was finally able to produce the taylor-green vortex 2D case with acceptable error levels. The case is actually harder than it looks. There were several small bugs in the code which produced cumulatively enough error to destabilise the flow. The smaller vortices had a tendency to collapse into one big vortex.

Case Setup: 80x80 grid at [-π,π],[-π,π] domain, dirichlet conditions for physical velocity, nonhomogenous poisson for pressure, dt/h = 0.01, simulated until t=1.5s.

The velocity and pressure gradient errors dont exhibit numerical boundary layers, but there seems to be something strange going on with the velocity divergence near boundaries, its almost two orders of magnitude higher than the interior error. Is this something that actually happens with dirichlet boundaries or it just a hidden bug somewhere? It only happens with dirichlet velocity boundaries and is nonexistent in poisseule flow with neumann conditons.

FMDenaro December 21, 2023 16:37

Quote:

Originally Posted by Winston Virtaus (Post 862085)
After alot of code debugging I was finally able to produce the taylor-green vortex 2D case with acceptable error levels. The case is actually harder than it looks. There were several small bugs in the code which produced cumulatively enough error to destabilise the flow. The smaller vortices had a tendency to collapse into one big vortex.

Case Setup: 80x80 grid at [-π,π],[-π,π] domain, dirichlet conditions for physical velocity, nonhomogenous poisson for pressure, dt/h = 0.01, simulated until t=1.5s.

The velocity and pressure gradient errors dont exhibit numerical boundary layers, but there seems to be something strange going on with the velocity divergence near boundaries, its almost two orders of magnitude higher than the interior error. Is this something that actually happens with dirichlet boundaries or it just a hidden bug somewhere? It only happens with dirichlet velocity boundaries and is nonexistent in poisseule flow with neumann conditons.


Are you sure to prescribe the Dirichlet BC at the correct time from the analytical solution?
I had a lot of work and experience on such test-case but many years ago, I don't remember all the things I did.
However, details are in my papers and can be useful.
The most relevant thing is to check the correct scaling of the error for vanishing grid size. Using only one grid cannot help.
Use the max norm to see where the error is produced during the scaling.
You wil find a lot of figures about the error scaling in my papers.

Winston Virtaus December 21, 2023 17:52

I'll take a look if there are still some bugs with the prescribed dirichlet velocity and see if I find something useful from the papers :)


All times are GMT -4. The time now is 12:29.