Skip to content

D3Q19 mwrt #407

Answered by llaniewski
NickZhaooo asked this question in Q&A
Sep 26, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Generally in https://github.com/CFD-GO/TCLB/blob/master/src/lib/feq.R you have everything you need. You can generate an object, which carries all the information for MRT:

library(polyAlgebra)
source("src/lib/feq.R")
source("src/lib/lattice.R")

# Velocity set
U = d3q19

# symbolic variables
f = PV("f",1:nrow(U)-1)
R = PV("R",1:nrow(U)-1)

# object that has all the MRT things
EQ = MRT_eq(U)

# example collision
C( R, f %*% EQ$mat )
C( PV("rho","Jx","Jy","Jz"), R[1:4] )
C( R, R + (EQ$Req - R)*PV("omega"))
C( f, R %*% solve(EQ$mat) )

To do WMRT (weight MRT)

# get rid of the hardcoded MRT matrix from literature
attr(U, "MAT") = NULL

# generate WMRT matrix
M = WMRT_mat(U)

# rest is the same,…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@NickZhaooo
Comment options

Comment options

You must be logged in to vote
1 reply
@NickZhaooo
Comment options

Answer selected by llaniewski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #406 on September 26, 2022 12:35.