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

Lost connection to Fi when recommitting particles #1014

Open
JStroo2000 opened this issue Nov 29, 2023 · 5 comments
Open

Lost connection to Fi when recommitting particles #1014

JStroo2000 opened this issue Nov 29, 2023 · 5 comments
Labels

Comments

@JStroo2000
Copy link

When adding new SPF particles to a running Fi hydro code, the code crashes

time = 0|units.yr
end_time = 10|units.yr
while time <= end_time:
time += timestep
new_wind = wind.create_wind(star)
cloud.add_particles(new_wind)
cloud.synchronize_to(hydro.gas_particles)
hydro.evolve_model(time)
channel_hydro_to_gas.copy()
print(time)
Error message:
CodeException: Exception when calling function 'recommit_particles', of code 'FiInterface', exception was 'lost connection to code'

@GijsVermarien

@JStroo2000 JStroo2000 added the bug label Nov 29, 2023
@rieder
Copy link
Member

rieder commented Nov 29, 2023

Can you try starting Fi with
hydro = Fi(redirection='none')?
The code above can crash for any number of reasons, I can't immediately see what could cause it.

@JStroo2000
Copy link
Author

Can you try starting Fi with hydro = Fi(redirection='none')? The code above can crash for any number of reasons, I can't immediately see what could cause it.

Setting redirection to none gives a 'timestep too small' message, for timesteps up to 1 Myr. It also gives the same error message as above.

@rieder
Copy link
Member

rieder commented Nov 29, 2023 via email

@prashant050701
Copy link

Hello!
I am having the same error when I trying to use timestep in yr, it works for timesteps of a few days when the total evolution time is couple of hundred of days but when the evolution time is in hundred of years and timestep is in yr, it gives timestep too small error. Strangely, it also gave me timestep way too small error when I increased the timestep.

@rieder
Copy link
Member

rieder commented Dec 17, 2023

Thanks. I’ve seen this error before then, I’ll get back to you soon.

I saw it before in #670. It's probably not the same solution here, but the underlying cause is probably the same.

As a potential workaround, could you try manually setting hydro.parameters.timestep = 1 | units.s, calling hydro.evolve_model(hydro.model_time + (1 | units.s)) and then setting the timestep back to its original value, e.g.:

timestep_old = hydro.parameters.timestep
hydro.parameters.timestep = 1 | units.s
hydro.evolve_model(hydro.model_time + (1 | units.s))
hydro.parameters.timestep = timestep_old
hydro.evolve_model(time)

Please let me know if this works.

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

No branches or pull requests

3 participants