---

# For information
valueTypes:
  - scalar # default
  - table
  - expression
  - complex # not used
  - coupled # not used

# For information
styleTypes:
  - checkbox
  - dropdown
  - input #default
  - radio

# For information
valueKinds:
  - boolean #default for checkboxes
  - float #default
  - integer
  - string

# Try to name by UNIT, not the term of physics, e.g., "ampere", but not "electricCurrent".
# Use ALPHABETIC order, please. Both, for names and base units:
#    A:
#    cd:
#    K:
#    kg:
#    m:
#    mol:
#    s:

baseUnits:
  siAmpere:
    A: 1

  siAmperePerMeter:
    A: 1
    m: -1

  siCurrentDensity:
    A: 1
    m: -2

  siHeatFlux:
    kg: 1
    s: -3

  siHeatFlow:
    kg: 1
    m: 2
    s: -3

  siHeatSource:
    kg: 1
    m: -1
    s: -3

  siHertz:
    s: -1

  siMagneticFluxDensity:
    kg: 1
    A: -1
    s: -2

  siMagneticPermeability:
    A: -2
    kg: 1
    m: 1
    s: -2

  siMagneticVectorPotential:
    A: −1
    kg: 1
    m: -1
    s: −2

  siMagnetization:
    A: 1
    m: 2

  siNone: {}

  siSimensOnMeter:
    A: 2
    kg: -1
    m: -3
    s: 3

  siStefBolzConstUnit:
    K: -4
    kg: 1
    s: -3

  siTemperature:
    K: 1

  siTesla:
    A: −1
    kg: 1
    s: −2

  siTime:
    s: 1

  siVelocity:
    m: 1
    s: -1

  siAngularVelocity:
    s: -1

  siVolt:
    A: -1
    kg: 1
    m: 2
    s: -3


physicalConstants:
  - key: sb_constant
    name: Stefan–Boltzmann constant
    symbol: sb
    units: "\frac{W}{m^2 K^4}"
    default: 5.68e-8
    baseUnit: siStefBolzConstUnit

  - key: mu0
    name: Magnetic permeability constant
    symbol: mu_0
    units: "H/m"
    default: 0.0000012566
    baseUnit: siMagneticPermeability
    
  - key: nu0
    name: Magnetic permeability inverse constant
    symbol: nu_0
    units: "m/H"
    default: 795774.7155
    baseUnit: siNone

  - key: eps0
    name: Electric constant
    symbol: eps_0
    units: "F/m"
    default: 8.8541878176e-12
    baseUnit: siElectricConstant
    
  - key: c0
    name: Speed of light
    symbol: c_0
    units: "m/s"
    default: 299792458
    baseUnit: siVelocity
    
# function for skin effect correction
# Jürgen Biela. Optimierung des elektromagnetisch integrierten
# Serien-Parallel-Resonanzkonverters mit eingeprägtem Ausgangsstrom. PhD thesis, ETH Zurich, 2005
  - key: Fs
    name: Skin effect correction function for stranded coils
    symbol: Fs
    units: "-"
    default:
      argument: frequency # in reality - d/(sqrt(2) * delta)
      argumentPosition: 1
      type: 1
      value:
        - 0
        - 1
        - 0.5
        - 1.00033
        - 1
        - 1.00519
        - 1.5
        - 1.02582
        - 2
        - 1.07816
        - 2.5
        - 1.17538
        - 3
        - 1.31809
        - 3.5
        - 1.49202
        - 4
        - 1.67787
        - 4.5
        - 1.86275
        - 5
        - 2.04273
        - 5.5
        - 2.21893
        - 6
        - 2.39359
        - 6.5
        - 2.56816
        - 7
        - 2.74319
        - 7.5
        - 2.91867
        - 8
        - 3.09445
        - 8.5
        - 3.27037
        - 9
        - 3.44638
        - 9.5
        - 3.62245
        - 10
        - 3.79858
        - 15
        - 5.56208
        - 20
        - 7.32767
        - 25
        - 9.09413
        - 30
        - 10.861
        - 35
        - 12.6282
        - 40
        - 14.3954
        - 45
        - 16.1628
        - 50
        - 17.9303
        - 55
        - 19.6978
        - 60
        - 21.4654
        - 65
        - 23.233
        - 70
        - 25.0006
        - 75
        - 26.7683
        - 80
        - 28.5359
        - 85
        - 30.3036
        - 90
        - 32.0713
        - 95
        - 33.839
        - 100
        - 35.6067
        - 150
        - 53.2839
        - 200
        - 70.9613
        - 250
        - 88.6389
        - 300
        - 106.316
        - 350
        - 123.994
        - 400
        - 141.672
        - 450
        - 159.349
        - 500
        - 177.027
        - 550
        - 194.705
        - 600
        - 212.382
        - 650
        - 230.06
        - 700
        - 247.738
        - 750
        - 265.415
        - 800
        - 283.093
        - 850
        - 300.771
        - 900
        - 318.448
        - 950
        - 336.126
        - 1000
        - 353.804
        - 1500
        - 530.58
        - 2000
        - 707.357
        - 2500
        - 884.134
        - 3000
        - 1060.91
        - 3500
        - 1237.69
        - 4000
        - 1414.46
        - 4500
        - 1591.24
        - 5000
        - 1768.02
        - 5500
        - 1944.79
        - 6000
        - 2121.57
        - 6500
        - 2298.35
        - 7000
        - 2475.12
        - 7500
        - 2651.9
        - 8000
        - 2828.68
        - 8500
        - 3005.45
        - 9000
        - 3182.23
        - 9500
        - 3359.01
        - 10000
        - 3535.78
        - 100000
        - 35355.6
        - 1000000
        - 353554
    baseUnit: siNone
    
    
# function for proximity effect correction
# for convinience, the strand wire diameter d was taken out of the Gs formula,
# so Gs has to multiplied with d^2
# Jürgen Biela. Optimierung des elektromagnetisch integrierten
# Serien-Parallel-Resonanzkonverters mit eingeprägtem Ausgangsstrom. PhD thesis, ETH Zurich, 2005
  - key: Gs
    name: Proximity effect correction function for stranded coils
    symbol: Gs
    units: "-"
    default:
      argument: frequency  # in reality - d/(sqrt(2) * delta)
      argumentPosition: 1
      type: 1
      value:
        - 0
        - 0
        - 0.5
        - 0.0192421
        - 1
        - 0.299846
        - 1.5
        - 1.3647
        - 2
        - 3.40398
        - 2.5
        - 5.82043
        - 3
        - 7.99355
        - 3.5
        - 9.84128
        - 4
        - 11.5312
        - 4.5
        - 13.2008
        - 5
        - 14.903
        - 5.5
        - 16.638
        - 6
        - 18.3897
        - 6.5
        - 20.1451
        - 7
        - 21.8981
        - 7.5
        - 23.6482
        - 8
        - 25.3963
        - 8.5
        - 27.1435
        - 9
        - 28.8905
        - 9.5
        - 30.6374
        - 10
        - 32.3842
        - 15
        - 49.8452
        - 20
        - 67.2995
        - 25
        - 84.751
        - 30
        - 102.201
        - 35
        - 119.65
        - 40
        - 137.099
        - 45
        - 154.547
        - 50
        - 171.995
        - 55
        - 189.443
        - 60
        - 206.891
        - 65
        - 224.339
        - 70
        - 241.787
        - 75
        - 259.234
        - 80
        - 276.682
        - 85
        - 294.129
        - 90
        - 311.577
        - 95
        - 329.024
        - 100
        - 346.471
        - 150
        - 520.945
        - 200
        - 695.417
        - 250
        - 869.889
        - 300
        - 1044.36
        - 350
        - 1218.83
        - 400
        - 1393.3
        - 450
        - 1567.78
        - 500
        - 1742.25
        - 550
        - 1916.72
        - 600
        - 2091.19
        - 650
        - 2265.66
        - 700
        - 2440.13
        - 750
        - 2614.61
        - 800
        - 2789.08
        - 850
        - 2963.55
        - 900
        - 3138.02
        - 950
        - 3312.49
        - 1000
        - 3486.96
        - 1500
        - 5231.68
        - 2000
        - 6976.4
        - 2500
        - 8721.11
        - 3000
        - 10465.8
        - 3500
        - 12210.5
        - 4000
        - 13955.3
        - 4500
        - 15700
        - 5000
        - 17444.7
        - 5500
        - 19189.4
        - 6000
        - 20934.1
        - 6500
        - 22678.8
        - 7000
        - 24423.6
        - 7500
        - 26168.3
        - 8000
        - 27913
        - 8500
        - 29657.7
        - 9000
        - 31402.4
        - 9500
        - 33147.1
        - 10000
        - 34891.9
        - 100000
        - 348941
        - 1000000
        - 3489430
    baseUnit: siNone
    
    
    
    
# function for proximity effect correction
# for convinience, the strand wire diameter d was taken out of the Ds formula,
  - key: Ds
    name: Proximity effect correction function for stranded coils
    symbol: Ds
    units: "-"
    default:
      argument: frequency  # in reality - d/delta
      argumentPosition: 1
      type: 1
      value:
        - 0	
        - 0
        - 0.5	
        - 0.0974769
        - 1	
        - 1.41001
        - 1.5	
        - 5.07674
        - 2	
        - 9.28173
        - 2.5	
        - 12.6872
        - 3	
        - 15.7105
        - 3.5	
        - 18.7551
        - 4	
        - 21.8825
        - 4.5	
        - 25.0415
        - 5	
        - 28.1985
        - 5.5	
        - 31.3483
        - 6	
        - 34.4947
        - 6.5	
        - 37.6403
        - 7	
        - 40.7857
        - 7.5	
        - 43.9309
        - 8	
        - 47.0756
        - 8.5	
        - 50.2199
        - 9	
        - 53.364
        - 9.5	
        - 56.5078
        - 10	
        - 59.6514
        - 15	
        - 91.0801
        - 20	
        - 122.503
        - 25	
        - 153.922
        - 30	
        - 185.341
        - 35	
        - 216.759
        - 40	
        - 248.176
        - 45	
        - 279.593
        - 50
        - 311.01
        - 55	
        - 342.426
        - 60	
        - 373.843
        - 65	
        - 405.259
        - 70	
        - 436.676
        - 75	
        - 468.092
        - 80	
        - 499.508
        - 85	
        - 530.925
        - 90	
        - 562.341
        - 95	
        - 593.757
        - 100	
        - 625.173
    baseUnit: siNone



physicalProperties:
  - &propTemperature
    id: 1
    key: temperature
    name: Temperature
    symbol: T
    units: "\\degree C"
    baseUnit: siTemperature
    min: -273.15
    minExclude: false

  - &propTime
    id: 2
    key: time
    name: Time
    symbol: t
    units: s
    baseUnit: siTime

  - &propMagFlux
    id: 3
    key: magflux
    name: Magnetic Flux Density
    symbol: B
    units: T
    baseUnit: siTesla

  - &propMagIntensity
    key: magIntensity
    name: Magnetic field intensity
    symbol: H
    units:  "\\frac{A}{m}"
    baseUnit: siAmperePerMeter

  - &propFrequency
    key: frequency
    name: Frequency
    symbol: f
    
    
    baseUnit: siHertz
    min: 0
    minExclude: true


timeTypes:
  - &timeSteady
    id: 1
    key: steady
    name: Steady

  - &timeTransient
    id: 2
    key: transient
    name: Transient
    arguments: [*propTime]
    properties:
      -
        <<: *propTime
        key: tstart
        name: Initial time
        symbol: t_0
        default: 0
        hidden: true
      -
        <<: *propTime
        key: tend
        name: End time
        symbol: t_1
        min: 0
        minExclude: true
      -
        key: isAdaptive
        name: Use adaptive time step
        default: false
        style: checkbox
      -
        <<: *propTime
        key: tstep
        name: Calculation time step
        symbol: "\\delta t"
        relevance:
          - key: isAdaptive
            value: false
        min: 0
        minExclude: true
        valueTypes: [scalar, table]
      -
        key: sfreq
        name: Save every n-th time step
        symbol: n
        units: ''
        baseUnit: siNone
        valueKind: integer
        hidden: true
        default: 1
        relevance:
          - key: isAdaptive
            value: false
      -
        key: initdt
        name: Initial time step
        symbol: "\\delta t_0"
        units: 's'
        baseUnit: siTime
        default: 1e-2
        hidden: false
        relevance:
          - key: isAdaptive
            value: true
      -
        key: mindt
        name: Minimal time step
        symbol: "\\delta t_{min}"
        units: 's'
        baseUnit: siTime
        default: 1e-8
        hidden: true
        relevance:
          - key: isAdaptive
            value: true
      -
        key: maxdt
        name: Maximal time step
        symbol: "\\delta t_{max}"
        units: 's'
        baseUnit: siTime
        default: 100000
        hidden: true
        relevance:
          - key: isAdaptive
            value: true
      -
        key: toler1
        name: Toler1
        symbol: "\\t_{1}"
        units: 's'
        baseUnit: siTime
        default: 5e-4
        hidden: true
        sendAlways: true
        relevance:
          - key: isAdaptive
            value: true
      -
        key: toler2
        name: Toler2
        symbol: "\\t_{1}"
        units: 's'
        baseUnit: siTime
        default: 1
        hidden: true
        sendAlways: true
        relevance:
          - key: isAdaptive
            value: true
      -
        key: hasCalculatedTimeStep
        name: Has calculated timestep (hidden parameter)
        default: false
        style: checkbox
        hidden: true
      -
        key: continueFromLast
        name: Continue from the last time step
        default: false
        style: checkbox
        relevance:
          - key: hasCalculatedTimeStep
            value: true

      # -
        # key: meshMotion
        # name: Use moving mesh
        # default: false
        # style: checkbox
      # -
        # <<: *propTime
        # key: meshTstep
        # name: Mesh update time step
        # symbol: "\\delta t_m"
        # relevance:
          # - key: meshMotion
            # value: true
        # min: 0
        # minExclude: true

      # -
        # key: coordMin
        # name: Starting coordinate
        # symbol: "A"
        # relevance:
          # - key: meshMotion
            # value: true

      # -
        # key: coordMax
        # name: End coordinate
        # symbol: "B"
        # relevance:
          # - key: meshMotion
            # value: true
#Used for formulations where it is not necessary to output frequency as time
  - &timeHarmonic
    id: 3
    key: harmonic
    name: Harmonic
    properties:
      -
        <<: *propFrequency
        valueTypes: [scalar, table]
        arguments: [*propTime]

  - &timeSteadyWithHarmonic
    <<: *timeSteady
    id: 4
    properties:
      -
        <<: *propFrequency
        valueTypes: [scalar, table]
        arguments: [*propTime]

  - &timeTransientWithHarmonic
    id: 5
    properties:
      -
        <<: *propTime
        key: tstart
        name: Initial time
        symbol: t_0
      -
        <<: *propTime
        key: tend
        name: End time
        symbol: t_1
      -
        <<: *propTime
        key: tstep
        name: Time step
        symbol: "\\delta"
        valueTypes: [scalar, table]
        arguments: [*propTime]

      - key: sfreq
        name: Save every n-th time step
        symbol: n
        units: ''
        baseUnit: siNone

      -
        <<: *propFrequency
        valueTypes: [scalar, table]
        arguments: [*propTime]

  - &timeMultipleFrequency
    id: 6
    key: multiHarmonic
    name: Multiple Frequencies
    properties:
      -
        <<: *propFrequency
        name: Starting Frequency
        symbol: f_0
      -
        <<: *propFrequency
        key: fend
        name: End Frequency
        symbol: f_1
      -
        <<: *propFrequency
        key: fstep
        name: Frequency step
        symbol: "\\Delta f"

# Used where it is necessary to output frequency as time (e.g. antennas)
  - &timeHarmonicWithoutTime
    id: 7
    key: harmonic
    name: Harmonic
    properties:
      - *propFrequency


basisTypes:
  - &mesh1D
    key: mesh1D
    name: 1D
    dimensions: 1

  - &mesh2D
    key: mesh2D
    name: 2D
    dimensions: 2
    symmetryHeading: Axial symmetry
    symmetryTypes:
      - key: planar
        id: 1
        name: No
        properties:
          - key: depthZ
            name: Depth in Z direction
            symbol: L_Z
            units: 'm'
            baseUnit: siNone
            default: 1
      - key: axial
        id: 2
        name: Yes (y axis)
        description: Y-axis must be the axis of symmetry in geometry/mesh. If it is not
          so, please go back to pre-processing part, rotate the mesh and save it to CENOS
          again

  - &mesh3D
    key: mesh3D
    name: 3D
    dimensions: 3
    properties:
    symmetryHeading: Symmetry
    symmetryTypes:
      - key: full
        id: 3
        name: Full 3D model
      - key: slice
        id: 4
        name: Slice
        properties:
          - key: symmetryFactor
            name: Slice angle
            symbol: \alpha
            units: '-'
            baseUnit: siNone
            default: 360
            min: 0
            minExclude: true
            max: 360
            maxExclude: false

