CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Make my solver to work in parallel

Register Blogs Community New Posts Updated Threads Search

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

Code:
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, 16:14
Default
  #2
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22
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

Reply


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 07:33
"Define_Profile" UDF for parallel solver Antoine Fluent UDF and Scheme Programming 9 February 29, 2016 07:09
Explicitly filtered LES saeedi Main CFD Forum 16 October 14, 2015 12:58
simpleFoam parallel AndrewMortimer OpenFOAM Running, Solving & CFD 12 August 7, 2015 19:45
RBF motion solver does not work well in parallel lakeat OpenFOAM Bugs 3 August 8, 2013 06:50


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