Merge pull request #4037 from totto82/scaleEnergy

scale energy residual to have the same relative order as the mass balance residuals
This commit is contained in:
Atgeirr Flø Rasmussen 2022-10-17 23:33:28 +02:00 committed by GitHub
commit a2c5ec1127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -736,7 +736,7 @@ namespace Opm {
}
if constexpr (has_energy_) {
B_avg[ contiEnergyEqIdx ] += 1.0;
B_avg[ contiEnergyEqIdx ] += 1.0 / (4.182e1); // converting J -> RM3 (entalpy / (cp * deltaK * rho) assuming change of 1e-5K of water
const auto R2 = ebosResid[cell_idx][contiEnergyEqIdx];
R_sum[ contiEnergyEqIdx ] += R2;
maxCoeff[ contiEnergyEqIdx ] = std::max( maxCoeff[ contiEnergyEqIdx ], std::abs( R2 ) / pvValue );