Hello Bjarke!
On 10/26/2012 10:35 AM, Bjarke Dalslet wrote:
Hello sfepy users!
I am using sfepy to do thermal simulations of (BIG!) electric resistors. Nothing fancy, but i would like to be able to use temperature dependent thermal conductivities as my system gets very hot.
At the moment I am employing the Laplace weak term: int(s * \nabla q *\nabla p) where s is the thermal conductivity, q is the test field parameter and p is the temperature field
What i want is for s to depend on the temperature. I wonder which strategy to use: 1: To limit myself to a linear s, i.e. s(q)=s0+\alpha * q. In that case i guess i can do this: int(s(q) * \nabla q *\nabla p) = int(s0 * \nabla q *\nabla p) + int(\alpha * q * \nabla q *\nabla p) Unfortunately the second term is not implemented. Looking at the source, this would be some work to implement. 2: To iterate and after each iteration assign new values of s at each point. This would not be a big deal when doing time dependent simulations, but steady-state would be much slower to calculate I guess? An added plus would be that arbitrary c(q) could be used. 3: Ask for help here, and go "Ahhh! Of course!", when you state the obvious, easily implementable and fantastic solution.
I have only used sfepy for about a week, and this is the first time i am messing around with weak formulation FEM, so this question might be really silly, but I ask anyway: Is the strategy above completely crazy or am I on the right track?
I would try 2 first, as the Laplace equation can be very quickly solved by a conjugate gradients solver, so doing a few "time" iterations would not be that demanding. The linear system solution is fast even with the Python implementation from SciPy ('ls.scipy_iterative'), but if you have PETSc and petsc4py installed, it would be even faster ('ls.petsc') - see tests/test_linear_solvers.py file for example configurations of the linear solvers.
As for the artificial time-stepping, look at [1], which is almost exactly what you need, only the equation is the linear elasticity.
Then, if the above approach does not work, we could try adding a new nonlinear term.
If you get stuck, do not hesitate to ask here.
Cheers & thanks for trying SfePy! r.
[1] http://docs.sfepy.org/doc-devel/examples/linear_elasticity/material_nonlinea...
Kind regards Bjarke Dalslet