Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom CFL function and body force #174

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

b-fg
Copy link
Member

@b-fg b-fg commented Nov 14, 2024

These are small improvements to allow greater control of the time integration loop. Users can define custom CFL functions and pass arbitrary body forces.

A trivial case is to use a constant time step

CFL_ct(a::Flow) = 0.25
sim_step!(sim; CFL_f=CFL_ct)

Also body forces can be passed to the RHS easily with

random_force = randn(size(sim.flow.f))
sim_step!(sim; bf=random_force)

@b-fg b-fg changed the title Custom CFL function Custom CFL function and body force Nov 14, 2024
@marinlauber
Copy link
Member

marinlauber commented Nov 15, 2024

Looks good! I was just wondering what happens for the first time step? We force it to be 0.25 when the Flow is constructed

function Flow(N::NTuple{D}, U; f=Array, Δt=0.25, ν=0., g=nothing,
. Maybe we want this new CFL function to change that as well?

Any idea why the tests are failing?

@b-fg
Copy link
Member Author

b-fg commented Nov 15, 2024

The first time step can already be modified by the user, so no worries on that. One can just pass Simulation(...; Δt=CFL_f(0.0)) and create it's own CFL_f(t::Number) function, in addition to CFL_f(a::Flow).

I am not sure why the Julia 1 x86 tests are failing. It seemed to be a CI problem when loading the dependency packages, and not a problem of our tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants