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

Initial time step too small #2

Open
Peter9192 opened this issue Sep 20, 2023 · 0 comments
Open

Initial time step too small #2

Peter9192 opened this issue Sep 20, 2023 · 0 comments

Comments

@Peter9192
Copy link
Contributor

Peter9192 commented Sep 20, 2023

The call to BMI update needs to use the model's time step, which is calculated on the fly. However, the initial time step is so small, that the model never seems to get going. Forcing the timestep to 1 in the c++ wrapper solves the issue, but a hardcoded time step is obviously not desirable.

See the following example:

from grpc4bmi.bmi_client_docker import BmiClientDocker
model = BmiClientDocker(image='sfincs-bmiserver', image_port=50051, work_dir="./")
model.initialize('sfincs.inp')
for i in range(10):
    print(model.get_current_time(), model.get_time_step())
    model.update()

which gives:

950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07

Perhaps there needs to be some spinup? Should that be done in the call to initialize()?

Also see example notebook in this repo.

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

No branches or pull requests

1 participant