[S0029] 解析条件に点列を設定する

 

解析条件のパラメータには、時間や回転数などに対して変化する量を定義するものがあります。
依存関係が非線形の場合、そのデータを点列として設定します。点列はデータセットとしてグラフマネジャーにも登録します。
このスクリプトでは、効率マップ(発熱)条件に電圧の時間変化の点列を設定します。

前提条件

  • 非定常の熱解析スタディが1つ以上作成されており、効率マップ(発熱)条件が設定されていること
    このスクリプト例では、プロジェクトツリー上でアクティブな非定常熱解析スタディに対して実行している
  • 効率マップ解析スタディと効率マップの定義が1つ以上作成されていること
  • 効率マップ(発熱)条件では参照する効率マップが指定されており、その効率マップは[複数電圧を指定する]がオンになっていること
  • 効率マップ(発熱)条件の電圧の時間変化はJMAG-Designer v25.0以降で指定可能

スクリプトにおける設定内容

  • 効率マップ(発熱)条件のタイプ名"ReferenceMapLoss"を指定して、付与されている効率マップ(発熱)条件をすべて取得。複数取得した場合は1番目に対して設定を行う
  • 時間変化する電圧を表す点列(種類: efficiency_voltage_time)を作成し、値を設定
  • 効率マップ(発熱)条件の電圧の時間変化に定義した点列を設定
# Copyright (c) 2026 JSOL CORPORATION
#
# 本スクリプトはMITライセンスのもとで公開しています。
# ライセンス全文は以下を参照してください。
# https://www.jmag-international.com/jp/scriptlibrary/jmag_script_library_mit/

def getConditionsSpecifiedType(targetStudy, typeName):
    """スタディに付与されている指定されたタイプの条件を取得する"""
    matchedConditions = []
    numConds = targetStudy.NumConditions()

    for i in range(numConds):
        condition = targetStudy.GetCondition(i)
        CondType = condition.GetScriptTypeName()
        if CondType == typeName:
            matchedConditions.append(condition)
    return matchedConditions

def createDataSet(dataManager, pointType, pointName, points):
    """グラフマネージャに点列を追加する"""
    dataSet = dataManager.CreatePointArray(pointType, pointName)
    dataSet.SetTable(points)
    return dataSet


def setTimeDependentVoltageToEfficiencyMapHeatSource(targetStudy, dataManager):
    """targetStudyに付与されている効率マップ(発熱)条件を取得し、電圧の時間変化点列を設定する"""
    conditionType = u"ReferenceMapLoss" # 効率マップ (発熱) 条件を示す条件タイプ
    efficiencyMapHeatSourceConditions = getConditionsSpecifiedType(study, conditionType)

    if len(efficiencyMapHeatSourceConditions) <= 0:
        print(f"The condition ({conditionType}) is not found.")
    elif len(efficiencyMapHeatSourceConditions) > 1:
        print(f"This study contains two or more conditions ({conditionType}).\nThis sample uses the first condition found.")

    if len(efficiencyMapHeatSourceConditions) >= 1:
        propertyName = u"VoltageTimeTable" # 効率マップ (発熱) 条件の電圧の時間変化点列プロパティのタイプ名
        pointType = u"efficiency_voltage_time" # 時間変化する電圧を表す点列のタイプ名
        pointName = u"TimeDependentVoltageArray1"
        pointArrayTimeVoltage = [[0 for i in range(2)] for j in range(2)]
        pointArrayTimeVoltage[0][0] = 0
        pointArrayTimeVoltage[0][1] = 10
        pointArrayTimeVoltage[1][0] = 100
        pointArrayTimeVoltage[1][1] = 20
        dataSet = createDataSet(dataManager, pointType, pointName, pointArrayTimeVoltage)
        efficiencyMapHeatSourceConditions[0].SetTableProperty(propertyName, dataSet)


app = designer.GetApplication()
study = app.GetCurrentStudy()
dataManager = app.GetDataManager()
setTimeDependentVoltageToEfficiencyMapHeatSource(study, dataManager)

Download Python source code

ファイルご利用の注意点

JMAGスクリプトライブラリをご利用されるに際し、以下をよくお読みいただき、ご同意の上ご利用くださるようお願い申し上げます。

絞込み検索

  • カテゴリー 一覧

JMAG-Express Online
An engineer's diary