opm-simulators icon indicating copy to clipboard operation
opm-simulators copied to clipboard

Add option for solving the energy equation sequentially

Open totto82 opened this issue 11 months ago • 6 comments

  • adds flow_blackoil_temp simulator that solves energy equation sequentially
  • activated by the TEMP keyword (THERMAL is still used for fully implicit) Depends on https://github.com/OPM/opm-common/pull/4411

totto82 avatar Jan 08 '25 13:01 totto82

jenkins build this opm-common=4411 please

totto82 avatar Jan 10 '25 08:01 totto82

@akva2 I dont build with HDF5 on the machine I am working on so I have being misusing jenkins for some testing without any sucsess. It seems to complain about some missing serializeOp(). I have tried to add them accordingly based on my understanding, but it keeps complaining. 1) Any hints of what I am missing? 2) Would adding a test for the temperatureModel serialization in test_RestartSerialization help detecting the issue that causes the failure related to HDF5?

totto82 avatar Jan 10 '25 08:01 totto82

Well, you are on to it, but fundamentally you need to add serializeOp to the types your are serializing, in particular the EnergyVectors in storage1_ and the intQuants. But first a fundamental question:

I'm surprised that you need to serialize any of this. The only things you need to serialize are dynamic state that will not be recreated when we start a new report step and which is not derived from the primary solution. It looks to me like both of these are recreated from simulator state in beginTimeStep(), hence none of the serialization should be required, and the "fix" is to remove the serialization of the TemperatureModel in FlowProblem.

As an example, the only thing we serialize from the PVT classes (ie the material law manager) are the hysteresis parameters since these are dynamic in nature.

akva2 avatar Jan 10 '25 09:01 akva2

and the "fix" is to remove the serialization of the TemperatureModel in FlowProblem

Does that mean that I need to remove these

template <class Restarter>
void serialize(Restarter&)
{ /* not implemented */ }

template <class Restarter> void deserialize(Restarter&) { /* not implemented */ }

The serializeOp is already commented

    //template<class Serializer>
    //void serializeOp(Serializer& serializer)
    //{
    //    serializer(intQuants_);
    //    serializer(storage1_);
    //}

totto82 avatar Jan 10 '25 10:01 totto82

only serializeOp is used with flow. the other serialize/deserialize combo is an opm-models mechanism that is not in use in flow, but you need the functions there for the code to compile as they are called by simulator.hh.

you can just remove the implementation of serializeOp. but as I said you have to remove the serializer call for temperature model in FlowProblem's serializeOp(). that's the call site where you are telling it to call serializeOp in the temperature model.

akva2 avatar Jan 10 '25 10:01 akva2

Arg.. I didn't notice that I had added it in FlowProblem. Thanks!

totto82 avatar Jan 10 '25 10:01 totto82

jenkins build this opm-common=4411 please

totto82 avatar Aug 12 '25 08:08 totto82

jenkins build this opm-common=4411 please

totto82 avatar Aug 12 '25 08:08 totto82

jenkins build this opm-common=4411 please

totto82 avatar Aug 12 '25 10:08 totto82

jenkins build this opm-common=4411 please

totto82 avatar Aug 12 '25 10:08 totto82

jenkins build this opm-common=4411 please

totto82 avatar Aug 12 '25 11:08 totto82

Not sure if this is releveant, but it maybe the storage is keept for serialization to simplyfy restart, normally we do not need to calculate it since it is known from last iteration in previous solve. In addition it maybe issues with some keywords.

hnil avatar Aug 20 '25 07:08 hnil

Rebased and updated. Now depends on https://github.com/OPM/opm-common/pull/4825

totto82 avatar Nov 05 '25 14:11 totto82

Did a preliminary review to quickly check the parts I already looked at previously. I understand this is still in a draft state!

Thanks for the review. Regarding two of your comments that I didn't address, I still find it unclear what you would like me to do. I plan to undraft the PR soon. Just need to re-run some tests with the new Clamp default.

totto82 avatar Nov 07 '25 09:11 totto82