Dear Dr. Guyer,
First of all I would like to thank you very much for your help, as I read
the example, used your code and started getting results!
>From the samples I ended up with this code:

--------------------------------------------------------
from fipy import *
import time

dx = dy = 10
nx = ny = 100
L = dx * nx
mesh = Grid2D(dx=dx, dy=dy, nx=nx, ny=ny)

# Fluid Properties
tc0=0.141
den0=867.
cp0=1717

# Wire Properties
tcw=57.5
denw=16690.
cpw=135.
Qw=1.5*10**9

dT = CellVariable(name = r'$\Delta T$',
                   mesh = mesh, value=0., hasOld=True)
Q = CellVariable(name = r'$Q$',
                   mesh = mesh, value=0.)
tc = CellVariable(name = r'$Tc$',
                   mesh = mesh, value=tc0)
den = CellVariable(name = r'$Den$',
                   mesh = mesh, value=den0)
cp = CellVariable(name = r'$Cp$',
                   mesh = mesh, value=cp0)


x, y = mesh.cellCenters[0], mesh.cellCenters[1]
# Wire diameter
radius=50
# Set Wire Properties
Q.setValue(Qw, where=(x)**2 + (y)**2 <= radius**2)
tc.setValue(tcw, where=(x)**2 + (y)**2 <= radius**2)
den.setValue(denw, where=(x)**2 + (y)**2 <= radius**2)
cp.setValue(cpw, where=(x)**2 + (y)**2 <= radius**2)

# Heat Conduction Equation
heatEq = (TransientTerm() == DiffusionTerm(tc/(den*cp)) + (1/(den*cp))*(Q))

viewer = Viewer(vars=dT, datamin=0., datamax=10.)

steps=20
dt = 10e-4
for i in range(steps):
dT.updateOld()
heatEq.solve(dT, dt=dt)
viewer.plot()
 time.sleep(1)
--------------------------------------------------------

However the change of Temperature only takes place within the radius of the
wire and do not seem to affect the outer fluid. Do you know how can I fix
this?
I do apologize for troubling you, but this is the first time I use FEM and
for me this is real challenge.
Thank you very much for your kind help, it is very valuable to me!

J.


On Wed, Jan 16, 2013 at 4:51 PM, Jonathan Guyer <[email protected]> wrote:

>
> On Jan 16, 2013, at 6:35 AM, John Assael wrote:
>
> > Thank you very much for your help!
> > Do you know how can I set only a point (a small circle) as the heat
> source and not the whole side?
>
> examples.diffusion.mesh1D, examples.diffusion.electrostatics, and
> examples.phase.anisotropy all show how to set a CellVariable to have a
> value in only one region. You can either use
>
> Q = CellVariable(..., value=0.)
> Q.setValue(Q0, where=(x - cx)**2 + (y - cy)**2 <= r)
>
> or
>
> Q = Q0 * ((x - cx)**2 + (y - cy)**2 <= r)
>
>
>
> Note: due to http://matforge.org/fipy/ticket/447, be sure to use
>
> x, y = mesh.cellCenters[0], mesh.cellCenters[1]
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
>   [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
>



-- 
..:: 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 ]

Reply via email to