singlePhysics:
    #
  # THERMAL.
  #
  - &physicsThermal
    key: &physicsKey physicsThermal
    name: &physicsName Thermal Analysis
    description: Solves heat transfer equation. Both steady and transient solvers available.
    arguments: &argThermal [*propTemperature]

    physicalProperties:
      - &velocityX
        key: Velocity_x
        name: Velocity X component
        symbol: "U_X"
        units: "\\frac{m}{s}"
        baseUnit: siVelocity
        default: 0
        valueTypes: [scalar, table]
        arguments: [*propTime]

      - &velocityY
        key: Velocity_y
        name: Velocity Y component
        symbol: "U_Y"
        units: "\\frac{m}{s}"
        baseUnit: siVelocity
        default: 0
        valueTypes: [scalar, table]
        arguments: [*propTime]

      - &velocityZ
        key: Velocity_z
        name: Velocity Z component
        symbol: "U_Z"
        units: "\\frac{m}{s}"
        baseUnit: siVelocity
        default: 0
        valueTypes: [scalar, table]
        arguments: [*propTime]

      - &angularVelocityZ
        key: Omega_Z
        name: Angular velocity around Z axis
        symbol: "\\Omega_Z"
        units: "\\frac{rad}{s}"
        baseUnit: siAngularVelocity
        default: 0

      - &propQVol
        key: qVol
        name: Volume heat source
        symbol: F
        units: "\\frac{W}{m^3}"
        baseUnit: siHeatSource
        default: 0
        valueTypes: [scalar, table]
        arguments: [*propTemperature, *propTime]

      - &propHeatFlux
        key: heatflux
        name: Heat Flux
        symbol: q
        units: "\\frac{W}{m^2}"
        baseUnit: siHeatFlux

      - &propHeatFlow
        key: heatflow
        name: Integral Heat Flow
        symbol: Q
        hidden: true
        units: "W"
        baseUnit: siHeatFlow

      - &propLambda
        key: lambda
        name: Thermal conductivity
        symbol: "\\lambda"
        units: "\\frac{W}{m K}"
        baseUnit: siNone #Fixme
        min: 0
        minExclude: true
        valueTypes: [scalar, table, expression]
        arguments: [*propTemperature]

      - &propCp
        key: cp
        name: Heat capacity
        symbol: c_p
        units: "\\frac{J}{kg K}"
        baseUnit: siNone #Fixme
        min: 0
        minExclude: true
        valueTypes: [scalar, table]
        arguments: [*propTemperature]

      - &propRho
        key: rho
        name: Density
        symbol: "\\rho"
        units: "\\frac{kg}{m^3}"
        baseUnit: siNone #Fixme
        min: 0
        minExclude: true
        valueTypes: [scalar, table]
        arguments: [*propTemperature]

      - &propHeatTransfer
        key: h
        name: Heat Transfer Coefficient
        symbol: h
        units: "\\frac{W}{m^2 K}"
        baseUnit: siNone #Fixme
        min: 0
        minExclude: false
        valueTypes: [scalar, table, expression]
        arguments: [*propTemperature, *propTime]

      - &propEmissivity
        key: hr
        name: Emissivity
        symbol: "\\epsilon"
        units: "-"
        baseUnit: siNone #Fixme
        min: 0
        minExclude: false
        valueTypes: [scalar, table, expression]
        arguments: [*propTemperature]

      - &propResistance
        key: resistance_thermal
        name: Thermal Contact Resistance
        symbol: R
        units: "\\frac{m^2 K}{W}"
        baseUnit: siNone #Fixme
        min: 0
        minExclude: true

    MaxTemperatureCalculation:
      - &propMaxTemp_useModel
        key: _maxTempCalculation
        name: Max Temperature calculation
        default: true
        style: checkbox
        hidden: true

    PhaseModelProperties:
      - &propPhaseChange_useModel
        key: _phaseCalculation
        name: Phase calculation
        default: false
        style: checkbox
        #relevance:
         # - key: physicsThermal
         #   value: true

      - &propPhaseChange_AustenizationTemp1
        #<<: *propAustenizationTemp1
        key: ATemp1
        name: Austenization start temp.
        symbol: "T_{Ac_1}"
        units: "\\degree C"
        baseUnit: siNone #Fixme
        min: 0
        minExclude: true
        description: "Temperature at which austenite begins to form. If unknown - use Ac1 = Ac3"
        relevance:
          - key: _phaseCalculation
            value: true

      - &propPhaseChange_AustenizationTemp3
        #<<: *propAustenizationTemp3
        key: ATemp3
        name: Fully austenized temp.
        symbol: "T_{Ac_3}"
        units: "\\degree C"
        baseUnit: siNone #Fixme
        min: 0
        minExclude: true
        description: "Austenization temperature; the temperature at which structure is fully austenite"
        relevance:
          - key: _phaseCalculation
            value: true

      - &propPhaseChange_MartensiteStartTemp
        #<<: *propMartensiteStartTemp
        key: MartStart
        name: Martensite start temp.
        symbol: "T_{Ms}"
        units: "\\degree C"
        baseUnit: siNone #Fixme
        min: 0
        minExclude: true
        description: "Martensite formation start temperature; belove this temperature martensite phase occur"
        relevance:
          - key: _phaseCalculation
            value: true

      - &propPhaseChange_StartTime
        #<<: *propStartTime
        key: StartTime
        name: Phase change start time
        symbol: "t_s"
        units: "s"
        baseUnit: siNone #Fixme
        min: 0
        minExclude: true
        valueTypes: [table]
        arguments: [*propTemperature]
        description: "Time data for the C-curve which reprezents the begining of phase change (usually when 1% transformation has happened)"
        relevance:
          - key: _phaseCalculation
            value: true

      - &propPhaseChange_EndTime
        #<<: *propEndTime
        key: EndTime
        name: Phase change end time
        symbol: "t_e"
        units: "s"
        baseUnit: siNone #Fixme
        min: 0
        minExclude: true
        valueTypes: [table]
        arguments: [*propTemperature]
        description: "Time data for the C-curve which reprezents the end of phase change (usually when 99% change has happened)"
        relevance:
          - key: _phaseCalculation
            value: true

    boundaryTypes:
      - &bcFixed
        id: 1
        key: fixed
        name: Fixed temperature
        description: Fixed temperature at the surface
        properties:
          - *propTemperature

      - &bcFlux
        id: 2
        key: flux
        name: Heat flux
        description: Define heat flux density at the surface
        properties:
          -
            <<: *propHeatFlux
            key: qSurf
            valueTypes: [scalar, table, expression]
            arguments: [*propTemperature, *propTime]

      - &bcConvection
        id: 3
        key: convection
        name: Convection
        description: |-
            Convective heat transfer
            \( q = h (T-T_{amb}) \)
            Read article 'Heat Exchange' in Cenos Documentation for more information
        properties:
          -
            <<: *propTemperature
            key: tref
            name: Ambient temperature
            symbol: T_{amb}
            default: 22
          -
            <<: *propHeatTransfer
            key: h

      - &bcRadiation
        id: 4
        key: radiation
        name: Radiation
        description: |-
            Thermal radiation to ambient temperature:
            heat flux \( q = \sigma_{SB} \epsilon (T^4 - T_{amb}^4) \)
        properties:
          -
            <<: *propTemperature
            key: tref
            name: Ambient temperature
            symbol: T_{amb}
            default: 22
          - *propEmissivity
          -
            key: _radiation
            name: Radiation
            default: true
            style: checkbox
            sendAlways: true
            hidden: true

      - &bcCombined
        id: 5
        key: combined
        name: Combined
        description: |-
            Allows defining multiple conditions at the surface
        properties:
          - key: _blocker_if_no_checkbox_selected
            hidden: true
            default: false
            sendAlways: true
            relevance:
              - key: _convection
                value: false
              - key: _radiation
                value: false
              - key: _flux
                value: false
              - key: _flow
                value: false
          -
            <<: *propTemperature
            key: tref
            name: Ambient temperature
            symbol: T_{amb}
            sendAlways: true
            default: 22
            relevance:
              - key: _convection
                value: true
              - key: _radiation
                value: false
          -
            <<: *propTemperature
            key: tref
            name: Ambient temperature
            symbol: T_{amb}
            sendAlways: true
            default: 22
            relevance:
              - key: _convection
                value: false
              - key: _radiation
                value: true
          -
            <<: *propTemperature
            key: tref
            name: Ambient temperature
            symbol: T_{amb}
            sendAlways: true
            default: 22
            relevance:
              - key: _convection
                value: true
              - key: _radiation
                value: true
          -
            key: _convection
            name: Convection
            default: false
            style: checkbox
          -
            <<: *propHeatTransfer
            key: h
            sendAlways: false
            # default: 0
            relevance:
              - key: _convection
                value: true
          -
            <<: *propHeatTransfer
            key: h_
            hidden: true
            sendAlways: false
            default: 0
            relevance:
              - key: _convection
                value: false
          -
            key: _radiation
            name: Radiation
            default: false
            style: checkbox

         # -
         #   <<: *propTemperature
         #   key: tref
         #   name: Ambient temperature
         #   symbol: T_{amb}
         #   sendAlways: true
         #   default: 22
         #   relevance:
         #     - key: _radiation
         #       value: true
          -
            <<: *propEmissivity
            key: hr
            sendAlways: false
            # default: 0
            relevance:
              - key: _radiation
                value: true
          -
            <<: *propEmissivity
            key: hr_
            hidden: true
            sendAlways: false
            default: 0
            relevance:
              - key: _radiation
                value: false
          -
            key: _flux
            name: Heat Flux
            default: false
            style: checkbox
            incompatibleWith:
              - _flow
          -
            <<: *propHeatFlux
            key: qSurf
            valueTypes: [scalar, table, expression]
            arguments: [*propTemperature, *propTime]
            sendAlways: false
            # default: 0
            relevance:
              - key: _flux
                value: true
          -
            <<: *propHeatFlux
            key: qSurf_
            sendAlways: false
            hidden: true
            default: 0
            relevance:
              - key: _flux
                value: false
          -
            key: _flow
            name: Heat Flow
            default: false
            hidden: true
            style: checkbox
            incompatibleWith:
              - _flux
          -
            <<: *propHeatFlow
            key: qSurfInt
            sendAlways: false
            # default: 0
            relevance:
              - key: _flow
                value: true
          -
            <<: *propHeatFlow
            key: qSurfInt_
            sendAlways: false
            hidden: true
            default: 0
            relevance:
              - key: _flow
                value: false

      - &bcFlow
        id: 6
        key: flow
        name: Heat flow
        description: Define heat flow (in watts) at the surface
        properties:
          -
            <<: *propHeatFlow
            key: qSurfInt

      - &bcAdiabatic
        id: 7
        key: adiabatic
        name: Adiabatic
        description: |-
            Zero incoming and outgoing heat flux condition at the surface
        properties:
          -
            <<: *propHeatFlux
            key: qSurf
            valueTypes: [scalar, table, expression]
            arguments: [*propTemperature, *propTime]
            default: 0
            sendAlways: true
            hidden: true

      - &bcInterface
        id: 8
        key: interface
        name: Interface
        description: Interface
        isInterfaceType: true
        isOuterType: false

      - &bcResistanceThermal
        id: 9
        key: resistance_thermal
        name: Thermal Contact Resistance
        description: |-
          Define contact resistance as thin layer at interface.
          IMPORTANT: The same condition has to be set on both sides.
          Resistance can be calculated as \( d / \lambda \)
          (\( d \) - thickness, \( \lambda \) - conductivity).
        isInterfaceType: true
        isOuterType: false
        properties:
          -
            <<: *propResistance

    domainTypes:
      - &domainThermal
        id: 1
        key: thermal
        name: Thermal
        properties:
          -
            <<: *propQVol
            hidden: true

          -
            key: _velocityEffects
            name: Motion
            default: false
            style: checkbox
            hidden: true
          -
            <<: *velocityX
            sendAlways: true
            relevance:
              - key: _velocityEffects
                value: true
            hidden: true
          -
            <<: *velocityY
            sendAlways: true
            relevance:
              - key: _velocityEffects
                value: true
            hidden: true
          -
            <<: *velocityZ
            sendAlways: true
            relevance:
              - key: _velocityEffects
                value: true
            hidden: true
          -
            <<: *angularVelocityZ
            sendAlways: true
            relevance:
              - key: _velocityEffects
                value: true
              - key: dimensions
                value: 3
            hidden: true

        boundaryTypes:
          - *bcFixed
          - *bcFlux
         # - *bcFlow
          - *bcConvection
          - *bcRadiation
          - *bcCombined
          - *bcAdiabatic
          - *bcInterface
          - *bcResistanceThermal

        initialConditions:
          properties:
            -
              <<: *propTemperature
              default: 22

        material:
          properties:
            - *propLambda
            - *propCp
            - *propRho
            - *propMaxTemp_useModel
            - *propPhaseChange_useModel
            - *propPhaseChange_AustenizationTemp1
            - *propPhaseChange_AustenizationTemp3
            - *propPhaseChange_MartensiteStartTemp
            - *propPhaseChange_StartTime
            - *propPhaseChange_EndTime

    subPhysicsParts:
      - &subPhysicsThermalGeneral
        key: subPhysicsThermalGeneral
        name: Thermal General Physics
        physicsKey: *physicsKey
        physicsName: *physicsName
        arguments: *argThermal

        resultValues:
          - *propTemperature
          - *propHeatFlux

        timeTypes:
          - *timeTransient
          - *timeSteady

        domainTypes:
          - *domainThermal

    subPhysics:
      - key: subPhysicsThermal
        name: Thermal
        description: Solves heat transfer equation. Both steady and transient solvers available.

        basisList:
          -
            key: subPhysicsThermalGeneral2D
            basis: *mesh2D
            physicsList:
              - *subPhysicsThermalGeneral
          -
            key: subPhysicsThermalGeneral3D
            basis: *mesh3D
            physicsList:
              - *subPhysicsThermalGeneral

   #
  # ELECTROMAGNETICS.
  #
  - &physicsElectromagnetics
    key: &physicsKey physicsElectromagnetics
    name: &physicsName Electromagnetics
    description: #Fixme
    arguments: &argElectromagnetics [*propMagFlux]

    physicalProperties:
      - &propJouleHeat
        <<: *propMagFlux
        key: Jheat
        name: Joule heat
        symbol: Q
        units: "\\frac{W}{m^3}"
        baseUnit: siHeatSource

      - &propBField
        <<: *propMagFlux
        key: Bfield

      - &propBFieldRe
        <<: *propMagFlux
        key: Bfield_re
        name: Magnetic field intensity (Re)
        components: 3

      - &propBFieldIm
        <<: *propMagFlux
        key: Bfield_im
        name: Magnetic field intensity (Im)
        components: 3

      - &propCurrentDensity
        key: CurrDens
        name: Current density
        symbol: J
        units: "\\frac{A}{m^2}"
        baseUnit: siCurrentDensity

      - &propCurrentDensityRe
        <<: *propCurrentDensity
        key: CurrDens_re
        name: Current density (Re)
        components: 3

      - &propCurrentDensityIm
        <<: *propCurrentDensity
        key: CurrDens_im
        name: Current density (Im)
        components: 3

      - &propMagneticVectorPotential
        key: MagneticVectorPotential
        name: Vector potential
        symbol: A
        units: T/m
        baseUnits: siMagneticVectorPotential
        default: 0
        hidden: true

      - &propMagneticVectorPotential2D
        <<: *propMagneticVectorPotential
        key: MagneticVectorPotential_2D
        name: Vector potential Z
        symbol: A_z

      - &propDummyLin2D
        key: Lin2D
        name: Dummy line
        default: 1
        hidden: true

      - &propDummyLin3D
        key: Lin3D
        name: Dummy line
        default: 1
        hidden: true

      - &propElectricScalarPotential
        key: ElectricScalarPotential
        name: Electric Scalar Potential
        symbol: "\\phi"
        baseUnits: siVolt
        default: 0
        hidden: true

      - &propVoltage
        key: volt
        name: Voltage
        symbol: U
        units: V
        default: 0
        baseUnits: siVolt

      - &propVoltageRe
        <<: *propVoltage
        key: volt_re
        name: Electric scalar potential (Re)
        components: 3

      - &propVoltageIm
        <<: *propVoltage
        key: volt_im
        name: Electric scalar potential (Im)
        components: 3

      - &propCurrent
        key: I_3D
        name: Current (Amplitude)
        symbol: I
        units: A
        baseUnits: siAmpere
        # default: 0

      - &propPower
        key: target_power
        name: Power
        symbol: P
        units: W
        baseUnits: siW
        # default: 0

      - &propOrientation
        units: "-"
        baseUnits: siNone
        # default: 0

      - &propMagneticPermeability
        key: mu
        name: Magnetic permeability
        symbol: "\\mu_r"
        units: "-"
        baseUnits: siNone
        min: 0
        minExclude: true
        valueTypes: [scalar, table, expression]
        arguments: [*propTemperature]

      - &propRemanence
        key: br
        name: Magnet Remanence
        symbol: "B_r"
        units: "T"
        baseUnits: siMagneticFluxDensity
        min: 0
        minExclude: false

      - &propElectricConductivity
        key: sigma
        name: Electric conductivity
        symbol: "\\sigma"
        units: "\\frac{S}{m}"
        baseUnits: siSimensOnMeter
        min: 0
        minExclude: false
        valueTypes: [scalar, table, expression]
        arguments: [*propTemperature]

      - &propResistanceElectric
        key: resistance_electric
        name: Electric contact resistance
        symbol: R
        units: "\\Omega m^2"
        baseUnit: siNone #Fixme
        min: 0
        minExclude: true

      - &propDirection
        key: direction
        name: Rotation direction (only sign of value is used)
        symbol: "-"
        units: "-"
        baseUnits: siNone

      - &voltFlag
        key: isVoltageSource
        name: Voltage source
        default: false
        style: checkbox
        incompatibleWith:
          - isCurrentSource

      - &currentFlag
        key: isCurrentSource
        name: Current source
        default: true
        style: checkbox
        incompatibleWith:
          - isVoltageSource

      - &propArea
        key: area
        name: Area
        symbol: A
        units: "m^2"
        baseUnit: siNone

      - &propWindings
        key: windings
        name: Number of turns
        symbol: N
        units: "-"
        baseUnit: siNone
        type: integer

      - &propFillFactor
        name: Fill Factor
        symbol: f
        units: "-"
        baseUnit: siNone
        min: 0
        minExclude: true
        max: 1
        maxExclude: false

      - &propVolume
        key: volume
        name: Volume
        symbol: V
        units: "-"
        baseUnit: siNone

      - &steinmetz_useLosses
        key: useSteinmetzLosses
        name: Use power losses in non-conducting material
        description: Steinmetz equation \( q = k \times f^a \times B^b \)
        default: false
        style: checkbox
        relevance:
          - key: physicsThermal
            value: true

      - &steinmetz_Amplitude
        key: steinmetz_k
        name: Amplitude for power losses
        symbol: "k"
        units: "W cm^-3"
        baseUnit: siNone
        relevance:
          - key: physicsThermal
            value: true
          - key: useSteinmetzLosses
            value: true

      - &steinmetz_FreqExp
        key: steinmetz_a
        name: Frequency exponent
        symbol: "a"
        units: "-"
        baseUnit: siNone
        relevance:
          - key: physicsThermal
            value: true
          - key: useSteinmetzLosses
            value: true

      - &steinmetz_MagnExp
        key: steinmetz_b
        name: Magnetic field exponent
        symbol: "b"
        units: "-"
        baseUnit: siNone
        relevance:
          - key: physicsThermal
            value: true
          - key: useSteinmetzLosses
            value: true

    BHModelProperties:
      - &BHModel_Permeability
        <<: *propMagneticPermeability
        relevance:
          - key: useBHModel
            value: false
          - key: useTForMagFlux
            value: false

      - &BHModel_Permeability_C
        <<: *propMagneticPermeability
        key: mu_C
        valueTypes: [scalar, expression]
        relevance:
          - key: useBHModel
            value: false
          - key: useTForMagFlux
            value: true

      - &BHModel_Flux
        <<: *propMagFlux
        key: BHModel
        valueTypes: [table]
        arguments:
          - <<: *propMagIntensity
            always: true
        relevance:
          - key: useBHModel
            value: true

      - &BHModel_useBHModel
        key: useBHModel
        name: Use B(H) model
        default: false
        style: checkbox
        incompatibleWith:
          - useAnalyticBHModel

      - &BHModel_useTemperature
        key: useTForMagFlux
        name: Use temperature dependance
        description: \( \mu(T) = 1 + (1 - \mu_r)(1-(T/T_C)^\beta) \)
        default: false
        style: checkbox
        relevance:
          - key: physicsThermal
            value: true

      - &BHModel_TCurie
        <<: *propTemperature
        key: TCurie
        name:  Curie temperature
        symbol: T_C
        relevance:
          - key: physicsThermal
            value: true
          - key: useTForMagFlux
            value: true

      - &BHModel_TCurieExponent
        key: TCurieExponent
        name: Exponent
        symbol: "\\beta"
        units: "-"
        baseUnit: siNone
        relevance:
          - key: physicsThermal
            value: true
          - key: useTForMagFlux
            value: true

      - &BHModel_isHarmonic
        key: isHarmonic
        name: HarmonicFlag
        units: "-"
        baseUnit: siNone
        hidden: true
        relevance:
          - key: time
            value: harmonic


    boundaryTypes:
      - &symmetryAxis2D
        id: 1
        key: symm_axis
        name: Symmetry axis
        description: Zero vector potential at the axis (axisymmetric only)
        isSymmetryType: true
        properties:
          - *propMagneticVectorPotential2D

      - &flux_parallel2D
        id: 2
        key: flux_parallel
        name: Flux parallel
        description: Magnetic field lines are parallel to the boundary
        properties:
          - *propMagneticVectorPotential2D

      - &infinity2D
        id: 3
        key: infinity
        name: Infinity
        description: Zero vector potential at outer boundary
        properties:
          - *propMagneticVectorPotential2D

      - &interface2D
        id: 4
        key: interface
        name: Interface
        isInterfaceType: true
        isOuterType: false
        description: Internal face between two domains
        properties:
          - *propDummyLin2D

      - &flux_normal2D
        id: 5
        key: flux_normal
        name: Flux normal
        description: Magnetic field lines are normal to the boundary

      - &sibc2D
        id: 6
        key: sibc
        name: Surface Impedance
        description: Surface Impedance Boundary Condition

      - &infinity3D
        id: 1
        key: infinity
        name: Infinity
        description: Zero vector potential at the boundary
        properties:
          -
            <<: *propMagneticVectorPotential
            key: Gauge
          -
            <<: *propMagneticVectorPotential
            key: MVP_3D

      - &flux_parallel_cond3D
        id: 2
        key: flux_parallel_cond
        name: Flux parallel
        description: Magnetic field lines are parallel to the boundary
        properties:
          -
            <<: *propMagneticVectorPotential
            key: MVP_3D
          -
            <<: *propMagneticVectorPotential
            key: Gauge
          -
            <<: *propElectricScalarPotential
            key: ElPot

      - &flux_parallel_ncond3D
        id: 3
        key: flux_parallel_ncond
        name: Flux parallel
        description: Magnetic field lines are parallel to the boundary
        properties:
          -
            <<: *propMagneticVectorPotential
            key: MVP_3D
          -
            <<: *propMagneticVectorPotential
            key: Gauge

      - &flux_normal3D
        id: 4
        key: flux_normal
        name: Flux normal
        description: Magnetic field lines are normal to the boundary

      - &voltage3D
        id: 5
        key: voltage
        name: Voltage (Amplitude)
        description: |-
            Voltage source. Amplitude value has to be input
            \( U_{amplitude} = U_{RMS} * \sqrt{2}\)
        properties:
          -
            <<: *propVoltage
            key: V_3D
            valueTypes: [scalar, table, expression]
            arguments: [*propTime]

          -
            <<: *propMagneticVectorPotential
            key: Gauge
      - &power3D
        id: 6
        key: power
        name: Power
        properties:
          -
            <<: *propCurrent
            default: 1
            hidden: true
          -
            <<: *propMagneticVectorPotential
            key: Gauge

          - 
            <<: *propPower
            valueTypes: [scalar, table, expression]
            arguments: [*propTime]
            


      - &current3D
        id: 6
        key: current
        name: Current (Amplitude)
        description: |-
            Current source. Amplitude value has to be input
            \( I_{amplitude} = I_{RMS} * \sqrt{2} \)
        properties:
          -
            <<: *propCurrent
            valueTypes: [scalar, table, expression]
            arguments: [*propTime]
          -
            <<: *propMagneticVectorPotential
            key: Gauge

      - &ground3D
        id: 7
        key: ground
        name: Ground
        properties:
          -
            <<: *propMagneticVectorPotential
            key: Gauge
          -
            <<: *propMagneticVectorPotential
            key: MVP_3D

      - &interface3D
        id: 8
        key: interface
        name: Interface
        description: Internal face between two domains
        isInterfaceType: true
        isOuterType: false
        properties:
          - *propDummyLin3D

      - &sibc3D
        id: 9
        key: sibc
        name: Surface Impedance
        description: Surface Impedance Boundary Condition

      - &currentStr3D
        id: 11
        key: current_stranded
        name: Current
        properties:
          -
            <<: *propCurrent
            hidden: true
            default: 1
          -
            <<: *propMagneticVectorPotential
            key: Gauge

      - &groundStr3D
        id: 12
        key: ground_stranded
        name: Ground
        properties:
          -
            <<: *propMagneticVectorPotential
            key: Gauge
          -
            <<: *propMagneticVectorPotential
            key: MVP_3D

      - &resistance_electric
        id: 13
        key: resistance_electric
        name: Electric Contact Resistance
        description: |-
          Define contact resistance as thin layer at interface.
          IMPORTANT: The same condition has to be set on both sides.
          Resistance can be calculated as \( d / \sigma \)
          (\( d \) - thickness, \( \sigma \) - conductivity).
        isInterfaceType: true
        isOuterType: false
        properties:
          -
            <<: *propResistanceElectric


    domainTypes:
      # Non-conductive domain (common for 2D and 3D)
      - &domainEMNonConductiveAbstract
        id: 1
        key: em_nc
        name: Non-conductive
        material:
          properties:
            - *BHModel_Permeability
            - *BHModel_Flux
            - *BHModel_useBHModel
            - *BHModel_useTemperature
            - *BHModel_TCurie
            - *BHModel_TCurieExponent
            - *BHModel_TCurieExponent
            - *steinmetz_useLosses
            - *steinmetz_Amplitude
            - *steinmetz_FreqExp
            - *steinmetz_MagnExp

      # Non-conductive domain (2D)
      - &domainEMNonConductive2D
        <<: *domainEMNonConductiveAbstract
        boundaryTypes:
          - *infinity2D
          - *flux_parallel2D
          - *flux_normal2D
          - *symmetryAxis2D
          - *interface2D

      # Non-conductive domain (3D)
      - &domainEMNonConductive3D
        <<: *domainEMNonConductiveAbstract
        boundaryTypes:
          - *infinity3D
          - *flux_parallel_ncond3D
          - *flux_normal3D
          - *interface3D

      # Conductive domain (common for 2D and 3D)
      - &domainEMConductiveAbstract
        id: 2
        key: em_cc
        name: Conductive
        material:
          properties:
            - *propElectricConductivity
            - *BHModel_Permeability
            - *BHModel_Permeability_C
            - *BHModel_Flux
            - *BHModel_useBHModel
            - *BHModel_useTemperature
            - *BHModel_TCurie
            - *BHModel_TCurieExponent

      # Conductive domain (2D)
      - &domainEMConductive2D
        <<: *domainEMConductiveAbstract
        boundaryTypes:
          - *infinity2D
          - *flux_parallel2D
          - *flux_normal2D
          - *symmetryAxis2D
          - *interface2D
        properties:
          -
            <<: *propVoltage
            key: VoltageLoad_2D
            hidden: true

      # Conductive domain (3D)
      - &domainEMConductive3D
        <<: *domainEMConductiveAbstract
        boundaryTypes:
          - *infinity3D
          - *flux_parallel_cond3D
          - *flux_normal3D
          - *interface3D
          - *resistance_electric

      # Current source domain (common for 2D and 3D)
      - &domainEMSourceAbstract
        id: 3
        key: source_dom
        name: Current source
        material:
          properties:
            - *propElectricConductivity
            - *BHModel_Permeability
            - *BHModel_Permeability_C
            - *BHModel_Flux
            - *BHModel_useBHModel
            - *BHModel_useTemperature
            - *BHModel_TCurie
            - *BHModel_TCurieExponent

      # Current source domain (2D)
      - &domainEMSource2D
        <<: *domainEMSourceAbstract
        boundaryTypes:
          - *infinity2D
          - *flux_parallel2D
          - *flux_normal2D
          - *symmetryAxis2D
          - *interface2D
        properties:
          -
            key: _current
            name: Current
            default: true
            style: checkbox
            incompatibleWith:
              - _voltage
              - _power
          -
            <<: *propCurrent
            key: Current_2D
            valueTypes: [scalar, table, expression]
            arguments: [*propTime]
            relevance:
              - key: _current
                value: true
          -
            key: _voltage
            name: Voltage
            default: false
            style: checkbox
            incompatibleWith:
              - _current
              - _power
          -
            <<: *propVoltage
            key: Voltage_2D
            valueTypes: [scalar, table, expression]
            arguments: [*propTime]
            relevance:
              - key: _voltage
                value: true

          -
            key: _power
            name: Power
            default: false
            style: checkbox
            incompatibleWith:
              - _current
              - _voltage
            
          -
            <<: *propCurrent
            key: Current_2D
            default: 1
            hidden: true
            relevance:
              - key: _power
                value: true

          -
            key: ElectricalCircuit
            name: Circuit
            default: 0
            hidden: true

          -
            name: Power
            symbol: P
            units: W
            key: target_power
            valueTypes: [scalar, table, expression]
            arguments: [*propTime]
            relevance:
              - key: _power
                value: true

        domain_groups:
          source:
            - this

      # Current source domain (3D)
      - &domainEMSource3D
        <<: *domainEMSourceAbstract
        boundaryTypes:
          - *voltage3D
          - *current3D
          - *ground3D
          - *power3D
          - *flux_parallel_cond3D
          - *flux_normal3D
          - *interface3D
          - *infinity3D
          - *resistance_electric


        domain_groups:
          source_domain:
            - this
          terms:
            - voltage
            - current
            - ground

      # Magnet domain (common for 2D and 3D)
      #- &domainEMPerMagnetAbstract
      # id: 4
      #  key: permag_dom
      #  name: Permanent Magnet
      #  material:
      #    properties:
      #      - *propElectricConductivity
      #      - *BHModel_Permeability
      #      - *BHModel_Flux
      #      - *BHModel_useBHModel
      #      - *BHModel_useTemperature
      #      - *BHModel_TCurie
      #      - *BHModel_TCurieExponent
      #      - *propRemanence

      # Magnet domain (2D)
      #- &domainEMPerMagnet2D
      #  <<: *domainEMPerMagnetAbstract
      #  boundaryTypes:
      #    - *infinity2D
      #    - *flux_parallel2D
      #    - *flux_normal2D
      #    - *symmetryAxis2D
      #    - *interface2D
      #  properties:
      #    -
      #      <<: *propOrientation
      #      key: orientx
      #      symbol: e_{x}
      #      name: Magnet orientation X
      #    -
      #      <<: *propOrientation
      #      key: orienty
      #      symbol: e_{y}
      #      name: Magnet orientation Y
      #    -
      #      <<: *propDirection
      #     relevance:
      #        - key: time
      #          value: harmonic

      # Magnet domain (3D)
      #- &domainEMPerMagnet3D
      #  <<: *domainEMPerMagnetAbstract
      #  boundaryTypes:
      #    - *infinity3D
      #    - *flux_parallel_cond3D
      #    - *flux_normal3D
      #    - *interface3D
      #  properties:
      #    -
      #      <<: *propOrientation
      #      key: orientx
      #      symbol: e_{x}
      #      name: Magnet orientation X
      #    -
      #      <<: *propOrientation
      #      key: orienty
      #      symbol: e_{y}
      #      name: Magnet orientation Y
      #    -
      #      <<: *propOrientation
      #      key: orientz
      #      symbol: e_{z}
      #      name: Magnet orientation Z
      #    -
      #      <<: *propDirection
      #      relevance:
      #        - key: time
      #          value: harmonic

      # Suface-impedance BC
      - &domainEMSIBCAbstract
        id: 5
        key: em_sibc
        name: Surface Impedance Domain
        material:
          properties:
            - *propElectricConductivity
            - *propMagneticPermeability
            # - *BHModel_Permeability_C
            # - *BHModel_Flux
            # - *BHModel_useBHModel
            # - *BHModel_useTemperature
            # - *BHModel_TCurie
            # - *BHModel_TCurieExponent

      - &domainEMSIBC2D
        <<: *domainEMSIBCAbstract
        boundaryTypes:
          - *infinity2D
          - *flux_parallel2D
          - *flux_normal2D
          - *symmetryAxis2D
          - *interface2D
          - *sibc2D

      - &domainEMSIBC3D
        <<: *domainEMSIBCAbstract
        boundaryTypes:
          - *infinity3D
          - *flux_parallel_cond3D
          - *flux_normal3D
          - *interface3D
          - *sibc3D

      - &domainEMStrandesSourceAbstract
        id: 6
        key: stranded_source_dom
        name: Stranded Coil Source
        material:
          properties:
            - *propElectricConductivity
            - *BHModel_Permeability
            - *BHModel_Flux
            - *BHModel_useBHModel
            - *BHModel_useTemperature
            - *BHModel_TCurie
            - *BHModel_TCurieExponent

      # Current source stranded (2D)
      - &domainEMStrandedSource2D
        <<: *domainEMStrandesSourceAbstract
        boundaryTypes:
          - *infinity2D
          - *flux_parallel2D
          - *flux_normal2D
          - *symmetryAxis2D
          - *interface2D
        properties:
          -
            key: a_litz
            name: Litz wire
            default: false
            style: checkbox
          -
            key: _current
            name: Current
            default: true
            style: checkbox
            incompatibleWith:
              - _voltage
          -
            <<: *propCurrent
            key: Current_2D
            valueTypes: [scalar, table, expression]
            arguments: [*propTime]
            relevance:
              - key: _current
                value: true
          -
            key: _voltage
            name: Voltage
            default: false
            style: checkbox
            incompatibleWith:
              - _current
          -
            <<: *propVoltage
            key: Voltage_2D
            valueTypes: [scalar, table, expression]
            arguments: [*propTime]
            relevance:
              - key: _voltage
                value: true
          -
            key: ElectricalCircuit
            name: Circuit
            default: 0
            hidden: true
          -
            <<: *propWindings
            key: Nc
          -
            <<: *propFillFactor
            key: FillFactor

        domain_groups:
          stranded_source_domain:
            - this


      # Current source stranded (3D)
      - &domainEMStrandedSource3D
        <<: *domainEMStrandesSourceAbstract
        boundaryTypes:
          - *currentStr3D
          - *groundStr3D
          - *flux_parallel_cond3D
          - *flux_normal3D
          - *interface3D
          - *infinity3D

        properties:
          -
            key: a_litz
            name: Litz wire
            default: false
            style: checkbox
          -
            <<: *propWindings
            key: Nc
          -
            <<: *propFillFactor
            key: FillFactor
          -
            <<: *propArea
            name: Cross section area
            key: cross_section_area
          -
            key: I_str
            name: Current (Amplitude)
            symbol: I
            units: A
            valueTypes: [scalar, table, expression]
            arguments: [*propTime]


      # Magnet domain (common for 2D and 3D)
      - &domainCircuitDummy
        id: 7
        key: circdom
        name: Circuit Domain (Dummy)
        hidden: true
        properties:
          -
            <<: *propWindings
            key: Nc
            default: 1
          -
            <<: *propFillFactor
            key: FillFactor
            default: 1
          -
            key: a_litz
            name: Litz wire
            default: false
            style: checkbox



    subPhysicsParts:
      #
      # Electromagnetics 2D General.
      #
      - &subPhysicsEMGeneral2D
        key: subPhysicsEMGeneral2D
        name: Low frequency 2D
        description: "Solves EM 2D"
        physicsKey: *physicsKey
        physicsName: *physicsName
        arguments: *argElectromagnetics

        resultValues:
          - *propJouleHeat
          - *propBField
          - *propBFieldRe
          - *propBFieldIm
          - *propCurrentDensity
          - *propCurrentDensityRe
          - *propCurrentDensityIm

        timeTypes:
          - *timeHarmonic
          - *timeSteady

        domainTypes:
          - *domainEMNonConductive2D
          - *domainEMConductive2D
          - *domainEMSource2D
         # - *domainEMPerMagnet2D
          - *domainEMSIBC2D
          - *domainEMStrandedSource2D
          - *domainCircuitDummy

      #
      # Electromagnetics 2D with transient time.
      #
      - &subPhysicsEMWithTransient2D
        key: subPhysicsEMGeneral2D
        name: Low frequency 2D
        description: "Solves EM 2D"
        physicsKey: *physicsKey
        physicsName: *physicsName
        arguments: *argElectromagnetics

        resultValues:
          - *propJouleHeat
          - *propBField
          - *propBFieldRe
          - *propBFieldIm
          - *propCurrentDensity
          - *propCurrentDensityRe
          - *propCurrentDensityIm

        timeTypes:
          - *timeHarmonic
          - *timeSteady
          - *timeTransient

        domainTypes:
          - *domainEMNonConductive2D
          - *domainEMConductive2D
          - *domainEMSource2D
        #  - *domainEMPerMagnet2D
          - *domainEMSIBC2D
          - *domainEMStrandedSource2D
          - *domainCircuitDummy

      #
      # Electromagnetics 3D General.
      #
      - &subPhysicsEMGeneral3D
        key: subPhysicsEMGeneral3D
        name: Low frequency 3D,
        description: "Solves EM 3D"
        physicsKey: *physicsKey
        physicsName: *physicsName
        arguments: *argElectromagnetics

        resultValues:
          - *propJouleHeat
          - *propBField
          - *propBFieldRe
          - *propBFieldIm
          - *propCurrentDensity
          - *propCurrentDensityRe
          - *propCurrentDensityIm
          - *propVoltage
          - *propVoltageRe
          - *propVoltageIm

        timeTypes:
          - *timeHarmonic
          - *timeSteady

        domainTypes:
          - *domainEMNonConductive3D
          - *domainEMConductive3D
          - *domainEMSource3D
         # - *domainEMPerMagnet3D
          - *domainEMSIBC3D
          - *domainEMStrandedSource3D

      #
      # Electromagnetics 3D with transient time.
      #
      - &subPhysicsEMWithTransient3D
        key: subPhysicsEMGeneral3D
        name: Low frequency 3D,
        description: "Solves EM 3D"
        physicsKey: *physicsKey
        physicsName: *physicsName
        arguments: *argElectromagnetics

        resultValues:
          - *propJouleHeat
          - *propBField
          - *propBFieldRe
          - *propBFieldIm
          - *propCurrentDensity
          - *propCurrentDensityRe
          - *propCurrentDensityIm
          - *propVoltage
          - *propVoltageRe
          - *propVoltageIm

        timeTypes:
          - *timeHarmonic
          - *timeSteady
          - *timeTransient

        domainTypes:
          - *domainEMNonConductive3D
          - *domainEMConductive3D
          - *domainEMSource3D
        #  - *domainEMPerMagnet3D
          - *domainEMSIBC3D
          - *domainEMStrandedSource3D


    subPhysics:
      - key: subPhysicsEMGeneral
        name: Low Frequency
        description: "Solver for electromagnetic equation using AV formulation. Steady, and frequency domain solvers available"

        basisList:
          -
            key: subPhysicsEMGeneral2D
            basis: *mesh2D
            name: Low frequency 2D,
            description: "Solves EM 2D"
            physicsList:
              - *subPhysicsEMWithTransient2D

          -
            key: subPhysicsEMGeneral3D
            basis: *mesh3D
            name: Low frequency 3D,
            description: "Solves EM 3D"
            physicsList:
              - *subPhysicsEMWithTransient3D

#      - key: subPhysicsEMHighFrequency
#        name: High Frequency
#        description: "Solver for electromagnetic equation using AV formulation. Steady, and frequency domain solvers available"
#
#        basisList:
#          -
#            key: subPhysicsEMHighFrequency2D
#            basis: *mesh2D
#            name: High frequency 2D,
#            description: "Solves EM HF 2D"
#            physicsList:
#              - *subPhysicsEMHighFrequency2D
#          -
#            key: subPhysicsEMHighFrequency3D
#            basis: *mesh3D
#            name: High frequency 3D,
#            description: "Solves EM HF 3D"
#            physicsList:
#              - *subPhysicsEMHighFrequency3D

    #
  # ELECTROMAGNETICS.
  #
  - &physicsMicrowaves
    key: &physicsKey physicsMicrowaves
    name: &physicsName Antenna Design
    description: Electromagnetics for Antenna Design
    arguments: &argMicrowaves [*propMagFlux]

    physicalProperties:

      - &propVoltage
        key: volt
        name: Voltage
        symbol: U
        units: V
        default: 1
        baseUnits: siVolt
        relevance:
          - key: autoFeedParams
            value: false

      - &propGap
        key: gap
        name: Gap
        symbol: \delta
        units: m
        min: 0
        minExclude: true
        baseUnits: siLenght
        relevance:
          - key: autoFeedParams
            value: false

      - &propRadius
        key: radius
        name: Radius
        symbol: r
        units: m
        min: 0
        minExclude: true
        baseUnits: siLenght
        relevance:
          - key: autoFeedParams
            value: false

      - &propEfield
        key: Efield
        name: Electric field
        symbol: E
        units: V/m
        default: 0
        baseUnits: siVoltOnMeter

      - &propImpedance
        key: impedance
        name: Impedance
        symbol: Z
        units: Ohm
        default: 50
        baseUnits: siImpedance

      - &propMagneticPermeability
        key: mu
        name: Magnetic permeability
        symbol: "\\mu_r"
        units: "-"
        baseUnits: siNone
        min: 0
        minExclude: true

      - &propDielectricConstant
        key: epsilon
        name: Dielectric constant
        symbol: "\\epsilon_r"
        units: "-"
        baseUnits: siNone
        min: 0
        minExclude: true

      - &propElectricConductivity
        key: sigma
        name: Electric Conductivity
        symbol: "\\sigma"
        units: "\\frac{S}{m}"
        baseUnits: siSimensOnMeter
        min: 0
        minExclude: false

      - &propLossTangent
        key: tan_delta
        name: Dielectric loss tangent
        symbol: "tan(\\delta)"
        units: "-"
        baseUnits: siNone
        min: 0
        minExclude: false

      - &propEx
        key: eDirX
        name: Feed vector X
        symbol: E_x
        units: "-"
        default: 0
        min: -1
        max: 1
        baseUnits: siNone
        valueTypes: [scalar, expression]
        relevance:
          - key: autoFeedParams
            value: false

      - &propEy
        key: eDirY
        name: Feed vector Y
        symbol: E_y
        units: "-"
        default: 0
        min: -1
        max: 1
        baseUnits: siNone
        valueTypes: [scalar, expression]
        relevance:
          - key: autoFeedParams
            value: false

      - &propEz
        key: eDirZ
        name: Feed vector Z
        symbol: E_z
        units: "-"
        default: 1
        min: -1
        max: 1
        baseUnits: siNone
        valueTypes: [scalar, expression]
        relevance:
          - key: autoFeedParams
            value: false

      - &automaticFeedFlag
        key: autoFeedParams
        name: Automatic Feed Parameters
        default: true
        style: checkbox

      - &phaseFlag
        key: hasPhaseShift
        name: Phase shift
        default: false
        style: checkbox

      - &roughnessFlag
        key: roughFlag
        name: Rough conductor
        default: false
        style: checkbox

      - &propPhase
        key: phase
        name: Phase shift angle
        symbol: \theta
        units: deg
        default: 0
        baseUnits: siAngle
        relevance:
          - key: hasPhaseShift
            value: true

      - &propPortNumber
        key: numberPort
        name: Port Number
        symbol: N
        valueKind: integer
        min: 1
        default: 1



    boundaryTypes:
      - &uniformPort
        id: 1
        key: uniformPort
        name: Uniform port 
        description: Port for planar feed
        isInterfaceType: true
        isOuterType: true
        properties:
          -
            <<: *propPortNumber
          -
            <<: *propImpedance
          -
            <<: *automaticFeedFlag
          -
            <<: *propVoltage
          -
            <<: *propGap
          -
            <<: *propEx
          -
            <<: *propEy
          -
            <<: *propEz
          -
            <<: *propEfield
            key: Efield_port
            hidden: true
            default: 0
          -
            <<: *propPhase
          -
            <<: *phaseFlag


      - &coaxialPort
        id: 2
        key: coaxialPort
        name: Coaxial Port
        description: Port for coaxial feed
        isInterfaceType: true
        isOuterType: true
        properties:
          -
            <<: *propImpedance
          -
            <<: *automaticFeedFlag
          -
            <<: *propVoltage
          -
            <<: *propRadius
            key: radius_in
            name: "Inner radius"
            symbol: r_{in}
          -
            <<: *propRadius
            key: radius_out
            name: "Outer radius"
            symbol: r_{out}
          -
            <<: *propEfield
            key: Efield_port
            hidden: true
            default: 0
          -
            <<: *propPhase
          -
            <<: *phaseFlag

      - &perfectConductor
        id: 3
        key: perfectConductor
        name: Perfect Electric Conductor
        description: Electric field is perpendicular to this boundary
        isInterfaceType: true
        isOuterType: true
        properties:
          -
            <<: *propEfield
            hidden: true
            default: 0

      - &radiationBoundary
        id: 4
        key: radiationBoundary
        name: Radiation Boundary
        description: Silver-Muller absorbing condition, prevents reflection
        properties:

      - &interface
        id: 5
        key: interface
        name: Interface
        isInterfaceType: true
        isOuterType: false

      - &groundPEC
        id: 6
        key: groundPEC
        name: Ground
        description: Ground as perfect electric conductor
        properties:
          -
            <<: *propEfield
            hidden: true
            default: 0

      - &conductingBoundary
        id: 7
        key: conductingBoundary
        name: Conductor
        description: Conducting boundary
        isInterfaceType: true
        isOuterType: true
        properties:
          -
            <<: *roughnessFlag
          -
             key: height
             name: Height
             symbol: h
             units: m
             hidden: false
             default: 0
             relevance:
                - key: roughFlag
                  value: true
        material:
          properties:
            - *propMagneticPermeability
            - *propDielectricConstant
            - *propLossTangent
            - *propElectricConductivity

    domainTypes:
      # Non-conductive domain
      - &domainEMNonConductive
        id: 1
        key: em_nc
        name: Non-conductive
        material:
          properties:
            - *propMagneticPermeability
            - *propDielectricConstant
            - *propLossTangent
        boundaryTypes:
          
          - *uniformPort
          - *coaxialPort
          - *perfectConductor
          - *interface
          - *conductingBoundary

      # Perfectly conductive domain
      - &domainEMPerfectlyConductive
        id: 2
        key: em_pec
        name: Perfect conductor
        material:
          properties: []
            # - *propMagneticPermeability
            # - *propDielectricConstant
            # - *propElectricConductivity
        boundaryTypes:
          
          - *uniformPort
          - *coaxialPort
          - *perfectConductor
          - *interface
          - *conductingBoundary

      # Conductive domain
      - &domainEMConductive
        id: 3
        key: em_cc
        name: Conductive
        material:
          properties:
            - *propMagneticPermeability
            - *propDielectricConstant
            - *propElectricConductivity
        boundaryTypes:
          
          - *uniformPort
          - *coaxialPort
          - *perfectConductor
          - *interface
          - *conductingBoundary

      # Open air domain
      - &domainEMOpenAir
        id: 4
        key: em_open
        name: Open-Air
        material:
          properties:
            - *propMagneticPermeability
            - *propDielectricConstant
            - *propLossTangent
        boundaryTypes:
          - *uniformPort
          - *coaxialPort
          - *perfectConductor
          - *radiationBoundary
          - *interface
          - *conductingBoundary

    subPhysicsParts:
      #
      #Microwaves General.
      #
      - &subPhysicsMicrowavesGeneral
        key: subPhysicsMicrowavesGeneral
        name: Electromagnetics
        description: "Solver of Electromagnetics for Antenna Design"
        physicsKey: *physicsKey
        physicsName: *physicsName
        arguments: *argElectromagnetics

        resultValues:

        timeTypes:
          -
            <<: *timeHarmonicWithoutTime
            name: Single Frequency
          -
            <<: *timeMultipleFrequency


        domainTypes:
          - *domainEMNonConductive
          - *domainEMPerfectlyConductive
          - *domainEMConductive
          - *domainEMOpenAir

    subPhysics:
      - key: subPhysicsMicrowavesGeneral
        name: Antenna Design
        description: "Solver for microwaves computation in frequency domain"

        basisList:
          -
            key: subPhysicsMicrowavesGeneral2D
            basis: *mesh2D
            physicsList:
              - *subPhysicsMicrowavesGeneral
          -
            key: subPhysicsMicrowavesGeneral3D
            basis:
              <<: *mesh3D
              symmetryTypes: # Keep Full 3D only.
                - key: full
                  name: Full 3D model

            physicsList:
              - *subPhysicsMicrowavesGeneral



  

  
     #
  # FLUID DYNAMICS.
  #
  - &physicsFluidDynamics
    key: &physicsKey physicsFluidDynamics
    name: &physicsName Fluid Dynamics
    description: #Fixme
    arguments: &argFluiDynamics

    physicalProperties:
      - &propVelocity
        key: velocity
        name: Velocity
        symbol: U
        units: "m/s"
        baseUnit: siVelocity

      - &propPressure
        key: pressure
        name: Pressure
        symbol: p
        units: "Pa"
        baseUnit: siPressure

      - &propViscosity
        key: nu
        name: Viscosity
        symbol: "\\nu"
        units: "\\frac{m}{s^2}"
        baseUnit: siViscosity
        min: 0
        minExclude: false
       
      - &propDensity
        key: rho
        name: Density
        symbol: "\\rho"
        units: "\\frac{kg}{m^3}"
        baseUnits: siDensity
        min: 0
        minExclude: false
        
    boundaryTypes:
      - &inlet
        id: 1
        key: inlet
        name: Inlet
        description: Inlet boundary condition
        properties:
          -
            <<: *propVelocity
            name: Velocity X
            key: velocity_x
          -
            <<: *propVelocity
            name: Velocity Y
            key: velocity_y
          -
            <<: *propVelocity
            name: Velocity Z
            key: velocity_z
            
      - &outlet
        id: 2
        key: outlet
        name: Outlet
        description: Outlet boundary condition
        properties:
          -
            <<: *propPressure
            default: 0

      - &wall
        id: 3
        key: wall
        name: Wall
        description: No slip boundary condition

    domainTypes:
      - &domainFluid
        id: 1
        key: fluid
        name: Fluid domain
        material:
          properties:
            - *propViscosity
            - *propDensity
            
        boundaryTypes:
          - *inlet
          - *outlet
          - *wall

    subPhysicsParts:
      #
      # Fluid dynamics general
      #
      - &subPhysicsFluidGeneral
        key: subPhysicsFluidGeneral
        name: Fluid Dynamics
        description: "Solves Fluid dynamics"
        physicsKey: *physicsKey
        physicsName: *physicsName
        arguments: *argFluiDynamics

        timeTypes:
          - *timeTransient
          - *timeSteady

        domainTypes:
          - *domainFluid


    subPhysics:
      - key: subPhysicsFluidDynamics
        name: Fluid Dynamics
        description: "Solver for fluid dynamics"

        basisList:
          -
            key: subPhysicsFluidDynamics2D
            basis: *mesh2D
            name: Fluid Dynamics
            description: "Solver for fluid dynamics"
            physicsList:
              - *subPhysicsFluidGeneral

          -
            key: subPhysicsFluidDynamics3D
            basis: *mesh3D
            name: Fluid Dynamics
            description: "Solver for fluid dynamics"
            physicsList:
              - *subPhysicsFluidGeneral

     #
  # ROTATING MAGNET ELECTROMAGNETICS.
  #
  - &physicsRotatingMagnetsEM
    key: &physicsKey physicsRotatingMagnetsEM
    name: &physicsName EM for Magnets
    description: #subPhysicsRotatingMagnetsGeneral2D
    arguments: &argRotatingMagnetsEM

    physicalProperties:
      - &propMagneticPermeability
        key: mu
        name: Magnetic permeability
        symbol: "\\mu_r"
        units: "-"
        baseUnits: siNone
        min: 0
        minExclude: true

      - &propRemanence
        key: br
        name: Magnet Remanence
        symbol: "B_r"
        units: "T"
        baseUnits: siMagneticFluxDensity
        min: 0
        minExclude: false

      - &propElectricConductivity
        key: sigma
        name: Electric conductivity
        symbol: "\\sigma"
        units: "\\frac{S}{m}"
        baseUnits: siSimensOnMeter
        min: 0
        minExclude: false
        
      - &angularVelocity
        key: Omega
        name: Angular velocity
        symbol: "\\Omega"
        units: "\\frac{rad}{s}"
        baseUnit: siAngularVelocity
        default: 0
        
    boundaryTypes:
      - &infinity
        id: 1
        key: infinity
        name: Infinity
        description: Zero vector potential at the boundary

      - &flux_parallel
        id: 2
        key: flux_parallel
        name: Flux parallel
        description: Magnetic field lines are parallel to the boundary

      - &flux_normal
        id: 3
        key: flux_normal
        name: Flux normal
        description: Magnetic field lines are normal to the boundary

      - &interface
        id: 4
        key: interface
        name: Interface
        description: Internal face between two domains
        isInterfaceType: true
        isOuterType: false

    domainTypes:
      - &domainEMNonConductive
        id: 1
        key: non_conductive
        name: Non-conductive
        material:
          properties:
            - *propMagneticPermeability
        boundaryTypes:
          - *infinity
          - *flux_parallel
          - *flux_normal
          - *interface
          
      - &domainEMConductive
        id: 2
        key: conductive
        name: Non-conductive
        material:
          properties:
            - *propMagneticPermeability
            - *propElectricConductivity
        boundaryTypes:
          - *infinity
          - *flux_parallel
          - *flux_normal
          - *interface
          
      - &domainEMMagnet
        id: 3
        key: magnet
        name: Magnet
        material:
          properties:
            - *propMagneticPermeability
            - *propElectricConductivity
            - *propRemanence
        boundaryTypes:
          - *infinity
          - *flux_parallel
          - *flux_normal
          - *interface

    subPhysicsParts:
      #
      # Rotating magnets electromagnetics general
      #
      - &subPhysicsRotatingMagnetsGeneral
        key: subPhysicsRotatingMagnetsGeneral
        name: Rotating Magnets Electromagnetics
        description: "Solves Rotating Magnets Electromagnetics"
        physicsKey: *physicsKey
        physicsName: *physicsName
        arguments: *argRotatingMagnetsEM

        timeTypes:
          - *timeHarmonic
          - *timeSteady

        domainTypes:
          - *domainEMNonConductive
          - *domainEMConductive
          - *domainEMMagnet


    subPhysics:
      - key: subPhysicsRotatingMagnets
        name: Rotating Magnets Electromagnetics
        description: "Solver for rotating magnets electromagnetics"

        basisList:
          -
            key: subPhysicsRotatingMagnets2D
            basis: *mesh2D
            name: Rotating Magnets Electromagnetics
            description: "Solver for rotating magnets electromagnetics"
            physicsList:
              - *subPhysicsRotatingMagnetsGeneral

          -
            key: subPhysicsRotatingMagnets3D
            basis: *mesh3D
            name: Rotating Magnets Electromagnetics
            description: "Solver for rotating magnets electromagnetics"
            physicsList:
              - *subPhysicsRotatingMagnetsGeneral

  



