CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Make my solver to work in parallel

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   August 9, 2021, 06:11
Default Make my solver to work in parallel
New Member
Giovanni Luddeni
Join Date: Jan 2021
Posts: 14
Rep Power: 4
gionni is on a distinguished road
I wrote a solver with some blocks of code where i manually alter some field values. Something like:

forAll(field,c) {
    if (something) field[c]=1;
When I do this, my code can't be run using mpirun: I was expecting the single thread to have its own information only, so field.size() being its own portion of the field, but apparently it doesn't work this way.
How can I have a code like this to work in parallel?

In my case I have 2 regions, and I need to couple them using a 1-halo layer. So I need to update the values at the boundary manually and impose the boundary conditions using boundaryFieldRef. Having the simulation running on a single core only would be very limiting.
Any help is appreciated. Thank you.
gionni is offline   Reply With Quote

Old   August 14, 2021, 15:14
Senior Member
Join Date: Mar 2009
Posts: 229
Rep Power: 21
klausb will become famous soon enough
Please be more specific about your requirements/setup, I am not convinced, that you need MPI operations at all.

When you talk about two regions, do you mean two areas which are part of your problem description or do you want to decompose your domain into two parts to run your simulation on two cores?

If you decompose you case to run it on multiple cores, are the settings (the values you want to introduce) for your "regions" influencing each other across processor boundaries which would require to transfer information from one core to another?
klausb is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Fail to converge when solving with a fabricated solution zizhou FLUENT 0 March 22, 2021 06:33
"Define_Profile" UDF for parallel solver Antoine Fluent UDF and Scheme Programming 9 February 29, 2016 06:09
Explicitly filtered LES saeedi Main CFD Forum 16 October 14, 2015 11:58
simpleFoam parallel AndrewMortimer OpenFOAM Running, Solving & CFD 12 August 7, 2015 18:45
RBF motion solver does not work well in parallel lakeat OpenFOAM Bugs 3 August 8, 2013 05:50

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