I'm running Ubuntu 12.04 on VirtualBox 4.3.12 on Mac OS X 10.9 as host. In the last few days I tried to solve some chemistry mechanisms with an extension to the open-source software Cantera 2.0.0. In my particular case, there is an input.txt file, which can be modified to define the boundary conditions. The software solves some equations and writes two files. The first one is there to store all the results of the calculation, the second one serves as the basis for the next run.
Whereas the calculation runs fine, I sometimes (depends on the entries in the input file) get an error when the program tries to access the files:
Code: Select all
*** glibc detected *** ./flamelet: malloc(): memory corruption: 0x0000000000e67360 ***I took a look at the code of this "flamelet" executable and localized the error. It might help you to have a look also, so I insert the important part of the code:
Code: Select all
//-------Scalar Dissipation Rate calculation
double a = sqrt(abs(solution(1,4))/ gas.density());
double dissRate = 2.0*a/M_PI*exp(-2.0*pow(boost::math::erfc_inv(2.0*Z_st),2));
cout << "Scalar Dissipation Rate: " << dissRate << " 1/s"<< endl;
//-------Construct Filename
ostringstream strs;
strs << dissRate;
std::string str_dissRate = strs.str();
string strfile = "canteraTables/canteraTable_" + str_dissRate + ".csv";
char * filename = new char[strfile.length()];
strcpy(filename,strfile.c_str());
// Print the flamelet table to be used in OPENFOAM
ofstream myfile;
myfile.open(filename);
output_Excel(myfile, filename, names, solution);
string title;
string id;
string desc;
cout << "Do you want to write the initial guess file? press 1 for yes or 0 to no";
cin >> log_num;
if(log_num==1){
remove ("solution.xml");
flame.save(title= "solution.xml",id="id_01", desc="case_1");}Can someone please help me with my current problem? Many thanks in advance!