electric circuits with ELMER

Numerical methods and mathematical models of Elmer
Post Reply
cris91
Posts: 10
Joined: 21 Nov 2017, 12:38
Antispam: Yes

electric circuits with ELMER

Post by cris91 »

Hi all,

I'm trying to run a transient simulation with a simple C-core model (all the scripts are attached).
I obtained good results with the series connection of the 2 FEM components.
Now, I want to realize the parallel connection between the 2 FEM components. I tried to write the circuit code but
the results are wrong. The voltage and the current of the right FEM component are zero.

The problem is that I do not know how to build the matrices "B" and "source". I know the meaning of the column index but I don't understand the row one. The model documentation does not report this procedure.

(I have already read the Tutorials about the SPM and IM of Pavel Ponomarev)

Is there any documentation that explains such problem?

Thanks a lot
Attachments
Ccore.zip
(226.13 KiB) Downloaded 459 times
Takala
Posts: 186
Joined: 23 Aug 2009, 23:59

Elmer writes FE component equation rows automatically

Post by Takala »

Hi,

Quickly looking at your circuits, they seem mostly fine, but there is one critical problem:

When the circuit equations are written, one must avoid defining equations to the component rows.
This is because Elmer defines the component rows automatically to the voltage variable row of each
component. Hence, if you have defined

Code: Select all

! define circuit variables
$ C.1.name.1 = "i_su"
$ C.1.name.2 = "v_su"
$ C.1.name.3 = "i_component(1)" ! <-- coil left
$ C.1.name.4 = "v_component(1)"
$ C.1.name.5 = "i_component(2)" ! <-- coil right
$ C.1.name.6 = "v_component(2)"
then you cannot define equations to rows 4 nor 6. This means Matc indices 3 nor 5.

So replacing this

Code: Select all

!2-nd loop
$ C.1.B(3,1) = -1
$ C.1.B(3,5) = 1
with this

Code: Select all

!2-nd loop
$ C.1.B(4,1) = -1
$ C.1.B(4,5) = 1
should fix the issue.

BR,

Eelis
Takala

Posts: 175
Joined: 23 Aug 2009 22:59
cris91
Posts: 10
Joined: 21 Nov 2017, 12:38
Antispam: Yes

Re: electric circuits with ELMER

Post by cris91 »

Thank you Takala,

Now I've got what I need. I will try to test other more complex circuits.
zeljkoT
Posts: 24
Joined: 14 Nov 2018, 12:55
Antispam: Yes

Re: electric circuits with ELMER

Post by zeljkoT »

Hi Eelis

In your Test example you defined a circuit with a current source connected with the "FEM-component" in series.
How would the B matrix looks like if instead a current a voltage source is applied?
I would set:

Code: Select all

$ C.1.B(0,1) = 1
And in this case, not the voltage of the component will be calculated but the current? So MATC row 2 must be empty, rigth?
In addition, the voltage relation between v_source and v_component is: v_source-v_component=0, leeds to current and voltage relation in the appendix.

But this definition is not right, since I got strange results in the B re field.

Any advice?

BR and thx
Zeljko
Attachments
02_voltSource.zip
(1.05 KiB) Downloaded 332 times
zeljkoT
Posts: 24
Joined: 14 Nov 2018, 12:55
Antispam: Yes

Re: electric circuits with ELMER

Post by zeljkoT »

So, I got the model running with current and voltage sources respectively.
Compared the results to Infolytica and it works at least.
Check out the sif file.

But im still strugelling to understand how to built the B matrix for another circuit.
Considering an open circuit calculation of a transformer one can connect the second winding to a very high resistor. Check out the drawing in the appendix.
How does the cirucuit file looks like (B matrix)? If I ad the second circuit I got: ERROR:: RealBiCGStab(l): Breakdown error: bnrm = NaN.

Any suggestions?
Cheers
Attachments
twoCircuits.zip
(4.49 KiB) Downloaded 330 times
openCir_sim.PNG
openCir_sim.PNG (3.55 KiB) Viewed 4765 times
diffSources.zip
(7.63 KiB) Downloaded 325 times
Post Reply