couple cells from different meshes in parallel
Hi,
To calculate the thermal interaction between the coolant in a radiator and the air flowing through the radiator, I want to couple the cells of two overlapping regions (air/coolant) in order to match their heat transfer (in a later part of the code). The coolant mesh has identical cells as the radiator zone in the air mesh. In serial the coupling is achieved without problems with the following code: Code:
const volVectorField& CAir = meshAir.C(); //Air cell centres This causes the .findCell function to fail when running in parallel. How can I best solve (or circumvent) this problem? Any help is much appreciated. Best regards, Sylvester |
|
Hi Matvej,
I circumvented the problem by making sure that all water cells are on the same processor as the associated air cells. This leaves some processors without any water cells, but this does not seem to cause any problems. regards, Sylvester |
Hi, Sylvester
thank you for your reply. But i think, that it is not an elegant way of organizing parallel computations. After looking through forum, i found that this problem can be solved by using MPI API. As i understand, this could be done in a such way: In master process: 1) Gather values of field from slave processes 2) Assembly whole field (for whole domain) 3) Update field 4) Send updated field values (parts of the field) to slave processes But i still don't understand how to do this. For now, i'm examining OpenFOAM source code and forum for examples or similar cases. |
Hi Matvej,
Yes, my solution might not be very elegant, but it works. And it works for me now, which is very important to me. I'm still interested in a proper solution though, so please share it when you find it. regards, Sylvester |
Sylvester,
how do you ensure all cells to be on the same cpu? Which entry do you use in decomposParDICT? Thanks. BastiL |
Hi BastiL,
First decompose the first mesh with the -cellDist argument. Next map the created cellDist file to the second mesh using mapFields. Then make the new cellDist file suitable for decomposePar by deleting the unnecessary stuff. Finally decompose the second mesh with the method specified as 'manual' in decomposeParDict. Make sure it uses your new cellDist file. regards, Sylvester |
Sylveser, mkraposhin,
your parallelisation seems quite complex to me. Would a preserveFaceZones (zonename); in decomposepardict not do the job? I am interested in how your code looks like? Is it in a solver or a functionObject? Would it be possible sharing it with me? Thanks BastiL |
Hi BastiL,
As the coupling required by me was on the volume cell level, I do not expect that preserveFaceZones would have been sufficient. But with the method described in my previous message I can get the code running without problems. The code snippet I have given before is used in a solver. I cannot release more of it, but that snippet should be enough to get you started. regards, Sylvester |
All times are GMT -4. The time now is 04:21. |