CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

OpenFOAM issue with interpolation (urgent help)

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 13, 2024, 00:27
Default OpenFOAM issue with interpolation (help)
  #1
New Member
 
Saman
Join Date: Nov 2024
Posts: 2
Rep Power: 0
Fairy is on a distinguished road
Hello Foamers,
I hope you are all doing well.

I’m encountering a complex issue in OpenFOAM 5.x and would greatly appreciate your assistance. I have a class that calculates the temperature at a specific point in each cell, which is called every timestep.

The calculation of temperature at that specific point is conducted using cell, cellPoint, cellPintFace interpolation schemes.
The class for calling the interpolation header files is as follows:

Temp.C

Code:
interpolationCellPoint<scalar> voidfractionInterpolator_(voidfraction_);
interpolationCellPoint<vector> UInterpolator_(U_);
interpolationCellPoint<scalar> TInterpolator_(tempField_);

 for(int index = 0;index < particleCloud_.numberOfParticles(); ++index)
    {
            cellI = particleCloud_.cellIDs()[index][0];
            if(cellI >= 0)
            {
                    vector position = particleCloud_.position(index);
                    voidfraction = voidfractionInterpolator_.interpolate(position,cellI);
                    Ufluid = UInterpolator_.interpolate(position,cellI);
                    Tfluid = TInterpolator_.interpolate(position,cellI);
            }
   }
However, I’ve noticed that the line for:
Code:
interpolationCellPoint<scalar> TInterpolator_(tempField_);
suddenly gets stuck after a large number of iterations without any error. This behaviour occurs with the schemes cellPoint and cellPointFace, but not with cell, which is not accurate enough.



I’m wondering if this could be related to a memory leak for the TInterpolator_ because of its enourmous usage during simulation. The interpolationCellPoint.C file suggests a possible cause for this scenario:

Code:
template<class Type>
Foam::interpolationCellPoint<Type>::interpolationCellPoint
(
    const GeometricField<Type, fvPatchField, volMesh>& psi
)
:
    interpolation<Type>(psi),
    psip_
    (
        volPointInterpolation::New(psi.mesh()).interpolate
        (
            psi,
            "volPointInterpolate(" + psi.name() + ')',
            true        // use cache
        )
    )
{
    // Uses cellPointWeight to do interpolation which needs tet decomposition
    (void)psi.mesh().tetBasePtIs();
}
If it is indeed a memory issue, how can I reset the memory allocation for TInterpolator_ every timestep to prevent this problem?


Please guide me how to solve this issue!

Last edited by Fairy; November 13, 2024 at 02:50.
Fairy is offline   Reply With Quote

Old   November 14, 2024, 18:23
Default
  #2
New Member
 
Saman
Join Date: Nov 2024
Posts: 2
Rep Power: 0
Fairy is on a distinguished road
Nobody knows how I can reset the memory for his interpolation variable every time step?
I really got stuck into this issue.
Fairy is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM.org] Openfoam 5 on centos 7, environment variables issue mahmoodn OpenFOAM Installation 2 October 6, 2020 09:52
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology wyldckat OpenFOAM 17 November 10, 2017 16:54
OpenFOAM v3.0+ ?? SBusch OpenFOAM 22 December 26, 2016 15:24
OpenFOAM Training: Programming CFD Course 12-13 and 19-20 April 2016 cfd.direct OpenFOAM Announcements from Other Sources 0 January 14, 2016 11:19
CyclicAMI Issue In OpenFOAM 2.2.0 prasant OpenFOAM Running, Solving & CFD 17 March 16, 2013 03:00


All times are GMT -4. The time now is 11:58.