Hello,
I am trying to solve Poisson equation in SAMFET (Self Assembly Monolayer Field Effect Transistor).
The device is consisted of electrolyte - oxide - semiconductor. I have written charge _expression_ (for the different regions) in the following way:
# calculate the charge density in the semiconductor
x = mesh.getCellCenters()[...,0]
s1_semi =( -((q*B)/(eps_si))*(Na*exp(-B*psy)+np0*exp(B*psy))) * (x <= dbulk)
s0_semi= ((q/eps_si)*(Na*(exp(-B*psy)-1)-np0*(exp(B*psy)-1))-s1_semi*psy) * (x <= dbulk)
from fipy.terms.implicitSourceTerm import ImplicitSourceTerm
implicitSource_semi = ImplicitSourceTerm(coeff = s1_semi)
# calculate the charge density in the diffuse layer
psyD=psy-Vref
s1_electrolyte=-(((q*Ho*B)/(eps_aqa))*(exp(-B*psyD)+exp(B*psyD))) * (x >= dh)
s0_electrolyte=(((q*Ho)/(eps_aqa))*(exp(-B*psyD)-exp(B*psyD))-s1_electrolyte*psyD) * (x >= dh)
from fipy.terms.implicitSourceTerm import ImplicitSourceTerm
implicitSource_electrolyte = ImplicitSourceTerm(coeff = s1_electrolyte)
and the equation is written in the following way:
samfet_eq = diffTerm + s0_semi + implicitSource_semi + s0_electrolyte + implicitSource_electrolyte == 0
Running my full script will cause the following errors:
>>>>
cg not converged
....
....
.... errors
....
ValueError: math domain error
It seems that FiPy is trying to solve it, has convergence problem and then exit because of error that is not clear to me.
I will appreciate if you could give some clue about this error.
Thanks,
Omer