void FENE_P::correct()
{

    // Velocity gradient tensor
    volTensorField L = fvc::grad( U() );

    // Convected derivate term
    volTensorField C = tau_ & L;

    // Twice the rate of deformation tensor
    volSymmTensorField twoD = twoSymm( L );

     // Stress transport equation
    tmp<fvSymmTensorMatrix> tauEqn
    (
        fvm::ddt(tau_)
        + fvm::div(phi(), tau_)
        ==
        ( 1 / lambda_ / (1 - 3/L2_) ) * etaP_ * twoD 
        + twoSymm( C )
        - fvm::Sp( 1 / lambda_ + ( 3 / lambda_ / (1 - 3/L2_) +  tr(tau_)/etaP_ ) / (L2_), tau_ )
    );

    tauEqn().relax();
    solve(tauEqn);
}
Esempio n. 2
0
void XPP_SE::correct()
{
    // Velocity gradient tensor
    volTensorField L = fvc::grad( U() );

    // Convected derivate term
    volTensorField C = tau_ & L;

    // Twice the rate of deformation tensor
    volSymmTensorField twoD = twoSymm( L );

    // Two phase transport properties treatment
    volScalarField alpha1f = min(max(alpha(), scalar(0)), scalar(1));

    volScalarField lambdaOb =  alpha1f*lambdaOb1_ + (scalar(1) - alpha1f)*lambdaOb2_;

    volScalarField lambdaOs =  alpha1f*lambdaOs1_ + (scalar(1) - alpha1f)*lambdaOs2_;

    volScalarField etaP =  alpha1f*etaP1_ + (scalar(1) - alpha1f)*etaP2_;

    volScalarField alpha =  alpha1f*alpha1_ + (scalar(1) - alpha1f)*alpha2_;

    volScalarField q =  alpha1f*q1_ + (scalar(1) - alpha1f)*q2_;


    // Lambda (Backbone stretch)
    volScalarField Lambda = Foam::sqrt( 1 + tr(tau_)*lambdaOb/3/etaP );

    // lambdaS (stretch relaxation time)
    volScalarField lambdaS = lambdaOs*Foam::exp( -2/q*(Lambda - 1));  // lambdaOs and q different from zero

    // Extra function
    volScalarField fTau = 2*lambdaOb/lambdaS*(1 - 1/Lambda) + 1/Foam::sqr(Lambda)*(1 - alpha*tr(tau_ & tau_)*Foam::sqr(lambdaOb)/3/Foam::sqr(etaP));

     // Stress transport equation
    tmp<fvSymmTensorMatrix> tauEqn
    (
        fvm::ddt(lambdaOb, tau_)
        + lambdaOb * fvm::div(phi(), tau_)
        ==
        etaP * twoD
        + lambdaOb * twoSymm( C )
        - fvm::Sp(fTau, tau_)
        - ( alpha*lambdaOb/etaP*(tau_ & tau_) + etaP/(lambdaOb + pt_)*(fTau -1)*I_)  // pt_ to avoid numeric problems for lambdaOb = 0. Jovani Favero - 29/12/2009
    );

    tauEqn().relax();
    solve(tauEqn);

}
void Foam::Oldroyd_B::correct()
{
    // Velocity gradient tensor
    volTensorField L = fvc::grad(U());

    // Convected derivate term
    volTensorField C = tau_ & L;

    // Twice the rate of deformation tensor
    volSymmTensorField twoD = twoSymm(L);

    // Stress transport equation
    fvSymmTensorMatrix tauEqn
    (
        fvm::ddt(tau_)
      + fvm::div(phi(), tau_)
     ==
        etaP_/lambda_*twoD
      + twoSymm(C)
      - fvm::Sp(1/lambda_, tau_)
    );

    tauEqn.relax();
    tauEqn.solve();
}
void Foam::WhiteMetznerCross::correct()
{
    // Velocity gradient tensor
    volTensorField L = fvc::grad(U());

    // Convected derivate term
    volTensorField C = tau_ & L;

    // Twice the rate of deformation tensor
    volSymmTensorField twoD = twoSymm(L);

    // Effective viscosity and relaxation time
    volScalarField etaPValue = etaP_/
        (1 + Foam::pow(K_* sqrt(2.0)*mag(symm(L)), (1 - m_)));

    volScalarField lambdaValue = lambda_/
        (1 + Foam::pow(L_ * sqrt(2.0)*mag(symm(L)), (1 - n_)));

    // Stress transport equation
    fvSymmTensorMatrix tauEqn
    (
        fvm::ddt(tau_)
      + fvm::div(phi(), tau_)
     ==
        etaPValue/lambdaValue*twoD
      + twoSymm(C)
      - fvm::Sp(1/lambdaValue, tau_)
    );

    tauEqn.relax();
    tauEqn.solve();
}
Esempio n. 5
0
void FENE_P::correct()
{
    // Velocity gradient tensor
    volTensorField L = fvc::grad(U());

    // Convected derivate term
    volTensorField C = tau_ & L;

    // Twice the rate of deformation tensor
    volSymmTensorField twoD = twoSymm(L);

    // Two phase transport properties treatment
    volScalarField alpha1f = 
		min(max(alpha(),scalar(0)),scalar(1));

    volScalarField lambda =  
		alpha1f*lambda1_ + (scalar(1) - alpha1f)*lambda2_;

    volScalarField etaP =  
		alpha1f*etaP1_ + (scalar(1) - alpha1f)*etaP2_;

    volScalarField Lquad =  
		alpha1f*Lquad1_ + (scalar(1) - alpha1f)*Lquad2_;

     // Stress transport equation
    tmp<fvSymmTensorMatrix> tauEqn
    (
		fvm::ddt(lambda, tau_)
	  + lambda * fvm::div(phi(), tau_)
	 ==
		( 1 / (1 - 3/Lquad) ) * etaP * twoD
	  + lambda * twoSymm( C )
	  - fvm::Sp
		( 
			1  + (3/(1 - 3/Lquad) + lambda*tr(tau_)/etaP )/Lquad, 
			tau_ 
		)
    );

    tauEqn().relax();
    solve(tauEqn);
}
Esempio n. 6
0
void Feta_PTT::correct()
{
    // Velocity gradient tensor
    volTensorField L = fvc::grad( U() );

    // Convected derivate term
    volTensorField C = tau_ & L;

    // Twice the rate of deformation tensor
    volSymmTensorField twoD = twoSymm( L );

    // Two phase transport properties treatment
    alpha1f_ = min(max(alpha(), scalar(0)), scalar(1));

    // etaP effective
    etaPEff_ =  (etaP1_/( Foam::pow(scalar(1) + A1_*Foam::pow(0.5*( Foam::sqr(tr(tau_)) - tr(tau_ & tau_) ) * Foam::sqr(lambda1_) / Foam::sqr(etaP1_), a1_), b1_) ) )*alpha1f_ + (etaP2_/( Foam::pow(scalar(1) + A2_*Foam::pow(0.5*( Foam::sqr(tr(tau_)) - tr(tau_ & tau_) ) * Foam::sqr(lambda2_) / Foam::sqr(etaP2_), a2_), b2_) ) )*(scalar(1) - alpha1f_);

    // lambda effective
    lambdaEff_ =  (lambda1_ / (scalar(1)  + epsilon1_*lambda1_*tr(tau_) / etaP1_) )*alpha1f_ + (lambda2_ / (scalar(1)  + epsilon2_*lambda2_*tr(tau_) / etaP2_) )*(scalar(1) - alpha1f_);

    volScalarField epsilon =  alpha1f_*epsilon1_ + (scalar(1) - alpha1f_)*epsilon2_;

    volScalarField zeta =  alpha1f_*zeta1_ + (scalar(1) - alpha1f_)*zeta2_;

     // Stress transport equation
    tmp<fvSymmTensorMatrix> tauEqn
    (
          fvm::ddt(lambdaEff_, tau_)
        + lambdaEff_ * fvm::div(phi(), tau_)
        ==
          etaPEff_ * twoD
        + lambdaEff_ * twoSymm( C )
        - zeta * lambdaEff_ /2* symm( (tau_ & twoD) + (twoD & tau_) )
	  //add "twoSymm"(...), by Martin R. Du, [email protected]
	  //replace "*twoSymm" with "*symm", Martin R. Du, 2015/08/08
        - fvm::Sp( epsilon * lambdaEff_ / etaPEff_ * tr(tau_) + 1, tau_ )
    );

    tauEqn().relax();
    solve(tauEqn);

}
Esempio n. 7
0
void Foam::S_MDCPP::correct()
{
    // Velocity gradient tensor
    volTensorField L = fvc::grad(U());

    // Convected derivate term
    volTensorField C = tau_ & L;

    // Twice the rate of deformation tensor
    volSymmTensorField twoD = twoSymm(L);

    // Two phase transport properties treatment
    volScalarField alpha1f = min(max(alpha(), scalar(0)), scalar(1));

    volScalarField lambdaOb =  alpha1f*lambdaOb1_ + (scalar(1) - alpha1f)*lambdaOb2_;

    volScalarField lambdaOs =  alpha1f*lambdaOs1_ + (scalar(1) - alpha1f)*lambdaOs2_;

    volScalarField etaP =  alpha1f*etaP1_ + (scalar(1) - alpha1f)*etaP2_;

    volScalarField zeta =  alpha1f*zeta1_ + (scalar(1) - alpha1f)*zeta2_;

    volScalarField q =  alpha1f*q1_ + (scalar(1) - alpha1f)*q2_;

    // Lambda (Backbone stretch)
    volScalarField Lambda =
        Foam::sqrt(1 + tr(tau_)*lambdaOb*(1 - zeta)/3/etaP);

    // Auxiliary field
    volScalarField aux = Foam::exp( 2/q*(Lambda - 1));

    // Extra function
    volScalarField fTau =
        aux*(2*lambdaOb/lambdaOs*(1 - 1/Lambda) + 1/Foam::sqr(Lambda));

    // Stress transport equation
    fvSymmTensorMatrix tauEqn
    (
        fvm::ddt(lambdaOb, tau_)
      + fvm::div(phi(), tau_)
     ==
        etaP*twoD
      + lambdaOb * twoSymm(C)
      - lambdaOb * zeta*symm(tau_ & twoD)
      - fvm::Sp(fTau, tau_)
      - (
            (etaP/lambdaOb/(1 - zeta)*(fTau - aux)*I_)
        )
    );

    tauEqn.relax();
    tauEqn.solve();
}
Esempio n. 8
0
void Giesekus_Cross::correct()
{
    // Velocity gradient tensor
    volTensorField L = fvc::grad(U());

    // Convected derivate term
    volTensorField C = tau_ & L;

    // Twice the rate of deformation tensor
    volSymmTensorField twoD = twoSymm(L);

    // Two phase transport properties treatment
    volScalarField alpha1f = min(max(alpha(), scalar(0)), scalar(1));

    volScalarField lambda =  alpha1f*lambda1_ + (scalar(1) - alpha1f)*lambda2_;

    volScalarField etaP =  alpha1f*etaP1_ + (scalar(1) - alpha1f)*etaP2_;

    volScalarField alpha =  alpha1f*alpha1_ + (scalar(1) - alpha1f)*alpha2_;

     // Stress transport equation
    tmp<fvSymmTensorMatrix> tauEqn
    (
        fvm::ddt(lambda, tau_)
        + lambda * fvm::div(phi(), tau_)
        ==
        etaP * twoD
        + lambda * twoSymm( C )
        - (alpha * lambda / mu()) * ( tau_ & tau_)
        - fvm::Sp( scalar(1), tau_ )
    );
    Info << "test 0" << endl;
    tauEqn().relax();
    solve(tauEqn);

}
Esempio n. 9
0
File: EPTT.C Progetto: chnrdu/idurun
void Foam::EPTT::correct()
{
    // Velocity gradient tensor
    volTensorField L = fvc::grad(U());

    // Convected derivate term
    volTensorField C = tau_ & L;

    // Twice the rate of deformation tensor
    volSymmTensorField twoD = twoSymm(L);

    // Two phase transport properties treatment
    volScalarField alpha1f = 
		min(max(alpha(),scalar(0)),scalar(1));

    volScalarField lambda =  
		alpha1f*lambda1_ + (scalar(1) - alpha1f)*lambda2_;

    volScalarField etaP =  
		alpha1f*etaP1_ + (scalar(1) - alpha1f)*etaP2_;

    volScalarField epsilon =  
		alpha1f*epsilon1_ + (scalar(1) - alpha1f)*epsilon2_;

    volScalarField zeta =  
		alpha1f*zeta1_ + (scalar(1) - alpha1f)*zeta2_;

	// Stress transport equation
    fvSymmTensorMatrix tauEqn
    (
		fvm::ddt(lambda,tau_)
      + lambda*fvm::div(phi(),tau_)
     ==
        etaP*twoD
      + lambda*twoSymm(C)
      - zeta*lambda/2*((tau_ & twoD) + (twoD & tau_))
      - fvm::Sp
		( 
			Foam::exp(epsilon*lambda/etaP*tr(tau_)), 
			tau_ 
		)
	);

    tauEqn.relax();
    tauEqn.solve();
}
void Foam::Maxwell::correct()
{
    // Velocity gradient tensor
    volTensorField L = fvc::grad(U());

    // Twice the rate of deformation tensor
    volSymmTensorField twoD = twoSymm(L);

     // Stress transport equation
    fvSymmTensorMatrix tauEqn
    (
        fvm::ddt(tau_)
     ==
        etaP_/lambda_*twoD
      - fvm::Sp( 1/lambda_, tau_ )
    );

    tauEqn.relax();
    tauEqn.solve();
}
void Foam::S_MDCPP::correct()
{
    // Velocity gradient tensor
    volTensorField L = fvc::grad(U());

    // Convected derivate term
    volTensorField C = tau_ & L;

    // Twice the rate of deformation tensor
    volSymmTensorField twoD = twoSymm(L);

    // Lambda (Backbone stretch)
    volScalarField Lambda =
        Foam::sqrt(1 + tr(tau_)*lambdaOb_*(1 - zeta_)/3/etaP_);

    // Auxiliary field
    volScalarField aux = Foam::exp( 2/q_*(Lambda - 1));

    // Extra function
    volScalarField fTau =
        aux*(2*lambdaOb_/lambdaOs_*(1 - 1/Lambda) + 1/Foam::sqr(Lambda));

    // Stress transport equation
    fvSymmTensorMatrix tauEqn
    (
        fvm::ddt(tau_)
        + fvm::div(phi(), tau_)
        ==
        etaP_/lambdaOb_*twoD
        + twoSymm(C)
        - zeta_/2*((tau_ & twoD) + (twoD & tau_))
        - fvm::Sp(1/lambdaOb_*fTau, tau_)
        - (
            1/lambdaOb_*(etaP_/lambdaOb_/(1 - zeta_)*(fTau - aux)*I_)
        )
    );

    tauEqn.relax();
    tauEqn.solve();
}