Skip to content

Convective cooling of a bar using double newman boundary condition. #1075

Answered by guyer
sbtristan98 asked this question in Q&A
Discussion options

You must be logged in to vote

A few issues here:

  • You have a Robin condition, not a gradient constraint.
  • You need to .updateOld() in order to advance the time step. Sweeping just solves the same time step over and over again in an attempt to converge any nonlinearities.
    • Sweeping is something you do a small number of times at each time step. I didn't change this, but sweeping 10000 times is confusing.
  • Constraints should only be applied once. FiPy uses lazy evaluation, so a single expression before you start solving will automatically update each time your solution changes.

With the following changes, your code seems to exhibit the behavior you're looking for:

diff --git a/discussion1075.py b/discussion1075.py
index…

Replies: 1 comment 1 reply

Comment options

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

Answer selected by sbtristan98
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