comparison +scheme/Burgers2d.m @ 1155:336ee37a0617 feature/rv

Change penalty term and add missing semicolon
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Mon, 24 Jun 2019 17:44:21 +0200
parents 3108963cc42c
children 6cb03209f0a7
comparison
equal deleted inserted replaced
1154:3108963cc42c 1155:336ee37a0617
50 DissOpx = kron((ops_x.Dp - ops_x.Dm)/2,Iy); 50 DissOpx = kron((ops_x.Dp - ops_x.Dm)/2,Iy);
51 DissOpy = kron(Ix,(ops_y.Dp - ops_y.Dm)/2); 51 DissOpy = kron(Ix,(ops_y.Dp - ops_y.Dm)/2);
52 D1 = Dx + Dy; 52 D1 = Dx + Dy;
53 switch pde_form 53 switch pde_form
54 case 'skew-symmetric' 54 case 'skew-symmetric'
55 D = -1/3*D1 55 D = -1/3*D1;
56 switch length(fluxSplitting) 56 switch length(fluxSplitting)
57 case 1 57 case 1
58 DissOp = DissOpx + DissOpy; 58 DissOp = DissOpx + DissOpy;
59 obj.D = @(v) D*(v.*v) + (spdiags(v,0,m_tot,m_tot)*D + fluxSplitting{1}(v)*DissOp)*v; 59 obj.D = @(v) D*(v.*v) + (spdiags(v,0,m_tot,m_tot)*D + fluxSplitting{1}(v)*DissOp)*v;
60 case 2 60 case 2
105 switch type 105 switch type
106 % Stable dirchlet-like boundary conditions (u+-abs(u))*u/3 106 % Stable dirchlet-like boundary conditions (u+-abs(u))*u/3
107 % with +- at left/right boundaries in each coordinate direction 107 % with +- at left/right boundaries in each coordinate direction
108 case {'D', 'd', 'dirichlet', 'Dirichlet'} 108 case {'D', 'd', 'dirichlet', 'Dirichlet'}
109 109
110 magnitude = 2/3; 110 magnitude = 1/3;
111 Tau = s*magnitude*obj.Hi*e*H_b/2; 111 Tau = s*magnitude*obj.Hi*e*H_b/2;
112 m = length(index); 112 m = length(index);
113 tau = @(v) Tau*spdiags((v(index)-s*abs(v(index))),0,m,m); 113 tau = @(v) Tau*spdiags((v(index)-s*abs(v(index))),0,m,m);
114 closure = @(v) Tau*((v(index)-s*abs(v(index))).*v(index)); 114 closure = @(v) Tau*((v(index)-s*abs(v(index))).*v(index));
115 penalty = @(v) -tau(v); 115 penalty = @(v) -tau(v);