Mercurial > repos > public > sbplib
comparison +rv/ResidualViscosity.m @ 1015:9b7fcd5e4480 feature/advectionRV
Debug ResidualViscosity
- Pass exact time derivative to RungeKuttaExteriorRV and use that for evaluating the residual
- Start bootstrapping from later time level with higher order bdf
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 06 Dec 2018 17:03:22 +0100 |
parents | e547794a9407 |
children | 4b42999874c0 |
comparison
equal
deleted
inserted
replaced
1014:e547794a9407 | 1015:9b7fcd5e4480 |
---|---|
35 | 35 |
36 function obj = update(obj, v, dvdt) | 36 function obj = update(obj, v, dvdt) |
37 obj.u_t = dvdt; | 37 obj.u_t = dvdt; |
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 obj.viscosity = obj.smoothen(obj.Cres*obj.h^2*abs(obj.residual)/norm(v-mean(v),inf)); | |
42 | |
41 end | 43 end |
42 | 44 |
43 function smoothendVector = smoothen(obj, vector) | 45 function smoothendVector = smoothen(obj, vector) |
44 smoothendVector = vector; | 46 smoothendVector = vector; |
45 for i = 2:length(vector)-1 | 47 for i = 2:length(vector)-1 |