Re: casting implicit Boundary Conditions in FiPy

2016-07-15 Thread Daniel Wheeler
On Thu, Jul 14, 2016 at 10:34 AM, Gopalakrishnan, Krishnakumar wrote: > Dear Dan, > > Thanks a lot for your reply. > > In the 'hacked' source term to handle this special boundary condition, i.e. > > fp.ImplicitSourceTerm((mesh.faceNormals * implicitCoeff * > mesh.facesRight).divergence)), > > my i

RE: casting implicit Boundary Conditions in FiPy

2016-07-14 Thread Gopalakrishnan, Krishnakumar
[0]. Is my understanding correct? Best Regards Krishna -Original Message- From: fipy-boun...@nist.gov [mailto:fipy-boun...@nist.gov] On Behalf Of Daniel WheelerTo: 'fipy@nist.gov' Subject: RE: casting implicit Boundary Conditions in FiPy I recommend trying both methods and

Re: casting implicit Boundary Conditions in FiPy

2016-07-05 Thread Daniel Wheeler
On Fri, Jul 1, 2016 at 2:44 PM, Gopalakrishnan, Krishnakumar wrote: > > Now, my question is, for the explicit term in the BC, can't I just define in > a regular Neumann BC style of definition ? , i.e. > phi.facegrad.constrain([alpha/ (1 - beta*dx/2)], mesh.facesRight]) . i.e. > will this or

RE: casting implicit Boundary Conditions in FiPy

2016-07-01 Thread Gopalakrishnan, Krishnakumar
l Wheeler Sent: 23 June 2016 15:24 To: Multiple recipients of list Subject: Re: casting implicit Boundary Conditions in FiPy On Fri, Jun 17, 2016 at 5:36 PM, Gopalakrishnan, Krishnakumar wrote: > > My problem models the solid diffusion in a spherical particle. Matter > diffuses fro

Re: casting implicit Boundary Conditions in FiPy

2016-06-23 Thread Guyer, Jonathan E. Dr. (Fed)
> On Jun 23, 2016, at 10:23 AM, Daniel Wheeler > wrote: > > I'm not sure what the thinking is of your colleagues, but the size of > the elements has little or no impact on conservation. In finite > volume, the equations are conservative to at least the precision of > the linear solver (if not m

Re: casting implicit Boundary Conditions in FiPy

2016-06-23 Thread Daniel Wheeler
On Fri, Jun 17, 2016 at 5:36 PM, Gopalakrishnan, Krishnakumar wrote: > > My problem models the solid diffusion in a spherical particle. Matter > diffuses from the centre of the particle and reacts at the surface. This > is captured in a normalised 1-D domain with suitable equations and > co

RE: casting implicit Boundary Conditions in FiPy

2016-06-17 Thread Gopalakrishnan, Krishnakumar
e 2016 14:50 To: Multiple recipients of list Subject: Re: casting implicit Boundary Conditions in FiPy On Thu, Jun 16, 2016 at 12:35 PM, Gopalakrishnan, Krishnakumar mailto:k.gopalakrishna...@imperial.ac.uk>> wrote: > Thanks. > > Yes, this Is indeed only first order

RE: casting implicit Boundary Conditions in FiPy

2016-06-17 Thread Gopalakrishnan, Krishnakumar
:28 To: FIPY Subject: Re: casting implicit Boundary Conditions in FiPy Gmsh does do 1D meshes, and I've got experimental code that imports them, but it's not ready to merge, yet. In the meantime, this approach I've used for modeling semiconductor device contacts in 1D is probab

Re: casting implicit Boundary Conditions in FiPy

2016-06-17 Thread Guyer, Jonathan E. Dr. (Fed)
Gmsh does do 1D meshes, and I've got experimental code that imports them, but it's not ready to merge, yet. In the meantime, this approach I've used for modeling semiconductor device contacts in 1D is probably better: n_thickness = 1e-6 # m p_thickness = 149e-6 # m grid_resolution = 5e-8

Re: casting implicit Boundary Conditions in FiPy

2016-06-17 Thread Daniel Wheeler
On Thu, Jun 16, 2016 at 12:35 PM, Gopalakrishnan, Krishnakumar wrote: > Thanks. > > Yes, this Is indeed only first order accurate. I verified this by > successively cutting my dx by half, running your code, and comparing against > the Mathematica generated result. Each time dx is cut by half, t

RE: casting implicit Boundary Conditions in FiPy

2016-06-16 Thread Gopalakrishnan, Krishnakumar
ing ? Krishna -Original Message- From: fipy-boun...@nist.gov [mailto:fipy-boun...@nist.gov] On Behalf Of Daniel Wheeler Sent: 15 June 2016 17:50 To: Multiple recipients of list Subject: Re: casting implicit Boundary Conditions in FiPy On Wed, Jun 15, 2016 at 7:27 AM, Gopalakrishnan, Krishnakumar

Re: casting implicit Boundary Conditions in FiPy

2016-06-15 Thread Daniel Wheeler
On Wed, Jun 15, 2016 at 7:27 AM, Gopalakrishnan, Krishnakumar wrote: > > Dan. I was able validate that your code correctly implements the Implicit > Neumann Boundary Condition (in 1-D). > > Here is a link to the plot of the solution after a transient simulation for > 0.2 seconds. The plot on th

Re: casting implicit Boundary Conditions in FiPy

2016-06-15 Thread Guyer, Jonathan E. Dr. (Fed)
> On Jun 15, 2016, at 7:27 AM, Gopalakrishnan, Krishnakumar > wrote: > > Can we add this as a feature request in the project’s github page, perhaps > for a future release? By all means, please file issues on GitHub for any features you'd like or bugs you find. _

RE: casting implicit Boundary Conditions in FiPy

2016-06-15 Thread Gopalakrishnan, Krishnakumar
? Once again, thanks for your help in providing this solution approach. Krishna From: fipy-boun...@nist.gov [mailto:fipy-boun...@nist.gov] On Behalf Of Daniel Wheeler Sent: 10 June 2016 18:18 To: Multiple recipients of list Subject: Re: casting implicit Boundary Conditions in FiPy Hi Krishina

RE: casting implicit Boundary Conditions in FiPy

2016-06-14 Thread Gopalakrishnan, Krishnakumar
) steps = 75 for step in range(steps): eq.solve(var=phi, dt=timeStep) viewer.plot() Krishna -Original Message- From: fipy-boun...@nist.gov [mailto:fipy-boun...@nist.gov] On Behalf Of Daniel Wheeler Sent: 13 June 2016 03:17 To: Multiple recipients of list Subject: Re: casting imp

Re: casting implicit Boundary Conditions in FiPy

2016-06-12 Thread Daniel Wheeler
On Sun, Jun 12, 2016 at 8:14 AM, Gopalakrishnan, Krishnakumar wrote: > > 1. The backward Euler method is used in formulating the equation, > "n.grad(phi) = k * (phi_P + n.grad(phi) * dx / 2) " . But Backward Euler > is a first order method, isn't it ? I am a bit confused about the second > o

Re: casting implicit Boundary Conditions in FiPy

2016-06-12 Thread Gopalakrishnan, Krishnakumar
my head. I have to think about this, when I implement them perhaps in a week or so. Thanks once again, Krishna From: fipy-boun...@nist.gov on behalf of Daniel Wheeler Sent: Friday, June 10, 2016 6:17 PM To: Multiple recipients of list Subject: Re: casting implic

Re: casting implicit Boundary Conditions in FiPy

2016-06-10 Thread Daniel Wheeler
gt; >> c.faceGrad.constrain([-(j_at_c_star + partial_j_at_op_point*(c.faceValue >> - c_star))], mesh.facesTop), then c.faceValue gets immediately >> evaluated at the operating point, c_star, and we are left with 0 >> multiplying the first-order derivative. >> >>

Re: casting implicit Boundary Conditions in FiPy

2016-06-10 Thread Raymond Smith
;ithint=photo%2cjpg > > > > Meanwhile, may I also ask if other Fipy users or developers had to deal > with non-linear Implicit Neumann boundary conditions in their problems? > > > > > > Krishna > > > > *From:* fipy-boun...@nist.gov [mailto:fipy-boun...@nist.

Re: casting implicit Boundary Conditions in FiPy

2016-06-09 Thread Raymond Smith
lue substitution, we are simply left with > > > > > > i.e. evaluation of the j at a given DC operating point, introducing first > order errors in the local time-step. > > > > Am I on the wrong track here ? > > > > > > Krishna > > > > *F

RE: casting implicit Boundary Conditions in FiPy

2016-06-09 Thread Gopalakrishnan, Krishnakumar
: Re: casting implicit Boundary Conditions in FiPy Hi, Krishna. Perhaps I'm misunderstanding something, but I'm still not convinced the second version you suggested -- c.faceGrad.constrain([-(j_at_c_star + partial_j_at_op_point*(c.faceValue - c_star))], mesh.facesTop) -- isn't wo

Re: casting implicit Boundary Conditions in FiPy

2016-06-09 Thread Raymond Smith
ated > at the operating point, c_star, and we are left with 0 multiplying the > first-order derivative. > > > > ie. the Boundary conditions becomes, > > > > Leading to huge loss of accuracy. > > > > Is there any hope at all in this situation ? J . Cheers and tha

RE: casting implicit Boundary Conditions in FiPy

2016-06-09 Thread Gopalakrishnan, Krishnakumar
: fipy@nist.gov Subject: Re: casting implicit Boundary Conditions in FiPy Hi, Krishna. Could you give a bit more detail and/or an example about how you know it's doing the wrong thing throughout the solution process? In the example you sent, the correct solution is the same (c(x, t) = 0) wh

Re: casting implicit Boundary Conditions in FiPy

2016-06-09 Thread Raymond Smith
icit. >> >> >> >> In FiPy, I have previously set up an implicit source term,by using >> the following code snippet, ImplicitSourceTerm(coeff=k) . Perhaps there >> might be an equivalent method in FiPy to set up the implicit BC, I think ? >> >> >&

Re: casting implicit Boundary Conditions in FiPy

2016-06-09 Thread Raymond Smith
code snippet, ImplicitSourceTerm(coeff=k) . Perhaps there > might be an equivalent method in FiPy to set up the implicit BC, I think ? > > > > > > Krishna > > > > > > > > > > *From:* fipy-boun...@nist.gov [mailto:fipy-boun...@nist.gov] *On Behal

RE: casting implicit Boundary Conditions in FiPy

2016-06-09 Thread Gopalakrishnan, Krishnakumar
ymond Smith Sent: 09 June 2016 14:23 To: fipy@nist.gov Subject: Re: casting implicit Boundary Conditions in FiPy Oh, right, the boundary condition is applied on a face, so you need the facevalue of phi: phi.faceGrad.constrain([phi.harmonicFaceValue]) Ray On Thu, Jun 9, 2016 at 7:28 AM, Gopalakri

Re: casting implicit Boundary Conditions in FiPy

2016-06-09 Thread Raymond Smith
kumar > *Sent:* 08 June 2016 23:42 > *To:* fipy@nist.gov > *Subject:* RE: casting implicit Boundary Conditions in FiPy > > > > Hi Raymond, > > > > Sorry, it was a typo. > > > > Yes, It is indeed d (phi)/dx, the spatial derivative BC. I shall try > se

RE: casting implicit Boundary Conditions in FiPy

2016-06-09 Thread Gopalakrishnan, Krishnakumar
st Regards Krishna From: fipy-boun...@nist.gov [mailto:fipy-boun...@nist.gov] On Behalf Of Gopalakrishnan, Krishnakumar Sent: 08 June 2016 23:42 To: fipy@nist.gov Subject: RE: casting implicit Boundary Conditions in FiPy Hi Raymond, Sorry, it was a typo. Yes, It is indeed d (phi)/dx

RE: casting implicit Boundary Conditions in FiPy

2016-06-08 Thread Gopalakrishnan, Krishnakumar
Behalf Of Raymond Smith Sent: 08 June 2016 23:36 To: fipy@nist.gov Subject: Re: casting implicit Boundary Conditions in FiPy Hi, Krishna. Just to make sure, do you mean that the boundary condition is a derivative with respect to the spatial variable or with respect to time as-written? If you mean

Re: casting implicit Boundary Conditions in FiPy

2016-06-08 Thread Raymond Smith
Hi, Krishna. Just to make sure, do you mean that the boundary condition is a derivative with respect to the spatial variable or with respect to time as-written? If you mean spatial, such that d\phi/dx = k*phi, have you tried phi.faceGrad.constrain(k*phi) and that didn't work? If you mean that its