I am simulating a three-phase transformer made with interleaved foil windings in Flux 2D, using the transient magnetic solver.
I would like to estimate the ac to dc joule losses in each conductor by calculating the time average joule losses in the conductor regions. There are many conductor regions in my transformer so I would like to script this.
I can manually "Compute" the desired value for a selected time step and region, I can also create a 2D IO curve for each region. However, these are tedious given the number of regions or time steps.
Instead I would like to better understand how to use the PyFlux methods.
When I perform the manual computation I get the following PyFlux commands in the Flux2D_log.py
ComputePhysicTransient['ComputePhysic'].storageName='ComputePhysic_1'
ComputePhysicTransient['ComputePhysic'].formula=['A_1_P']
I cannot find this command described in the PyFlux documentation for 2022.3. However, I do find a similar command,
computeLossesFaceRegion(), but there is no example of how to actually use this command (as is the case with most of the PyFlux commands). I have tried the following syntax, but I get a error:
test = computeLossesFaceRegion(regionFace = RegionFace['A_1_P'], resultName = 'test');
Run time error.
Invalid arguments for method: executeAlgo_c
Failed Execution
Here, I am guessing that regionFace, follows a similar syntax as meshPoint = MeshPoint['SMALL'], or coordSys = CoordSys['XY1']. I am unsure about resultName. Because it seems redundant to give the result a name, but also to assign the result to a variable. It is unclear to me what the form of test will be in this use case.
Here is pseudo code for what I am trying to accomplish.
for ii = start:step:stop
select time step
for each winding
compute joule losses
store joule losses in array
compute active power
store active power in array
end for
end for
compute time average values
store results
Any help would be appreciated. Are there any useful tips for resolving Flux errors or PyFlux issues in general?