comparison +rv/ResidualViscosity.m @ 1014:e547794a9407 feature/advectionRV

Add boot-strapping to RungeKuttaExteriorRV - Higher order BDF approximations are successively used as increasing number of time levels are obtained.
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Thu, 06 Dec 2018 11:30:47 +0100
parents 1e437c9e5132
children 9b7fcd5e4480
comparison
equal deleted inserted replaced
1013:eb441fbdf379 1014:e547794a9407
38 obj.grad_f = obj.D(v); 38 obj.grad_f = obj.D(v);
39 obj.residual = obj.u_t + obj.grad_f; 39 obj.residual = obj.u_t + obj.grad_f;
40 obj.viscosity = min(obj.Cmax*obj.h*abs(obj.waveSpeed(v)), obj.Cres*obj.h^2*abs(obj.residual)/norm(v-mean(v),inf)); 40 obj.viscosity = min(obj.Cmax*obj.h*abs(obj.waveSpeed(v)), obj.Cres*obj.h^2*abs(obj.residual)/norm(v-mean(v),inf));
41 end 41 end
42 42
43 function smoothendVector = smoothen(obj, vector)
44 smoothendVector = vector;
45 for i = 2:length(vector)-1
46 smoothendVector(i) = (1/6)*(vector(i-1) + 4*vector(i) + vector(i+1));
47 end
48 end
49
43 function [residual, u_t, grad_f] = getResidual(obj) 50 function [residual, u_t, grad_f] = getResidual(obj)
44 residual = obj.residual; 51 residual = obj.residual;
45 u_t = obj.u_t; 52 u_t = obj.u_t;
46 grad_f = obj.grad_f; 53 grad_f = obj.grad_f;
47 end 54 end