CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Issues running custom code in parallel (http://www.cfd-online.com/Forums/openfoam-programming-development/120875-issues-running-custom-code-parallel.html)

BigBlueDart July 16, 2013 14:08

Issues running custom code in parallel
 
I am working on a solver that I've developed using the solidParticle class as a base. I've gotten the code to run properly in serial, but when I try running it in parallel it gets stuck. I've narrowed it down to where a interpolationCellPoint<vector> is declared. While I have modified the code some, this would analogous to line 79 of solidParticleCloud.C (I have lines 78 and 80 commented out). Any ideas of why the code would get stuck here when running in parallel?

sophie_l October 15, 2013 06:11

Hi Scott,

Sorry I cannot contribute something to your question, but I've got a code based on solidParticle as well. When I decompose a case, particles are divided onto different processors and 'positions' under /processor*/0/lagrangian/defaultCloud/ are written correctly, but there is FOAM Warning:
Quote:

Processor 0: field transfer
--> FOAM Warning :
From function Cloud<ParticleType>::initCloud(const bool checkClass)
in file /openfoam/OpenFOAM-1.7.1/src/lagrangian/basic/lnInclude/CloudIO.C at line 124
Cannot read particle positions file
"/home/channel/processor0/0/lagrangian/defaultCloud"
assuming the initial cloud contains 0 particles.
I don't know whether this warning is fatal to a parallel run or not. After that, I tried to run it in parallel using 'mpirun -np $NSLOTS $EXEC' and 'mpirun -np $NSLOTS $EXEC -parallel' respectively, then it runs in serial rather than in parallel as files in all the time steps are written directly in the case directory rather than under /processor*/.

Just wondering have you got some progress on your parallel issue? I'd appreciate it if you could show some clue on my case.

Thank you very much in advance.
Sophie

BigBlueDart October 15, 2013 08:25

Hey, Sophie.

It's been awhile, so I don't really remember all the details of what my problem was at that point. I do know that I ended up writing a script that would start my simulation again whenever it crashed, and that seemed to get it running.

As for your problem, I'm not entirely sure what the answer would be. What version of OpenFOAM are you running? Are you starting your simulation with an existing field of particles? Are you sure you have MPI installed and set up with OpenFOAM correctly?

If I had to guess I'd say that decomposePar doesn't seem to be handling lagrangian distribution correctly, but I can't really tell for sure with the information I've got.

sophie_l October 18, 2013 14:41

Hi Scott,

Thank you very much for your response.

Sorry for the late reply. I'm using OF 1.7.1. The standard solvers run in parallel without problem. I have particles existing from the beginning of the simulation.

About the variables introduced with the particle phase, do you think special treatment are needed to get them passed and run in parallel even after I get decomposePar work correctly? I assumed it could run in parallel without new implementation as the solidParticle library is already integrated in OpenFOAM. But now I think it may be necessary.

Thanks,
Sophie

sophie_l October 23, 2013 06:17

Hi Scott,

Sorry to be a pain, but may I ask you some questions about the decomposition of particle field please?

1. As for the input files, I only got d, U, positions in the directory of 0/lagrangian/defaultCloud. After looking at CloudIO.C, I'm wondering do I have to prepare 0/uniform/lagrangian/defaultCloud/cloudProperties? If cloudProperties is essential for a successful decomposition, what is the right format? I tried some format, but they didn't help.

2. My 0/lagrangian/defaultCloud/positions is posted here,

Quote:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class Cloud<solidParticle>;
location "0";
object positions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
4000
(
(0.5025 0.0025 0.0025) 100
(0.5075 0.0025 0.0025) 101
(0.5125 0.0025 0.0025) 102
(0.5175 0.0025 0.0025) 103
(0.5225 0.0025 0.0025) 104
(0.5275 0.0025 0.0025) 105
(0.5325 0.0025 0.0025) 106
(0.5375 0.0025 0.0025) 107
(0.5425 0.0025 0.0025) 108
(0.5475 0.0025 0.0025) 109
(0.5525 0.0025 0.0025) 110
(0.5575 0.0025 0.0025) 111
(0.5625 0.0025 0.0025) 112
which is of the class Cloud<solidParticle>; however, after decomposePar, the positions file under /processor*/0/lagrangian/defaultCloud/ is of class Cloud<passiveParticle>. I output 'ioP.type()' in CloudIO.C, it is Cloud<passiveParticle>. Is this the reason for the warning? What can I do with it?

Thanks a lot in advance.

Cheers,
Sophie

Quote:

Processor 0: field transfer
--> FOAM Warning :
From function Cloud<ParticleType>::initCloud(const bool checkClass)
in file /openfoam/OpenFOAM-1.7.1/src/lagrangian/basic/lnInclude/CloudIO.C at line 124
Cannot read particle positions file
"/home/channel/processor0/0/lagrangian/defaultCloud"
assuming the initial cloud contains 0 particles.


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