comparison +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
comparison
equal deleted inserted replaced
1030:78c75c95b7dd 1031:2ef20d00b386
20 obj.Cmax = Cmax; 20 obj.Cmax = Cmax;
21 obj.Cres = Cres; 21 obj.Cres = Cres;
22 obj.normalization = normalization; 22 obj.normalization = normalization;
23 end 23 end
24 24
25 function [viscosity, Df] = evaluate(obj, v, dvdt) 25 function [viscosity, Df, firstOrderViscosity, residualViscosity] = evaluate(obj, v, dvdt)
26 Df = obj.Df(v); 26 Df = obj.Df(v);
27 viscosity = min(obj.Cmax*obj.h*abs(obj.waveSpeed(v)), obj.Cres*obj.h^2*abs(dvdt + Df)/obj.normalization(v)); 27 firstOrderViscosity = obj.Cmax*obj.h*abs(obj.waveSpeed(v));
28 residualViscosity = obj.Cres*obj.h^2*abs(dvdt + Df)/obj.normalization(v);
29 viscosity = min(firstOrderViscosity, residualViscosity);
30 %viscosity = obj.Cmax*obj.h*abs(obj.waveSpeed(v));
28 end 31 end
29 end 32 end
30 end 33 end