patnr / HistoryMatching

Notebooks on production optimisation and history matching
MIT License
22 stars 13 forks source link

Got NaN on the dt/cfl #8

Closed qckid98 closed 1 year ago

qckid98 commented 1 year ago

ValueError Traceback (most recent call last) Cell In[43], line 2 1 wsat0 = np.zeros(model.Nxy) ----> 2 wsat.past.Truth = model.sim(dt, nTime, wsat0, implicit=False) 3 prod.past.Truth = np.array([obs_model(x) for x in wsat.past.Truth[1:]])

File ~/.local/lib/python3.10/site-packages/TPFA_ResSim/init.py:345, in ResSim.sim(self, dt, nSteps, x0, pbar, leave, **kwargs) 343 kk = tqdm(kk, "Simulation", leave=leave, mininterval=1e-2) 344 for k in kk: --> 345 xx[k+1] = step(xx[k], k) 346 return xx

File ~/.local/lib/python3.10/site-packages/TPFA_ResSim/init.py:320, in ResSim.time_stepper..integrate(S, k) 318 S = self.saturation_step_implicit(S, V, dt) 319 else: --> 320 S = self.saturation_step_upwind(S, V, dt) 321 return S

File ~/.local/lib/python3.10/site-packages/TPFA_ResSim/init.py:249, in ResSim.saturation_step_upwind(self, S, V, dt) 247 # Compute sub/local dt 248 cfl = self.estimate_CFL(pv, V, fi) --> 249 nT = int(np.ceil(dt / cfl)) 250 nT = max(1, nT) 252 # Scale A

ValueError: cannot convert float NaN to integer

Error while trying to simulate model wsat.past.Truth, trying to set the implicit to true but it wont converge for some reasons

patnr commented 1 year ago

Hi, and thanks for the report. I'm not sure what the error is. Could you try again now (with the latest version)?