Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sign issues for equation with transient, convection and implicit terms #342

Closed
wd15 opened this issue Sep 19, 2014 · 3 comments
Closed

sign issues for equation with transient, convection and implicit terms #342

wd15 opened this issue Sep 19, 2014 · 3 comments

Comments

@wd15
Copy link
Contributor

wd15 commented Sep 19, 2014

The following breaks when the sign is changed on the equation

from fipy import Grid1D, CellVariable
from scipy import exp
from fipy import TransientTerm, ConvectionTerm, ImplicitSourceTerm, Viewer

xmax = 5.
dx = 0.05
nx = xmax/dx
mesh = Grid1D(dx=dx, Lx=xmax)

x = mesh.getCellCenters()[0]
X = mesh.getFaceCenters()[0]

numerical = CellVariable(name="numerical", mesh=mesh)

numerical.constrain(1, mesh.facesLeft)
numerical.constrain(0, mesh.facesRight)
numerical.faceGrad.constrain([0], mesh.facesLeft)

analytical = CellVariable(name="analytical value", mesh=mesh)
analytical.setValue(exp(-x**2/2.))

eqn = TransientTerm(coeff=1 / x) == \
  - ConvectionTerm(coeff=[[1]]) \
  - ImplicitSourceTerm(coeff=x)

numerical.setValue(exp(-x**2/2.))

vi = Viewer(vars=(numerical,analytical),datamin=0,datamax=2)

for i in range(10000):
eqn.solve(var=numerical,dt=1.)
vi.plot()
raw_input('stopped')

Imported from trac ticket #465, created by wd15 on 09-20-2012 at 12:23, last modified: 09-27-2012 at 10:07

@wd15
Copy link
Contributor Author

wd15 commented Sep 19, 2014

Pull request

The following changes since commit 084d3649a015f07b0cb3856038de5c53d03a391a:

  Merge branch 'loki-test-failures-rebase' into develop (2012-09-05 16:21:50 -0400)

are available in the git repository at:

  ssh://genie.nist.gov//users/wd15/git/fipy ticket465-sign-issues-rebase

Daniel Wheeler (1):
Fix for issue #342, using diagonalSign with convection terms.

 fipy/terms/abstractConvectionTerm.py |   53 +++++++++++++++++++++++++--------
 fipy/terms/cellTerm.py               |    1 -
 fipy/terms/implicitSourceTerm.py     |   16 ++--------
 fipy/terms/nonDiffusionTerm.py       |   14 +++++++++
 fipy/terms/term.py                   |    9 ++++-
 fipy/terms/upwindConvectionTerm.py   |    3 +-
 6 files changed, 65 insertions(+), 31 deletions(-)

Trac comment by wd15 on 09-21-2012 at 16:33

@guyer
Copy link
Member

guyer commented Sep 19, 2014

Replying to wd15:

Pull request

These changes (again) look reasonable.

Trac comment by guyer on 09-25-2012 at 12:04

@wd15
Copy link
Contributor Author

wd15 commented Sep 19, 2014

Changes merged with 2a422a6 and 23c8412

Trac comment by wd15 on 09-27-2012 at 10:07

@wd15 wd15 closed this as completed Sep 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants