You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Many thanks for implementing Free stream boundary condition #138. It works nicely on scalar fields. But how to use it on the velocity field?
I am willing to set up the velocity field and apply advection on it, something like this:
v = StaggeredGrid(Noise(vector='x,y'), InOutConditionalExtrapolation(???),x=32, y=32)
v = advect.semi_lagrangian(v, v, dt=0.1)
v, p = fluid.make_incompressible(v)
Unfortunately there is no way to get velocity values to construct the InOutConditionalExtrapolation.
The idea is that when the velocity leaves the boundary, it should be able to do it freely (like zero_gradient), but when is pointed inside, the velocity outside the boundary is treated as zero and the solver inside the make_incompressible decreases the pressure near boundary to be able to drag the flow inwards.
Any suggestions how to make it work?
The text was updated successfully, but these errors were encountered:
Hi @KarlisFre, that is a bit tricky because in that case the extrapolation requires all values of the field it's used for. I see two ways of doing this:
Either we create the field first and then do something like v.with_extrapolation(InOutExtrapolation(v)) or
We amend the extrapolation system to handle this sort of dependency natively, then the extrapolation would not require any external dependencies, i.e. StaggeredGrid(..., InternalInOutConditionalExtrapolation(in, out)). This would only be available for Φ-Flow version 3.0 and above.
If I do v.with_extrapolation(InOutExtrapolation(v)), would it work correctly in v = fluid.make_incompressible(v)? Velocity is changed inside it and will the result correctly conform to boundary condition that is dependent on v?
I think the InOutExtrapolation I sent is not compatible with staggered grids yet. I can look into this but there may be some difficulties when it comes to which values actually need to be stored. Performing the pressure solve on a centered grid may be easier.
Hi,
Many thanks for implementing Free stream boundary condition #138. It works nicely on scalar fields. But how to use it on the velocity field?
I am willing to set up the velocity field and apply advection on it, something like this:
Unfortunately there is no way to get velocity values to construct the InOutConditionalExtrapolation.
The idea is that when the velocity leaves the boundary, it should be able to do it freely (like zero_gradient), but when is pointed inside, the velocity outside the boundary is treated as zero and the solver inside the make_incompressible decreases the pressure near boundary to be able to drag the flow inwards.
Any suggestions how to make it work?
The text was updated successfully, but these errors were encountered: