dpinney / omf

The Open Modeling Framework for smart grid cost-benefit analysis.
https://omf.coop
GNU General Public License v2.0
112 stars 60 forks source link

Debug powerflow issues with Coserv model [80h] #120

Closed dpinney closed 9 years ago

dpinney commented 11 years ago

Looks like we'll need to:

  1. Convert integer phase codes to subsets of {A,B,C,N}.
  2. Swap load objects for a combination of Triplex objects.
  3. Hopefully we won't need to replace everything between the loads and the transformers.
cshjin commented 11 years ago

Element Phase Configuration

The phase configuration can be described using an integer 1-7, a string A-ABC, or even a phase ordering such as CBA, BCA, etc.

1 = A

2 = B

3 = C

4 = AB

5 = AC

6 = BC

7 = ABC ref: http://milsoft.com/uploads/documentation/File%20Layouts/index.htm

cshjin commented 11 years ago

Function of converting phases to ABC has been committed to milToGridlab.py, named convertPhases() And function of replace load objects with triplex objects has been committed to gridEdit.html, but not integrated in the edit function menu yet. Instead, call replaceLoadWithTriplex() in console.

Error session to run gridlabd:

...
WARNING [INIT] : emergency_rating for link:XFMR47481 is zero - this may lead to
odd warning messages about line limits with nonsense values
WARNING [INIT] : Fuse:FUSEx8145 has a negative or 0 mean replacement time - defa
ulting to 1 hour
WARNING [INIT] : last warning message was repeated 72 times
WARNING [INIT] : Init() triplex_node (name:triplex_meter1119421, id:9811): Phase
s specified did not include phase S. Adding phase S.
ERROR [INIT] : triplex_meter1119421 (triplex_meter:9811): NR: Parent and child n
ode phases for nodes node0021354916003UGSx189401 and triplex_meter1119421 do not
 match!
WARNING [INIT] : init_all(): object triplex_meter1119421 initialization failed
ERROR [INIT] : init failure: init_all(): object triplex_meter1119421 initializat
ion failed
ERROR [INIT] : model initialization failed
FATAL [INIT] : shutdown after simulation stopped prematurely
dump to 'gridlabd.xml' complete
FATAL [INIT] : environment startup failed: Domain error
...

Hope PNNL can figure it out

dpinney commented 11 years ago

Perfect. Thanks!

jcfuller1 commented 11 years ago

Looks like an error in the topology. What model is this being processed on and we can take a look. Is this using the merged milToGridlab.py, as we fixed a number of these errors during our process?

dpinney commented 11 years ago

Yeah, it appears their secondary system (underground) is getting translated as non-triplex objects:

image

We're using the pre-merge milToGridlab.py.

The relevant Windmil and glm are in /scratch/coservCvrDebug/

mhavard999 commented 10 years ago

Running gridlabd .\Rector2413.glm from the command line in the coservCvrDebug directory throws a ton of errors about invalid longitudes and latitudes. '1196.99306234' is not a valid latitude or '572.827265661' is not a valid longitude for example. Not sure if this has already been discovered or if it even matters, but there are literally over 1000 of those types of messages. I think they are just warnings, not fatal errors, though. I imagine ERROR [INIT] : weather file 'climate.tmy2' access failed is probably the main issue.

mhavard999 commented 10 years ago

Just an update. The error I'm getting now is ERROR [INIT] : XFMR47590 (transformer:4): transformer:4 (split phase) - XFMR47590 has a phase mismatch at one or both ends. For reference, this is what transformer XFMR47590 looks like in the glm:

object transformer {
phases 7;
from RECTOR 1;
name XFMR47590;
to nodeREG46602XFMR47590;
configuration XFMR47590transformer_configuration101;
};

I googled the error message and found this helpful snippet from the gridlabd source:

GL_THROW("transformer:%d (split phase) - %s has a phase mismatch at one or both ends",obj->id,obj->name);
/*  TROUBLESHOOT
A line has been configured to carry a certain set of phases.  Either the input node or output
node is not providing a source/sink for these different conductors.  The To and From nodes must
have at least the phases of the line connecting them. Center-tap transformers specifically require
at least a single phase (A, B, or C) on the primary side, and the same phase and phase S on the
secondary side.
*/

