Mercurial > repos > public > sbplib
comparison +scheme/Utux2d.m @ 1021:cc61dde120cd feature/advectionRV
Add upwind dissipation to the operator inside Utux2d
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Wed, 19 Dec 2018 20:00:27 +0100 |
parents | f029b97dbc72 |
children | 234c1c02ea39 |
comparison
equal
deleted
inserted
replaced
1020:5359a61cb4d9 | 1021:cc61dde120cd |
---|---|
25 D % Total discrete operator | 25 D % Total discrete operator |
26 end | 26 end |
27 | 27 |
28 | 28 |
29 methods | 29 methods |
30 function obj = Utux2d(g ,order, opSet, a) | 30 function obj = Utux2d(g ,order, opSet, a, fluxSplitting) |
31 | 31 |
32 default_arg('a',1/sqrt(2)*[1, 1]); | 32 default_arg('a',1/sqrt(2)*[1, 1]); |
33 default_arg('opSet',@sbp.D2Standard); | 33 default_arg('opSet',@sbp.D2Standard); |
34 default_arg('fluxSplitting',[]); | |
34 | 35 |
35 assertType(g, 'grid.Cartesian'); | 36 assertType(g, 'grid.Cartesian'); |
36 if iscell(a) | 37 if iscell(a) |
37 a1 = grid.evalOn(g, a{1}); | 38 a1 = grid.evalOn(g, a{1}); |
38 a2 = grid.evalOn(g, a{2}); | 39 a2 = grid.evalOn(g, a{2}); |
96 | 97 |
97 obj.m = m; | 98 obj.m = m; |
98 obj.h = [ops_x.h ops_y.h]; | 99 obj.h = [ops_x.h ops_y.h]; |
99 obj.order = order; | 100 obj.order = order; |
100 obj.a = a; | 101 obj.a = a; |
101 obj.D = -(a{1}*obj.Dx + a{2}*obj.Dy); | 102 |
103 if (isequal(opSet,@sbp.D1Upwind)) | |
104 obj.D = -(a{1}*obj.Dx + a{2}*obj.Dy + fluxSplitting{1}*obj.DissOpx + fluxSplitting{2}*obj.DissOpy); | |
105 else | |
106 obj.D = -(a{1}*obj.Dx + a{2}*obj.Dy); | |
107 end | |
108 | |
102 end | 109 end |
103 % Closure functions return the opertors applied to the own domain to close the boundary | 110 % Closure functions return the opertors applied to the own domain to close the boundary |
104 % Penalty functions return the opertors to force the solution. In the case of an interface it returns the operator applied to the other doamin. | 111 % Penalty functions return the opertors to force the solution. In the case of an interface it returns the operator applied to the other doamin. |
105 % boundary is a string specifying the boundary e.g. 'l','r' or 'e','w','n','s'. | 112 % boundary is a string specifying the boundary e.g. 'l','r' or 'e','w','n','s'. |
106 % type is a string specifying the type of boundary condition if there are several. | 113 % type is a string specifying the type of boundary condition if there are several. |