lettucecfd / lettuce

Computational Fluid Dynamics based on PyTorch and the Lattice Boltzmann Method
MIT License
222 stars 39 forks source link

Dirichlet Boundary Conditions #120

Open robert-DL opened 2 years ago

robert-DL commented 2 years ago

Hi,

I want to initialize proper Dirichlet Boundary Conditions, e.g. of the Form

\uD = \u{avg} \frac{6y(H-y)} {H^2} w(t),

with w(t) given as w(t) = 0.5 - 0.5cos(2pi*t) if t < 0.5 and 1 if t > 0.5.

In the Krüger et. al. book, there is a short chapter on proper initialization. They mention the method by Mei et. al. However, this approach is only for one single time step (most likely t=0). How to handle the above case. Use the iterative approach of Mei, repeat it for subsequent time steps and set the initial condition for every time step separately? Seems a little bit odd to me.

Furthermore, there is a method in the Simulation class, that initializes f such that it matches the given moments. It looks pretty similar to the approach of Mei et. al., with the only difference that the termination criterion is pressure-dependent, Mei et. al. propose a density-dependent criterion.

Any suggestions on that?

Best, Robert

Olllom commented 2 years ago

Hi @robert-DL,

sorry, just saw this. Did you figure something out?

It should not matter whether you use density or pressure variation as a stopping criterion, as there is a linear relation between the two.

Pressure is probably a bit more convenient. For a fixed tolerance it gives you the same quality initial solution independent of Mach number. So checking for pressure facilitates setting a default tolerance.

Cheers, Andreas

PhiSpel commented 4 months ago

@Olllom we can close this, right?

Olllom commented 4 months ago

I don't think this is solved.

Depends if the native implementation is currently utilized and if there are plans to further develop it.