Hi py17js,

can you send also the mesh file (small/coarse version, if possible, or provide a link) so that we are able to run the code?

The problem is linear, so there should be no linesearch message, provided the solver tolerances are not too low.

r.

On 04. 02. 21 18:58, py17js@leeds.ac.uk wrote:

Hi,

I am attempting to solve heat diffusion in a spin valve. I have created a 3D mesh of part of the valve which has a hotspot on the wire and i want to see the heat diffusion into the substrate below. The wire is treated as being insulated with the surroundings and the only heat flow is into the substrate. I have found out that the mesh needs to be separate volumes for the wire and substrate or I get a linesearch failed message. I have an image of the spin valve and what the temperature distribution is like in real life and i am trying to recreate it. I can get the problem to work with 2 boundary conditions: the hotspot at 25C and bottom of substrate at 21C. Is there a way to set one ebcs and initial and see how the heat diffuses into the substrate that way? Also there appears to be some strange overlap effects between the wire and subs as my regions overlap at z=0 if there a way to stop this given there is also an interface conductance I need to factor in at z =0?

My code:

from

__future__import absolute_import from sfepy import data_dir import numpy as nm filename_mesh = data_dir + '/3_vol.mesh'materials = { 'coef4' : ({'val' : 1.2},), 'coef5' : ({'val' : 240},), 'coef6' : ({'val' : -2.5},), 'Ag' : ({'K' : 240 * nm.eye(3)},), 'Cu' : ({'K' : 240 * nm.eye(3)},), 'S' : ({'K' : 1.2 * nm.eye(3)},), }

regions = { 'Omega' : 'all', 'subs' : ('cells of group 1', 'cell'), 'Ag_wire' : ('cells of group 2 ', 'cell'), 'Cu_wire' : ('cells of group 3 ', 'cell'), 'Gamma_Left' : ('vertices in (x == 7.8) & ( z > 0)', 'facet'), 'Gamma_Right' : ('vertices in (x == 27.8) & ( z > 0)', 'facet'), 'Gamma_Bottom' : ('vertices in (x > 7.8) & (x < 27.8) & ( y < 3) & ( y > 2) & ( z == 0) ', 'facet'), 'Sub_Bottom' : ('vertices in ( z == -2) ', 'facet'), 'Wire_top' : ('vertices in ( z == 1) ', 'facet'),

}

fields = { 'temperature' : ('real', 1, 'Omega', 1), }

variables = { 't' : ('unknown field', 'temperature', 0), 's' : ('test field', 'temperature', 't'), }

ebcs = { 't1' : ('Gamma_Left', {'t.0' : 25}), 't2' : ('Sub_Bottom', {'t.0' : 21}), }

integrals = { 'i' : 2, } equations = { 'temperature' : """ dw_diffusion.i.Ag_wire(Ag.K, s,t) dw_diffusion.i.Cu_wire(Cu.K, s,t) dw_diffusion.i.subs(S.K, s,t) = 0 """ } solvers = { 'ls' : ('ls.scipy_direct', {}), 'newton' : ('nls.newton', {'i_max' : 1, 'eps_a' : 1e-10, 'eps_r' : 1.0,

`}),`

} options = { 'nls' : 'newton', 'ls' : 'ls', } _______________________________________________ SfePy mailing list -- sfepy@python.org To unsubscribe send an email to sfepy-leave@python.org https://mail.python.org/mailman3/lists/sfepy.python.org/ Member address: cimrman3@ntc.zcu.cz