-
Notifications
You must be signed in to change notification settings - Fork 89
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 global damping based on density change in CompositionalFlow/WellSolvers #1065
Conversation
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 good!
src/coreComponents/physicsSolvers/fluidFlow/CompositionalMultiphaseFlow.hpp
Outdated
Show resolved
Hide resolved
src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.hpp
Outdated
Show resolved
Hide resolved
@@ -26,6 +26,7 @@ | |||
solidNames="{ rock }" | |||
relPermNames="{ relperm }" | |||
temperature="297.15" | |||
maxRelComponentDensityChange="0.9" |
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.
Does the test actively make use of this feature now (i.e. actually changing the number of Newton iterations due to chopping)?
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.
@klevzoff yes this test actively uses some chopping. To summarize what I did in the integratedTests:
- In the
CompositionalMultiphaseFlow
integratedTests, the default behavior is used everywhere (no chopping/damping based on change in component fractions, but chopping of the negative densities). But of course the chopping of the negative densities never kicks in, because no negative density is found. - In the
CompositionalMultiphaseWell
integratedTests, the default behavior is used for all tests except this one (that I converted to CO2, because I previously had three true compositional tests, but no CO2). For this one, I made sure that the chopping based on component fractions kicks in during the first time step. In the other tests, I modifieddead_oil_wells_2d.xml
to make sure that negative densities are found and chopped.
I guess we could have a separate option flag ( |
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.
It looks good to me. It would probably make sense to revisit the structure of the Newton solver at some point. For example, I think that using 3 different functions (which implies looping over all cells every time) for this is a bit of an overkill.
I also find it a bit hard to come up with a good limit for a variable like density which does not really have physical bounds. However, doing the chopping using fractions (or saturations) might be hard since densities are our primary variables.
@klevzoff Yes I modified my initial implementation with the introduction of a flag Regarding the computation of the scaling factor using the change in component fraction between Newton iterations, I decided to deactivate it by default. I find it useful in the CO2 simulations on HI24L, but I think this is going to be highly problem-dependent. To use it, one has to select a value of To summarize, if |
Yes I agree the current implementation involves a lot of redundancies, since, as you said, we loop once over all cells to compute the scaling factor in As a side note, I think consolidating these functions would allow a more convenient form of local chopping (i.e. having a different scaling factor for each cell). This may not be a very rigorous approach, but it can work well in some cases. |
@CusiniM I agree with your comment. To address it, I modified the computation of the scaling factor to try to enforce a check on the change in component fractions (that will always be between zero and one) instead of on the change in component densities. Computing the scaling factor \lambda using component fractions directly would mean enforcing I ended up doing something simpler that we may want to revisit later. I compute the scaling factor \lambda that satisfies In the future, I think we will have more tests to validate/invalidate this approach, and then we can come back to this to modify it as necessary. |
While testing #1086 I've encountered a case ( |
This PR is ready to be merged once we merge the corresponding |
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 a couple of requests to consolidate some constants to the top of the file where they may be found easily.
We currently check the validity of a solution in
CheckSystemSolution
by checking that all the component densities are positive, and if not, we cut the time step. As pointed out by @mquanbui and @klevzoff this is quite restrictive.In this PR, I tried to address this problem with two changes:
An option to perform global damping based on component fraction change between two Newton iterations in
ScalingForSystemSolution
. This option is controlled by the flagmaxCompFractionChange
in the flow and well solver blocks. Note by default this option is not used.An option to skip the check on the positivity of the component densities in
CheckSystemSolution
, and to instead chop the negative densities cell by cell inApplySystemSolution
. This option is controlled by the flagallowLocalCompDensityChopping
in the flow and well solver blocks. By default, this option is activated.I will do a cleanup of the multiphase tutorials in a separate PR.
Related to https://github.com/GEOSX/IntegratedTests/pull/79.
Related to GEOS-DEV/PVTPackage#23.