[Opm] Explicitly setting the initial solution of EBOS.

Joakim R. Andersen joakira at stud.ntnu.no
Mon Jul 31 14:35:48 UTC 2017


Hi, Andreas.

Ok. Sorry for that. I've now made a "diff"-file. I agree that the current
solution remains the same, but because the first argument to ConvertInput
is 0, the initial solution should also be updated, and be set to the same
as the current solution.

Maybe here is where the misunderstanding lies:
When we calculate the residuals using 'linearize()', the initial solution
of the substep is also used, right? In other words, the solution which is
stored in:
_ebosSimulator.model().solution(/*timeIdx=*/1) is a part of the calculation
of the residuals?


Best regards,
Joakim R. Andersen

2017-07-31 11:02 GMT-03:00 Andreas Lauser <and at poware.org>:

> Hi,
>
> On Montag, 31. Juli 2017 10:12:01 CEST you wrote:
> > Thank you for your answer.  I've attached a minimum working example. As
> you
> > can see, the residuals do not change after the update of the initial
> > solution.
> > In the example, the initial solution is (attempted) to be set to be equal
> > to the final state.
>
> sorry, but I cannot see that you change anything compared to the current
> solution before the call to convertInput(tmp_reservoir_state), so getting
> the
> same result is the expected behavior. Also, I still can't see how your
> code is
> supposed to be used without doing some guesswork of where it should go (I
> suppose the run() method of the simulator class?) it would be less
> confusing
> if you would send patches (i.e., the output of `git diff origin/master`).
>
> I've attached a patch which probably does what you want. In particular,
> note
> that if you cannot guarantee a fixed number of changed variables of the
> result
> due to a single change of the initial condition, the problem is not sparse.
>
> cheers
>   Andreas
>
> > 2017-07-28 11:41 GMT-03:00 Andreas Lauser <and at poware.org>:
> > > Hi Joakim,
> > >
> > > it looks like you modify copies of the objects which are actually used
> by
> > > the
> > > simulator. I can't be too sure because the file which you attached is
> > > incomplete.
> > >
> > > cheers
> > >
> > >   Andreas
> > >
> > > On Donnerstag, 27. Juli 2017 16:15:32 CEST Joakim R. Andersen wrote:
> > > > Hi, all.
> > > >
> > > > I am trying to calculate the numerical Jacobian of the reservoir
> > >
> > > residuals
> > >
> > > > w.r.t. the initial state. To do this I need to replace the initial
> > >
> > > solution
> > >
> > > > of EBOS with a perturbed one. I've been trying for a while, and I am
> > > > getting nowhere.
> > > >
> > > > I've attached the code. It is placed at the end of
> "nonlinearIteration"
> > >
> > > in
> > >
> > > > "BlackoilModelEbos.hpp":
> > > >
> > > > if (!report.converged) { ... }
> > > >
> > > > else {
> > > > // all the code goes here.
> > > > }
> > > >
> > > > I've also made the "nonlinearIteration" take the initial reservoir
> state
> > >
> > > as
> > >
> > > > an input. Thus, we have both the final state and the initial state
> when
> > >
> > > the
> > >
> > > > "else"-case is invoked.
> > > >
> > > > Setting the initial solution as done in the attachment does not work.
> > > > How
> > > > can I pass this information further such that the "linearize()"
> function
> > > > (the one that calculates the residuals and the Jacobian in EBOS)
> will be
> > > > affected?
> > > >
> > > > Let me be more precise. The code runs, and the initial solution is
> set,
> > >
> > > but
> > >
> > > > the "linearize()" function are not aware of the change.
> > > >
> > > >
> > > > Best regards,
> > > > Joakim R. Andersen
> > >
> > > --
> > > The Illuminati don't run the world. C programmers do.
> > >
> > >         -- Daniel Angel Muñoz Trejo
> > >
> > > _______________________________________________
> > > Opm mailing list
> > > Opm at opm-project.org
> > > http://opm-project.org/cgi-bin/mailman/listinfo/opm
>
>
> --
> The Illuminati don't run the world. C programmers do.
>         -- Daniel Angel Muñoz Trejo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <//opm-project.org/pipermail/opm/attachments/20170731/48fa79f4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_changing_initial_state
Type: application/octet-stream
Size: 2275 bytes
Desc: not available
URL: <//opm-project.org/pipermail/opm/attachments/20170731/48fa79f4/attachment.obj>


More information about the Opm mailing list