Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpolating tracers to cell faces #98

Open
anthony-meza opened this issue Apr 7, 2023 · 1 comment
Open

Interpolating tracers to cell faces #98

anthony-meza opened this issue Apr 7, 2023 · 1 comment

Comments

@anthony-meza
Copy link
Contributor

Coordinates of velocity fields (Γ.XS, Γ.YS, Γ.XW, Γ.YW) seem to have some spurious discontinuities. For example, look at Γ.XS[1]. I think I have recreated these variables, but it requires a call to exch_UV

@anthony-meza
Copy link
Contributor Author

anthony-meza commented Apr 7, 2023

Here is an example of the code that I use. Heavily based of the convergence function


function tofaces(uFLD::MeshArrays.gcmarray{T, 1, Matrix{T}},
    vFLD::MeshArrays.gcmarray{T, 1, Matrix{T}}) where T<:Real
    Ugrid = T.(similar(uFLD))
    Vgrid = T.(similar(uFLD))
    (tmpU,tmpV)=exch_UV(uFLD,vFLD)

    for a in 1:5
        (s1,s2)=size(uFLD.f[a])
        tmpU1=view(tmpU.f[a],1:s1,1:s2)
        tmpU2=view(tmpU.f[a],2:s1+1,1:s2)
        tmpV1=view(tmpV.f[a],1:s1,1:s2)
        tmpV2=view(tmpV.f[a],1:s1,2:s2+1)
        Ugrid.f[a] =(tmpU1+tmpU2) / 2
        Vgrid.f[a] =(tmpV1+tmpV2) / 2
    end

return Ugrid, Vgrid
end

@time XW, XS = tofaces(Γ.XC, Γ.XC)
@time YW, YS = tofaces(Γ.YC, Γ.YC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant