time | calls | line |
---|
| | 1 | function [Fu Fv] = UVadvect_TVD_mex(Nx, Ny, dx, dy, dt, ui, vi, uj, vj, Nodeu, Nodev, idsu, idsv,Nbcs,NbcsDu,NbcsDv)
|
| | 2 | % function [Fu Fv] = UVadvect_DO_mex(Nx, Ny, dx, dy, u, v, Nodeu, Nodev, idsu, idsv)
|
| | 3 | % This function calculates the FV fluxes in a staggered grid for velocity
|
| | 4 | % advection, and allows for different velocities to be used to determine the
|
| | 5 | % upwind direction (as required by the DO implementation). QUICK scheme used for
|
| | 6 | % advection.
|
| | 7 | %
|
| | 8 | % INPUTS:
|
| | 9 | % Nx: Number of interior nodes in the x-direction
|
| | 10 | % Ny: Number of interior nodes in the y-direction
|
| | 11 | % dx: Step size in x direction
|
| | 12 | % dy: Step size in y direction
|
| | 13 | % ui: Vector containing the i'th u mode of velocity, including boundary
|
| | 14 | % data
|
| | 15 | % vi: Vector containing the i'th v mode of velocity, including boundary
|
| | 16 | % data
|
| | 17 | % uj: Vector containing the j'th u mode of velocity, including boundary
|
| | 18 | % data
|
| | 19 | % vj: Vector containing the j'th v mode of velocity, including boundary
|
| | 20 | % data
|
| | 21 | % Nodeu: Is the node numbering matrix for the u velocity
|
| | 22 | % Nodev: Is the node numbering matrix for the v velocity
|
| | 23 | % idsu: Location of active u-velocity nodes in interior
|
| | 24 | % idsv: Location of active v-velocity nodes in interior
|
| | 25 | % Nbcs: Number of boundary conditions
|
| | 26 | % NbcsDu: Number of Dirichlet u-velocity boundary conditions
|
| | 27 | % NbcsDv: Number of Dirichlet v-velocity boundary conditions
|
| | 28 | %
|
| | 29 | % OUTPUTS:
|
| | 30 | % Fu: Output vector:Fu = (Fue-Fuw)*dy/dV+(Fus-Fun)*dx/dV
|
| | 31 | % Fv: Output vector:Fv = (Fve-Fvw)*dy/dV+(Fvs-Fvn)*dx/dV
|
| | 32 | %
|
| | 33 | % Authors: Matt Ueckermann, Themis Sapsis,
|
| | 34 | % Pierre Lermusiaux, Pat Haley for MIT course 2.29
|
| | 35 | %
|
| | 36 | % NOTE: In this version of the advection equation, there is no upwind direction.
|
| | 37 | % This is consistent for the modes which should have no sign attached to them.
|
| | 38 |
|
| | 39 | %% Call C++ function to do advection. Note the casting to int32's (important)
|
840.42 | 66420 | 40 | [Fu Fv]=UVadvect_TVD_mx(int32(Nx),int32(Ny),dx,dy,dt,ui,vi,uj, vj,...
|
| | 41 | int32(Nodeu),int32(Nodev),int32(Nbcs),int32(NbcsDu),int32(NbcsDv));
|
| | 42 | %Reformat flux for output
|
43.25 | 66420 | 43 | Fu=Fu(idsu);
|
31.50 | 66420 | 44 | Fv=Fv(idsv);
|