CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   KinematicParcel fvc::curl(U) (https://www.cfd-online.com/Forums/openfoam/205011-kinematicparcel-fvc-curl-u.html)

cojua8 August 7, 2018 12:54

KinematicParcel fvc::curl(U)
 
Hello,

I'm trying to set the vorticity of the fluid in a similar way than the velocity or density in the KinematicParcel class:

File KinematicParcelTrackingDataI.H:

Code:

template<class ParcelType>
template<class CloudType>
inline Foam::KinematicParcel<ParcelType>::TrackingData<CloudType>::TrackingData
(
    CloudType& cloud,
    trackPart part
)
:
    ParcelType::template TrackingData<CloudType>(cloud),
    rhoInterp_
    (
        interpolation<scalar>::New
        (
            cloud.solution().interpolationSchemes(),
            cloud.rho()
        )
    ),
    UInterp_
    (
        interpolation<vector>::New
        (
            cloud.solution().interpolationSchemes(),
            cloud.U()
        )
    ),
    muInterp_
    (
        interpolation<scalar>::New
        (
            cloud.solution().interpolationSchemes(),
            cloud.mu()
        )
    ),
    curlUInterp_
    (
        interpolation<vector>::New
        (
            cloud.solution().interpolationSchemes(),
            fvc::curl(cloud.U())
        ).ptr()
    ),

    g_(cloud.g().value()),
    part_(part)
{}

file KinematicParcel.C:

Code:

template<class ParcelType>
template<class TrackData>
void Foam::KinematicParcel<ParcelType>::setCellValues
(
    TrackData& td,
    const scalar dt,
    const label celli
)
{
    tetIndices tetIs = this->currentTetIndices();

    rhoc_ = td.rhoInterp().interpolate(this->coordinates(), tetIs);

    if (rhoc_ < td.cloud().constProps().rhoMin())
    {
        if (debug)
        {
            WarningInFunction
                << "Limiting observed density in cell " << celli << " to "
                << td.cloud().constProps().rhoMin() <<  nl << endl;
        }

        rhoc_ = td.cloud().constProps().rhoMin();
    }

    Uc_ = td.UInterp().interpolate(this->coordinates(), tetIs);

    muc_ = td.muInterp().interpolate(this->coordinates(), tetIs);

    curlUc_ = td.curlUInterp().interpolate(this->coordinates(), tetIs);


    // Apply dispersion components to carrier phase velocity
    Uc_ = td.cloud().dispersion().update
    (
        dt,
        celli,
        U_,
        Uc_,
        UTurb_,
        tTurb_
    );
}

However, when running my case it crashes after a while giving this error:

Code:

[1] #0  Foam::error::printStack(Foam::Ostream&) at ??:?
[1] #1  Foam::sigSegv::sigHandler(int) at ??:?
[1] #2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
[1] #3  Foam::interpolationCell<Foam::Vector<double> >::interpolate(Foam::Vector<double> const&, int, int) const at ??:?
[1] #4  Foam::interpolationCell<Foam::Vector<double> >::interpolate(Foam::Barycentric<double> const&, Foam::tetIndices const&, int) const at ??:?

How can I solve this?


All times are GMT -4. The time now is 07:25.