Variable from lumped scalars

Numerical methods and mathematical models of Elmer
Post Reply
pavel
Posts: 34
Joined: 17 Apr 2014, 17:08
Antispam: Yes

Variable from lumped scalars

Post by pavel »

Hi,

Is it possible to create a global scalar variable from scalars computed in other solvers within SIF without programming ?
E.g. I want to create a variable Torque from "res: air gap torque" created by the MagnetoDynamics2D solver. Later I would use this Torque variable together with ODESolver to estimate speed knowing the inertia J of the rotor (J*w'=Torque).
In the SaveData SaveScalars solver there is functionality to save certain data by "Variable i String" and then place it as a proper variable "Target Variable i String". However with this approach I can not get access to the "res: air gap torque".

BR, Pavel
raback
Site Admin
Posts: 4827
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Variable from lumped scalars

Post by raback »

Hi Pavel

Basically this should be possible. However, the problem is that the number related to this scalar may vary depending on what else is done. Therefore I would rather edit the MadgentoDynamics2D directly and add there something like

Code: Select all

CALL DefaultVariableAdd("air gap torque",Global=.TRUE.,InitValue=Torque)
Then you can access this by

Code: Select all

Var => DefaultVariableGet("air gap torque")
Torque = Var % Values(1)
and in sif files say

Code: Select all

Expression = Variable "air gap torque" 
   Real MATC "1.23*tx"
I think that the end results would be prettier with these choices.

-Peter
Post Reply