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

new cannot satisfy memory request.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 16, 2022, 13:27
Default new cannot satisfy memory request.
  #1
New Member
 
Roozbeh Salajeghe
Join Date: Feb 2020
Location: DTU_ Denmark
Posts: 2
Rep Power: 0
Roozbeh_Sa is on a distinguished road
Dear fomers,

I faced a strange run-time error after doing some small modifications to the interFoam solver, (with a new name interNewFoam after modification) and some of the libraries relevant to the mixture viscosity calculation. All the libraries and the solver were compiled without any warning and error, but when I tried to run the interNewFoam solver on the damBreak tutorial case I faced the following error.
Code:
new cannot satisfy memory request.
This does not necessarily mean you have run out of virtual memory.
It could be due to a stack violation caused by e.g. bad use of pointers or an out-of-date shared library
Aborted (core dumped)
My primary aim was to change the way viscosity was calculated in the interface of two phases. I describe what I did in what follows:
1- I modified the "incompressibleTwoPhaseMixture" library.
2- I modified the "immiscibleIncompressibleNewTwoPhaseMixture" library, and linked the modified library of step 1, to this library
3- I linked both of the above libraries to interNewFoam solver, and modified it as well.
All the new files, with their new names, are attached.
Having tried to solve this issue, I found out that the problem is coming from a very simple thing which is the initialization of two scalar variables. I defined two variables in my incompressibleNewTwoPhaseMixture.H as follows:
Code:
const scalar k_;
const scalar L_;
And initialized them in the constructor of the class (only the relevant part of the constructor is shown below):
Code:
Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture
(
    const volVectorField& U,
    const surfaceScalarField& phi
)
:
...,
k_(20),
L_(2),
...
{
calcNu();
}
With this method, I faced the run-time error message that was shown at the beginning of this post. However, if I define the scalar variables for each member function, the simulation runs very smoothly. One example of defining these variables in the calcNu() member function is shown below:

Code:
void Foam::incompressibleTwoPhaseMixture::calcNu()
{
    const scalar k_=20.0;
    const scalar L_=2.0;
    ...
    ...
}
I implemented this solver on the damBreak case, and I used both precompiled and compiled versions of OFv2112.

I want to know why this error message appears for the first method (defining the variable in the header file and initializing them in the constructor), while it is a valid C++ variable definition.

My src and applications directories, located in the $FOAM_RUN, containing only the two described libraries and the modified interNewFoam solver are attached below.

Any comment is appreciated.
Attached Files
File Type: zip src.zip (9.1 KB, 0 views)
File Type: zip applications.zip (8.3 KB, 1 views)
Roozbeh_Sa is offline   Reply With Quote

Reply


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
General recommendations for CFD hardware [WIP] flotus1 Hardware 19 June 23, 2024 19:02
new cannot satisfy memory request. sahm OpenFOAM Running, Solving & CFD 18 May 29, 2024 12:13
Error: New Cannot Satisfy Memory Request TCS OpenFOAM Programming & Development 2 June 5, 2018 11:23
new cannot satisfy memory request openFoam!! what is the meaning of this? adambarfi OpenFOAM Running, Solving & CFD 0 November 2, 2013 14:57
[OpenFOAM] Saving ParaFoam views and case sail ParaView 9 November 25, 2011 16:46


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