-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDispersiveLDGRHS1D.m
executable file
·30 lines (24 loc) · 1.13 KB
/
DispersiveLDGRHS1D.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function [rhsu] = DispersiveLDGRHS1D(u,time)
% function [rhsu] = DispersiveLDGRHS1D(u,time)
% Purpose : Evaluate RHS flux in 1D u_xxx using LDG fluxes and periodic BC's
Globals1D;
% Define field differences at faces, incl BC
du = zeros(Nfp*Nfaces,K); du(:) = u(vmapM)-u(vmapP);
uin = u(vmapO); du (mapI) = u(vmapI) - uin;
uout = u(vmapI); du (mapO) = u(vmapO) - uout;
fluxu = nx.*(1.0+nx).*du/2.0;
% Compute local variable p, define differences, incl BC
p = rx.*(Dr*u) - LIFT*(Fscale.*fluxu);
dp = zeros(Nfp*Nfaces,K); dp(:) = p(vmapM)-p(vmapP);
pin = p(vmapO); dp(mapI) = p(vmapI) - pin;
pout = p(vmapI); dp(mapO) = p(vmapO) - pout;
fluxp = nx.*(1.0-nx).*dp/2.0;
% Compute local variable q, define differences, incl BC
q = rx.*(Dr*p) - LIFT*(Fscale.*fluxp);
dq = zeros(Nfp*Nfaces,K); dq(:) = q(vmapM)-q(vmapP);
qin = q(vmapO); dq (mapI) = q(vmapI) - qin;
qout = q(vmapI); dq (mapO) = q(vmapO) - qout;
fluxq = nx.*(1.0-nx).*dq/2.0;
% compute right hand sides of the semi-discrete PDE
rhsu = rx.*(Dr*q) - LIFT*(Fscale.*fluxq);
return