Fesapi 2.10.1.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Loading...
Searching...
No Matches
FluidCharacterization.h
1/*-----------------------------------------------------------------------
2Licensed to the Apache Software Foundation (ASF) under one
3or more contributor license agreements. See the NOTICE file
4distributed with this work for additional information
5regarding copyright ownership. The ASF licenses this file
6to you under the Apache License, Version 2.0 (the
7"License"; you may not use this file except in compliance
8with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12Unless required by applicable law or agreed to in writing,
13software distributed under the License is distributed on an
14"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15KIND, either express or implied. See the License for the
16specific language governing permissions and limitations
17under the License.
18-----------------------------------------------------------------------*/
19#pragma once
20
21#include "../common/AbstractObject.h"
22
23#include "PvtSpecification.h"
24
25namespace RESQML2_NS
26{
28 class RockFluidUnitInterpretation;
29}
30
38#define GETTER_FLUID_CATALOG_COMPONENT_ATTRIBUTE(vectorName, attributeName, attributeDatatype)\
39 DLL_IMPORT_OR_EXPORT attributeDatatype get##vectorName##attributeName(unsigned int index) const {\
40 if (static_cast<gsoap_eml2_3::prodml22__FluidCharacterization*>(gsoapProxy2_3)->FluidComponentCatalog == nullptr ||\
41 static_cast<gsoap_eml2_3::prodml22__FluidCharacterization*>(gsoapProxy2_3)->FluidComponentCatalog->vectorName.size() <= index) { throw std::out_of_range("The index is out of range"); }\
42 return static_cast<gsoap_eml2_3::prodml22__FluidCharacterization*>(gsoapProxy2_3)->FluidComponentCatalog->vectorName[index]->attributeName;\
43 }
44
52#define GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(vectorName, attributeName, attributeDatatype)\
53 DLL_IMPORT_OR_EXPORT void set##vectorName##attributeName(unsigned int index, const attributeDatatype& value);\
54 DLL_IMPORT_OR_EXPORT bool has##vectorName##attributeName(unsigned int index) const {\
55 return static_cast<gsoap_eml2_3::prodml22__FluidCharacterization*>(gsoapProxy2_3)->FluidComponentCatalog != nullptr &&\
56 static_cast<gsoap_eml2_3::prodml22__FluidCharacterization*>(gsoapProxy2_3)->FluidComponentCatalog->vectorName.size() > index &&\
57 static_cast<gsoap_eml2_3::prodml22__FluidCharacterization*>(gsoapProxy2_3)->FluidComponentCatalog->vectorName[index]->attributeName != nullptr;\
58 }\
59 DLL_IMPORT_OR_EXPORT attributeDatatype get##vectorName##attributeName(unsigned int index) const {\
60 if (!has##vectorName##attributeName(index)) { throw std::out_of_range("The index is out of range"); }\
61 return *static_cast<gsoap_eml2_3::prodml22__FluidCharacterization*>(gsoapProxy2_3)->FluidComponentCatalog->vectorName[index]->attributeName;\
62 }
63
71#define GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(vectorName, attributeName, uomDatatype)\
72 DLL_IMPORT_OR_EXPORT void set##vectorName##attributeName(unsigned int index, double value, uomDatatype uom);\
73 DLL_IMPORT_OR_EXPORT bool has##vectorName##attributeName(unsigned int index) const {\
74 return static_cast<gsoap_eml2_3::prodml22__FluidCharacterization*>(gsoapProxy2_3)->FluidComponentCatalog != nullptr &&\
75 static_cast<gsoap_eml2_3::prodml22__FluidCharacterization*>(gsoapProxy2_3)->FluidComponentCatalog->vectorName.size() > index &&\
76 static_cast<gsoap_eml2_3::prodml22__FluidCharacterization*>(gsoapProxy2_3)->FluidComponentCatalog->vectorName[index]->attributeName != nullptr;\
77 }\
78 DLL_IMPORT_OR_EXPORT double get##vectorName##attributeName##Value(unsigned int index) const {\
79 if (!has##vectorName##attributeName(index)) { throw std::out_of_range("The index is out of range"); }\
80 return static_cast<gsoap_eml2_3::prodml22__FluidCharacterization*>(gsoapProxy2_3)->FluidComponentCatalog->vectorName[index]->attributeName->__item;\
81 }\
82 DLL_IMPORT_OR_EXPORT uomDatatype get##vectorName##attributeName##Uom(unsigned int index) const {\
83 if (!has##vectorName##attributeName(index)) { throw std::out_of_range("The index is out of range"); }\
84 return static_cast<gsoap_eml2_3::prodml22__FluidCharacterization*>(gsoapProxy2_3)->FluidComponentCatalog->vectorName[index]->attributeName->uom;\
85 }
86
92#define GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_COMMON_ATTRIBUTES(vectorName)\
93 GETTER_FLUID_CATALOG_COMPONENT_ATTRIBUTE(vectorName, uid, std::string)\
94 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(vectorName, Remark, std::string)\
95 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(vectorName, MassFraction, gsoap_eml2_3::eml23__MassPerMassUom)\
96 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(vectorName, MoleFraction, gsoap_eml2_3::eml23__AmountOfSubstancePerAmountOfSubstanceUom)
97
98namespace PRODML2_2_NS
99{
109 class FluidCharacterization : public COMMON_NS::AbstractObject
110 {
111 public:
112
120 DLL_IMPORT_OR_EXPORT FluidCharacterization(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : COMMON_NS::AbstractObject(partialObject) {}
121
131 FluidCharacterization(COMMON_NS::DataObjectRepository * repo,
132 const std::string & guid,
133 const std::string & title);
134
140 FluidCharacterization(gsoap_eml2_3::prodml22__FluidCharacterization* fromGsoap):AbstractObject(fromGsoap) {}
141
144 for (size_t i = 0; i < modelSpecifications.size(); ++i) {
145 if (modelSpecifications[i] != nullptr) {
146 delete modelSpecifications[i];
147 }
148 }
149 }
150
151 GETTER_SETTER_OPTIONAL_ATTRIBUTE(gsoap_eml2_3::prodml22__FluidCharacterization, gsoapProxy2_3, Kind, std::string)
152 GETTER_SETTER_OPTIONAL_ATTRIBUTE(gsoap_eml2_3::prodml22__FluidCharacterization, gsoapProxy2_3, IntendedUsage, std::string)
153 GETTER_SETTER_OPTIONAL_ATTRIBUTE(gsoap_eml2_3::prodml22__FluidCharacterization, gsoapProxy2_3, Remark, std::string)
154
155
163 DLL_IMPORT_OR_EXPORT void setStandardConditions(double temperatureValue, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom temperatureUom,
164 double pressureValue, gsoap_eml2_3::eml23__PressureUom pressureUom);
165
171 DLL_IMPORT_OR_EXPORT bool hasStandardConditions() const;
172
178 DLL_IMPORT_OR_EXPORT double getStandardTemperatureValue() const;
179
185 DLL_IMPORT_OR_EXPORT gsoap_eml2_3::eml23__ThermodynamicTemperatureUom getStandardTemperatureUom() const;
186
192 DLL_IMPORT_OR_EXPORT double getStandardPressureValue() const;
193
199 DLL_IMPORT_OR_EXPORT gsoap_eml2_3::eml23__PressureUom getStandardPressureUom() const;
200
206 DLL_IMPORT_OR_EXPORT void setRockFluidUnit(RESQML2_NS::RockFluidUnitInterpretation* rockFluidUnit);
207
213 COMMON_NS::DataObjectReference getRockFluidUnitDor() const;
214
220 DLL_IMPORT_OR_EXPORT RESQML2_NS::RockFluidUnitInterpretation* getRockFluidUnit() const;
221
227 DLL_IMPORT_OR_EXPORT void setFluidSystem(class FluidSystem* fluidSystem);
228
234 COMMON_NS::DataObjectReference getFluidSystemDor() const;
235
241 DLL_IMPORT_OR_EXPORT class FluidSystem* getFluidSystem() const;
242
248 DLL_IMPORT_OR_EXPORT unsigned int getFormationWaterCount() const;
249
255 DLL_IMPORT_OR_EXPORT void pushBackFormationWater(const std::string & uid);
256 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_COMMON_ATTRIBUTES(FormationWater)
257 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(FormationWater, Salinity, gsoap_eml2_3::eml23__MassPerMassUom)
258 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(FormationWater, SpecificGravity, double)
259
265 DLL_IMPORT_OR_EXPORT unsigned int getPureFluidComponentCount() const;
266
274 DLL_IMPORT_OR_EXPORT void pushBackPureFluidComponent(const std::string & uid, gsoap_eml2_3::prodml22__PureComponentKind kind, bool hydrocarbonFlag);
275 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_COMMON_ATTRIBUTES(PureFluidComponent)
276 GETTER_FLUID_CATALOG_COMPONENT_ATTRIBUTE(PureFluidComponent, Kind, std::string)
277 GETTER_FLUID_CATALOG_COMPONENT_ATTRIBUTE(PureFluidComponent, HydrocarbonFlag, bool)
278 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PureFluidComponent, MolecularWeight, gsoap_eml2_3::eml23__MolecularWeightUom)
279
285 DLL_IMPORT_OR_EXPORT unsigned int getPlusFluidComponentCount() const;
286
293 DLL_IMPORT_OR_EXPORT void pushBackPlusFluidComponent(const std::string & uid, gsoap_eml2_3::prodml22__PlusComponentKind kind);
294 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_COMMON_ATTRIBUTES(PlusFluidComponent)
295 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PlusFluidComponent, SpecificGravity, double)
296 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PlusFluidComponent, StartingCarbonNumber, int64_t)
297 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PlusFluidComponent, StartingBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom)
298 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PlusFluidComponent, AvgDensity, std::string)
299 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PlusFluidComponent, AvgMolecularWeight, gsoap_eml2_3::eml23__MolecularWeightUom)
300
306 DLL_IMPORT_OR_EXPORT unsigned int getStockTankOilCount() const;
307
313 DLL_IMPORT_OR_EXPORT void pushBackStockTankOil(const std::string & uid);
314 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_COMMON_ATTRIBUTES(StockTankOil)
315 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(StockTankOil, APIGravity, gsoap_eml2_3::eml23__APIGravityUom)
316 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(StockTankOil, MolecularWeight, gsoap_eml2_3::eml23__MolecularWeightUom)
317 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(StockTankOil, GrossEnergyContentPerUnitMass, gsoap_eml2_3::eml23__EnergyPerMassUom)
318 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(StockTankOil, NetEnergyContentPerUnitMass, gsoap_eml2_3::eml23__EnergyPerMassUom)
319 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(StockTankOil, GrossEnergyContentPerUnitVolume, gsoap_eml2_3::eml23__EnergyPerVolumeUom)
320 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(StockTankOil, NetEnergyContentPerUnitVolume, gsoap_eml2_3::eml23__EnergyPerVolumeUom)
321
327 DLL_IMPORT_OR_EXPORT unsigned int getNaturalGasCount() const;
328
334 DLL_IMPORT_OR_EXPORT void pushBackNaturalGas(const std::string & uid);
335 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_COMMON_ATTRIBUTES(NaturalGas)
336 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(NaturalGas, GasGravity, double)
337 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(NaturalGas, MolecularWeight, gsoap_eml2_3::eml23__MolecularWeightUom)
338 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(NaturalGas, GrossEnergyContentPerUnitMass, gsoap_eml2_3::eml23__EnergyPerMassUom)
339 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(NaturalGas, NetEnergyContentPerUnitMass, gsoap_eml2_3::eml23__EnergyPerMassUom)
340 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(NaturalGas, GrossEnergyContentPerUnitVolume, gsoap_eml2_3::eml23__EnergyPerVolumeUom)
341 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(NaturalGas, NetEnergyContentPerUnitVolume, gsoap_eml2_3::eml23__EnergyPerVolumeUom)
342
348 DLL_IMPORT_OR_EXPORT unsigned int getPseudoFluidComponentCount() const;
349
356 DLL_IMPORT_OR_EXPORT void pushBackPseudoFluidComponent(const std::string & uid, gsoap_eml2_3::prodml22__PseudoComponentKind kind);
357 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_COMMON_ATTRIBUTES(PseudoFluidComponent)
358 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PseudoFluidComponent, SpecificGravity, double)
359 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PseudoFluidComponent, StartingCarbonNumber, int64_t)
360 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PseudoFluidComponent, EndingCarbonNumber, int64_t)
361 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PseudoFluidComponent, StartingBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom)
362 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PseudoFluidComponent, EndingBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom)
363 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PseudoFluidComponent, AvgBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom)
364 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PseudoFluidComponent, AvgDensity, std::string)
365 GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PseudoFluidComponent, AvgMolecularWeight, gsoap_eml2_3::eml23__MolecularWeightUom)
366
369 CompositionalThermal = 0,
370 SrkEos = 1,
371 PengRobinson76Eos = 2,
372 PengRobinson78Eos = 3,
373 LohrenzBrayClarkCorrelation = 4,
374 CSPedersen87 = 5,
375 CSPedersen84 = 6,
376 FrictionTheory = 7,
377 CorrelationThermal = 8,
378 BergmanSuttonBubblePoint = 9,
379 DeGhettoBubblePoint = 10,
380 StandingBubblePoint = 11,
381 DindorukChristmanBubblePoint = 12,
382 PetroskyFarshadBubblePoint = 13
383 };
384
390 DLL_IMPORT_OR_EXPORT unsigned int getModelCount() const;
391
397 DLL_IMPORT_OR_EXPORT void pushBackModel(const std::string & uid = "");
398
406 DLL_IMPORT_OR_EXPORT PvtSpecification* getModelSpecification(unsigned int modelIndex) { return modelSpecifications[modelIndex]; }
407
417 DLL_IMPORT_OR_EXPORT PvtSpecification* initModelSpecification(unsigned int modelIndex, ModelSpecification kind);
418
419 GETTER_SETTER_OPTIONAL_ATTRIBUTE_IN_VECTOR(gsoap_eml2_3::prodml22__FluidCharacterization, gsoapProxy2_3, Model, Name, std::string)
420 GETTER_SETTER_OPTIONAL_ATTRIBUTE_IN_VECTOR(gsoap_eml2_3::prodml22__FluidCharacterization, gsoapProxy2_3, Model, Remark, std::string)
421 GETTER_SETTER_MEASURE_OPTIONAL_ATTRIBUTE_IN_VECTOR(gsoap_eml2_3::prodml22__FluidCharacterization, gsoapProxy2_3, Model, ReferenceTemperature, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom)
422 GETTER_SETTER_MEASURE_OPTIONAL_ATTRIBUTE_IN_VECTOR(gsoap_eml2_3::prodml22__FluidCharacterization, gsoapProxy2_3, Model, ReferenceStockTankTemperature, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom)
423
424
429 DLL_IMPORT_OR_EXPORT unsigned int getTableFormatCount() const;
430
436 DLL_IMPORT_OR_EXPORT void pushBackTableFormat(const std::string & uid = "");
437
445 DLL_IMPORT_OR_EXPORT uint64_t getTableFormatColumnCount(const std::string & tableFormatUid) const;
446
454 DLL_IMPORT_OR_EXPORT std::string getTableFormatColumnUom(const std::string & tableFormatUid, unsigned int columnIndex) const;
455
463 DLL_IMPORT_OR_EXPORT std::string getTableFormatColumnProperty(const std::string & tableFormatUid, unsigned int columnIndex) const;
464
472 DLL_IMPORT_OR_EXPORT void pushBackTableFormatColumn(unsigned int tableFormatIndex, gsoap_eml2_3::eml23__UnitOfMeasure uom, gsoap_eml2_3::prodml22__OutputFluidProperty fluidProperty);
473
481 DLL_IMPORT_OR_EXPORT void pushBackTableFormatColumn(unsigned int tableFormatIndex, const std::string & uom, const std::string & fluidProperty);
482
489 DLL_IMPORT_OR_EXPORT unsigned int getTableCount(unsigned int modelIndex) const;
490
498 DLL_IMPORT_OR_EXPORT std::string getTableName(unsigned int modelIndex, unsigned int tableIndex) const;
499
507 DLL_IMPORT_OR_EXPORT std::string getTableFormatUid(unsigned int modelIndex, unsigned int tableIndex) const;
508
517 DLL_IMPORT_OR_EXPORT void pushBackTable(unsigned int modelIndex, const std::string & name, const std::string & tableFormatUid, const std::string & uid = "");
518
526 DLL_IMPORT_OR_EXPORT unsigned int getTableRowCount(unsigned int modelIndex, unsigned int tableIndex) const;
527
536 DLL_IMPORT_OR_EXPORT std::string getTableRowContent(unsigned int modelIndex, unsigned int tableIndex, unsigned int rowIndex) const;
537
545 DLL_IMPORT_OR_EXPORT void pushBackTableRow(unsigned int modelIndex, unsigned int tableIndex, const std::vector<double> & rowContent);
546
555 DLL_IMPORT_OR_EXPORT void pushBackTableRow(unsigned int modelIndex, unsigned int tableIndex, const std::vector<double> & rowContent, bool isSaturated);
556
565 DLL_IMPORT_OR_EXPORT void pushBackParameter(unsigned int modelIndex, double value, gsoap_eml2_3::eml23__UnitOfMeasure uom, gsoap_eml2_3::prodml22__OutputFluidProperty fluidProperty);
566
576 DLL_IMPORT_OR_EXPORT void pushBackParameter(unsigned int modelIndex, double value, gsoap_eml2_3::eml23__UnitOfMeasure uom, gsoap_eml2_3::prodml22__OutputFluidProperty fluidProperty, gsoap_eml2_3::prodml22__ThermodynamicPhase phase);
577
583 DLL_IMPORT_OR_EXPORT static constexpr char const* XML_TAG = "FluidCharacterization";
584
590 DLL_IMPORT_OR_EXPORT virtual std::string getXmlTag() const final { return XML_TAG; }
591
595 DLL_IMPORT_OR_EXPORT static constexpr char const* XML_NS = "prodml22";
596
600 DLL_IMPORT_OR_EXPORT std::string getXmlNamespace() const final { return XML_NS; }
601
604
605 private:
607 std::vector<PvtSpecification*> modelSpecifications;
608 };
609}
Definition FluidCharacterization.h:110
void pushBackModel(const std::string &uid="")
FluidCharacterization(gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject)
Definition FluidCharacterization.h:120
FluidCharacterization(common::DataObjectRepository *repo, const std::string &guid, const std::string &title)
~FluidCharacterization()
Definition FluidCharacterization.h:143
unsigned int getModelCount() const
PvtSpecification * getModelSpecification(unsigned int modelIndex)
Definition FluidCharacterization.h:406
FluidCharacterization(gsoap_eml2_3::prodml22__FluidCharacterization *fromGsoap)
Definition FluidCharacterization.h:140
ModelSpecification
Definition FluidCharacterization.h:368
std::string getXmlNamespace() const final
Definition FluidCharacterization.h:600
PvtSpecification * initModelSpecification(unsigned int modelIndex, ModelSpecification kind)
Definition FluidSystem.h:103
Definition PvtSpecification.h:42