Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

How to specify initial coil current in Electric Circuit + Magnetic fields

Please login with a confirmed email address before reporting spam

Hello, I want to simulate the decay of the current in a coil from an initial state. The coil is connected to an external resistor.

The initial state has been simulated in a stationary solution, with a current of I0 in the coil (no external resistor yet). Now, I would like to run a time-dependent simulation of magnetic fields + electircal circuit starting from this state. I know how to set the initial condition for the magnetic field pattern, but how can I define the current of the coil to be I0 at t=0?

Thank you Daniel


2 Replies Last Post Dec 17, 2018, 12:44 a.m. EST

Please login with a confirmed email address before reporting spam

Posted: 5 years ago Dec 14, 2018, 9:26 a.m. EST

Hi, The right solution for such a simple system is maybe the following (attached): - adjust the coil resistance in the simulation in such a way that it is equal to the sum of the coil's own resistance and the external dump resistor - in the module 'mf' make a coil with the current I0 (1[A] in the attached example), run the simulation - in the module mf2 make the same coil with the current 'coil_current', which is then driven in a 'Global equation' in such a way that initially (before 0.01s in the attached example) it is constrained to I0, and after 0.01s the coil voltage mf.VCoil_1 is constrained to 0 (i.e. we short-circuit the coil). Solve this module in a time-dependent study, initial condition taken from mf.

It seems to run, and the exponential decay has the same time constant to what is predicted from the coil inductance and resistance, derived from the stationary solution.

tHowever, at t=0 the magnetic field at the origin is lower than it should be (see the plot 'Magnetic field at the origin vs. time'). It only occurs at the very first time point (if I refine the time-steps in the time-dependent simulation, only the first point will be off).

Can anybody comment on this?

Hi, The right solution for such a simple system is maybe the following (attached): - adjust the coil resistance in the simulation in such a way that it is equal to the sum of the coil's own resistance and the external dump resistor - in the module 'mf' make a coil with the current I0 (1[A] in the attached example), run the simulation - in the module mf2 make the same coil with the current 'coil_current', which is then driven in a 'Global equation' in such a way that initially (before 0.01s in the attached example) it is constrained to I0, and after 0.01s the coil voltage mf.VCoil_1 is constrained to 0 (i.e. we short-circuit the coil). Solve this module in a time-dependent study, initial condition taken from mf. It seems to run, and the exponential decay has the same time constant to what is predicted from the coil inductance and resistance, derived from the stationary solution. tHowever, at t=0 the magnetic field at the origin is lower than it should be (see the plot 'Magnetic field at the origin vs. time'). It only occurs at the very first time point (if I refine the time-steps in the time-dependent simulation, only the first point will be off). Can anybody comment on this?


Please login with a confirmed email address before reporting spam

Posted: 5 years ago Dec 17, 2018, 12:44 a.m. EST

Actually the attached model is not really representative, since it does not contain anything else but the coil. Its magnetic field will instantly follow its current. What I would like to simulate is the following: a coil + a piece of bulk good conductor. The coil is powered initially, and the good conductor is fully magnetized. That is, I would like an initial state from a static magnetic field simulation, where the coil has a current of I0, and the magnetic field is static. Then, I short-circuit the coil over an external dump resistor, and study the evaluation of the system. The fast-decreasing current in the coil will induce eddy currents in the bulk conductor.

I think the best way to simulate the coil + external dump resistor is to have a coil only (and no Electric Circuit module), and adjust its resistivity such that mf.RCoil_1 is equal to the own resistance of the coil + the external dump resistor. Drive the coil with the thee variable 'coil_current', which is driven by a Global equation: f(u,du/dt,t) = (t<t0)(coil_current-400[A])/1[A] + (t>=t0)mf.VCoil_1/1[V]. This will initially constrain the coil current to be 400A, and then short-circuits the coil over the external dump resistor. Unfortunately, I can not start this simulation fro the results of a static simulation. Whatever I do, comsol assumes that the magnetic field is initially zero, and the initial value of 400[A] for the coil current will be treated as an immediate switch-on of this current, inducing eddy currents in the bulk conductor. I do not want this. Can this be done in an elegant way? If not, I think the solution is to set the resistivity of the bulk conductor to a very large number before t0, and then instantly switch it to the realistic value a t0.

Does anybody have a better solution?

Actually the attached model is not really representative, since it does not contain anything else but the coil. Its magnetic field will instantly follow its current. What I would like to simulate is the following: a coil + a piece of bulk good conductor. The coil is powered initially, and the good conductor is fully magnetized. That is, I would like an initial state from a static magnetic field simulation, where the coil has a current of I0, and the magnetic field is static. Then, I short-circuit the coil over an external dump resistor, and study the evaluation of the system. The fast-decreasing current in the coil will induce eddy currents in the bulk conductor. I think the best way to simulate the coil + external dump resistor is to have a coil only (and no Electric Circuit module), and adjust its resistivity such that mf.RCoil_1 is equal to the own resistance of the coil + the external dump resistor. Drive the coil with the thee variable 'coil_current', which is driven by a Global equation: f(u,du/dt,t) = (t=t0)*mf.VCoil_1/1[V]. This will initially constrain the coil current to be 400A, and then short-circuits the coil over the external dump resistor. Unfortunately, I can not start this simulation fro the results of a static simulation. Whatever I do, comsol assumes that the magnetic field is initially zero, and the initial value of 400[A] for the coil current will be treated as an immediate switch-on of this current, inducing eddy currents in the bulk conductor. I do not want this. Can this be done in an elegant way? If not, I think the solution is to set the resistivity of the bulk conductor to a very large number before t0, and then instantly switch it to the realistic value a t0. Does anybody have a better solution?

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.