Dear all,
I have some problem in implementing a 2D cylindrical problem. Basically it

shall end up some day by having a cylindrical porous medium heated radially

and having some uniform gas flow through the pores. 
Both will later be
coupled by convective heat transfer to each other.

I just started using FiPy 3 (I was now and then using previous versions)
thus I do not know, if the following is a problem of my implementation or of
FiPy:

 

The  error message and script are found at pastebin (and perhaps below- I
have some problems with Gmane also): http://pastebin.com/3Wg7mdmy


It would be wonderful if anybody could give me a hint on what is going
wrong! Thanks in advance!

Burak
........

ERROR:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "\spyderlib\widgets\externalshell\sitecustomize.py", line 540, in runfile
    execfile(filename, namespace)
  File ".../2DcylinderConvHeat.py", line 78, in <module>
    eqG.solve(dt=timeStepDuration)
  File "...fipy-3.0_dev5303-py2.7.egg\fipy\terms\term.py", line 209, in solve
    solv...\fipy\terms\term.py", line 171, in _prepareLinearSystem
    buildExplicitIfOther=self._buildExplcitIfOther)
  File "...\fipy\terms\binaryTerm.py", line 68, in _buildAndAddMatrices
    buildExplicitIfOther=buildExplicitIfOther)
  File "...fipy\terms\binaryTerm.py", line 68, in _buildAndAddMatrices
    buildExplicitIfOther=buildExplicitIfOther)
  File "...\fipy\terms\unaryTerm.py", line 97, in _buildAndAddMatrices
    diffusionGeomCoeff=diffusionGeomCoeff)
  File "...\fipy\terms\abstractConvectionTerm.py", line 188, in _buildMatrix
    b += numerix.reshape(self.constraintB.value, ids.shape).sum(0).ravel()
AttributeError: 'NotImplementedType' object has no attribute 'sum'

##############################################

The script is the following, the eroor message refers to the last line:


from fipy import *

# some constants:
nr = 5
nz = 5
Lr = .15
Lz = .3
L = Lr
T0=300.
TG0=40.

mesh = CylindricalGrid2D(Lx=Lr, Ly=Lz, nx=nr, ny=nz)

rhoS=1500.
rhoG=1.
cvS=800.
cvG=700.
cpG=1000.
p0=1e5
rhoG0=p0/287./T0 
lamS=2.e-1
lamG=0.01
alph=1000.
u0=0.1
qdot=1e4
qdotV=qdot/(L*pi*(Lr)**2)
print "qdot/V",qdotV
cc=zeros([2])
cc[0]=0.
cc[1]=u0*cpG*rhoG0

#geometrische Faktoren Schuettung:
por=.25 #Porositaet
d0=.2e-3  # Korndurchmesser
Ai=pi*d0**2 #Flaeche Einzelkorn/Kugel
Vk=pi/6*(d0)**3
AV=Ai/Vk*(1-por) #Flaeche pro Volumen


T_s = CellVariable(name = "Temperature solid",
                   mesh = mesh,
                   value = T0)#, hasOld=True)
T_g = CellVariable(name = "Temperature gas",
                   mesh = mesh,
                   value = TG0, hasOld=True)
u   =CellVariable(name="Gas Geschwindigkeit",mesh=mesh, rank=1)
u.value[0,:]=cc[0]
u.value[1,:]=cc[1]
eqS = TransientTerm(coeff=rhoS*cvS,var=T_s) == DiffusionTerm(coeff=lamS,
var=T_s)#+alph*AV*(T_g-T_s)#+qdotV*0 #+alph*c
eqG = TransientTerm(coeff=rhoG*cvG,var=T_g) == DiffusionTerm(coeff=lamG,
var=T_g)+ \
                       
ExponentialConvectionTerm(coeff=[[2.],[1.]],var=T_g)#+alph*AV*(T_s-T_g)
#

x, y = mesh.faceCenters

T_s.faceGrad.constrain(((qdot/lamS,),(0,)) , where=(x==Lr))
T_g.constrain(TG0, mesh.facesTop)
#

#
if __name__ == '__main__':
    viewer = Viewer(vars=T_s, datamin=T0, datamax=T0+200.)
    viewer.plot()
#
# and solve the equation by repeatedly looping in time:
#
timeStepDuration = .25 #10 * 0.9 * (Lz/nz)**2 / (2 * D)
steps = 60
for step in range(steps):
    eqS.solve(dt=timeStepDuration)
    eqG.solve(dt=timeStepDuration)



_______________________________________________
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