Can I used the CellVariable method to map some lists onto the grid and put it into the coefficients of the equation? #958
Unanswered
LiuDongDong1989
asked this question in
Q&A
Replies: 1 comment 4 replies
-
Assuming that coeff1=CellVariable(mesh=self.mesh, value=self.h)
coeff2=CellVariable(mesh=self.mesh, value=self.h * self.u)
coeff3=CellVariable(mesh=self.mesh, value=self.h * self.DH) This will create three static variables which do not change as Instead, write coeff1=self.h
coeff2=self.h * self.u
coeff3=self.h * self.DH or just self.eqc = ( TransientTerm(var=self.c, coeff=self.h) +
ConvectionTerm(var=self.c, coeff=self.h * self.u * [[1]]) ) == (
DiffusionTerm (var=self.c, coeff=self.h * self.DH) +
Sss -
self.c * R
) As to |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I used the CellVariable method to map the list onto the grid and put it into the coefficients of the equation. I am not sure if this approach is correct.
In the above code, h, u, Sss_tmp are Python lists and have the same length as 1D Mesh. The code runs perfectly, but I don’t know if the equation is represented correctly, and are there any better methods to do this if I use 2D mesh?
Beta Was this translation helpful? Give feedback.
All reactions