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
Added two-phase executable for numEq = 2. #1235
Conversation
That is great! What kind of speedup do you see? Eventually we want to have this included in a single flow executable (along with solvent, polymer etc.), but this would be the important step, I expect it to be fairly easy (if not trivial) to instantiate a model at run-time depending on input. (Might get a fairly big executable though.) |
@atgeirr: Speedup is roughly 2. |
I'll review this before the end of the week, I hope that is quick enough? |
60bca0b
to
794c180
Compare
jenkins build this please |
the ewoms part has just been merged. |
jenkins build this please |
@atgeirr: This test fails because the data for flow_ebos_2p does not exist yet in opm-data. This could be a simple link to flow_ebos. Or should we copy the data? |
I think it should have a separate reference, after all we do not expect it to produce bitwise identical results. They should be close however, so taking a copy (at least initially) seems reasonable. |
So then I copy and make a PR in opm-data. |
jenkins build this please with opm-data=#233 |
Is there are jenkins cmd list? |
jenkins build this with opm-data=233 please |
jenkins build this please |
794c180
to
ce7f3f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very nice! Only two very minor nitpicks. Currently testing with a significant benchmark case.
@@ -113,6 +113,7 @@ list (APPEND EXAMPLE_SOURCE_FILES | |||
examples/flow_reorder.cpp | |||
examples/flow_sequential.cpp | |||
examples/flow_ebos.cpp | |||
examples/flow_ebos_2p.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to add it to the next list below also, of programs that will be installed.
NEW_TYPE_TAG(EclFlowTwoPhaseProblem, INHERITS_FROM(EclFlowProblem)); | ||
//! The indices required by the model | ||
SET_TYPE_PROP(EclFlowTwoPhaseProblem, Indices, | ||
Ewoms::BlackOilTwoPhaseIndices<GET_PROP_VALUE(TypeTag, EnableSolvent)?1:0, GET_PROP_VALUE(TypeTag, EnablePolymer)?1:0, /*PVOffset=*/0>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that this is intended to work with solvent and polymer, good! Has it been tested?
static const int numEq = BlackoilIndices::numEq; | ||
static const int numWellEq = GET_PROP_VALUE(TypeTag, EnablePolymer)? 3:numEq; // //numEq; //number of wellEq is only for 3 for polymer | ||
static const int numWellEq = GET_PROP_VALUE(TypeTag, EnablePolymer)? numEq-1 : numEq; // //numEq; //number of wellEq is only numEq for polymer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this fix is correct, but the comment is wrong, should be (numEq - 1) I think.
@@ -239,7 +239,7 @@ namespace Opm { | |||
} | |||
|
|||
// add trivial equation for 2p cases (Only support water + oil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious: I assume there is some kind of checking that we do not try to run this with (oil + gas) or (water + gas)?
It looks like you don't have Jenkins trigger privileges here. That is a bug, but I don't know how to fix it (and probably do not have the privilege to change the privileges...) so I'll trigger it. |
jenkins build this please |
I have now run a benchmark case, and timing results are as follows:
Great job! It should be noted that most of the improvement seen in flow_ebos comes from the changed tuning: only taking 10 nonlinear iterations before declaring failure, and ignoring cell-wise residuals after 8 iterations. This causes the curves for this case to change, probably due to less timestep cutting and therefore longer timesteps in some parts of the schedule. But the curves for flow_ebos and flow_ebos_2p are almost identical, which means this PR accomplishes its aim. |
To continue the above: limiting the step size to something reasonable in the above case makes flow_legacy, flow_ebos before tuning and flow_ebos_2p give very close results. Timings with this limitation:
|
Thanks. @atgeirr: The current version only works with water+oil, because for the other cases not tests exist. So it does not make sense to start investigating these cases right now. |
I agree, I just hope that any user who tries gets an understandable error message...! |
@atgeirr: For the two-phase cases it sometimes makes sense to use |
For the current case (with the limited timesteps) I got 404.359 seconds, so it definitely helps! |
This PR adds an executable for two-phases cases with hard coded numEq = 2. This results in faster execution times for theses cases. This PR needs OPM/opm-models#204.