29 #ifndef SolverCompresorH
30 #define SolverCompresorH
51 stCompSolverVOut(Doub gas, Doub sout, Doub ttout, Doub ptout, Doub cpm, Doub rm, Doub g) {
60 Doub operator()(
const Doub AOut) {
66 TempOut = AOut * AOut / Gam / RMezcla;
67 VOut = sqrt((TempTotOut - TempOut) * 2 * CpMezcla);
68 PresOut = PresTotOut / pow(TempTotOut / TempOut, Gam / (Gam - 1));
69 return Massflow - PresOut / RMezcla / TempOut * VOut * SecOut;
105 stCompSolverVIn(Doub cari, Doub caro, Doub aai, Doub g, Doub rm, Doub cpm, Doub sin, Doub sout, Doub rc, Doub cpre,
106 Int_ s, Int_ sf, Doub ttinant, Doub ttoutant, Bool dir, Bool firt) {
113 Gam4 = 2 * Gam / Gam1;
120 TempTotInAnt = ttinant;
124 Doub operator()(
const Doub AIn) {
155 PresIn = __units::BarToPa(pow(AaIn / AIn, -Gam4));
156 TempIn =
pow2(AIn) / Gam / RMezcla;
157 VIn = 2 * (__cons::ARef * CarIn - AIn) / Gam1;
158 RhoIn = PresIn / (RMezcla * TempIn);
159 TempTotIn = TempIn +
pow2(VIn) / 2. / CpMezcla;
160 PresTotIn = PresIn * pow(TempTotIn / TempIn, Gam / Gam1);
162 Massflow = SentFlow * SecIn * RhoIn * VIn;
164 PresTotOut = PresTotIn * pow(RelComp, SentFlow);
167 TempTotOut = TempTotIn * (1 + CoefPres);
169 TempTotOut = TempTotInAnt;
172 Doub AOutMin = CarOut * __cons::ARef;
173 Doub AOutMax = 2 * CarOut * __cons::ARef / (3 - Gam);
175 Doub lim = sqrt(Gam * RMezcla * TempTotOut);
180 stCompSolverVOut FunAout(Massflow, SecOut, TempTotOut, PresTotOut, CpMezcla, RMezcla, Gam);
182 AOut = rtbis(FunAout, AOutMin, AOutMax, 1e-10);
190 return CarOut * __cons::ARef - (AOut - (double) Sig * VOut * Gam1 / 2) / __cons::ARef;