multiPhysics:
    #
  # INDUCTION HEATING.
  #
  - &physicsInductionHeating
    key: physicsInductionHeating
    name: Induction Heating
    isMultiPhysics: true

    subPhysics:
      #
      # Induction heating: General.
      #
      - key: subPhysicsInductionGeneral
        name: Low Frequency
        description: "Solves induction heating problem"

        basisList:
          # 2D
          -
            key: subPhysicsInductionGeneral2D
            basis: *mesh2D
            isMultiPhysics: true
            physicsList:
              - *subPhysicsThermalGeneral
              - *subPhysicsEMGeneral2D

          # 3D
          -
            key: subPhysicsInductionGeneral3D
            basis: *mesh3D
            isMultiPhysics: true
            physicsList:
              - *subPhysicsThermalGeneral
              - *subPhysicsEMGeneral3D

      #
      # Induction heating: High frequency.
      #
#      - key: subPhysicsInductionHighFrequency
#        name: High Frequency
#        description: "Solves induction heating problem"
#
#        basisList:
#          # 2D
#          -
#            key: subPhysicsInductionHighFrequency2D
#            basis: *mesh2D
#            isMultiPhysics: true
#            physicsList:
#              - *subPhysicsThermalGeneral
#              - *subPhysicsEMHighFrequency2D
#
#          # 3D
#          -
#            key: subPhysicsInductionHighFrequency3D
#            basis: *mesh3D
#            isMultiPhysics: true
#            physicsList:
#              - *subPhysicsThermalGeneral
#              - *subPhysicsEMHighFrequency3D

  
      #
  # MAGNET STIRRING.
  #
  - &physicsMagnetStirring
    key: physicsMagnetStirring
    name: Magnet Stirring
    isMultiPhysics: true

    subPhysics:
      #
      # Stirring: General.
      #
      - key: subPhysicsStirring
        name: Magnet Stirring
        description: "Solves magnet stirring MHD problem"

        basisList:
          # 2D
          -
            key: subPhysicsStirringGeneral2D
            basis: *mesh2D
            isMultiPhysics: true
            physicsList:
              - *subPhysicsFluidGeneral
              - *subPhysicsRotatingMagnetsGeneral

          # 3D
          -
            key: subPhysicsStirringGeneral3D
            basis: *mesh3D
            isMultiPhysics: true
            physicsList:
              - *subPhysicsFluidGeneral
              - *subPhysicsRotatingMagnetsGeneral

  

