D3Q19 mwrt #407
Answered
by
llaniewski
NickZhaooo
asked this question in
Q&A
D3Q19 mwrt
#407
-
In source code, is there any functions or modules for wmrt model, especially for d3q19? |
Beta Was this translation helpful? Give feedback.
Answered by
llaniewski
Sep 27, 2022
Replies: 2 comments 2 replies
-
@TravisMitchell Can you point to a WMRT generation example? |
Beta Was this translation helpful? Give feedback.
1 reply
-
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, generate an object and do collision
EQ = MRT_eq(U, mat=M)
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) ) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
llaniewski
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
To do WMRT (weight MRT)