CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Problems with interpolation (https://www.cfd-online.com/Forums/openfoam-programming-development/141261-problems-interpolation.html)

oswald September 3, 2014 11:51

Problems with interpolation
 
Dear Users,

I am trying to implement some forces in the lagrangian library. For this purpose I need the curl of the carrier velocity field at the particles' positions. So I included a interpolator similar for this in kinematicParcel, similar to the already existing interpolators.

Code:

    curlUInterp_
    (
        interpolation<vector>::New
        (
            cloud.solution().interpolationSchemes(),
            fvc::curl(cloud.U())
        )
    ),

This is in principle working. But after some time of running a simulation, I get an output like the following:

0] #0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[0] #1 Foam::sigSegv::sigHandler(int) in "/opt/openfoam/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[0] #2 in "/lib/libc.so.6"
[0] #3 Foam::interpolationCellPoint<Foam::Vector<double> >::interpolate(Foam::Vector<double> const&, Foam::tetIndices const&, int) const in "/opt/openfoam/openfoam211/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
[0] #4
[0] at ~/OpenFOAM/user-2.1.1/src/lagrangian/incompressible/intermediate/lnInclude/KinematicParcel.C:67
...

Line 67 in KinematicParcel.C calls this new interpolator:

Code:

    curlUc_ = td.curlUInterp().interpolate(this->position(), tetIs);
All the other interpolators work fine. Does anyone have an idea what the error could be? And maybe how to solve it?

dradenkovic March 7, 2016 11:28

Hello oswald,

Have you found the error?

Regards,
Darko

oswald March 15, 2016 02:49

Hi Darko,

I don't remember exactly what the solution was, but at the moment I call the interpolator in KinematicParcel.C like this:

Code:

    curlUc_ = td.curlUcInterp().interpolate(this->position(), cellI);
and I changed the Cloud so that it has a field called curlUc and I can use this in KinematicParcelTrackingData.H:

Code:

    curlUcInterp_
    (
        interpolation<vector>::New
        (
            cloud.solution().interpolationSchemes(),
            cloud.curlUc()
        )
    ),

Hope this helps :)
oswald

dradenkovic March 15, 2016 04:09

Thank you.

Regards,
Darko


All times are GMT -4. The time now is 01:21.