Esempio n. 1
0
PNamedShape CCPACSControlSurfaceDevice::getTransformedFlapShape()
{
    PNamedShape deviceShape = getFlapShape()->DeepCopy();
    gp_Trsf T = GetFlapTransform();
    BRepBuilderAPI_Transform form(deviceShape->Shape(), T);
    deviceShape->SetShape(form.Shape());
    
    // store the transformation property. Required e.g. for VTK metadata
    gp_GTrsf gT(T);
    CTiglTransformation tiglTrafo(gT);
    unsigned int nFaces = deviceShape->GetFaceCount();
    for (unsigned int iFace = 0; iFace < nFaces; ++iFace) {
        CFaceTraits ft = deviceShape->GetFaceTraits(iFace);
        ft.SetTransformation(tiglTrafo);
        deviceShape->SetFaceTraits(iFace, ft);
    }
    
    return deviceShape;
}
Esempio n. 2
0
Foam::tmp<Foam::Field<Foam::scalar>>
Foam::ParticleStressModels::Lun::tau
(
    const Field<scalar>& alpha,
    const Field<scalar>& rho,
    const Field<scalar>& uSqr
) const
{
    tmp<Field<scalar>> g0
    (
        0.6
      / max
        (
            1.0 - pow(alpha/alphaPacked_,1.0/3.0),
            max(eps_*(1.0 - alpha), small)
        )
    );

    tmp<Field<scalar>> gT(uSqr/3.0);

    return alpha*rho*(1.0 + alpha*(1.0 + e_)*g0)*gT;
}
void Foam::filmHeightInletVelocityFvPatchVectorField::updateCoeffs()
{
    if (updated())
    {
        return;
    }

    const fvsPatchField<scalar>& phip =
        patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);

    const fvPatchField<scalar>& rhop =
        patch().lookupPatchField<volScalarField, scalar>(rhoName_);

    // delatf has not yet been solved for, 
    // therefore initial deltafp value will be "value" from deltaf bc file
    const fvPatchField<scalar>& deltafp =
        patch().lookupPatchField<volScalarField, scalar>(deltafName_);

    vectorField n(patch().nf());
    const scalarField& magSf = patch().magSf();

    static bool first=true;
    if(!first){
        first=false;
//###################Nusselt velocity######################
        if(1){
            typedef const regionModels::surfaceFilmModels::kinematicSingleLayer filmModelType;

            filmModelType& film =
                refCast<filmModelType>(db().time().lookupObject
                                       <regionModels::surfaceFilmModels::surfaceFilmModel>
                                       ("surfaceFilmProperties")
                    );
            volVectorField gTan2(film.gTan());
            const label patchI = patch().index();
            gTan2.boundaryField()[patchI];
            const fvPatchField<scalar>& mup =
                patch().lookupPatchField<volScalarField, scalar>("muf");
            scalarField nu(deltafp.size()); 
            nu=mup/rhop;
            scalarField gT(deltafp.size()); 
            gT=mag(gTan2.boundaryField()[patchI]);
            /*operator==(0.1*n);*/
            /*Info << "gT " << gT<<endl;*/
            Info << "deltafp " << deltafp<<endl;
            Info << "deltafp.size " << deltafp.size() << endl;
            /*Info << "nu " << nu<<endl;*/
            /*Info << "n " << n<<endl;*/
            operator==(-(gT*deltafp*deltafp/3.0/nu)*n);
        }
//###################Nusselt velocity######################

    }
    else{
        // DEBUG(deltafp[0]);
        // DEBUG(phip[0]);
        // DEBUG(rhop[0]);
        // DEBUG(magSf[0]);
        // const vectorField u(deltafp*n*phip/(rhop*magSf*sqr(deltafp) + ROOTVSMALL));
        // DEBUG(u[0][1]);
        operator==(deltafp*n*phip/(rhop*magSf*sqr(deltafp) + ROOTVSMALL));
        /*operator==(deltafp*n*phip/(rhop*magSf*sqr(deltafp) + SMALL));*/
    }
    

    fixedValueFvPatchVectorField::updateCoeffs();
}