Mercurial > repos > public > sbplib
diff +rv/ResidualViscosity.m @ 1031:2ef20d00b386 feature/advectionRV
For easier comparison, return both the first order and residual viscosity when evaluating the residual. Add the first order and residual viscosity to the state of the RungekuttaRV time steppers
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 17 Jan 2019 10:25:06 +0100 |
parents | 2d7c1333bd6c |
children | a8ee5eca0e6c |
line wrap: on
line diff
--- a/+rv/ResidualViscosity.m Fri Jan 11 15:52:48 2019 +0100 +++ b/+rv/ResidualViscosity.m Thu Jan 17 10:25:06 2019 +0100 @@ -22,9 +22,12 @@ obj.normalization = normalization; end - function [viscosity, Df] = evaluate(obj, v, dvdt) + function [viscosity, Df, firstOrderViscosity, residualViscosity] = evaluate(obj, v, dvdt) Df = obj.Df(v); - viscosity = min(obj.Cmax*obj.h*abs(obj.waveSpeed(v)), obj.Cres*obj.h^2*abs(dvdt + Df)/obj.normalization(v)); + firstOrderViscosity = obj.Cmax*obj.h*abs(obj.waveSpeed(v)); + residualViscosity = obj.Cres*obj.h^2*abs(dvdt + Df)/obj.normalization(v); + viscosity = min(firstOrderViscosity, residualViscosity); + %viscosity = obj.Cmax*obj.h*abs(obj.waveSpeed(v)); end end end \ No newline at end of file