Bug in geothermal module

11 views
Skip to first unread message

Tongchao

unread,
Oct 3, 2025, 9:28:52 AMOct 3
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hello MRST developers,

I really like MRST and want to express my gratitude to all MRST developers. When I tried to do EDFM+geothermal simulation and found no way in standard MRST, I decided to write a new module ETH (based on hfm ad geothermal modules, see: https://doi.org/10.1016/j.advwatres.2025.105120).

However, in the process of ETH development, I noticed that injection wells may be not properly handled. I attach an simple example to validate this issue, in which a well injects cold water into a hot geothermal reservoir. The temperature at well cells seemingly continuously increase in exponential-like manner, which makes no sense. I hope I am wrong. I believe that examples in geothermal module fail to detect the behavior of injection well.

I have spent weeks trying to figure out why and fix this issue but didn't complete the mission so far. Furthermore, I don't have time in the coming months, thus have to post the bug here. Maybe someone can help.

Below is my observation/speculation and may be helpful for debugging:
(1) according to literature on solute/heat transport, Q_{well,energy} = Q_{well,water} * (h_well - h_wellcell)
(2) in geothermal module, Q_{well,energy} = Q_{well,water} * h_well (not 100% sure, but highly fishy)

Hope MRST developers / community are able to confirm and fix it.

Cheers,
TC
buginGeothermal.m

Øystein S. Klemetsdal

unread,
Oct 3, 2025, 3:58:18 PMOct 3
to MRST-users: The Matlab Reservoir Simulation Toolbox User Group
Hi Tongchao,

You have forgotten to provide ´sign´ to your injector:
W = addWell(W, G, G.rock, cell_inj, 'name','inj', 'type','bhp','val',pRef*1.1, 'sign', 1);
W = addWell(W, G, G.rock, cell_pump,'name','pump', 'type','bhp','val',pRef*0.9, 'sign', -1);

Without this, none of the wells are treated as injectors when computing injected thermal energy, and since you have not specified BCs, the energy conservation equation is underdetermined.

Regarding your remark that "according to literature on solute/heat transport, Q_{well,energy} = Q_{well,water} * (h_well - h_wellcell)", and "Q_{well,energy} = Q_{well,water} * h_well" is "highly fishy", can you elaborate? To the best of my knowledge, the latter is the standard definition thermal energy flux (and the one implemented in all geothermal simulators I know).

Best,
Øystein Klemetsdal // Research Scientist, SINTEF Digital
Reply all
Reply to author
Forward
0 new messages