Foam::tmp<Foam::volScalarField> Foam::SyamlalOBrien::K ( const volScalarField& Ur ) const { volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6))); volScalarField A(pow(beta, 4.14)); volScalarField B ( neg(beta - 0.85)*(0.8*pow(beta, 1.28)) + pos(beta - 0.85)*(pow(beta, 2.65)) ); volScalarField Re(max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3))); volScalarField Vr ( 0.5* ( A - 0.06*Re + sqrt(sqr(0.06*Re) + 0.12*Re*(2.0*B - A) + sqr(A)) ) ); volScalarField Cds(sqr(0.63 + 4.8*sqrt(Vr/Re))); return 0.75*Cds*phaseb_.rho()*Ur/(phasea_.d()*sqr(Vr)); }
Foam::tmp<Foam::volScalarField> Foam::dragModels::SyamlalOBrien::CdRe() const { volScalarField alpha2 ( max(scalar(1) - pair_.dispersed(), pair_.continuous().residualAlpha()) ); volScalarField A(pow(alpha2, 4.14)); volScalarField B ( neg(alpha2 - 0.85)*(0.8*pow(alpha2, 1.28)) + pos0(alpha2 - 0.85)*(pow(alpha2, 2.65)) ); volScalarField Re(pair_.Re()); volScalarField Vr ( 0.5 *( A - 0.06*Re + sqrt(sqr(0.06*Re) + 0.12*Re*(2.0*B - A) + sqr(A)) ) ); volScalarField CdsRe(sqr(0.63*sqrt(Re) + 4.8*sqrt(Vr))); return CdsRe *max(pair_.continuous(), pair_.continuous().residualAlpha()) /sqr(Vr); }
Foam::tmp<Foam::volScalarField> Foam::dragModels::SyamlalOBrien::K ( const volScalarField& Ur ) const { volScalarField alpha2(max(phase2_, scalar(1.0e-6))); volScalarField A(pow(alpha2, 4.14)); volScalarField B ( neg(alpha2 - 0.85)*(0.8*pow(alpha2, 1.28)) + pos(alpha2 - 0.85)*(pow(alpha2, 2.65)) ); volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3))); volScalarField Vr ( 0.5* ( A - 0.06*Re + sqrt(sqr(0.06*Re) + 0.12*Re*(2.0*B - A) + sqr(A)) ) ); volScalarField Cds(sqr(0.63 + 4.8*sqrt(Vr/Re))); return 0.75*Cds*phase2_.rho()*Ur/(phase1_.d()*sqr(Vr)); }
Real Generalized_HullWhite::A(Time t, Time T) const { DiscountFactor discount1 = termStructure()->discount(t); DiscountFactor discount2 = termStructure()->discount(T); Rate forward = termStructure()->forwardRate(t, t, Continuous, NoFrequency); Real temp = B(t,T); Real value = B(t,T)*forward - 0.5*temp*temp*Vr(0, t); return std::exp(value)*discount2/discount1; }
Real Generalized_HullWhite::Vp(Time t, Time Tf, Time Tp) const { return Vr(t, Tf) * B(Tf, Tp) * B(Tf, Tp); }
Real Generalized_HullWhite::stdDeviation(Time s, Time t, Rate x) { return std::sqrt( Vr(s, t) ); }