Hi,
I am receiving the following error when running my code:
eq.sweep(var=energy, boundaryConditions=boundaryConditions, dt=1.0)
File "/usr/lib/pymodules/python2.7/fipy/terms/term.py", line 149, in sweep
solver = self._prepareLinearSystem(var=var, solver=solver,
boundaryConditions=boundaryConditions, dt=dt)
File "/usr/lib/pymodules/python2.7/fipy/terms/term.py", line 111, in
_prepareLinearSystem
self.__buildMatrix(var, solver, boundaryConditions, dt)
File "/usr/lib/pymodules/python2.7/fipy/terms/term.py", line 98, in
__buildMatrix
matrix, RHSvector = self._buildMatrix(var, solver._getMatrixClass(),
boundaryConditions, dt)
File "/usr/lib/pymodules/python2.7/fipy/terms/equation.py", line 94, in
_buildMatrix
dt, self)
File "/usr/lib/pymodules/python2.7/fipy/terms/faceTerm.py", line 165, in
_buildMatrix
weight = self._getWeight(mesh, equation=equation)
File "/usr/lib/pymodules/python2.7/fipy/terms/convectionTerm.py", line 143, in
_getWeight
alpha = self._Alpha(-self._getGeomCoeff(mesh) / diffCoeff)
File "/usr/lib/pymodules/python2.7/fipy/terms/term.py", line 430, in
_getGeomCoeff
self.geomCoeff = self._calcGeomCoeff(mesh)
File "/usr/lib/pymodules/python2.7/fipy/terms/convectionTerm.py", line 121, in
_calcGeomCoeff
self.coeff = FaceVariable(mesh=mesh, value=self.coeff, rank=1)
File "/usr/lib/pymodules/python2.7/fipy/variables/meshVariable.py", line 130,
in __init__
array=array, cached=cached)
File "/usr/lib/pymodules/python2.7/fipy/variables/variable.py", line 111, in
__init__
self._setValue(value=value, unit=unit, array=array)
File "/usr/lib/pymodules/python2.7/fipy/variables/variable.py", line 498, in
_setValue
self.value = self._makeValue(value=value, unit=unit, array=array)
File "/usr/lib/pymodules/python2.7/fipy/variables/variable.py", line 530, in
_makeValue
array[:] = value
ValueError: shape mismatch: objects cannot be broadcast to a single shape
I believe this is happening when the solver is called, but I am not sure what is
causing the problem. I would greatly appreciate any help. My code is below...
from fipy import *
rho = 4420
k = 25
hl = 25
V = (10,)
Vs = (10,)
eta = 0.4
powerl = 700
poweratt = 100
R = 1.25e-9
hcc = 10
epsilon = 0.3
omega = 5.6697e-8
Tinf = 300
me = 50
Lv = 9.86e6
K = 0.2
dx = 10
dy = 10
nx = 5
ny = 5
mesh = Grid2D(dx=dx, dy=dy, nx=nx, ny=ny)
T = CellVariable(mesh=mesh, name = 'Temperature')
S = CellVariable(mesh = mesh, rank = 0, name = 'Source Term')
boundaryConditions =(
FixedFlux(faces=mesh.getExteriorFaces(),
value = -(hcc/K)*(T.getArithmeticFaceValue() - Tinf)),
FixedFlux(faces=mesh.getFacesUp(),
value = - (1/K)*epsilon*omega*((T**4).getArithmeticFaceValue() -
Tinf**4)
- (1/K)*me*Lv+ (1/K)*((eta*(powerl - poweratt)))/(pi*R**2))
)
energy=CellVariable(mesh = mesh, hasOld = 1, name = 'Energy')
energy.updateOld()
eq = (TransientTerm(coeff=rho) +
PowerLawConvectionTerm(coeff=rho*V) ==
(k*T)
+S)
eq.sweep(var=energy, boundaryConditions=boundaryConditions, dt=1.0)
if __name__ == '__main__':
viewer = Viewer(vars=var)
viewer.plot()
Thanks,
Rodney Clayton
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
[ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]