コード例 #1
0
tmp<fvMatrix<Type> >
laplacian
(
    GeometricField<Type, fvPatchField, volMesh>& vf
)
{
    surfaceScalarField Gamma
    (
        IOobject
        (
            "1",
            vf.time().constant(),
            vf.mesh(),
            IOobject::NO_READ
        ),
        vf.mesh(),
        dimensionedScalar("1", dimless, 1.0)
    );

    return fvm::laplacian
    (
        Gamma,
        vf,
        "laplacian(" + vf.name() + ')'
    );
}
コード例 #2
0
const tmp<surfaceScalarField> interpolWeights(GeometricField<type, fvPatchField, volMesh>& vf, const word& name){

    //vf.boundaryField().updateCoeffs();
    const objectRegistry& db = vf.db();

    //const volVectorField& u = db.lookupObject<volVectorField>("vc");
    const volVectorField& u = db.lookupObject<volVectorField>("u");
    //const volVectorField& u = db.lookupObject<volVectorField>("s");

    surfaceScalarField phi
    (
        IOobject
        (
            "phi",
            vf.time().timeName(),
            vf.mesh(),
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        linearInterpolate(u) & vf.mesh().Sf()
    );

    tmp<surfaceInterpolationScheme<type> > tinterpScheme;
    tinterpScheme = fvc::scheme<type>(phi, vf.mesh().schemesDict().interpolationScheme(name));

    const surfaceInterpolationScheme<type>& interpolationScheme = tinterpScheme();

    tmp<surfaceScalarField> tweights = interpolationScheme.weights(vf);

    //Info << "weights[15]:" << tweights()[15] << endl;

    return tweights;

}
コード例 #3
0
ファイル: fvmGrad.C プロジェクト: JonasBuenger/myFoamStuff
 tmp<fvMatrix<typename outerProduct<vector, Type>::type> > grad
 (
     GeometricField<Type, fvPatchField, volMesh>& vf
 )
 {
     return fv::gradScheme<Type>::New
     (
         vf.mesh(),
         vf.mesh().schemesDict().gradScheme(vf.name())
     )().fvmGrad(vf);
 }
コード例 #4
0
ファイル: fvcD2dt2.C プロジェクト: Haider-BA/foam-extend-3.0
tmp<GeometricField<Type, fvPatchField, volMesh> >
d2dt2
(
    const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
    return fv::d2dt2Scheme<Type>::New
    (
        vf.mesh(),
        vf.mesh().schemesDict().ddtScheme("d2dt2(" + vf.name() + ')')
    )().fvcD2dt2(vf);
}
コード例 #5
0
ファイル: fvmD2dt2.C プロジェクト: Cescfangs/OpenFOAM-1.7.x
tmp<fvMatrix<Type> >
d2dt2
(
    GeometricField<Type, fvPatchField, volMesh>& vf
)
{
    return fv::d2dt2Scheme<Type>::New
    (
        vf.mesh(),
        vf.mesh().d2dt2Scheme("d2dt2(" + vf.name() + ')')
    )().fvmD2dt2(vf);
}
コード例 #6
0
ファイル: fvcDdt.C プロジェクト: Brzous/WindFOAM
tmp<GeometricField<Type, fvPatchField, volMesh> >
ddt
(
    const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
    return fv::ddtScheme<Type>::New
    (
        vf.mesh(),
        vf.mesh().ddtScheme("ddt(" + vf.name() + ')')
    )().fvcDdt(vf);
}
コード例 #7
0
ファイル: famDdt.C プロジェクト: Haider-BA/foam-extend-3.0
tmp<faMatrix<Type> >
ddt
(
    GeometricField<Type, faPatchField, areaMesh>& vf
)
{
    return fa::faDdtScheme<Type>::New
    (
        vf.mesh(),
        vf.mesh().schemesDict().ddtScheme("ddt(" + vf.name() + ')')
    )().famDdt(vf);
}
コード例 #8
0
ファイル: fvcSnGrad.C プロジェクト: OpenFOAM/OpenFOAM-dev
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
snGrad
(
    const GeometricField<Type, fvPatchField, volMesh>& vf,
    const word& name
)
{
    return fv::snGradScheme<Type>::New
    (
        vf.mesh(),
        vf.mesh().snGradScheme(name)
    )().snGrad(vf);
}
コード例 #9
0
ファイル: fvmD2dt2.C プロジェクト: Cescfangs/OpenFOAM-1.7.x
tmp<fvMatrix<Type> >
d2dt2
(
    const volScalarField& rho,
    GeometricField<Type, fvPatchField, volMesh>& vf
)
{
    return fv::d2dt2Scheme<Type>::New
    (
        vf.mesh(),
        vf.mesh().d2dt2Scheme("d2dt2(" + rho.name() + ',' + vf.name() + ')')
    )().fvmD2dt2(rho, vf);
}
コード例 #10
0
ファイル: fvcDdt.C プロジェクト: Brzous/WindFOAM
tmp<GeometricField<Type, fvPatchField, volMesh> >
ddt
(
    const dimensionedScalar& rho,
    const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
    return fv::ddtScheme<Type>::New
    (
        vf.mesh(),
        vf.mesh().ddtScheme("ddt(" + rho.name() + ',' + vf.name() + ')')
    )().fvcDdt(rho, vf);
}
コード例 #11
0
tmp<fvMatrix<Type> >
ddt
(
    GeometricField<Type, fvPatchField, volMesh>& vf,
    const word& name
)
{
    return fv::ddtScheme<Type>::New
    (
        vf.mesh(),
        vf.mesh().schemesDict().ddtScheme(name)
    )().fvmDdt(vf);
}
コード例 #12
0
tmp<GeometricField<Type, faPatchField, areaMesh> >
laplacian
(
    const GeometricField<Type, faPatchField, areaMesh>& vf,
    const word& name
)
{
    return fa::laplacianScheme<Type>::New
    (
        vf.mesh(),
        vf.mesh().schemesDict().laplacianScheme(name)
    )().facLaplacian(vf);
}
コード例 #13
0
tmp<GeometricField<Type, fvPatchField, volMesh> >
laplacian
(
    const GeometricField<Type, fvPatchField, volMesh>& vf,
    const word& name
)
{
    return fv::laplacianScheme<Type, scalar>::New
    (
        vf.mesh(),
        vf.mesh().laplacianScheme(name)
    )().fvcLaplacian(vf);
}
コード例 #14
0
ファイル: fvcD2dt2.C プロジェクト: OpenFOAM/OpenFOAM-dev
tmp<GeometricField<Type, fvPatchField, volMesh>>
d2dt2
(
    const volScalarField& rho,
    const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
    return fv::d2dt2Scheme<Type>::New
    (
        vf.mesh(),
        vf.mesh().ddtScheme("d2dt2(" + rho.name() + ',' + vf.name() + ')')
    ).ref().fvcD2dt2(rho, vf);
}
コード例 #15
0
tmp<faMatrix<Type> >
laplacian
(
    const edgeScalarField& gamma,
    GeometricField<Type, faPatchField, areaMesh>& vf,
    const word& name
)
{
    return fa::laplacianScheme<Type>::New
    (
        vf.mesh(),
        vf.mesh().schemesDict().laplacianScheme(name)
    )().famLaplacian(gamma, vf);
}
コード例 #16
0
tmp<fvMatrix<Type> >
laplacian
(
    const GeometricField<GType, fvsPatchField, surfaceMesh>& gamma,
    GeometricField<Type, fvPatchField, volMesh>& vf,
    const word& name
)
{
    return fv::laplacianScheme<Type, GType>::New
    (
        vf.mesh(),
        vf.mesh().schemesDict().laplacianScheme(name)
    )().fvmLaplacian(gamma, vf);
}
コード例 #17
0
tmp<GeometricField<Type, fvPatchField, volMesh> >
div
(
    const surfaceScalarField& flux,
    const GeometricField<Type, fvPatchField, volMesh>& vf,
    const word& name
)
{
    return fv::convectionScheme<Type>::New
    (
        vf.mesh(),
        flux,
        vf.mesh().schemesDict().divScheme(name)
    )().fvcDiv(flux, vf);
}
コード例 #18
0
tmp<GeometricField<Type, faPatchField, areaMesh> >
div
(
    const edgeScalarField& flux,
    const GeometricField<Type, faPatchField, areaMesh>& vf,
    const word& name
)
{
    return fa::convectionScheme<Type>::New
    (
        vf.mesh(),
        flux,
        vf.mesh().schemesDict().divScheme(name)
    )().facDiv(flux, vf);
}
コード例 #19
0
ファイル: fvmAdjDiv.C プロジェクト: Brzous/WindFOAM
tmp<fvMatrix<Type> >
adjDiv
(
    const surfaceScalarField& flux,
    GeometricField<Type, fvPatchField, volMesh>& vf,
    const word& name
)
{
    return fv::adjointConvectionScheme<Type>::New
    (
        vf.mesh(),
        flux,
        vf.mesh().divScheme(name)
    )().fvmAdjDiv(flux, vf);
}
コード例 #20
0
tmp<fvMatrix<Type> >
adjDiv
(
    const volVectorField& Up,
    GeometricField<Type, fvPatchField, volMesh>& vf,
    const word& name
)
{
    return fv::adjConvectionScheme<Type>::New
           (
               vf.mesh(),
               Up,
               vf.mesh().schemesDict().divScheme(name)
           )().fvmAdjDiv(Up, vf);
}
コード例 #21
0
tmp
<
    BlockLduSystem<vector, typename outerProduct<vector, Type>::type>
> grad
(
    GeometricField<Type, fvPatchField, volMesh>& vf,
    const word& name
)
{
    return fv::gradScheme<Type>::New
    (
        vf.mesh(),
        vf.mesh().schemesDict().gradScheme(name)
    )().fvmGrad(vf);
}
コード例 #22
0
ファイル: fvcFlux.C プロジェクト: BarisCumhur/OpenFOAM-dev
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
flux
(
    const surfaceScalarField& phi,
    const GeometricField<Type, fvPatchField, volMesh>& vf,
    const word& name
)
{
    return fv::convectionScheme<Type>::New
    (
        vf.mesh(),
        phi,
        vf.mesh().divScheme(name)
    )().flux(phi, vf);
}
コード例 #23
0
ファイル: fvmSup.C プロジェクト: EricAlex/OpenFOAM-dev
Foam::tmp<Foam::fvMatrix<Type>>
Foam::fvm::SuSp
(
    const DimensionedField<scalar, volMesh>& susp,
    const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
    const fvMesh& mesh = vf.mesh();

    tmp<fvMatrix<Type>> tfvm
    (
        new fvMatrix<Type>
        (
            vf,
            dimVol*susp.dimensions()*vf.dimensions()
        )
    );
    fvMatrix<Type>& fvm = tfvm.ref();

    fvm.diag() += mesh.V()*max(susp.field(), scalar(0));

    fvm.source() -= mesh.V()*min(susp.field(), scalar(0))
        *vf.primitiveField();

    return tfvm;
}
コード例 #24
0
void Foam::motionSmootherAlgo::checkConstraints
(
    GeometricField<Type, pointPatchField, pointMesh>& pf
)
{
    typedef GeometricField<Type, pointPatchField, pointMesh> FldType;

    const polyMesh& mesh = pf.mesh();

    const polyBoundaryMesh& bm = mesh.boundaryMesh();

    // first count the total number of patch-patch points

    label nPatchPatchPoints = 0;

    forAll(bm, patchi)
    {
        if (!isA<emptyPolyPatch>(bm[patchi]))
        {
            nPatchPatchPoints += bm[patchi].boundaryPoints().size();
        }
    }


    typename FldType::GeometricBoundaryField& bFld = pf.boundaryField();


    // Evaluate in reverse order

    forAllReverse(bFld, patchi)
    {
        bFld[patchi].initEvaluate(Pstream::blocking);   // buffered
    }
コード例 #25
0
ファイル: noConvectionScheme.C プロジェクト: Brzous/WindFOAM
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
noConvectionScheme<Type>::interpolate
(
    const surfaceScalarField&,
    const GeometricField<Type, fvPatchField, volMesh>& vf
) const
{
    return tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
    (
        new GeometricField<Type, fvsPatchField, surfaceMesh>
        (
            IOobject
            (
                "interpolate("+vf.name()+')',
                vf.instance(),
                vf.db()
            ),
            vf.mesh(),
            dimensioned<Type>
            (
                "0",
                vf.dimensions(),
                pTraits<Type>::zero
            )
        )
    );
}
コード例 #26
0
Foam::tmp<Field<Type> > Foam::tecplotWriter::getFaceField
(
    const GeometricField<Type, fvsPatchField, surfaceMesh>& sfld,
    const labelList& faceLabels
) const
{
    const polyBoundaryMesh& patches = sfld.mesh().boundaryMesh();

    tmp<Field<Type> > tfld(new Field<Type>(faceLabels.size()));
    Field<Type>& fld = tfld();

    forAll(faceLabels, i)
    {
        label faceI = faceLabels[i];

        label patchI = patches.whichPatch(faceI);

        if (patchI == -1)
        {
            fld[i] = sfld[faceI];
        }
        else
        {
            label localFaceI = faceI - patches[patchI].start();
            fld[i] = sfld.boundaryField()[patchI][localFaceI];
        }
    }
コード例 #27
0
tmp<GeometricField<Type, PatchField, GeoMesh> > transform
(
    const GeometricField<tensor, PatchField, GeoMesh>& trf,
    const GeometricField<Type, PatchField, GeoMesh>& tf
)
{
    tmp<GeometricField<Type, PatchField, GeoMesh> > tranf
    (
        new GeometricField<Type, PatchField, GeoMesh>
        (
            IOobject
            (
                "transform(" + trf.name() + ',' + tf.name() + ')',
                tf.instance(),
                tf.db(),
                IOobject::NO_READ,
                IOobject::NO_WRITE
            ),
            tf.mesh(),
            tf.dimensions()
        )
    );

    transform(tranf(), trf, tf);

    return tranf;
}
コード例 #28
0
tmp
<
BlockLduSystem<vector, typename outerProduct<vector, Type>::type>
>
gradScheme<Type>::fvmGrad
(
    const GeometricField<Type, fvPatchField, volMesh>& vf
) const
{
    FatalErrorIn
    (
        "tmp<BlockLduSystem> gradScheme<Type>::fvmGrad\n"
        "(\n"
        "    GeometricField<Type, fvPatchField, volMesh>&"
        ")\n"
    )   << "Implicit gradient operator currently defined only for Gauss linear "
        << "and leastSquares (cell and face limiters are optional)."
        << abort(FatalError);

    typedef typename outerProduct<vector, Type>::type GradType;

    tmp<BlockLduSystem<vector, GradType> > tbs
    (
        new BlockLduSystem<vector, GradType>(vf.mesh())
    );

    return tbs;
}
コード例 #29
0
Type Foam::interpolatePointToCell
(
    const GeometricField<Type, pointPatchField, pointMesh>& ptf,
    const label celli
)
{
    const primitiveMesh& mesh = ptf.mesh()();

    const cell& cFaces = mesh.cells()[celli];

    labelHashSet pointHad(10*cFaces.size());

    Type sum(pTraits<Type>::zero);

    forAll(cFaces, i)
    {
        const face& f = mesh.faces()[cFaces[i]];

        forAll(f, fp)
        {
            label v = f[fp];

            if (pointHad.insert(v))
            {
                sum += ptf[v];
            }
        }
    }
コード例 #30
0
ファイル: volPointInterpolate.C プロジェクト: Brzous/WindFOAM
void volPointInterpolation::interpolateInternalField
(
    const GeometricField<Type, fvPatchField, volMesh>& vf,
    GeometricField<Type, pointPatchField, pointMesh>& pf
) const
{
    if (debug)
    {
        Info<< "volPointInterpolation::interpolateInternalField("
            << "const GeometricField<Type, fvPatchField, volMesh>&, "
            << "GeometricField<Type, pointPatchField, pointMesh>&) : "
            << "interpolating field from cells to points"
            << endl;
    }

    const labelListList& pointCells = vf.mesh().pointCells();

    // Multiply volField by weighting factor matrix to create pointField
    forAll(pointCells, pointi)
    {
        const scalarList& pw = pointWeights_[pointi];
        const labelList& ppc = pointCells[pointi];

        pf[pointi] = pTraits<Type>::zero;

        forAll(ppc, pointCelli)
        {
            pf[pointi] += pw[pointCelli]*vf[ppc[pointCelli]];
        }
    }