I know that we can set the parameter 'underRelaxation' if we use 'sweep' to solve the equation. eg:
xVelocity_eq.sweep(dt=dt, underRelaxation = 0.5)
But how to set this parameter to coupled equation. eg:
coupled_eq = xVelocity_eq & yVelocity_eq & zVelocity
coupled_eq.sweep(dt=dt,underRelaxation = ?)
I have tried set underRelaxtion = 0.5 and set underRelaxation as a array like following code:
relaxation = np.zeros(len(self.yVelocity) + len(self.zVelocity) + len(self.xVelocity))
relaxation[:] = velocityRelaxation
coupled_eq.sweep(dt=dt,underRelaxation = relaxation)
However, it does not work correctly with an IndexError(indices out of range).If i do not set the underRelaxation, the error will not appear and the codes can run.
File "C:\Program Files\Itasca\PFC500\exe64\python27\lib\site-packages\fipy\terms\term.py", line 237, in sweep
solver._applyUnderRelaxation(underRelaxation=underRelaxation)
File "C:\Program Files\Itasca\PFC500\exe64\python27\lib\site-packages\fipy\solvers\solver.py", line 133, in _applyUnderRelaxation
self.matrix.putDiagonal(self.matrix.takeDiagonal() / underRelaxation)
File "C:\Program Files\Itasca\PFC500\exe64\python27\lib\site-packages\fipy\matrices\pysparseMatrix.py", line 223, in putDiagonal
self.put(vector, ids, ids)
File "C:\Program Files\Itasca\PFC500\exe64\python27\lib\site-packages\fipy\matrices\offsetSparseMatrix.py", line 55, in put SparseMatrix.put(self, vector, id1 + self.mesh.numberOfCells * self.equationIndex, id2 + self.mesh.numberOfCells * self.varIndex)
File "C:\Program Files\Itasca\PFC500\exe64\python27\lib\site-packages\fipy\matrices\pysparseMatrix.py", line 198, in put self.matrix.put(vector, id1, id2)
IndexError: indices out of range