CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to use IOList (https://www.cfd-online.com/Forums/openfoam-solving/58354-how-use-iolist.html)

floooo November 11, 2008 10:26

Hi, I have modified icoLagr
 
Hi,

I have modified icoLagrangianFoam in a rhoPourousSimpleLagrangianFoam.

I have the position of particules which hit a filter.

Info << "position : "<<particule() << endl work
It works
position : (0.005758021228 0.01650806108 0.001)

Now I whant to write these positions in a file in order see it in paraFoam

I try with C and C++ but it doesn't work because position Type is Vector

C++ version

std::ofstream file("porous_hit", std::ios_base::out | std::ios_base::trunc);
if(file)
{
file << position() << std::endl;
file.close();
}


C version

FILE* file = NULL;
file = fopen("porous_result", "a");
fprintf(file,"%ld",position());
fclose(file);

I think the only solution is to use IOList but i don't know how

If it works my next step will be to stop only the bigest particules.


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