Hi,
I am working with the leveler.py script in the level set examples. The
script chooses dt value for solving the equations based on the maximum
velocity of the interface at any given instant and the CFL number.
Script: leveler.py
dt = cflNumber * cellSize / extOnInt.max()
I changed that to a user specified fixed dt. To test the changes I made, I
ran the script for a flat interface and plotted acceleratorVar.interfaceVar
as a function of time for different dt values. Unfortunately, I was unable
to get dt convergence. By trial and error, I found out that if I call
AdsorbingSurfactantEquation with consumptionCoeff=None,
I get dt convergence. I then went through the
AdsorbingSurfactantEquation.py to see if I can find something. I think
there is a dt term missing in the AdsorbingSurfactantEquation.py.
Script: AdsorbingSurfactantEquation.py
self.eq = TransientTerm(coeff = 1) -
ExplicitUpwindConvectionTerm(SurfactantConvectionVariable(distanceVar))
*self.dt* = Variable(0.)
mesh = distanceVar.mesh
adsorptionCoeff = *self.dt* * bulkVar * rateConstant *#dt
multiplication *
spCoeff = adsorptionCoeff * distanceVar._cellInterfaceFlag
scCoeff = adsorptionCoeff * distanceVar.cellInterfaceAreas /
mesh.cellVolumes
self.eq += ImplicitSourceTerm(spCoeff) - scCoeff
if otherVar is not None:
otherSpCoeff = *self.dt* * otherBulkVar * otherRateConstant *
distanceVar._cellInterfaceFlag *#dt multiplication*
otherScCoeff = -otherVar.interfaceVar * scCoeff
self.eq += ImplicitSourceTerm(otherSpCoeff) - otherScCoeff
if consumptionCoeff is not None:
self.eq += ImplicitSourceTerm(consumptionCoeff) * #This is
where I think a dt term is missing*
I believe the line should be
if consumptionCoeff is not None:
self.eq += ImplicitSourceTerm(consumptionCoeff**self.dt*)
Please let me know if I am thinking on the right lines.
Regards,
Chaitanya
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
[ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]