Hi!
The coupled equations i try to solve with fipy are explained pretty easy.
I wrote the coupling as a source term - and it works good:
REALeqb = TransientTerm(coeff = -2*k) == (a.getFaceGrad()).getDivergence()
IMAGeqa = TransientTerm(coeff = 2*k) == (b.getFaceGrad()).getDivergence()
for sweepdummy in range(nr_of_sweeps):
resa = REALeqb.sweep(var=b , boundaryConditions=BCb, dt=dz)
resb = IMAGeqa.sweep(var=a , boundaryConditions=BCa, dt=dz)
# a and b are cellvariables.
# BoundaryConditions: a and b goes to zero at the edges of the solution area.
# a+i*b (with i=imag.unit) solves the timedep.-Schrödingerequation
without potential or paraxial Helmholtzequation
My problem is, that it becomes unstable with large timesteps ("dt=dz",
large dz)
I saw in the 1D-diffusion-example
(http://www.ctcms.nist.gov/fipy/examples/diffusion/generated/examples.diffusion.mesh1D.html)
that i can use really large timesteps with the "DiffusionTerm()" command
(compared to the ExplicitDiffusion()
)
In the trunk folder is an example for coupled Diffusion-eq. that is
really close to my problem:
http://matforge.org/fipy/browser/trunk/examples/diffusion/coupled.py
I first tried out to write it in the manner of the coupled.py example... so:
REALeqb = TransientTerm(var = b, coeff = -2*k) == DiffusionTerm(var = a)
IMAGeqa = TransientTerm(var = a, coeff = 2*k) == DiffusionTerm(var = b)
this doesnt work, of course ;) because i have the 2.1.3 fipy version
and not the "trunk" version
my question are:
- will i get rid of the timestep-limitation if i use the
"trunk"-version of fipy with DiffusionTerm(var=the_other_variable)
instead of the SourceTerm?
- or is it possible to get usefull solutions with large timesteps in
fipy 2.1.3 for this coupled problem? maybe rewriting something in the
equation-definition or so...?
- do i have to install everything thats in the trunkfolder when i want
to execute the coupled.py example-file correctly?
- i currently use windowsxp, will "copy-n-paste" from the trunkfolder
work? or do i have to pay attention here on something?
Thanks in advance for any kind of hints and help!
Christoph
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
[ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]