physics:
  

  

  
  - *physicsFluidDynamics
  - *physicsRotatingMagnetsEM
  - *physicsMagnetStirring
  





defaultPhysicsBlock: "physicsMagnetStirring"


solverParts:
    # GetDP Thermal solver
  getdpThermal: &getdpThermal
    key: getdpThermal
    command: runGetdp
    DOF_variable: T
    constraints:
      - temperature

    domain_groups:
      thermal:
        Vol_The: [this]
        Tot_The: [this, flux, convection, radiation, combined, flow, adiabatic, interface, resistance_thermal]
        ThermRes_OneSideVol:
            oneSideOf: [resistance_thermal]

    bc_groups:
      fixed: Sur_FIXED_T
      flux: Sur_HEATFLUX_T
      convection: Sur_CONVECTIVE_T
      radiation: Sur_RADIATION_T
      combined: Sur_COMBINED_T
      flow: Sur_HEATFLOW_T
      adiabatic: Sur_ADIABATIC_T
      interface: Sur_INTERFACE_T
      resistance_thermal: Sur_RESISTANCE_T

    flags:
      boundary:
        radiationNLFlag:
          condition: _radiation
          isNLFlag: false

      material:
        lambdaNLFlag:
          condition: lambda
          isNLFlag: false
        cpNLFlag:
          condition: cp
          isNLFlag: false
        # rhoNLFlag: rho

    argumentPosition:
      rho:
        temperature: 1
      cp:
        temperature: 1
      h:
        temperature: 1
        time: 2
      hr:
        temperature: 1
      lambda:
        temperature: 1
      qSurf:
        temperature: 1
        time: 2
      qVol:
        temperature: 1
        time: 2
      Velocity_x:
        time: 1
      Velocity_y:
        time: 1
      Velocity_z:
        time: 1
      tstep:
        time: 1
      StartTime:
        temperature: 1
      EndTime:
        temperature: 1

    postValues:
      temperature:
        name: Temperature
        safeName: Temperature_T_[C]
        symbol: T
        units: C
        type: NODE_FIELD
        components: 1
        term: ["{ T }"]
        domains:
          - Vol_The
        smoothing: 0
        exportToVTK: false
        hidden: false
        default: true
        locked: true
      averageTemperature:
        name: Average temperature
        safeName: Average_Temperature_[C]
        units: C
        type: INTEGRAL
        term: '{T}* GeomCoeff[]  /volume[]'
        domains:
          - Vol_The
        smoothing: 0
        hidden: false
        default: true
        locked: true
      temp:
        name: temp
        units: C
        term:
          - '{ T }'
        type: RESIDUAL
        valueRegister: 7
        domains:
          - Vol_The
        smoothing: 0
        hidden: true
        default: true
      tempTest:
        term:
          - '{ T }'
        type: RESIDUAL_FOR_ADAPTIVE
        name: tempTest
        domains:
          - Vol_The
        smoothing: 0
        hidden: true
        default: true

      hFlux:
        name: Convective flux
        safeName: Convective_flux_[W/m2]
        units: "W/m^2"
        term:
          - '{ U_h }'
        type: BOUNDARY_GLOBAL
        domains:
          - Sur_CONVECTIVE_T, Sur_COMBINED_T
        smoothing: 1
        hidden: false
        default: true
        locked: true

      hrFlux:
        name: Radiative flux
        safeName: Radiative_flux_[W/m2]
        units: "W/m^2"
        term:
          - '{ U_hr }'
        type: BOUNDARY_GLOBAL
        domains:
          - Sur_RADIATION_T, Sur_COMBINED_T
        smoothing: 1
        hidden: false
        default: true
        locked: true

      PhaseField:
        name: Phase Field
        safeName: Phase_Field
        symbol: \\phi
        units: "%"
        type: NODE_FIELD
        components: 1
        external:
          calculator: steel_phases
          mainField: true
        domains:
          - Vol_The
        smoothing: 0
        exportToVTK: false
        hidden: true
        default: true
        locked: false

      MartensiteField:
        name: Martensite Field
        safeName: Phase_Martensite_[%]
        symbol: \\phi
        units: "%"
        type: NODE_FIELD
        components: 1
        external:
          calculator: steel_phases
          mainField: false
        domains:
          - Vol_The
        smoothing: 0
        exportToVTK: false
        hidden: true
        default: true
        locked: false


      AusteniteField:
        name: Austenite Field
        safeName: Phase_Austenite_[%]
        symbol: \\phi
        units: "%"
        type: NODE_FIELD
        components: 1
        external:
          calculator: steel_phases
          mainField: false
        domains:
          - Vol_The
        smoothing: 0
        exportToVTK: false
        hidden: true
        default: true
        locked: false


      BainiteField:
        name: Bainite Field
        safeName: Phase_Bainite_and_Pearlite_[%]
        symbol: \\phi
        units: "%"
        type: NODE_FIELD
        components: 1
        external:
          calculator: steel_phases
          mainField: false
        domains:
          - Vol_The
        smoothing: 0
        exportToVTK: false
        hidden: true
        default: true
        locked: false

      MaxTemperatureField:
        name: Max Temperature Field
        safeName: MaxTemperature
        symbol: T
        units: "C"
        type: NODE_FIELD
        components: 1
        external:
          calculator: steel_hardness
          mainField: false
        domains:
          - Vol_The
        smoothing: 0
        exportToVTK: false
        hidden: true
        default: true
        locked: false


    # GetDP Electromagnetics general solver 2D
  getdpEMGeneral2D: &getdpEMGeneral2D
    key: getdpEMGeneral2D
    command: runGetdp
    DOF_variable: AZ

    constraints:
      - MagneticVectorPotential_2D
      - CurrentLoad_2D
      - VoltageLoad_2D
      - Lin2D
      - name: Voltage_2D
        limitedTo: circdom
      - name: Current_2D
        limitedTo: circdom
      - name: target_power
        limitedTo: circdom
        
    case_constants:
      - target_power

    networks:
      - name: ElectricalCircuit
        typeKey: circdom

    domain_groups:
      em_nc:
        non_conducting_domain: [this]
      em_cc:
        conducting_domain: [this]
      source_dom:
        source_domain: [this]
      #permag_dom:
      #  magnet_domain: [this]
      em_sibc:
        sibc_domain: [this]
      stranded_source_dom:
        stranded_source_domain: [this]
      circdom:
        circuit_domain: [this]

    bc_groups:
      infinity: Sur_INFINITY_B
      flux_parallel: Sur_FLUXPARALLEL_B
      flux_normal: Sur_FLUXNORMAL_B
      symm_axis: Sur_SYMMAXIS_B
      interface: Sur_INTERFACE_B
      sibc: Sur_SIBC_B

    flags:
      material:
        bhNLFlag:
          condition: BHModel
          isNLFlag: true
        # muCNLFlag: mu_C
        # muNLFlag: mu

    argumentPosition:
      Current_2D:
        time: -1
      Voltage_2D:
        time: -1
      frequency:
        time: -1
      BHModel:
        magIntensity: 1
      mu:
        temperature: 2
      sigma:
        temperature: 1
      target_power:
        time: -1


    postValues:
      muTest:
        name: muTest
        term:
          - '1/(nu_nu0[{d a},#1] * mu0)'
        type: RESIDUAL_FOR_ADAPTIVE
        domains:
          - non_conducting_domain, conducting_domain, source_domain, sibc_domain, stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: true
        default: true
      sigmaTest:
        name: sigmaTest
        term:
          - 'sigma[#1]'
          - '0'
        type: RESIDUAL_FOR_ADAPTIVE
        domains:
          - conducting_domain, source_domain, sibc_domain, stranded_source_domain
          - non_conducting_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: true
        default: true
      jheatTest:
        name: Joule_heat
        safeName: Joule_heat,_W/m3
        units: '\frac{W}{m^3}'
        term:
          - '0.5*sigma[#1]*SquNorm[Dt[{a}]+{ur}/GeomCoeff[]] '
          - '0.5*SquNorm[Nc[]*{istr}/area[]]/(FillFactor[]*sigma[#1]) '
          - '0'
        type: RESIDUAL_FOR_ADAPTIVE
        domains:
          - conducting_domain, source_domain
          - stranded_source_domain
          - non_conducting_domain, sibc_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: true
        default: false

      Bfield:
        name: Magnetic Flux Density
        safeName: Magnetic_Flux_Density_B,_[T]
        symbol: B
        units: T
        term:
          - Norm[ {d a} ]
        type: NODE_FIELD
        domains:
          - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: false
        default: true
        locked: true

      Bfield_re:
        name: Magnetic Flux Density
        safeName: Magnetic_Flux_Density_B_re,_[T]
        symbol: B_{re}
        units: T
        term:
          - Re[{d a}]
        type: NODE_FIELD
        components: 3
        domains:
          - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: false
        default: true

      Bfield_im:
        name: Magnetic Flux Density
        safeName: Magnetic_Flux_Density_B_im,_[T]
        symbol: B_{im}
        units: T
        term:
          - Im[{d a}]
        type: NODE_FIELD
        components: 3
        domains:
          - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: false
        default: true

      Jheat:
        name: Joule heat
        safeName: Joule_heat,_[W_m^-3]
        units: '\frac{W}{m^3}'
        term:
          - '0.5*Norm[sigma[#1]*(Dt[{a}]+{ur}/GeomCoeff[])*(Dt[{a}]+{ur}/GeomCoeff[])] '
          - '0.5*SquNorm[Nc[]*{istr}/area[]]/(FillFactor[]*sigma[#1]) '
        type: NODE_FIELD
        domains:
          - conducting_domain, source_domain
          - stranded_source_domain
        smoothing: 1
        exportToVTK: true
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true
        locked: true

      rSigma:
        name: rSigma
        term:
          - 'Abs[(Norm[sigma[#1] * Vector[1,1,1] - sigma[#2] * Vector[1,1,1]])/(Norm[sigma[#3] * Vector[1,1,1]])]'
        type: RESIDUAL
        valueRegister: 1
        domains:
          - conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}[1]]"
            2:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
            3:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: true
        default: true

      rSigmaMax:
        name: Electrical Conductivity
        term:
          - '#1'
        type: MAX_VAL
        valueRegister: 2
        domains:
          - conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: true
        default: true

      rMu:
        name: rMu
        term:
          - 'Abs[(Norm[ nu_nu0[{d a},#1] * Vector[1,1,1] - nu_nu0[{d a},#2] * Vector[1,1,1]])/( Norm[nu_nu0[{d a},#3] * Vector[1,1,1]])]'
        type: RESIDUAL
        valueRegister: 3
        domains:
          - conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}[1]]"
            2:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
            3:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: true
        default: true
      rMuMax:
        name: Magnetic Permeability
        term:
          - '#3'
        type: MAX_VAL
        valueRegister: 4
        domains:
          - conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: true
        default: true

      CurrDens:
        name: Current Density
        safeName: Current_Density_J,_[A_m^-2]
        symbol: J
        units: '\frac{A}{m^2}'
        term:
          - 'Norm[sigma[#1]*(Dt[{a}]+{ur}/GeomCoeff[])] '
          - 'Nc[]/area[]*Norm[{istr}] '
        type: NODE_FIELD
        domains:
          - conducting_domain, source_domain
          - stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true
        locked: true

      CurrDens_re:
        name: Current Density
        safeName: Current_Density_J_re,_[A_m^-2]
        symbol: J_{re}
        units: '\frac{A}{m^2}'
        term:
          - "-Re[sigma[#1]*(Dt[{a}]+{ur}/GeomCoeff[])]  "
          - "-Nc[]/area[]*Re [{istr}]"
        type: NODE_FIELD
        components: 3
        domains:
          - conducting_domain, source_domain
          - stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true

      CurrDens_im:
        name: Current Density
        safeName: Current_Density_J_im,_[A_m^-2]
        symbol: J_{im}
        units: '\frac{A}{m^2}'
        term:
          - "-Im[sigma[#1]*(Dt[{a}]+{ur}/GeomCoeff[])]"
          - "-Nc[]/area[]*Im [{istr}]"
        type: NODE_FIELD
        components: 3
        domains:
          - conducting_domain, source_domain
          - stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true

      aActivePower:
        name: Active Power
        safeName: Active_Power_[W]
        units: W
        term:
          - 'GeomCoeff[] * Norm[sigma[#1]*(Dt[{a}]+{ur}/GeomCoeff[])*(Dt[{a}]+{ur}/GeomCoeff[])]/(rmsCoeff[]^2) '
          - ' Fs[Sqrt[area[]*4/3.14]*Sqrt[3.14*Freq*sigma[#1]/(2*nu_nu0[{d a},#1])]] *GeomCoeff[] * SquNorm[{istr}/area[]] * Nc[]^(2*(1-a_litz[]))/(FillFactor[]*sigma[#1]*rmsCoeff[]^2) '
        type: INTEGRAL
        domains:
          - conducting_domain, source_domain
          - stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true
        locked: true
      # abSkinEffPower:
        # term:
          # - ' Fs[Sqrt[area[]*4/3.14]*Sqrt[3.14*Freq*sigma[]/(2*nu_nu0[])]] *GeomCoeff[] * SquNorm[{istr}/area[]] * Nc[]^(2*(1-a_litz[]))/(FillFactor[]*sigma[#1]*rmsCoeff[]^2) '
        # type: INTEGRAL
        # name: 'Skin Effect Power [W]'
        # domains:
          # - stranded_source_domain
        # smoothing: 1
        # args:
            # 1:
                # physics: physicsInductionHeating
                # string: "<T>[{T}]"

      # acProximityPower:
        # term:
          # - ' Gs[Sqrt[area[]*4/3.14]*Sqrt[3.14*Freq*sigma[]/(2*nu_nu0[])]] *GeomCoeff[]* SquNorm[{d a}*nu_nu0[]]*Nc[]/(FillFactor[]*sigma[#1]*rmsCoeff[]^2) '
        # type: INTEGRAL
        # name: 'Proximity Effect Power [W]'
        # domains:
          # - stranded_source_domain
        # smoothing: 1
        # args:
            # 1:
                # physics: physicsInductionHeating
                # string: "<T>[{T}]"

      # aeProximityPower:
        # term:
          # - ' Ds[0.003*Sqrt[3.14*Freq*  sigma[]/nu_nu0[]]] * GeomCoeff[] * SquNorm[{d a}*nu_nu0[]]/sigma[] '
        # type: INTEGRAL
        # name: 'Proximity Effect Power 2 [W]'
        # domains:
          # - stranded_source_domain
        # smoothing: 1
        # args:
            # 1:
                # physics: physicsInductionHeating
                # string: "<T>[{T}]"

      bApparentPower:
        name: Apparent Power
        safeName: Apparent_Power_[VA]
        units: VA
        term:
          - 'Abs[{U}*Conj[{I}]]/(rmsCoeff[]^2) '
          - 'Abs[{Ustr}*Conj[{Istr}]]/(Nc[]^a_litz[]*rmsCoeff[]^2) '
        type: GLOBAL
        domains:
          - source_domain
          - stranded_source_domain
        smoothing: 1
        hidden: false
        default: true
        locked: true

      cMagneticEnergy:
        name: Magnetic Energy
        safeName: Magnetic_Energy_[J]
        units: J
        term:
          - 'GeomCoeff[] * 1/2 *nu_nu0[{d a},#1]*{d a}*Conj[{d a}] / (rmsCoeff[]^2) '
        type: INTEGRAL
        domains:
          - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true

      ecVoltage:
        name: Voltage RMS
        safeName: Voltage.RMS_[V]
        units: V
        term:
          - ' Norm[{Uz}]/(Nc[]^a_litz[]*rmsCoeff[]) '
        type: GLOBAL
        domains:
          - circuit_domain
        smoothing: 1
        hidden: false
        default: true
        locked: true
      eaVoltage:
        name: Voltage Real
        safeName: Voltage.Real_[V]
        units: V
        term:
          - ' Re[{Uz}]/(Nc[]^a_litz[]) '
        type: GLOBAL
        domains:
          - circuit_domain
        smoothing: 1
        hidden: false
        default: true

      ebVoltage:
        name: Voltage Imaginary
        safeName: Voltage.Imaginary_[V]
        units: V
        term:
          - ' Im[{Uz}]/(Nc[]^a_litz[]) '
        type: GLOBAL
        domains:
          - circuit_domain
        smoothing: 1
        hidden: false
        default: true

      fResistance:
        name: Resistance
        safeName: Resistance_[Ohm]
        units: Ohm
        term:
          - ' Re[{Uz}*{Iz_post}^-1] '
        type: GLOBAL
        domains:
          - circuit_domain
        smoothing: 1
        hidden: false
        default: true

      fInductance:
        name: Inductance
        safeName: Inductance_[uH]
        units: uH
        term:
          - ' 1e6*Im[{Uz}*{Iz_post}^-1]/(2*3.14*Freq) '
        type: GLOBAL
        domains:
          - circuit_domain
        smoothing: 1
        hidden: false
        default: true
        locked: true
      ccInducedCurrent:
        name: Induced Current.RMS
        safeName: Induced_Current.RMS_[A]
        units: A
        term:
          - ' Norm[{I}]/rmsCoeff[] '
        type: GLOBAL
        domains:
          - conducting_domain
        smoothing: 1
        hidden: false
        default: true
      caInducedCurrentReal:
        name: Induced Current.Real
        safeName: Induced_Current.Real_[A]
        units: A
        term:
          - ' Re[{I}] '
        type: GLOBAL
        domains:
          - conducting_domain
        smoothing: 1
        hidden: false
        default: true
      cbInducedCurrentImag:
        name: Induced Current.Imaginary
        safeName: Induced_Current.Imaginary_[A]
        units: A
        term:
          - ' Im[{I}] '
        type: GLOBAL
        domains:
          - conducting_domain
        smoothing: 1
        hidden: false
        default: true

      SurfCurrDens:
        name: Surface Current Density
        safeName: Surface_Current_Density_J,_[A_m^-1]
        description: "For Surface impedance domains only."
        symbol: J
        units: '\frac{A}{m}'
        term:
          - "-1/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[#1])])*Norm[(Dt[{a}]+{ur})]  "
        type: BOUNDARY_NODE_FIELD
        components: 1
        domains:
          - Sur_SIBC_B
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true
      SurfCurrDens_re:
        name: Surface Current Density
        safeName: Surface_Current_Density_J_re,_[A_m^-1]
        description: "For Surface impedance domains only."
        symbol: J_{re}
        units: '\frac{A}{m}'
        term:
          - "-1/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[#1])])*Re[(Dt[{a}]+{ur})]  "
        type: BOUNDARY_NODE_FIELD
        components: 3
        domains:
          - Sur_SIBC_B
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true
      SurfCurrDens_im:
        name: Surface Current Density
        safeName: Surface_Current_Density_J_im,_[A_m^-1]
        description: "For Surface impedance domains only."
        symbol: J_{im}
        units: '\frac{A}{m}'
        term:
          - "-1/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[#1])])*Im[(Dt[{a}]+{ur})]"
        type: BOUNDARY_NODE_FIELD
        components: 3
        domains:
          - Sur_SIBC_B
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true
      SurfJheat:
        name: Surface_Joule_heat
        safeName: Surface_Joule_heat,_[W_m^-2]
        description: "For Surface impedance domains only."
        units: '\frac{W}{m^2}'
        term:
          - '0.5 * Re[Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[#1])]] * SquNorm[1/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[#1])]) *  (Dt[{a}]+{ur})] '
        type: BOUNDARY_NODE_FIELD
        domains:
        - Sur_SIBC_B
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true
      JheatSurfIntegral:
        name: Surface Joule Heat
        safeName: Surface_Joule_Heat_[W]
        description: "For Surface impedance domains only."
        units: W
        term:
          - '0.5 * GeomCoeff[] * Re[Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[#1])]] * SquNorm[1/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[#1])]) *  (Dt[{a}]+{ur})]'
        type: BOUNDARY_INTEGRAL
        domains:
          - Sur_SIBC_B
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true

      dcSourceCurrent:
        name: Source Current.RMS
        safeName: Source_Current.RMS_[A]
        units: A
        term:
          - ' Norm[{Iz_post}]/Sqrt[2]'
        type: GLOBAL
        domains:
          - circuit_domain
        smoothing: 1
        hidden: false
        default: true
        locked: true
      daSourceCurrentReal:
        name: Source Current.Real
        safeName: Source_Current.Real_[A]
        units: A
        term:
          - ' Re[{Iz_post}] '
        type: GLOBAL
        domains:
          - circuit_domain
        smoothing: 1
        hidden: false
        default: true
      dbSourceCurrentImag:
        name: Source Current.Imaginary
        safeName: Source_Current.Imaginary_[A]
        units: A
        term:
          - ' Im[{Iz_post}] '
        type: GLOBAL
        domains:
          - circuit_domain
        smoothing: 1
        hidden: false
        default: true

      mu:
        name: Relative Permeability
        safeName: Relative_Permeability_mu
        symbol: '\mu'
        units: '-'
        term:
          - '1/(Norm[nu_nu0[{d a},#1]*Vector[1,1,1]/Norm[Vector[1,1,1]]* mu0])'
        type: NODE_FIELD
        domains:
          - non_conducting_domain, conducting_domain, source_domain, sibc_domain, stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: false

      Avecpot:
        name: Magnetic vector potential
        safeName: Magnetic_Vector_Potential_A,_[T/m]
        symbol: A
        units: '\frac{T}{m}'
        term:
          - Norm[ {a} ]
        type: NODE_FIELD
        domains:
          - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: false
        default: false

      Avecpot_re:
        name: Magnetic vector potential
        safeName: Magnetic_Vector_Potential_A_re,_[T/m]
        symbol: A_{re}
        units: '\frac{T}{m}'
        term:
          - Re[ {a} ]
        type: NODE_FIELD
        domains:
          - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: false
        default: false

      Avecpot_im:
        name: Magnetic vector potential
        safeName: Magnetic_Vector_Potential_A_im,_[T/m]
        symbol: A_{im}
        units: '\frac{T}{m}'
        term:
          - Im[ {a} ]
        type: NODE_FIELD
        domains:
          - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: false
        default: false

      TotalPower:
        name: Total Active Power
        safeName: Total_Active_Power_[W]
        units: W
        term:
          - 'GeomCoeff[] * Norm[sigma[#1]*(Dt[{a}]+{ur}/GeomCoeff[])*(Dt[{a}]+{ur}/GeomCoeff[])]/(rmsCoeff[]^2) '
          - ' Fs[Sqrt[area[]*4/3.14]*Sqrt[3.14*Freq*sigma[#1]/(2*nu_nu0[{d a},#1])]] *GeomCoeff[] * SquNorm[{istr}/area[]] * Nc[]^(2*(1-a_litz[]))/(FillFactor[]*sigma[#1]*rmsCoeff[]^2) '
        type: TOTAL_VALUE
        domains:
          - conducting_domain, source_domain
          - stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true
        
      ScalingPower:
        name: Scaling Active Power
        safeName: Scaling_Active_Power_[W]
        units: W
        term:
          - ' GeomCoeff[] * Norm[sigma[#1]*(Dt[{a}]+{ur}/GeomCoeff[])*(Dt[{a}]+{ur}/GeomCoeff[])]/(rmsCoeff[]^2) / target_power[]'
          - ' Fs[Sqrt[area[]*4/3.14]*Sqrt[3.14*Freq*sigma[#1]/(2*nu_nu0[{d a},#1])]] *GeomCoeff[] * SquNorm[{istr}/area[]] * Nc[]^(2*(1-a_litz[]))/(FillFactor[]*sigma[#1]*rmsCoeff[]^2) / target_power[] '
        type: SCALING_VALUE
        domains:
          - conducting_domain, source_domain
          - stranded_source_domain
        scalingConstraints:
          - Current_2D
        smoothing: 1
        valueRegister: 11
        enableIfDefined: 'target_power'
        equationForScaling: '1/Sqrt[#11]'
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: true
        default: true        
        
      TotalMagneticEnergy:
        name: Total Magnetic Energy
        safeName: Total_Magnetic_Energy_[J]
        units: J
        term:
          - 'GeomCoeff[] * 1/2 *nu_nu0[{d a},#1]*{d a}*Conj[{d a}] / (rmsCoeff[]^2) '
        type: TOTAL_VALUE
        domains:
          - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true

      LorentzForce:
        name: Lorentz Force Density
        safeName: Lorentz_Force_Density_f,_[N_m^-3]
        symbol: f
        units: '\frac{N}{m^3}'
        term:
          - "(1/rmsCoeff[])^2*Re[{d a}/\\Conj[ sigma[#1]*(Dt[{a}]+{ur}/GeomCoeff[]) ]]"
          - '0'
        type: NODE_FIELD
        components: 3
        domains:
          - conducting_domain, source_domain
          - non_conducting_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: false

      xForceTM:
        name: Magnetic Force X
        safeName: Magnetic_Force_X_[N]
        units: N
        term:
          # - ' (GeomCoeff[] == 2*3.14 ? 0 : 1) * CompX[ - nu_nu0[{d a},#1] * GeomCoeff[] /(rmsCoeff[]^2) * (SquDyadicProduct[{d a}] - SquNorm[{d a}] * TensorDiag[0.5, 0.5, 0.5])* {d ln} ]'
          - ' (GeomCoeff[] == 2*3.14 ? 0 : 1) * CompX[ - nu_nu0[{d a},#1] * GeomCoeff[] /(rmsCoeff[]^2) * (TensorV[CompX[{d a}]*Conj[{d a}], CompY[{d a}]*Conj[{d a}], CompZ[{d a}]*Conj[{d a}]] - {d a}*Conj[{d a}] * TensorDiag[0.5, 0.5, 0.5]) *{d ln} ]'
        type: INTEGRAL
        domains:
          - non_conducting_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: false

      yForceTM:
        name: Magnetic Force Y
        safeName: Magnetic_Force_Y_[N]
        units: N
        term:
          # - 'CompY[ - nu_nu0[{d a},#1] * GeomCoeff[] /(rmsCoeff[]^2) * (SquDyadicProduct[{d a}] - SquNorm[{d a}] * TensorDiag[0.5, 0.5, 0.5]) *{d ln} ]'
          - ' CompY[ - nu_nu0[{d a},#1] * GeomCoeff[] /(rmsCoeff[]^2) * (TensorV[CompX[{d a}]*Conj[{d a}], CompY[{d a}]*Conj[{d a}], CompZ[{d a}]*Conj[{d a}]] - {d a}*Conj[{d a}] * TensorDiag[0.5, 0.5, 0.5]) *{d ln} ]'
        type: INTEGRAL
        domains:
          - non_conducting_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: false

      fLorentzForceX:
        name: Integral Lorentz Force X
        safeName: Integral_Lorentz_Force_X_[N]
        units: N
        term:
          - "(GeomCoeff[] == 2*3.14 ? 0 : 1) * CompX[(1/rmsCoeff[])^2*Re[{d a}/\\Conj[ sigma[#1]*(Dt[{a}]+{ur}/GeomCoeff[]) ]]]"
        type: INTEGRAL
        domains:
          - conducting_domain, source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: false

      fLorentzForceY:
        name: Integral Lorentz Force Y
        safeName: Integral_Lorentz_Force_Y_[N]
        units: N
        term:
          - "GeomCoeff[] * CompY[(1/rmsCoeff[])^2*Re[{d a}/\\Conj[ sigma[#1]*(Dt[{a}]+{ur}/GeomCoeff[]) ]]]"
        type: INTEGRAL
        domains:
          - conducting_domain, source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: false



   # GetDP Electromagnetics general solver 3D
  getdpEMGeneral3D: &getdpEMGeneral3D
    key: getdpEMGeneral3D
    command: runGetdp
    DOF_variable: AZ

    constraints:
      - name: Gauge
        region: Region[{non_conducting_domain, conducting_domain, source_domain, stranded_source_domain}]
      - I_3D
      - V_3D
      - Lin3D
      - MVP_3D
      - ElPot
      - target_power
    case_constants:
      - target_power
    domain_groups:
      em_nc:
        non_conducting_domain: [this]
      em_cc:
        conducting_domain: [this]
        ElecRes_OneSideVol:
            oneSideOf: [resistance_electric]
      source_dom:
        source_domain: [this]
        terms: [current, voltage, ground, power]
      #permag_dom:
      #  magnet_domain: [this]
      em_sibc:
        sibc_domain: [this]
      stranded_source_dom:
        stranded_source_domain: [this]
        terms_str: [current_stranded, ground_stranded]


    bc_groups:
      infinity: Sur_INFINITY_B
      flux_parallel_cond: Sur_PARALLEL_cond_B
      flux_parallel_ncond: Sur_PARALLEL_ncond_B
      flux_normal: Sur_NORMAL_B
      interface: Sur_INTERFACE_B
      voltage: Sur_VOLTAGE_B
      current: Sur_CURRENT_B
      ground: Sur_GROUND_B
      power: Sur_POWER_B
      sibc: Sur_SIBC_B
      current_stranded: SurStr_CURRENT_B
      ground_stranded: SurStr_GROUND_B
      voltage_CH: Sur_VOLTAGE_B_CH
      current_CH: Sur_CURRENT_B_CH
      ground_CH: Sur_GROUND_B_CH
      power_CH: Sur_POWER_B_CH
      current_stranded_CH: SurStr_CURRENT_B_CH
      ground_stranded_CH: SurStr_GROUND_B_CH
      resistance_electric: Sur_RESISTANCE_B

    flags:
      material:
        bhNLFlag:
          condition: BHModel
          isNLFlag: true
        # muCNLFlag: mu_C
        # muNLFlag: mu

    needs_cohomology:
      - current
      - current_stranded
      - voltage
      - power

    argumentPosition:
      I_3D:
        time: -1
      V_3D:
        time: -1
      I_str:
        time: 1
      frequency:
        time: -1
      BHModel:
        magIntensity: 1
      mu:
        temperature: 2
      sigma:
        temperature: 1
      target_power:
        time: -1

    postValues:
      muTest:
        name: muTest
        term:
          - '1/(nu_nu0[{d a},#1] * mu0)'
        type: RESIDUAL_FOR_ADAPTIVE
        domains:
          - non_conducting_domain, conducting_domain, source_domain, sibc_domain, stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: true
        default: true
      sigmaTest:
        name: sigmaTest
        term:
          - 'sigma[#1]'
          - '0'
        type: RESIDUAL_FOR_ADAPTIVE
        domains:
          - conducting_domain, source_domain, sibc_domain, stranded_source_domain
          - non_conducting_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: true
        default: true

      Bfield:
        name: Magnetic Flux Density
        safeName: Magnetic_Flux_Density_B,_[T]
        symbol: B
        units: T
        term:
        - Norm[ {d a} ]
        type: NODE_FIELD
        domains:
        - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: false
        default: true
        locked: true

      Bfield_re:
        name: Magnetic Flux Density
        safeName: Magnetic_Flux_Density_B_re,_[T]
        symbol: B_{re}
        units: T
        term:
        - Re[{d a}]
        type: NODE_FIELD
        components: 3
        domains:
        - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: false
        default: true
      Bfield_im:
        name: Magnetic Flux Density
        safeName: Magnetic_Flux_Density_B_im,_[T]
        symbol: B_{im}
        units: T
        term:
        - Im[{d a}]
        type: NODE_FIELD
        components: 3
        domains:
        - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: false
        default: true

      CurrDens:
        name: Current Density
        safeName: Current_Density_J,_[A_m^-2]
        symbol: J
        units: '\frac{A}{m^2}'
        term:
        - 'Norm[sigma[#1]*(Dt[{a}]+{e})] '
        - '0'
        - "FillFactor[]/Fs[Sqrt[cross_section_area[]*4/3.14]*Sqrt[3.14*Freq*sigma[#1]/(2*nu_nu0[{d a}, #1])]]/cross_section_area[]/(Norm[{e0}])*Norm[{e}]"
        type: NODE_FIELD
        domains:
        - conducting_domain, source_domain
        - non_conducting_domain
        - stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true
        locked: true

      CurrDens_re:
        name: Current Density
        safeName: Current_Density_J_re,_[A_m^-2]
        symbol: J_{re}
        units: '\frac{A}{m^2}'
        term:
        - "-Re[sigma[#1]*(Dt[{a}]+{e})] "
        - '0'
        # - "-FillFactor[] * I_str[]/cross_section_area[]/(Norm[{e0}])*Re[Dt[{a}]+{e}]"
        - "-FillFactor[]/Fs[Sqrt[cross_section_area[]*4/3.14]*Sqrt[3.14*Freq*sigma[#1]/(2*nu_nu0[{d a}, #1])]]/cross_section_area[]/(Norm[{e0}])*Re[{e}]"
        type: NODE_FIELD
        components: 3
        domains:
        - conducting_domain, source_domain
        - non_conducting_domain
        - stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true

      CurrDens_im:
        name: Current Density
        safeName: Current_Density_J_im,_[A_m^-2]
        symbol: J_{im}
        units: '\frac{A}{m^2}'
        term:
        - "-Im[sigma[#1]*(Dt[{a}]+{e})]"
        - '0'
        # - "-FillFactor[] *I_str[]/cross_section_area[]/(Norm[{e0}])*Im[Dt[{a}]+{e}]"
        - "-FillFactor[]/Fs[Sqrt[cross_section_area[]*4/3.14]*Sqrt[3.14*Freq*sigma[#1]/(2*nu_nu0[{d a}, #1])]]/cross_section_area[]/(Norm[{e0}])*Im[{e}]"
        type: NODE_FIELD
        components: 3
        domains:
        - conducting_domain, source_domain
        - non_conducting_domain
        - stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true

      volt_re:
        term:
        - " Re[ {dInv e} ] "
        - " 0 "
        - " Re[ {dInv e} ] "
        name: Electric_scalar_potential_V_re,_[V]
        domains:
        - conducting_domain, source_domain
        - non_conducting_domain
        - stranded_source_domain
        smoothing: 1
        hidden: false
        default: false

      volt_im:
        term:
        - " Im[ {dInv e} ] "
        - " 0 "
        - " Im[ {dInv e} ] "
        name: Electric_scalar_potential_V_im,_[V]
        domains:
        - conducting_domain, source_domain
        - non_conducting_domain
        - stranded_source_domain
        smoothing: 1
        hidden: false
        default: false

      volt:
        term:
        - " Sqrt[ Re[{dInv e}]*Re[{dInv e}] + Im[{dInv e}]*Im[{dInv e}] ] "
        - " 0 "
        - " Sqrt[ Re[{dInv e}]*Re[{dInv e}] + Im[{dInv e}]*Im[{dInv e}] ] "
        name: Electric_scalar_potential_V,_[V]
        domains:
        - conducting_domain, source_domain
        - non_conducting_domain
        - stranded_source_domain
        smoothing: 1
        hidden: false
        default: false

      Jheat:
        name: Joule_heat
        safeName: Joule_heat,_[W_m^-3]
        units: '\frac{W}{m^3}'
        term:
        - '0.5*Norm[sigma[#1]*(Dt[{a}]+{e})*(Dt[{a}]+{e})] '
        - '0'
        - '0.5*FillFactor[]/Fs[Sqrt[cross_section_area[]*4/3.14]*Sqrt[3.14*Freq*sigma[#1]/(2*nu_nu0[{d a}, #1])]]*SquNorm[1.0/cross_section_area[]/(Norm[{e0}])*({e})]/sigma[#2] '
        type: NODE_FIELD
        domains:
        - conducting_domain, source_domain
        - non_conducting_domain
        - stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
            2:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true
        locked: true

      rSigma:
        name: rSigma
        term:
          - 'Abs[(Norm[sigma[#1] * Vector[1,1,1] - sigma[#2] * Vector[1,1,1]])/(Norm[sigma[#3] * Vector[1,1,1]])]'
        type: RESIDUAL
        valueRegister: 1
        domains:
          - conducting_domain, source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}[1]]"
            2:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
            3:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: true
        default: true
      rSigmaMax:
        name: Electrical Conductivity
        term:
          - '#1'
        type: MAX_VAL
        valueRegister: 2
        domains:
          - conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: true
        default: true
      rMu:
        name: rMu
        term:
          - 'Abs[(Norm[ nu_nu0[{d a},#1] * Vector[1,1,1] - nu_nu0[{d a},#2] * Vector[1,1,1]])/( Norm[nu_nu0[{d a},#3] * Vector[1,1,1]])]'
        type: RESIDUAL
        valueRegister: 3
        domains:
          - conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}[1]]"
            2:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
            3:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: true
        default: true
      rMuMax:
        name: Magnetic Permeability
        term:
          - '#3'
        type: MAX_VAL
        valueRegister: 4
        domains:
          - conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: true
        default: true

      aActivePower:
        name: Active Power
        safeName: Active_Power_[W]
        units: W
        term:
          - '0.5*Norm[sigma[#1]*(Dt[{a}]+{e})*(Dt[{a}]+{e})]  * symmFactor[]'
          - '0.5*FillFactor[]/Fs[Sqrt[cross_section_area[]*4/3.14]*Sqrt[3.14*Freq*sigma[#1]/(2*nu_nu0[{d a}, #1])]]*SquNorm[1.0/cross_section_area[]/(Norm[{e0}])*({e})]/sigma[#2] * symmFactor[] '
        type: INTEGRAL
        domains:
          - conducting_domain, source_domain
          - stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
            2:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true
        locked: true
      bApparentPower:
        name: Apparent Power
        safeName: Apparent_Power_[VA]
        units: VA
        term:
          - 'Abs[{U}*Conj[{I_post}]]/(rmsCoeff[]^2)  * symmFactor[]'
          - 'Abs[({Ustr} + {Ustr_ind})*Conj[I_str[$Time]]]/(rmsCoeff[]^2)  * symmFactor[]'
        type: BOUNDARY_GLOBAL
        domains:
          - Sur_CURRENT_B_CH, Sur_VOLTAGE_B_CH, Sur_POWER_B_CH
          - SurStr_CURRENT_B_CH
        smoothing: 1
        hidden: false
        default: true
      ecVoltage:
        name: Voltage RMS
        safeName: Voltage.RMS_[V]
        units: V
        term:
          - ' Norm[{U}]/rmsCoeff[] * symmFactor[]'
          - ' Norm[{Ustr} + {Ustr_ind}]/rmsCoeff[] * symmFactor[]'
        type: BOUNDARY_GLOBAL
        domains:
          - Sur_CURRENT_B_CH, Sur_VOLTAGE_B_CH, Sur_POWER_B_CH
          - SurStr_CURRENT_B_CH
        smoothing: 1
        hidden: false
        default: true
        locked: true
      cMagneticEnergy:
        name: Magnetic Energy
        safeName: Magnetic_Energy_[J]
        units: J
        term:
          - '1/2 *nu_nu0[{d a},#1]*{d a}*Conj[{d a}] / (rmsCoeff[]^2)  * symmFactor[]'
        type: INTEGRAL
        domains:
          - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true

      eaVoltage:
        name: Voltage Real
        safeName: Voltage.Real_[V]
        units: V
        term:
          - ' Re[{U}] * symmFactor[]'
          - ' Re[{Ustr} + {Ustr_ind}] * symmFactor[]'
        type: BOUNDARY_GLOBAL
        domains:
          - Sur_CURRENT_B_CH, Sur_VOLTAGE_B_CH, Sur_POWER_B_CH
          - SurStr_CURRENT_B_CH
        smoothing: 1
        hidden: false
        default: true

      ebVoltage:
        name: Voltage Imaginary
        safeName: Voltage.Imaginary_[V]
        units: V
        term:
          - ' Im[{U}] * symmFactor[]'
          - ' Im[{Ustr} + {Ustr_ind}] * symmFactor[]'
        type: BOUNDARY_GLOBAL
        domains:
          - Sur_CURRENT_B_CH, Sur_VOLTAGE_B_CH, Sur_POWER_B_CH
          - SurStr_CURRENT_B_CH
        smoothing: 1
        hidden: false
        default: true

      dcSourceCurrent:
        name: Source Current.RMS
        safeName: Source_Current.RMS_[A]
        units: A
        term:
          - ' Norm[{I_post}]/rmsCoeff[]'
          - ' Norm[I_str[$Time]]/rmsCoeff[]'
        type: BOUNDARY_GLOBAL
        domains:
          - Sur_CURRENT_B_CH, Sur_VOLTAGE_B_CH, Sur_POWER_B_CH
          - SurStr_CURRENT_B_CH
        smoothing: 1
        hidden: false
        default: true
        locked: true
      daSourceCurrentReal:
        name: Source Current.Real
        safeName: Source_Current.Real_[A]
        units: A
        term:
          - ' Re[{I_post}] '
          - ' Re[I_str[$Time]] '
        type: BOUNDARY_GLOBAL
        domains:
          - Sur_CURRENT_B_CH, Sur_VOLTAGE_B_CH, Sur_POWER_B_CH
          - SurStr_CURRENT_B_CH
        smoothing: 1
        hidden: false
        default: true

      dbSourceCurrentImag:
        name: Source Current.Imaginary
        safeName: Source_Current.Imaginary_[A]
        units: A
        term:
          - ' Im[{I_post}] '
          - ' Im[I_str[$Time]] '
        type: BOUNDARY_GLOBAL
        domains:
          - Sur_CURRENT_B_CH, Sur_VOLTAGE_B_CH, Sur_POWER_B_CH
          - SurStr_CURRENT_B_CH
        smoothing: 1
        hidden: false
        default: true

      fResistance:
        name: Resistance
        safeName: Resistance_[Ohm]
        units: Ohm
        term:
          - ' Re[{U}*{I_post}^-1] * symmFactor[]'
          - ' Re[({Ustr} + {Ustr_ind})*I_str[$Time]^-1] * symmFactor[]'
        type: BOUNDARY_GLOBAL
        domains:
          - Sur_CURRENT_B_CH, Sur_VOLTAGE_B_CH, Sur_POWER_B_CH
          - SurStr_CURRENT_B_CH
        smoothing: 1
        hidden: false
        default: true

      fInductance:
        name: Inductance
        safeName: Inductance_[uH]
        units: uH
        term:
          - ' 1e6*Im[{U}*{I_post}^-1]/(2*3.14*Freq) * symmFactor[]'
          - ' 1e6*Im[({Ustr} + {Ustr_ind})*I_str[$Time]^-1]/(2*3.14*Freq) * symmFactor[]'
        type: BOUNDARY_GLOBAL
        domains:
          - Sur_CURRENT_B_CH, Sur_VOLTAGE_B_CH, Sur_POWER_B_CH
          - SurStr_CURRENT_B_CH
        smoothing: 1
        hidden: false
        default: true
        locked: true
      SurfCurrDens:
        name: Surface Current Density
        safeName: Surface_Current_Density_J,_[A_m^-1]
        description: "For Surface impedance domains only."
        symbol: J
        units: '\frac{A}{m}'
        term:
          - "-1/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[#1])])*Norm[(Dt[{a}]+{e})]  "
        type: BOUNDARY_NODE_FIELD
        components: 1
        domains:
          - Sur_SIBC_B
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true

      SurfCurrDens_re:
        name: Surface Current Density
        safeName: Surface_Current_Density_J_re,_[A_m^-1]
        description: "For Surface impedance domains only."
        symbol: J_{re}
        units: '\frac{A}{m}'
        term:
          - "-1/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[#1])])*Re[(Dt[{a}]+{e})]  "
        type: BOUNDARY_NODE_FIELD
        components: 3
        domains:
          - Sur_SIBC_B
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true

      SurfCurrDens_im:
        name: Surface Current Density
        safeName: Surface_Current_Density_J_im,_[A_m^-1]
        description: "For Surface impedance domains only."
        symbol: J_{im}
        units: '\frac{A}{m}'
        term:
          - "-1/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[#1])])*Im[(Dt[{a}]+{e})]  "
        type: BOUNDARY_NODE_FIELD
        components: 3
        domains:
          - Sur_SIBC_B
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true

      SurfJheat:
        name: Surface_Joule_heat
        safeName: Surface_Joule_heat,_[W_m^-2]
        description: "For Surface impedance domains only."
        units: '\frac{W}{m^2}'
        term:
        - '0.5 * Re[Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[#1])]] * SquNorm[1/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[#1])]) *  (Dt[{a}]+{e})] '
        type: BOUNDARY_NODE_FIELD
        domains:
        - Sur_SIBC_B
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true

      JheatSurfIntegral:
        name: Surface Joule Heat
        safeName: Surface_Joule_Heat_[W]
        description: "For Surface impedance domains only."
        units: W
        term:
          - '0.5 * Re[Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[#1])]] * SquNorm[1/(Complex[1,1]* Sqrt[3.14*Freq/(nu_nu0[]*sigma[#1])]) *  (Dt[{a}]+{e})]  * symmFactor[]'
        type: BOUNDARY_INTEGRAL
        domains:
          - Sur_SIBC_B
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true

      mu:
        name: Relative Permeability
        safeName: Relative_Permeability_mu
        symbol: '\mu'
        units: '-'
        term:
          - '1/(nu_nu0[{d a},#1] * mu0)'
        type: NODE_FIELD
        domains:
          - non_conducting_domain, conducting_domain, source_domain, sibc_domain, stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: false

      Avecpot:
        name: Magnetic vector potential
        safeName: Magnetic_Vector_Potential_A,_[T/m]
        symbol: A
        units: '\frac{T}{m}'
        term:
          - Norm[ {a} ]
        type: NODE_FIELD
        domains:
          - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: false
        default: false

      Avecpot_re:
        name: Magnetic vector potential
        safeName: Magnetic_Vector_Potential_A_re,_[T/m]
        symbol: A_{re}
        units: '\frac{T}{m}'
        term:
          - Re[ {a} ]
        type: NODE_FIELD
        domains:
          - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: false
        default: false

      Avecpot_im:
        name: Magnetic vector potential
        safeName: Magnetic_Vector_Potential_A_im,_[T/m]
        symbol: A_{im}
        units: '\frac{T}{m}'
        term:
          - Im[ {a} ]
        type: NODE_FIELD
        domains:
          - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        hidden: false
        default: false

      TotalPower:
        name: Total Active Power
        safeName: Total_Active_Power_[W]
        units: W
        term:
          - '0.5*Norm[sigma[#1]*(Dt[{a}]+{e})*(Dt[{a}]+{e})]  * symmFactor[]'
          - '0.5*FillFactor[]/Fs[Sqrt[cross_section_area[]*4/3.14]*Sqrt[3.14*Freq*sigma[#1]/(2*nu_nu0[{d a}, #1])]]*SquNorm[1.0/cross_section_area[]/(Norm[{e0}])*({e})]/sigma[#2] * symmFactor[] '
        type: TOTAL_VALUE
        domains:
          - conducting_domain, source_domain
          - stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
            2:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true
      ScalingPower:
        name: Scaling Active Power
        safeName: Scaling_Active_Power_[W]
        units: W
        term:
          - ' 0.5*Norm[sigma[#1]*(Dt[{a}]+{e})*(Dt[{a}]+{e})]  * symmFactor[] / target_power[]'
          - ' 0.5*FillFactor[]/Fs[Sqrt[cross_section_area[]*4/3.14]*Sqrt[3.14*Freq*sigma[#1]/(2*nu_nu0[{d a}, #1])]]*SquNorm[1.0/cross_section_area[]/(Norm[{e0}])*({e})]/sigma[#2] * symmFactor[] / target_power[] '
        type: SCALING_VALUE
        domains:
          - conducting_domain, source_domain
          - stranded_source_domain
        scalingConstraints:
          - I_3D
        smoothing: 1
        valueRegister: 11
        enableIfDefined: 'target_power'
        equationForScaling: '1/Sqrt[#11]'
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
            2:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: true
        default: true                
      TotalMagneticEnergy:
        name: Total Magnetic Energy
        safeName: Total_Magnetic_Energy_[J]
        units: J
        term:
          - '1/2 *nu_nu0[{d a},#1]*{d a}*Conj[{d a}] / (rmsCoeff[]^2)  * symmFactor[]'
        type: TOTAL_VALUE
        domains:
          - non_conducting_domain, conducting_domain, source_domain, stranded_source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: true

      # xForce:
        # term:
          # - 'CompX[ nu_nu0[{d a},#1] * (SquDyadicProduct[{d a}] - SquNorm[{d a}] * TensorDiag[0.5, 0.5, 0.5])*Normal[] ]'
        # type: BOUNDARY_INTEGRAL
        # name: 'Magnetic_Force_X'
        # domains:
          # - Sur_INTERFACE_B
        # smoothing: 1
        # args:
            # 1:
                # physics: physicsInductionHeating
                # string: "<T>[{T}]"

      # yForce:
        # term:
          # - 'CompY[ nu_nu0[{d a},#1] * (SquDyadicProduct[{d a}] - SquNorm[{d a}] * TensorDiag[0.5, 0.5, 0.5])*Normal[] ]'
        # type: BOUNDARY_INTEGRAL
        # name: 'Magnetic_Force_Y'
        # domains:
          # - Sur_INTERFACE_B
        # smoothing: 1
        # args:
            # 1:
                # physics: physicsInductionHeating
                # string: "<T>[{T}]"

      # zForce:
        # term:
          # - 'CompZ[ nu_nu0[{d a},#1] * (SquDyadicProduct[{d a}] - SquNorm[{d a}] * TensorDiag[0.5, 0.5, 0.5])*Normal[] ]'
        # type: BOUNDARY_INTEGRAL
        # name: 'Magnetic_Force_Z'
        # domains:
          # - Sur_INTERFACE_B
        # smoothing: 1
        # args:
            # 1:
                # physics: physicsInductionHeating
                # string: "<T>[{T}]"

      xForceTM:
        term:
          # - 'CompX[ - nu_nu0[{d a},#1] * GeomCoeff[] /(rmsCoeff[]^2) * (SquDyadicProduct[{d a}] - SquNorm[{d a}] * TensorDiag[0.5, 0.5, 0.5])* {d ln} ]'
          - ' CompX[ - nu_nu0[{d a},#1] * GeomCoeff[] /(rmsCoeff[]^2) * (TensorV[CompX[{d a}]*Conj[{d a}], CompY[{d a}]*Conj[{d a}], CompZ[{d a}]*Conj[{d a}]] - {d a}*Conj[{d a}] * TensorDiag[0.5, 0.5, 0.5]) *{d ln} ]'
        type: INTEGRAL
        name: 'Magnetic Force X'
        safeName: 'Magnetic_Force_X_[N]'
        domains:
          - non_conducting_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: false

      yForceTM:
        term:
          # - 'CompY[ - nu_nu0[{d a},#1] * GeomCoeff[] /(rmsCoeff[]^2) * (SquDyadicProduct[{d a}] - SquNorm[{d a}] * TensorDiag[0.5, 0.5, 0.5]) *{d ln} ]'
          - ' CompY[ - nu_nu0[{d a},#1] * GeomCoeff[] /(rmsCoeff[]^2) * (TensorV[CompX[{d a}]*Conj[{d a}], CompY[{d a}]*Conj[{d a}], CompZ[{d a}]*Conj[{d a}]] - {d a}*Conj[{d a}] * TensorDiag[0.5, 0.5, 0.5]) *{d ln} ]'
        type: INTEGRAL
        name: 'Magnetic Force Y'
        safeName: 'Magnetic_Force_Y_[N]'
        domains:
          - non_conducting_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: false

      zForceTM:
        term:
          # - 'CompZ[ - nu_nu0[{d a},#1] * GeomCoeff[] /(rmsCoeff[]^2) * (SquDyadicProduct[{d a}] - SquNorm[{d a}] * TensorDiag[0.5, 0.5, 0.5]) *{d ln} ]'
          - ' CompZ[ - nu_nu0[{d a},#1] * GeomCoeff[] /(rmsCoeff[]^2) * (TensorV[CompX[{d a}]*Conj[{d a}], CompY[{d a}]*Conj[{d a}], CompZ[{d a}]*Conj[{d a}]] - {d a}*Conj[{d a}] * TensorDiag[0.5, 0.5, 0.5]) *{d ln} ]'
        type: INTEGRAL
        name: 'Magnetic Force Z'
        safeName: 'Magnetic Force_Z_[N]'
        domains:
          - non_conducting_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: false

      LorentzForce:
        term:
          - "(1/rmsCoeff[])^2*Re[{d a}/\\Conj[ sigma[#1]*(Dt[{a}]+{e}) ]]"
          - '0'
        type: NODE_FIELD
        components: 3
        name: Lorentz Force Density
        safeName: Lorentz_Force_Density_f,N/m3
        domains:
          - conducting_domain, source_domain
          - non_conducting_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: false

      fLorentzForceX:
        term:
          - "CompX[(1/rmsCoeff[])^2*Re[{d a}/\\Conj[ sigma[#1]*(Dt[{a}]+{e}) ]]]"
        type: INTEGRAL
        name: Integral Lorentz Force X
        safeName: Integral_Lorentz_Force_X_[N]
        domains:
          - conducting_domain, source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: false

      fLorentzForceY:
        term:
          - "CompY[(1/rmsCoeff[])^2*Re[{d a}/\\Conj[ sigma[#1]*(Dt[{a}]+{e}) ]]]"
        type: INTEGRAL
        name: Integral Lorentz Force Y
        safeName: Integral_Lorentz_Force_Y_[N]
        domains:
          - conducting_domain, source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: false

      fLorentzForceZ:
        term:
          - "CompZ[(1/rmsCoeff[])^2*Re[{d a}/\\Conj[ sigma[#1]*(Dt[{a}]+{e}) ]]]"
        type: INTEGRAL
        name: Integral Lorentz Force Z
        safeName: Integral_Lorentz_Force_Z_[N]
        domains:
          - conducting_domain, source_domain
        smoothing: 1
        args:
            1:
                physics: physicsInductionHeating
                string: "<T>[{T}]"
        hidden: false
        default: false


  

  
      # OpenFOAM FluidDynamics solver
  ofFluidDynamics: &ofFluidDynamics
    key: ofFluidDynamics
    command: runOF

      # Elmer Rotating Magnets solver
  elmerRotatingMagnets: &elmerRotatingMagnets
    key: elmerRotatingMagnets
    command: runELMER

  

# GetDP Induction Heating 2D and 3D solvers


# EOF MagnetStirring 2D and 3D solvers

  eofMagnetStirringGeneral: &eofMagnetStirringGeneral
    command: runEOF
    isMultiPhysics: true
    subSolvers:
      subPhysicsFluidGeneral: *ofFluidDynamics
      subPhysicsRotatingMagnetsGeneral: *elmerRotatingMagnets


solvers:
  physicsThermal:
    subPhysicsThermal:
      mesh2D:
        - *getdpThermal
      mesh3D:
        - *getdpThermal

  physicsElectromagnetics:
    subPhysicsEMGeneral:
      mesh2D:
        - *getdpEMGeneral2D
      mesh3D:
        - *getdpEMGeneral3D

  

  

  
  physicsFluidDynamics:
    subPhysicsFluidDynamics:
      mesh2D:
        - *ofFluidDynamics
      mesh3D:
        - *ofFluidDynamics

  physicsRotatingMagnetsEM:
    subPhysicsRotatingMagnets:
      mesh2D:
        - *elmerRotatingMagnets
      mesh3D:
        - *elmerRotatingMagnets

  physicsMagnetStirring:
    subPhysicsStirring:
      mesh2D:
        - *eofMagnetStirringGeneral
      mesh3D:
        - *eofMagnetStirringGeneral
  

motion:
  -
    <<: *velocityX
    sendAlways: true
  -
    <<: *velocityY
    sendAlways: true
  -
    <<: *velocityZ
    sendAlways: true
    relevance:
      - key: dimensions
        value: 3
  -
    <<: *angularVelocityZ
    sendAlways: true
    relevance:
      - key: dimensions
        value: 3
