Skip to content

Implementing Parallelization with OpenDSSDirect same as OpenDSS Version 8 #90

@marifinarif87

Description

@marifinarif87

Hi all,

I am using the OpenDSSdirect.py package under the Linux version. Currently, I need to use parallelization which is implemented in OpenDSS Version 8. But, I can not do that using OpenDSSdirect.py. Here is an example function which is called to iteratively solve three different distribution system in parallel using the OpenDSS version 8.

It will be great if this functionality available in OpenDSSDirect.py

function [Loads_P_Dist, Loads_Q_Dist, DistCont] = DistribSystSimul(bus_voltages_pu, num_Bus, V_Mags, iter)

global  DSSCircuit DSSText DSSSolution  

disp(V_Mags)
%% run load flow in snap shot mode
if iter ==1,
    DSSText.Command = 'set ActiveActor=*'; % message to all the actors
    DSSText.Command = 'set mode = snap maxiterations=2'; 
    
end;
for i=1:num_Bus
    DSSText.Command='Set Parallel=Yes';
    DSSText.Command=['set ActiveActor=',num2str(i)];
    DSSCircuit.Vsources.First;      % select the first VSource (normally the substation)
    DSSText.Command='VSource.source.pu='+ string(V_Mags(i));
end

DSSText.Command='Set Parallel=Yes';
DSSSolution.SolveAll
DSSCircuit.Parallel.Wait

for i=1:num_Bus
     
    DSSText.Command=['set ActiveActor=',num2str(i)];
    Load_Dist = DSSCircuit.TotalPower;
    Loads_P_Dist(i) = -Load_Dist(1,1)/1000;
    Loads_Q_Dist(i) = -Load_Dist(1,2)/1000;
    
    if DSSSolution.Converged 

        DistCont(i) = 1;
        disp('Converged')
    else
        DistCont(i) = 0;
    end
    
end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions