-
Notifications
You must be signed in to change notification settings - Fork 0
Documentation #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Documentation #13
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,6 +121,8 @@ content names of which one or more must be present. | |
| XML processing | ||
| ---------------- | ||
|
|
||
| .. note:: All XML elements are described further in :doc:`opgee-xml`. | ||
|
|
||
| AttrDef | ||
| ~~~~~~~~~~ | ||
| The XML element ``<AttrDef>`` defines metadata for an attribute of an OPGEE XML element. | ||
|
|
@@ -134,13 +136,36 @@ is used for both validation and to generate the interactive user interface. | |
|
|
||
| ProcessChoice and ProcessGroup | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| A ``<ProcessGroup>`` describes a set of ``<ProcessRef>`` and ``<StreamRef>`` elements that | ||
| The ``<ProcessChoice>`` and ``<ProcessGroup>`` elements enable ``Fields`` to be used | ||
| as parameterized templates. A ``<ProcessGroup>`` encloses a set of ``<ProcessRef>`` | ||
| and ``<StreamRef>`` elements that | ||
| can be enabled or disabled as a set. The ``<ProcessChoice>`` element encloses multiple | ||
| ``<ProcessGroup>`` elements and selects among them based on the value of an attribute | ||
| ``<ProcessGroup>`` elements and selects among them based on the value of a ``Field`` attribute | ||
| named in the ``<ProcessChoice>``, whose value must match the name of one of the enclosed | ||
| ``<ProcessGroup>`` elements. | ||
|
Comment on lines
-137
to
145
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be beneficial to add an example to show the 2 equivalent ways of creating the same input? E.g. <!-- opgee.xml or other template XML file -->
<Field name="my_template">
<!-- ... other field elements -->
<ProcessChoice name="gas_path">
<ProcessGroup name="Minimal">
<ProcessRef name="GasGathering" />
<ProcessRef name="GasDehydration" />
<StreamRef name="GasGathering => GasDehydration" />
<StreamRef name="GasDehydration => GasPartition" />
</ProcessGroup>
<ProcessGroup name="Acid Wet Gas">
<ProcessRef name="GasGathering" />
<ProcessRef name="GasDehydration" />
<ProcessRef name="AcidGasRemoval" />
<ProcessRef name="Demethanizer" />
<ProcessRef name="NGL" />
<StreamRef name="GasGathering => GasDehydration" />
<StreamRef name="GasDehydration => AcidGasRemoval" />
<StreamRef name="AcidGasRemoval => Demethanizer" />
<StreamRef name="Demethanizer => GasPartition" />
<StreamRef name="Demethanizer => NGL" />
</ProcessGroup>
<ProcessGroup name="Acid Gas">
<ProcessRef name="GasGathering" />
<ProcessRef name="GasDehydration" />
<ProcessRef name="AcidGasRemoval" />
<StreamRef name="GasGathering => GasDehydration" />
<StreamRef name="GasDehydration => AcidGasRemoval" />
<StreamRef name="AcidGasRemoval => GasPartition" />
</ProcessGroup>
</ProcessChoice>
</Field>
<!-- attributes.xml -->
<ClassAttrs name="Field">
<Options name="gas_path" default="Minimal">
<Option desc="">None</Option>
<Option desc="Dehydrator">Minimal</Option>
<Option desc="Dehydrator + Amine Process">Acid Gas</Option>
<Option desc="Dehydrator + Amine Process + Demethanizer">Acid Wet Gas</Option>
</Options>
</ClassAttrs>The 2 XML inputs below are equivalent. <!-- using process choice attribute -->
<Field name="my_field" modifies="my_template">
<A name="gas_path">Acid Gas</A>
</Field>
<!-- using explicit process/stream definitions -->
<Field name="my_field">
<Process class="GasGathering"/>
<Process class="GasDehydration"/>
<Process class="AcidGasRemoval"/>
<Stream src="GasGathering" dst="GasDehydration">
<Contains>gas for gas dehydration</Contains>
</Stream>
<Stream src="GasDehydration" dst="AcidGasRemoval">
<Contains>gas for AGR</Contains>
</Stream>
<Stream src="AcidGasRemoval" dst="GasPartition">
<Contains>gas for gas partition</Contains>
</Stream>
</Field> |
||
|
|
||
| All XML elements are described further in :doc:`opgee-xml`. | ||
| When the model is built, all the ``Streams`` and ``Processes`` identified by | ||
| ``StreamRef`` and ``ProcessRef`` elements within the enclosed ``<ProcessGroup>>`` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Delete additional '>' around ProcessGroup |
||
| elements are disabled, then the ``Streams`` and ``Processes`` within the selected | ||
| ``ProcessGroup`` are enabled. In this way, groups | ||
| of related ``Processes`` can be turned on and off. | ||
|
|
||
| The file ``etc/opgee.xml``, included in the OPGEE distribution, | ||
| defines a ``Field`` named ``template`` that provides the basis for common | ||
| oil and gas field configurations. The subcommand ``csv2xml`` allows a | ||
| user to define ``Fields`` using a small number of attributes by generating | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a limit on the # of attributes that can be used by the csv2xml script when creating fields?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No limit. |
||
| XML from the columns in the CSV file and combining these with the | ||
| ``template`` field in ``etc/opgee.xml``. This system is used to generate XML | ||
| definitions for the 9,000 Fields used in testing OPGEE. See the schematic | ||
| figure below for an illustration of one such field. | ||
|
|
||
| .. figure:: images/gas_lifting.* | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if this is just an issue with how GitHub previews these files, but this currently doesn't show up correctly when reviewing on GitHub. I can see the image successfully in the images directory though, so it might just be a GitHub thing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a Sphinx/ReStrucutredText feature and goes beyond the basic Github rendering. You actually need to run I just built the docs locally, and the image appears as expected. |
||
| :figclass: align-center | ||
|
|
||
| Schematic diagram of a "gas lifting field" from the "template" field | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this text supposed to be tied to the figure in some way like as a sub-header? currently it just shows up as a "normal" paragraph in the preview after where the image is supposed to be.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It appears as a caption because it's indented and "within" the After building the docs, you can open docs/build/html/index.html to see the resulting files. |
||
| in ``etc/opgee.xml``, generated using OPGEE’s built-in “graph” command. | ||
| Rectangles indicate ``Process`` subclasses, and each arrow represents a | ||
| ``Stream``. Labels on arrows show the declared ``Stream`` contents. | ||
|
|
||
|
|
||
| Assorted features | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be consist on whether you always want to have <> brackets when referring to XML elements, or if you don't want to use them at all (or only use them the first time a new element is talked about/introduced). Right now it's not completely consistent.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I will address.
Note, though, that there are many Python classes of the same name as the XML elements, so whether to include "" brackets depends on whether the element or class is being discussed.