So from here I will look into what the comment is describing and try to understand how it applies to our transformer.

dpinney commented 10 years ago

Debug thoughts:

  1. The phase number needs to be translated to phase letters according to Hongwei's comment at the top.
  2. Regarding the source comment, if you have line1-transformer-line2 connected, then phases on line1 and line2 need to match. Example, we could have Line1 phases = A, then Line2 would have phases AS (I can explain secondary system later).
mhavard999 commented 10 years ago

I replaced all the integer phase numbers with their string counterparts, as per Hongwei's comment and I got the same error. The To and From nodes must have at least the phases of the line connecting them. is troubling because the nodes the transformer refers to are not referred to in any line objects.
The nodes:

object node {
phases "ABCN";
name RECTOR 1;
bustype SWING;
nominal_voltage 138000.0;
};

...

object node {
phases "ABC";
name nodeREG46602XFMR47590;
nominal_voltage 2400;
};

RECTOR 1 is only referred to in the transformer object and nothing else. The other node is referred to in the transformer object, the following regulator object, and nowhere else:

object regulator {
phases "ABC";
from nodeREG46602XFMR47590;
name REG46602;
to nodeOHx2REG46602;
configuration REGx7105regulator_configuration297601;
};
mhavard999 commented 10 years ago

Also, in milToGridlab._tests, if I set openPrefix = './scratch/coservCvrDebug/' and testFiles = [('SummerBaseOFFLINE.std', 'SummerBaseOFFLINE.seq')] I get the error below:

Beginning Windmil to GLM conversion.
Nominal feeder voltage 2400
FAILED CONVERTINTraceback (most recent call last):G SummerBaseOFFLINE.std

  File "C:\Users\mxh7\Documents\GitHub\omf\milToGridlab.py", line 1340, in _tests
    outGlm,x,y = convert(stdFile.read(),seqFile.read())
  File "C:\Users\mxh7\Documents\GitHub\omf\milToGridlab.py", line 770, in convert
    convertedComponents = [obConvert(x) for x in components]
  File "C:\Users\mxh7\Documents\GitHub\omf\milToGridlab.py", line 761, in obConvert
    return objectToFun[int(objectList[1])](objectList)
  File "C:\Users\mxh7\Documents\GitHub\omf\milToGridlab.py", line 699, in convertTransformer
    no_load_loss = trans_config[20]
TypeError: 'NoneType' object has no attribute '__getitem__'
[Finished in 1.1s]

I guess one important question is how was it converted in the first place? Could the problem be related to corrupt data in the milsoft files?

mhavard999 commented 10 years ago

In the coservCvrDebug directory, I wrote three scripts to attempt to uncover where the problems in the glm might be (findMismatchedPhases.py, feederSetup.py, and helperfuncs.py). Basically, after parsing the glm into a json dict, it finds all the node-link-node configurations where at least one of the nodes or the link (which could be an overhead_line or a transformer or etc) is different from the other two. The problem with this is that it is only checking if the literal string representation of the phases match, but, as per the gridlabd source comment above, phases do not have to be exact matches of each other to be valid. My scripts are designed to be modified and re-run several times at the interpreter (I'm using Sublime's Python REPL), sort of like a poor man's ipython notebook. The script you want to send to the interpreter is findMismatchedPhases.py, which imports and reloads the other two, meaning the interpreter will pick up changes you make in the other scripts every time you re-run findMismatchedPhases.py. The output is a bunch of stats about the amount of node-link-node configs that are mismatched a certain way: 1345 node-link-node configs with EXACTLY one phase mismatch or 1287 exactly one mismatch and exactly one invalid. for example. Invalid refers to phases like 26N rather than something like ACN.

dpinney commented 10 years ago

Thanks. I'll take over from here. I need to find an updated Windmil model.

dpinney commented 10 years ago

WM Model arrived. Conversion looks good -- 140k lines in exported GLM. Single step loadflow fails.

dpinney commented 10 years ago

Since there are loadflow problems from all GLM export options we need to postpone this issue until next quarter.

jcfuller1 commented 10 years ago

Particular utility uses underground triplex lines. PNNL needs to work a solution to reproduce "underground triplex lines".