DynaEM#

class ansys.dyna.core.pre.dynaem.DynaEM#

Bases: ansys.dyna.core.pre.dynabase.DynaBase

Contains methods for creating keywords related to EM.

Overview#

create_em_control

Enable the EM solver and set its options.

create_em_timestep

Control the EM time step and its evolution.

create_em_contact

Create an optional card for defining options on electromagnetic contacts between two sets of parts.

set_rogowsky_coil_to_output_current

Define Rogowsky coils to measure a global current versus time through a segment set or a node set.

create_em_mat001

Create an electromagnetic material type and set properties

create_em_mat002

Create an electromagnetic material type and set properties

create_em_solver_fembem_monolithic

Turn on the monolithic FEM-BEM solver.

create_em_output

Define the level of EM-related output on the screen and in the message file.

connect_isopotential

Define a connection between two isopotentials or between an isopotential and the ground.

create_em_database_globalenergy

Enable the output of global EM.

create_Permanent_magnet

Create a permanent magnet.

create_em_eos_permeability

Define the parameters for the behavior of a material’s permeability.

save_file

Save keyword files.

Import detail#

from ansys.dyna.core.pre.dynaem import DynaEM

Attribute detail#

DynaEM.analysis#

Method detail#

DynaEM.create_em_control(emsol=0, numls=100, macrodt=0, ncylfem=5000, ncylbem=5000)#

Enable the EM solver and set its options.

Parameters:
emsolint, optional

EM solver. The default is 0. Options are:

  • EQ.-1: Turn off the EM solver after reading the EM keywords.

  • EQ.1: Eddy current solver.

  • EQ.2: Induced heating solver.

  • EQ.3: Resistive heating solver.

  • EQ.11: Electrophysiology monodomain.

  • EQ.12: Electrophysiology bidomain.

  • EQ.13: Electrophysiology monodomain coupled with bidomain.

numlsint, optional

Number of local EM steps in a whole period for when emsol = 2. The default is 100.

macrodtint, optional

Macro time step for when emsol = 2. The default is 0.

ncylfemint, optional

Number of electromagnetism cycles between the recalculation of FEM matrices. The default is 5000.

ncylbemint, optional

Number of electromagnetism cycles between the recalculation of BEM matrices. The default is 5000.

Returns:
bool

True when successful, False when failed.

DynaEM.create_em_timestep(tstype, dtconst)#

Control the EM time step and its evolution.

Parameters:
tstypeint

Time step type. Options are:

  • EQ.1: Constant time step given in DTCONST

  • EQ.2: Time step as a function of time given by a load curve specified in LCID

  • EQ.3: Automatic time step computation, depending on the solver type

This time step is then multiplied by FACTOR.

dtconstfloat

Constant value for the time step for when tstype = 1.

Returns:
bool

True when successful, False when failed.

DynaEM.create_em_contact(contid=0, dtype=0, psidm=0, psids=0, eps1=0.3, eps2=0.3, eps3=0.3, d0=0)#

Create an optional card for defining options on electromagnetic contacts between two sets of parts.

Parameters:
contidint, optional

Electromagnetic contact ID. The default is 0.

dtypeint, optional

Detection type. The default is 0. Options are:

  • EQ.0: Contact type 0

  • EQ.1: Contact type 1

psidmint, optional

Master part set ID. The default is 0.

psidsint

Slave part set ID. The default is 0.

eps1float, optional

First contact coefficient for contact detection conditions. The default is 0.3.

eps2float, optional

Second contact coefficient for contact detection conditions. The default is 0.3.

eps3float, optional

Third contact coefficient for contact detection conditions. The default is 0.3.

d0float, optional

Contact condition 3 when dtype = 1.

Returns:
bool

True when successful, False when failed.

DynaEM.set_rogowsky_coil_to_output_current(segmentset=SegmentSet([[]]), settype=1, curtyp=1)#

Define Rogowsky coils to measure a global current versus time through a segment set or a node set.

Parameters:
rogidint

Rogowsky coil ID.

setidint

Segment or node set ID.

settypeint, optional

Type of set. The default is 1. Options are:

  • EQ.1: Segment set

  • EQ.2: Node set

curtypint

Type of current measured. The default is 1. Options are:

  • EQ.1: Volume current

  • EQ.2: Surface current (not available yet}

  • EQ.3: Magnetic field flow (B field times area)

Returns:
bool

True when successful, False when failed.

DynaEM.create_em_mat001(mid, mtype, sigma)#

Create an electromagnetic material type and set properties for a material whose permeability equals the free space permeability.

Parameters:
midint

Material ID.

mtypeint

Electromagnetism type of the material. Options are:

  • EQ.0: Air or vacuum

  • EQ.1: Insulator material (These materials have the same electromagnetism behavior as EQ.0.)

  • EQ.2: Conductor carrying a source

  • EQ.3: Fluid conductor

  • EQ.4: Conductor not connected to any current or voltage source, where the eddy current problem is solved

sigmafloat

Initial electrical conductivity of the material.

Returns:
bool

True when successful, False when failed.

