Giter Site home page Giter Site logo

patnr / historymatching Goto Github PK

View Code? Open in Web Editor NEW
22.0 2.0 13.0 1.84 MB

Notebooks on production optimisation and history matching

License: MIT License

Python 45.97% Shell 0.39% Jupyter Notebook 53.64%
data-assimilation history-matching pde-constrained-optimization optimization reservoir-characterization

historymatching's People

Contributors

dafeda avatar patnr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

historymatching's Issues

Forecasting issue

I'm trying to use this file in my own enviroment. I've set up the enviroment, installed the requirements.txt and have opened it up in jupyter notebook just as the README suggests but when I run the code, its holding up just after the forward model process. The line that it's crashing at is

(wsat.past.Prior,
prod.past.Prior) = forward_model(nTime, wsat.init.Prior, perm.Prior)

The error message I'm receiving is

A Jupyter widget could not be displayed because the widget state could not be found. This could happen if the kernel storing the widget is no longer available, or if the widget state was not saved in the notebook. You may be able to create the widget by running the appropriate cells.

RemoteTraceback Traceback (most recent call last)
RemoteTraceback:
"""
Traceback (most recent call last):
File "C:**\Anaconda3\lib\site-packages\multiprocess\pool.py", line 125, in worker
result = (True, func(args, **kwds))
File "C:*
\Anaconda3\lib\site-packages\pathos\helpers\mp_helper.py", line 15, in
func = lambda args: f(args)
File "C:*
\AppData\Local\Temp\ipykernel_4264\2723154157.py", line 10, in run1
NameError: name 'copy' is not defined
"""

The above exception was the direct cause of the following exception:

NameError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_4264\682821882.py in
1 (wsat.past.Prior,
----> 2 prod.past.Prior) = forward_model(nTime, wsat.init.Prior, perm.Prior)

~\AppData\Local\Temp\ipykernel_4264\2723154157.py in forward_model(nTime, *variables, **kwargs)
31
32 # Dispatch jobs
---> 33 Ef = mp(run1, E, total=len(variables[0]),
34 desc="Ens-run"+kwargs.get("desc", ""), leave=kwargs.get("leave", True))
35

~**\Documents\HistoryMatching-master\tools\utils.py in mp(fun, args, desc, total, leave)
155
156 from p_tqdm import p_map
--> 157 return p_map(fun, list(args), desc=desc, num_cpus=nCores, leave=leave)
158 else:
159 return progbar(map(fun, args), desc=desc, total=total, leave=leave)

~\Anaconda3\lib\site-packages\p_tqdm\p_tqdm.py in p_map(function, *iterables, **kwargs)
63 ordered = True
64 generator = _parallel(ordered, function, *iterables, **kwargs)
---> 65 result = list(generator)
66
67 return result

~\Anaconda3\lib\site-packages\p_tqdm\p_tqdm.py in _parallel(ordered, function, *iterables, **kwargs)
52 tqdm_func = kwargs.pop('tqdm', tqdm)
53
---> 54 for item in tqdm_func(map_func(function, *iterables), total=length, **kwargs):
55 yield item
56

~\Anaconda3\lib\site-packages\tqdm\notebook.py in iter(self)
252 try:
253 it = super(tqdm_notebook, self).iter()
--> 254 for obj in it:
255 # return super(tqdm...) will not catch exception
256 yield obj

~\Anaconda3\lib\site-packages\tqdm\std.py in iter(self)
1176
1177 try:
-> 1178 for obj in iterable:
1179 yield obj
1180 # Update and possibly print the progressbar.

~\Anaconda3\lib\site-packages\multiprocess\pool.py in next(self, timeout)
868 if success:
869 return value
--> 870 raise value
871
872 next = next # XXX

NameError: name 'copy' is not defined

I;ve also ran the MAIN python file in VS Code and ran the debugger and it's resulting in an error in the utils.py file on line 157.

return p_map(fun, list(args), desc=desc, num_cpus=nCores, leave=leave)

Exception has occurred: RuntimeError (note: full exception trace is shown but execution is paused at: )

    An attempt has been made to start a new process before the
    current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

File "C:**\Documents\HistoryMatching-master\tools\utils.py", line 157, in mp
return p_map(fun, list(args), desc=desc, num_cpus=nCores, leave=leave)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:**\Documents\HistoryMatching-master\MAIN.py", line 408, in forward_model
Ef = mp(run1, E, total=len(variables[0]),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:**\Documents\HistoryMatching-master\MAIN.py", line 441, in
prod.past.Prior) = forward_model(nTime, wsat.init.Prior, perm.Prior)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1, in (Current frame)
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

I'm not sure why this result is happening because I followed all the steps to run the code on my own server. Any help would be great.

Got NaN on the dt/cfl


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

Fix "oil/water cut" misuse

D. Oliver pointed out that water cut should not be confused with water saturation (at the well location, e.g.). Either fix naming, or definitions of observations (see email).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.