← Documentation
ADS-IDAC Engine 5.0.0
HydraulicJunction.cpp
Go to the documentation of this file.
1// HydraulicJunction.cpp: implementation of the HydraulicJunction class.
2//
4
5#include "HydraulicJunction.h"
6#include <boost/serialization/export.hpp>
7#include <boost/archive/binary_oarchive.hpp>
8#include <boost/archive/binary_iarchive.hpp>
9BOOST_CLASS_EXPORT_IMPLEMENT(HydraulicJunction)
10using namespace std;
11
13// Construction/Destruction
15
17{
18 mass_flow_rate = -999.0;
19 liquid_velocity = -999.0;
20 vapor_velocity = -999.0;
21 unit_of_mass_flow_rate = "NOT_SPECIFIED";
22 unit_of_liquid_velocity = "NOT_SPECIFIED";
23 unit_of_vapor_velocity = "NOT_SPECIFIED";
25}
26
27
29{
30
31}
32
40 this->setUnitOfMassFlowRate(si_unit);
41 this->setUnitOfLiquidVelocity(si_unit);
42 this->setUnitOfVaporVelocity(si_unit);
43}
45 if(si_unit){
47 }
48 else{
50 }
51}
53 if(si_unit){
55 }
56 else{
58 }
59}
61 if(si_unit){
63 }
64 else{
66 }
67}
73}
75 double xflow, lflow, vflow;
76 //
77 // adjust floating point variables to avoid overflow condition on retrieval
78 xflow = mass_flow_rate;
79 if (xflow > -1e-30 && xflow < 1e-30) {
80 xflow = 0.0;
81 }
82 lflow = liquid_velocity;
83 if (lflow > -1e-30 && lflow < 1e-30) {
84 lflow = 0.0;
85 }
86 vflow = vapor_velocity;
87 if (vflow > -1e-30 && vflow < 1e-30) {
88 vflow = 0.0;
89 }
90 fout << xflow << ' '
91 << lflow << ' '
92 << vflow << ' '
93
94 //fout << mass_flow_rate << ' '
95 //<< liquid_velocity << ' '
96 //<< vapor_velocity << ' '
99 << unit_of_vapor_velocity << '\n';
100 this->saveTHElementToFile(fout);
101}
103 fin >> mass_flow_rate
109 this->retrieveTHElementFromFile(fin);
110}
112 this->copyTHElement(_hj);
113 mass_flow_rate = _hj.getMassFlowRate(); //(mflowj)
114 liquid_velocity = _hj.getLiquidVelocity();//(velfj)
115 vapor_velocity = _hj.getVaporVelocity(); //(velgj)
119}
document e
void setUnitOfLiquidVelocity(bool unit)
void setUnitOfVaporVelocity(bool unit)
std::string unit_of_liquid_velocity
std::string getUnitOfLiquidVelocity()
void readInfoFromFile(std::ifstream &)
std::string getUnitOfVaporVelocity()
void setVaporVelocity(double velocity)
void retrieveHydraulicJunctionFromFile(std::ifstream &)
void copyHydraulicJunction(HydraulicJunction &)
void setUnits(bool unit)
std::string unit_of_vapor_velocity
void setLiquidVelocity(double velocity)
void setMassFlowRate(double rate)
void setUnitOfMassFlowRate(bool unit)
std::string getUnitOfMassFlowRate()
void saveHydraulicJunctionToFile(std::ofstream &)
std::string unit_of_mass_flow_rate
void setTypeOfCard(Relap5ComponentType newTypeOfCard)
Definition: THElement.cpp:35
void saveTHElementToFile(std::ofstream &)
Definition: THElement.cpp:36
void copyTHElement(THElement &)
Definition: THElement.cpp:42
void readInfoFromFile(std::ifstream &)
Definition: THElement.cpp:31
void retrieveTHElementFromFile(std::ifstream &)
Definition: THElement.cpp:39
bool si_unit
true = SI units, false = British units
Definition: fmodule.h:107