DynaEM.create_em_mat002(mid, mtype, sigma, eosid, murel)#

Create an electromagnetic material type and set properties whose permeability is different than the free space permeability.

Parameters:
midint

Material ID.

mtypeint

Electromagnetism type of the material. Options are:

  • EQ.0: Air or vacuum

  • EQ.1: Insulator material (These materials have the same electromagnetism behavior as EQ.0.)

  • EQ.2: Conductor carrying a source

  • EQ.4: Conductor not connected to any current or voltage source, where the wddy current problem is solved

sigmafloat

Initial electrical conductivity of the material.

eosidint

ID of the EOS to use for the electrical conductivity.

murelfloat

Relative permeability, which is the ratio of the permeability of a specific medium to the permeability of the free space.

Returns:
bool

True when successful, False when failed.

DynaEM.create_em_solver_fembem_monolithic(mtype=0, stype=0, abstol=1e-06, reltol=0.0001, maxit=500)#

Turn on the monolithic FEM-BEM solver.

Parameters:
mtypeint, optional

Monolithic solver type. The default is 0. The only option is EQ.0: Direct symmetric solver.

stypeint

Solver type. The default is 0. Options are:

  • EQ.0: MINRES iterative solver

  • EQ.1: GMRES iterative solver

abstolfloat, optional

Absolute tolerance. The default is 1e-6.

reltolfloat, optional

Relative tolerance. The default is 1e-4.

maxitint, optional.

Maximum number of iterations. The default is 500.

Returns:
bool

True when successful, False when failed.

DynaEM.create_em_output(mats=0, matf=0, sols=0, solf=0)#

Define the level of EM-related output on the screen and in the message file.

Parameters:
matsint, optional

Level of matrix assembly output to show on the screen. The default is 0. Options are:

  • EQ.0: No output

  • EQ.1: Basic assembly steps

  • EQ.2: Basic assembly steps + percentage completed + final statistics

  • EQ.3: Basic assembly steps + percentage completed + statistics at each percentage of completion

matfint, optional

Level of matrix assembly output to write to the message file. The default is 0. Options are:

  • EQ.0: No output

  • EQ.1: Basic assembly steps

  • EQ.2: Basic assembly steps + percentage completed + final statistics

  • EQ.3: Vasic assembly steps + percentage completed + statistics at each percentage of completion

solsint

Level of solver output to show on the screen. The default is 0. Options are:

  • EQ.0: No output

  • EQ.1: Global information at each FEM iteration

  • EQ.2: Detailed information at each FEM iteration

solfint, optional

Level of solver output to write to the message file. The default is 0. Options are:

  • EQ.0: No output

  • EQ.1: Global information at each FEM iteration

  • EQ.2: Detailed information at each FEM iteration

Returns:
bool

True when successful, False when failed.

DynaEM.connect_isopotential(contype=Isopotential_ConnType.SHORT_CIRCUIT, isopotential1=None, isopotential2=None, value=0, func=None, curve=None, inductance=0, capacity=0, initial_voltage=0)#

Define a connection between two isopotentials or between an isopotential and the ground.

Parameters:
contypeIsopotential_ConnType

Isopotential connection type. The default is SHORT_CIRCUIT.

isopotential1Isopotential

First isopotential to connect.

isopotential2Isopotential

Second isopotential to connect.

valuefloat, optional

Value of the resistance, voltage, or current depending on the isopotential connection type. The default is 0.

func
curve
inductance
capacity
initial voltage
Returns:
int

Connection ID.

DynaEM.create_em_database_globalenergy(outlv=0)#

Enable the output of global EM.

Parameters:
outlvint, optional

Flag for whether to generate the output file. The default is 0. Options are:

  • EQ.0: No output file is generated.

  • EQ.1: The output file is generated.

Returns:
bool

True when successful, False when failed.

DynaEM.create_Permanent_magnet(id, partid, mtype, north, sourth, hc)#

Create a permanent magnet.

Parameters:
idint

ID of the magnet.

partidint

Part ID.

mtypeint, optional

Magnet definition type. Options are:

  • EQ.0: Magnet defined by two node set for the north and south poles

  • EQ.1: Magnet defined by two segments set for the north and south poles

  • EQ.3: Magnet defined by a global vector orientation

  • EQ.4: Magnet defined by a global vector orientation given by two node IDs

northint

ID of the magnet’s north face for mtype = 0 and mtype = 1.

sourthint

ID of the magnet’s south face for mtype = 0 and mtype = 1.

hcint

Coercive force.

Returns:
bool

True when successful, False when failed.

DynaEM.create_em_eos_permeability(eosid, eostype, lcid)#

Define the parameters for the behavior of a material’s permeability.

Parameters:
eosidint

EM EOS ID.

eostypeint

Define the type of EOS. Options are:

  • EQ.1: Permeability defined by a B function of the H curve

  • EQ.2: Permeability defined by an H function of the B curve

lcidint

Load curve ID.

Returns:
bool

True when successful, False when failed.

DynaEM.save_file()#

Save keyword files.