You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to implement the shock tube equations as described in: https://en.wikipedia.org/wiki/MUSCL_scheme
Currently, I have implemented it as described in the attached file.
However, I get this error: AttributeError: 'binOp' object has no attribute 'divergence'.
I used the term (u * p).divergence as described in the FAQ
Instead, if I rewrite the term (u * p).divergence as: + p.grad[0] * u + u.grad[0] * p
The code performs decently well, leading to the comparison shown in the attachments compared to literature values (dashed -- lines).
The two solid lines correspond to:
It appears that .divergence doesn't work for CellVariables. It does work for FaceVariables so it's best to evaluate (u * p) as a FaceVariable. Use (u.faceValue * p.faceValue).divergence to make it work. It's best to use that form as u and p might be constrained on the boundaries and this format should pick that up (instead of (u * p).faceValue.divergence).
Note that the text at the end of this section in the FAQ appears to suggest that .divergence does exist for CellVariables, which is not the case.
Hello,
I am trying to implement the shock tube equations as described in: https://en.wikipedia.org/wiki/MUSCL_scheme
Currently, I have implemented it as described in the attached file.
However, I get this error:
AttributeError: 'binOp' object has no attribute 'divergence'.
I used the term
(u * p).divergence
as described in the FAQshocktube (copy).txt
Instead, if I rewrite the term
(u * p).divergence
as:+ p.grad[0] * u + u.grad[0] * p
The code performs decently well, leading to the comparison shown in the attachments compared to literature values (dashed -- lines).
The two solid lines correspond to:
velocity_comparison.pdf
pressure_comparison.pdf
density_comparison.pdf
Could you give me some advice on the best way to set it up?
Best,
Francisco
PS. I saw this old mailing list post: https://fipy.nist.narkive.com/ZLce9x2l/compressible-euler-equations
but the files are not attached...
The text was updated successfully, but these errors were encountered: