Thank you Ray.

I tried just including  '+ S' after my diffusion term, and I no longer see
the runaway heating but that still doesn't give me the confidence in the
solution I'd hoped for.

Since I am using a function to represent my source (I misspoke in my
original email: S = S(u, t) not S = S(x, t) btw), and I only update the
value of S after sweeping, does it matter the dependence on u?

-Chris


Chris Jones

*Project Electrical Engineer*

[email protected] | 603-601-3340




*ANTAYA* *SCIENCE & TECHNOLOGY*

7A Merrill Industrial Drive

Hampton,  NH  03842

603-601-7474


This message may contain information that is confidential, privileged or
otherwise protected from disclosure. If you are not the intended recipient,
you are hereby notified that any use, disclosure, dissemination,
distribution, or copying of this message, or any attachments, is strictly
prohibited. If you have received this message in error, please advise the
sender by reply e-mail, and delete the message and any attachments. Thank
you.

On Thu, Jan 8, 2015 at 11:41 AM, Raymond Smith <[email protected]> wrote:

> As a comment, if S is the whole source, you don't want to use
> ImplicitSourceTerm, because that assumes that the source is linear in the
> variable with coefficient as given. This is apparently usually the
> recommended way to do it if there is a way to write your source that way.
> However, if you have a source that can't be written that way, you can just
> type the source term into the equation directly: documentation
> <http://www.ctcms.nist.gov/fipy/documentation/numerical/discret.html#source-term>
> (and an example here
> <http://www.ctcms.nist.gov/fipy/examples/convection/generated/examples.convection.exponential1DSource.mesh1D.html#module-examples.convection.exponential1DSource.mesh1D>
> )
>
> Ray
>
> On Thu, Jan 8, 2015 at 10:30 AM, Christopher Jones <[email protected]>
> wrote:
>
>> Hello,
>>
>> I am modelling nonlinear heat conduction using time steps and sweeps.
>>
>> Basic equation is:
>>
>> du/dt = A(u) * d2u/dx2 + S(x, t)
>>
>> where u(x, t)
>>
>> I have functions written for A(u), the DiffusionTerm coefficient, and
>> S(x, t), the ImplicitSourceTerm. I implement them with the following
>> snippet:
>>
>> eq = TransientTerm() == DiffusionTerm(coeff=A) +
>> ImplicitSourceTerm(coeff=S)
>>
>> S is really the whole source term, not the coefficient, so have I coded
>> this correctly?
>>
>> I have declared A as a FaceVariable (because diffusion happens from cell
>> to cell, and S as a CellVariable, is this correct?
>>
>> Since S depends on t as well, I created a Variable t. I then created a
>> small function and included it with S with this snippet:
>>
>> B = 50 * numerix.exp(-t)
>>
>> S.setValue(B)
>>
>> After sweeping, I increment the elapsed time and then t, with
>>
>> t.setValue(elapsedTime)
>>
>> I can print B's value to see that it does decay.
>>
>>
>> I provide an initial distribution: u(x, 0). For simplicity, I will choose
>> no boundary conditions. The first set of sweeps causes u to zero out.
>>
>> What is happening? Have I not set this up correctly? What examples could
>> I use to iron this out?
>>
>> Thanks,
>> Chris
>>
>> _______________________________________________
>> fipy mailing list
>> [email protected]
>> http://www.ctcms.nist.gov/fipy
>>   [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
>>
>>
>
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
>   [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
>
>
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to