-
Notifications
You must be signed in to change notification settings - Fork 119
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
Discussion: role of Simulator classes. #107
Comments
The Wi-Fi connection here is flaky so I must be brief. I agree with most/everything you say, @atgeirr, except I think we need to be a bit more specific about the following
In principle, step size logic could need a large number of disparate data sources (e.g., the complete state object of the past several time steps). This all depends on the controller. Requesting that the solver report any data required by step size logic is, in my opinion, too onerous. That, I think, requires some kind of policy parameter to translate the solver's view of the state into the controller's input data. Or maybe you have something less ambitious in mind? |
@bska: Yes, I did not intend to make a universal solution now, but something less ambitious. I imagine putting (initially) a boolean (converged) and an integer (number of iterations) in a struct and having the solver return it. Then replace by something more comprehensive only as it becomes necessary. |
Okay, then. As a first step, I think that's an acceptable proposal. |
I agree with most stuff as well, but I've got a suggestion: The tasks for the simulator class sounds to be very generic (writing output, handling timesteps), so I think there is not much point for having a separate class for each model. Instead, we could have one templated class doing this crunch work (e.g. anyway, its a good idea to simplify everything which needs to be done in
and I think that's where the other modules should be heading as well... |
You have my full agreement on both suggestions, @andlaus, but one caveat. While we like templates, many people are put off by them. Anyway, I'd like us to get this done for the fully implicit simulator, then we can generalize after that. |
ok, quite likely, this can equally well be achieved using virtual functions (since that code is in no way performance critical, I also won't object doing it this way)... |
This means that the loop over all (report) timesteps should be in this class ...... The loop will be based on the report steps or simulation steps (without considering the sub-timestepping due to the convergence control), or they are basically the same in your concept? I think they will be different, even in your description. While which one the class will be base on? |
With all disclaimers applied - my reaction is that this:
is too much - in my opinion the Simulator class should just step forward a number of seconds, the looping over report steps should be done externally: for (report_step = 0; ...) {
size_t seconds = timeMap.getDelta( report_step);
simulator.run( seconds );
} This will give much more flexibility in manipulating the simulator state; one could e.g. consider changing simulator instance runtime? |
@joakim-hove that's basically how it's currently done in sim_fibo_ad.cpp (modulo writing output ;)) |
Yes - but in the current sim_fibo_ad.cpp a new simulator instance is instantiated for every time step - that should not be necessary. |
agreed. but, that's just an implementation detail IMO. as far as I understood this issue here, it is rather about how to best split the work between the simulator, solver and main function... |
@joakim-hove A comment on your note from a few days ago: stepping forward a set amount of time is indeed the sole purpose of a specific class, but it is the solver class, not the simulator class. Which is why I see the simulator class as the natural one-level-higher place to do timestep control. The solver class has a method step() taking a |
In the current implementation, we recreate or initialize the simulator class for each time step or report step. For the Norne case, the initialization of the simulator takes more than half minute each time. Each newton iteration takes something like 4 seconds. I feel that can be a problem, since it can mean we will need more than one and a quarter hour extra for a complete Norne simulation to do the recreation of the simulator class. |
Minor update and adaption to match opm-autodiff
fix the table handling code for live oil
I propose the following responsibilities for the Simulator classes, in particular SimulatorFullyImplicitBlackoil:
I propose that the following responsibility is removed from the class:
This requires the following changes to interfaces between levels (sim_fibo_ad, Simulator class and Solver class):
Please tell me what you think, before we start working on this.
(Update: forgot to mention that this is related to issues #103 and #106)
The text was updated successfully, but these errors were encountered: