🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Calculate Iron Losses via python - rounding of input Parameters issue

User: "Johannes_20922"
Altair Community Member
Updated by Johannes_20922

Hi all,

I want to read the Iron losses, flux is nicely presenting you a comand to do so:

result = IronLossesRegion(faceRegions=[RegionFace['STATOR']],
                 timeInterval=EvolutivePath(parameterSet=[SetParameterFixed(paramEvol=VariationParameter['F'],
                                                                            currentValue=5.0),
                                                          SetParameterFixed(paramEvol=VariationParameter['SPEED'],
                                                                            currentValue=50.0),
                                                          SetParameterFixed(paramEvol=VariationParameter['I'],
                                                                            currentValue=2.428169183),
                                                          SetParameterFixed(paramEvol=VariationParameter['IANGLE'],
                                                                            currentValue=1.570796327),
                                                          SetParameterXVariable(paramEvol=VariationParameter['TIME'],
                                                                                limitMin=0.0173914,
                                                                                limitMax=0.21739)]),
                 curveName='CURVE_LOSS_REGION_1',
                 resultName='LOSSES_IN_REGION_1',
                 lossSpatialParameterName='DVOL_LOSS_MEAN_1',
                 energySpatialParameterName='DVOL_ENERGY_LOSS_1',
                 periodicity=FullCycleIronLosses(),
                 sheetLossModel=CaseDefinedInMaterial())

 

which works well. But when I now replace the input numbers with my variables I get some trouble. When I provide more or less digits than flux expects I get an error:

Java exception occurred:
rsi.core.common.error.RsiServerException: Can not execute the following command :
result =
IronLossesRegion(faceRegions=[RegionFace['Statorzahn1']],timeInterval=EvolutivePath(parameterSet=[SetParameterFixed(paramEvol=VariationParameter['F'],currentValue=5),SetParameterFixed(paramEvol=VariationParameter['SPEED'],currentValue=50),SetParameterFixed(paramEvol=VariationParameter['I'],currentValue=2.428169183),SetParameterFixed(paramEvol=VariationParameter['IANGLE'],currentValue=1.570796327),SetParameterXVariable(paramEvol=VariationParameter['TIME'],limitMin=1.7391E-02,limitMax=2.1739E-01)]),curveName='CURVE_LOSS_REGION_1',resultName='LOSSES_IN_REGION_1',lossSpatialParameterName='DVOL_LOSS_MEAN_1',energySpatialParameterName='DVOL_ENERGY_LOSS_1',periodicity=FullCycleIronLosses(),sheetLossModel=CaseDefinedInMaterial())

The first two time steps cannot be selected for this

Now when I tweek the the thing a little with the last digits (defneately the same timesteps) it works for one model. Since I want something general that is not a way forward.

Is there a more robust way to calculate the iron loss via code?

BR

Johannes

 

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "Rishabh"
    Altair Employee
    Updated by Rishabh

    Hello Johannes

    Can you please share the code where you replace the input numbers with your variables ? According to my observation you changed the RegionFace Name from Stator to Statorzahn1 (Is the part stator teeth ?).

    Do you wish to replace the parameters such as currentValue ,  limitMin ,  limitMax with python variables ?