Perhaps your errors in assigning the values are coming from the initial
creation of the coefficients. I do recommend looking over the 1D diffusion
example
<http://www.ctcms.nist.gov/fipy/examples/diffusion/generated/examples.diffusion.mesh1D.html>
carefully. Note that when declaring the coefficient for a diffusion term,
it should be declared as a FaceVariable, not a CellVariable, as you've
noted.

Ray

On Tue, Sep 9, 2014 at 10:50 AM, John Assael <[email protected]> wrote:

> Dear Raymond,
>
> Thank you for your fast reply.
>
> No I don't have that problem as my T variable represents the thermal
> conductivity k,  and it is not described in terms of position, it just
> changes from material to material.
>
> Exactly rho * cp are the transient terms.
>
> Finally the equation results dT the temperature difference.
>
> What else could it be?
>
> Best regards,
> John
> On 9 Sep 2014 17:16, "Raymond Smith" <[email protected]> wrote:
>
>> Hi, John.
>>
>> I'm not completely sure if this is related, but I do want to make sure
>> it's not something like that discussed in the recent thread about the heat
>> equation on this list:
>>
>> http://thread.gmane.org/gmane.comp.python.fipy/3556/focus=3565
>>
>> Is your "diffusion coefficient" (typically called alpha, thermal
>> diffusivity, in heat transfer) a function of position? If so, it's
>> important to keep only the thermal conductivity, k, as the coefficient for
>> DiffusionTerm (more detail in the linked thread). The density and heat
>> capacity should be coefficients for the TransientTerm.
>>
>> Cheers,
>> Ray
>>
>> On Tue, Sep 9, 2014 at 10:00 AM, John Assael <[email protected]> wrote:
>>
>>> Hi,
>>> I keep getting inaccurate results on my heat conduction experiment, 0.1
>>> missing accuracy except if the shape is extremely and abnormally dense.
>>> In the beginning I though its the time steps but they are already very
>>> small and make no difference if I shorten the intervals.
>>>
>>> I am trying to replicate a simulation from COMSOL and if I take the mesh
>>> and the timesteps I cannot replicate the results accurately.
>>>
>>> I believe the problem is that all my variables are cell variables.
>>> However, I read in the FAQ that diffusion terms have to be FaceVariables.
>>>
>>> More specifically, my mesh is 2-D and I have the following equation and
>>> variables:
>>>
>>> *    dT = CellVariable(name=r'$\Delta T$', mesh=mesh, value=0.)*
>>> *    Q = CellVariable(name=r'$Q$', mesh=mesh, value=0.)*
>>> *    T = CellVariable (name=r'$T$', mesh=mesh, value=0.)*
>>> *    D = CellVariable (name=r'$D$', mesh=mesh, value=0.)*
>>>
>>> *    heat = (TransientTerm(coeff=D) == DiffusionTerm(coeff=T) + Q)*
>>>
>>> And then I go to the areas I have defined and set the values. Here is an
>>> example of two of them.
>>>
>>>
>>> *    x, y = mesh.cellCenters    meshW = (x ** 2 + y ** 2 <=
>>> properties['r'] ** 2)*
>>> *    Q.setValue(properties['Q'], where= meshW)*
>>> *    T.setValue(properties['T'], where= meshW)*
>>> *    D.setValue(properties['D'], where= meshW)*
>>>
>>> *    meshW1 = (x ** 2 + y ** 2 > properties['r'] ** 2)*
>>> *    T.setValue(properties['T1'], where= **meshW1**)*
>>> *    D.setValue(properties['D2'], where= **meshW1**)*
>>>
>>> However, when I do that I get an error for the face variable for every
>>> single one I try to change.
>>> Would sweeps instead of solve help me solve the problem?
>>> Do you have any suggestions?
>>>
>>> Thank you very much!
>>>
>>> Best regards,
>>> John
>>>
>>>
>>> --
>>> ..:: ic3man.gr ::..
>>> software | design | development
>>> _/_/_/ email : [email protected]
>>> _/_/_/ www   : http://www.ic3man.gr
>>> ------------------------------------------------------------------
>>> This e-mail and any attachments are confidential. You may not copy
>>> or disseminate any information  contained in them  to anyone other
>>> than the intended recipient. If you are not the intended recipient
>>> please contact the sender by reply  e-mail and destroy all  copies
>>> of the original message immediately.
>>> ------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> 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 ]
>
>
_______________________________________________
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