31 #include "TRotorTurbina.h"
36 TRotorTurbina::TRotorTurbina() :
44 TRotorTurbina::~TRotorTurbina() {
50 TRotorTurbina::TRotorTurbina(
TRotorTurbina *Origen,
int Valvula) :
55 FTipoRotor = Origen->FTipoRotor;
56 FCDEInicial = Origen->FCDEInicial;
57 FCDSInicial = Origen->FCDSInicial;
58 FDiametroRef = Origen->FDiametroRef;
60 FNumeroOrden = Origen->FNumeroOrden;
62 FDiamRef = FDiametroRef;
64 FCDTubVol = FCDEInicial;
65 FCDVolTub = FCDSInicial;
74 void TRotorTurbina::LeeDatosIniciales(
const char *FileWAM, fpos_t &filepos,
int norden,
bool HayMotor,
79 FILE *fich = fopen(FileWAM,
"r");
80 fsetpos(fich, &filepos);
82 FNumeroOrden = norden;
84 fscanf(fich,
"%lf %lf %lf ", &FCDEInicial, &FCDSInicial, &FDiametroRef);
86 fgetpos(fich, &filepos);
89 }
catch(exception &N) {
90 std::cout <<
"ERROR: LeeDatosIniciales CDFijo" << std::endl;
100 void TRotorTurbina::TipodeRotor(nmTipoRotor TipoRotor) {
103 FTipoRotor = TipoRotor;
105 }
catch(exception &N) {
106 std::cout <<
"ERROR: TRotorTurbina::TipodeRotor " << std::endl;
115 void TRotorTurbina::CalculaCD() {
119 FCDTubVol = FCDEInicial * FSectionRatio;
120 FCDVolTub = FCDSInicial * FSectionRatio;
123 FCDTubVol = FAreaEff / __geom::Circle_area(FDiamTubo);
124 FCDVolTub = FAreaEff / __geom::Circle_area(FDiamTubo);
127 FCDTubVol = FCDVbl * FSectionRatio;
128 FCDVolTub = FCDVbl * FSectionRatio;
133 }
else if(FCDTubVol < 0) {
138 }
else if(FCDVolTub < 0) {
141 }
catch(exception &N) {
142 std::cout <<
"ERROR: CalculaCD RotorTurbine" << std::endl;
149 void TRotorTurbina::GetCDin(
double Time) {
153 FCDTubVol = FCDEInicial * FSectionRatio;
156 FCDTubVol = FAreaEff / __geom::Circle_area(FDiamTubo);
159 FCDTubVol = FCDVbl * FSectionRatio;
164 }
else if(FCDTubVol < 0) {
169 void TRotorTurbina::GetCDout(
double Time) {
173 FCDVolTub = FCDSInicial * FSectionRatio;
176 FCDVolTub = FAreaEff / (
pow2(FDiamTubo) * __cons::Pi_4);
179 FCDVolTub = FCDVbl * FSectionRatio;
184 }
else if(FCDVolTub < 0) {
192 void TRotorTurbina::AsignaTurbina(
int NTurb) {
193 FNumeroTurbina = NTurb;
198 #pragma package(smart_init)