Well I finally did it with some extra points defining the cell size...
However I keep getting a marked difference from Comsol results
The charts are here... http://www.ic3man.gr/Tol8_6c.xls
Is it possible that the calculations are not done right? (although I have
specified quite small cell sizes)
Or are the units correctly specified? (I want to run the simulation for
1sec and the time step should be 0.002s)

Thank you very much in advance for all the solutions that you have provided
kindly these days!
J.

--------------Source Code-------------------
from fipy import *
import time
import math
cellSize = 3E-07

# Fluid Properties
tc0=0.1293 #(W/m/K)
den0=857.23 #(Kg/m3)
cp0=1721.28 #(J/kg/K)
fluidradius= 3E-03 #(m)

# Wire Properties
QW=1586112000
tcW=57.5 #(W/m/K)
denW=16600.19 #(Kg/m3)
cpW=150.5 #(J/kg/K)
radius=12.915E-06 #(m)

mesh = Gmsh2D('''
cellSize = %(cellSize)g;
radius = %(radius)g;
fluidradius = %(fluidradius)g;

Point(1) = {0, 0, 0, cellSize};
Point(2) = {radius, 0, 0, cellSize};
Point(3) = {0, radius, 0, cellSize};
Point(4) = {fluidradius, 0, 0, cellSize*1000};
Point(5) = {0, fluidradius, 0, cellSize*1000};

Point(6) = {fluidradius*0.1, 0, 0, cellSize*2};
Point(7) = {0, fluidradius*0.1, 0, cellSize*2};
Point(8) = {fluidradius*0.2, 0, 0, cellSize*5};
Point(9) = {0, fluidradius*0.2, 0, cellSize*5};
Point(10) = {fluidradius*0.33, 0, 0, cellSize*10};
Point(11) = {0, fluidradius*0.33, 0, cellSize*10};
Point(12) = {fluidradius*0.66, 0, 0, cellSize*100};
Point(13) = {0, fluidradius*0.66, 0, cellSize*100};
Point(14) = {fluidradius*0.8, 0, 0, cellSize*500};
Point(15) = {0, fluidradius*0.8, 0, cellSize*500};

Circle(1) = {3, 1, 2};
Line(2) = {1, 2};
Line(3) = {1, 3};
Line(4) = {2, 4};
Line(5) = {3, 5};
Circle(6) = {5, 1, 4};
Line Loop(8) = {1, -2, 3};
Plane Surface(8) = {8};
Line Loop(10) = {4, -6, -5, 1};
Plane Surface(10) = {10};
Physical Surface("Wire") = {8};
Physical Surface("Fluid") = {10};
''' % locals())
x, y = mesh.cellCenters[0], mesh.cellCenters[1]

dT = CellVariable(name = r'$\Delta T$', mesh = mesh, value=0.)
QCell = CellVariable(name = r'$Q$', mesh = mesh, value=0.)
tcCell = CellVariable(name = r'$Tc$', mesh = mesh, value=tc0)
denCell = CellVariable(name = r'$Den$', mesh = mesh, value=den0)
cpCell = CellVariable(name = r'$Cp$', mesh = mesh, value=cp0)

# Set Wire Properties
x0 = y0 = 0
meshWire = mesh.physicalCells["Wire"]
meshFluid = mesh.physicalCells["Fluid"]
QCell.setValue(QW, where=meshWire)
tcCell.setValue(tcW, where=meshWire)
denCell.setValue(denW, where=meshWire)
cpCell.setValue(cpW, where=meshWire)

# Heat Conduction Equation
heatEq = (TransientTerm() == DiffusionTerm(coeff=(tcCell/(denCell*cpCell)))
+ (1/(denCell*cpCell))*QCell)

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

steps = 500
timeStep = 2e-3
for i in range(steps):
heatEq.solve(var=dT, dt=timeStep)
 viewer.plot()
dTVal = dT(((x0+radius/numerix.sqrt(2),), (y0+radius/numerix.sqrt(2),)),
order=1 )[0]
 print '%s %s' % ( (i*timeStep+timeStep), dTVal )

raw_input("Press Enter to continue...")
---------------------------------

On Tue, Jan 22, 2013 at 4:30 PM, Jonathan Guyer <[email protected]> wrote:

>
> On Jan 19, 2013, at 6:21 AM, John Assael wrote:
>
> > Perfect I gave Gmsh a try! However is the Gmsh2D background parameter
> not working?
>
> It works for me. Do the tests pass? Background meshes are tested in the
> docstring for Gmsh2D and if the tests pass, then background meshes are
> working.
>
> What happens if you replicate the use documented in
> http://www.ctcms.nist.gov/fipy/fipy/generated/fipy.meshes.html#fipy.meshes.gmshMesh.Gmsh2D
>
>
>
> _______________________________________________
> 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