Krylov solver not working for Transient Thermoelastic problem


118
views
0
10 weeks ago by
Subhro  
I am trying to solve a transient thermo-elasticity problem. In my case, the displacement field is dependent on temperature but the temperature field is not dependent on displacements. I am fixing the left face of a cube domain and applying  a Temperature of 600 oC on the same face. The right face is free with convective heat transfer boundary conditions. All other faces are insulated. I am able to get the thermal transients with the cg method (petsc_amg preconditioning), but unable to calculate the displacements using the same solver in the transient loop. The LU solver is able to solve the system however.
I am running Fenics 2017.2.0 (ubuntu version). As per the error the load vector size is not getting updated for the elastic solve, but there is no arity mismatch error.
Please have a look into the code and let me know where am I going wrong?

Thank you very much in advance.


File attached: cube.py (4.39 KB)

Community: FEniCS Project

1 Answer


2
10 weeks ago by
The simplest thing to do would probably be to just create two different solver objects, say, solver and solver2, to be used on problems 1 and 2.  (This would also be helpful if you need different solver parameters for the different problems.)

Alternatively, if you want to stick with a single solver object, you could define the Krylov solver as a PETScKrylovSolver instead of a KrylovSolver, e.g.,
solver = PETScKrylovSolver('cg', 'petsc_amg')​

and re-set it after each solve by calling KSPReset on its underlying PETSc KSP, through the petsc4py API:

solver.ksp().reset()

Thank you very much David! The KSPReset has solved the issue.
written 10 weeks ago by Subhro  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »