not calculating emulsionViscosity for small liquid_fraction

it might introduce inf/nan in the Jacobian matrix.
This commit is contained in:
Kai Bao 2022-11-17 15:20:56 +01:00
parent 4845ad0107
commit 3ddb830ae9

View File

@ -884,9 +884,14 @@ pressureDropSpiralICD(const int seg) const
density.clearDerivatives();
}
const EvalWell liquid_emulsion_viscosity = mswellhelpers::emulsionViscosity(water_fraction, water_viscosity,
oil_fraction, oil_viscosity, sicd);
const EvalWell mixture_viscosity = (water_fraction + oil_fraction) * liquid_emulsion_viscosity + gas_fraction * gas_viscosity;
const EvalWell liquid_fraction = water_fraction + oil_fraction;
// viscosity contribution from the liquid
const EvalWell liquid_viscosity_fraction = liquid_fraction < 1.e-30 ? 0 :
liquid_fraction * mswellhelpers::emulsionViscosity(water_fraction, water_viscosity, oil_fraction, oil_viscosity, sicd);
const EvalWell mixture_viscosity = liquid_viscosity_fraction + gas_fraction * gas_viscosity;
const EvalWell reservoir_rate = segment_mass_rates_[seg] / density;