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

General Question about code developing

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 22, 2021, 22:23
Question General Question about code developing
  #1
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 274
Rep Power: 11
mostanad is on a distinguished road
Hi everyone,
I have a general question about OF coding. Considering that I have started a simulation using OF. Then during running this case, I have changed the OF library and compiled it. So does it affect the running case with the previously compiled configuration?
Cheers,
Mohammad
mostanad is offline   Reply With Quote

Old   September 24, 2021, 10:11
Default
  #2
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 274
Rep Power: 11
mostanad is on a distinguished road
Nobody interested in answering my question?
mostanad is offline   Reply With Quote

Old   September 24, 2021, 12:20
Default
  #3
Member
 
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16
guin is on a distinguished road
Quote:
Originally Posted by mostanad View Post
Hi everyone,
I have a general question about OF coding. Considering that I have started a simulation using OF. Then during running this case, I have changed the OF library and compiled it. So does it affect the running case with the previously compiled configuration?
Cheers,
Mohammad
A general answer to your general question: well, it depends...

Being more pragmatic: In principle it shall not affect your already-running case. Of course, if you stop&resume it the system will make use of the new binaries.
guin is offline   Reply With Quote

Old   September 25, 2021, 03:40
Default
  #4
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 274
Rep Power: 11
mostanad is on a distinguished road
Quote:
Originally Posted by guin View Post
A general answer to your general question: well, it depends...

Being more pragmatic: In principle it shall not affect your already-running case. Of course, if you stop&resume it the system will make use of the new binaries.

You was so specific indeed. I mean the already-running case. So in your opinion, making a change in library and compiling it doesn't affect that case.
mostanad is offline   Reply With Quote

Old   September 26, 2021, 02:06
Default
  #5
Senior Member
 
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18
fra76 is on a distinguished road
Quote:
Originally Posted by mostanad View Post
You was so specific indeed. I mean the already-running case. So in your opinion, making a change in library and compiling it doesn't affect that case.

As guin wrote, it depends.
I had systems in which changing a binary used by a simulation was causing the simulation stopping with a "BUS error", while on other systems it did not stop.


However, it's never a good idea...
fra76 is offline   Reply With Quote

Old   September 26, 2021, 19:24
Default
  #6
Senior Member
 
mohammad
Join Date: Sep 2015
Posts: 274
Rep Power: 11
mostanad is on a distinguished road
Quote:
Originally Posted by fra76 View Post
As guin wrote, it depends.
I had systems in which changing a binary used by a simulation was causing the simulation stopping with a "BUS error", while on other systems it did not stop.


However, it's never a good idea...

Got it. Thanks Francesco for your nice reply.
mostanad is offline   Reply With Quote

Old   September 30, 2021, 06:39
Default
  #7
New Member
 
Ali Baratian
Join Date: Oct 2013
Location: Kuhsangi, Mashhad, Iran
Posts: 22
Rep Power: 12
baratian is on a distinguished road
hello everybody
i wonder whether it is possible to run OF codes on a generic compiler (not through the TERMINAL determined by the official releases)?
for example can i run the Cavity tutorial codes on CodeBlocks C++ compiler?
i think if OF is a real open source code it must be possible!
thanks in advance.
baratian is offline   Reply With Quote

Old   September 30, 2021, 14:45
Default
  #8
Senior Member
 
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18
fra76 is on a distinguished road
Quote:
Originally Posted by baratian View Post
hello everybody
i wonder whether it is possible to run OF codes on a generic compiler (not through the TERMINAL determined by the official releases)?
for example can i run the Cavity tutorial codes on CodeBlocks C++ compiler?
i think if OF is a real open source code it must be possible!
thanks in advance.
Sure, you can choose a different compiler, recompile everything and run the software. Compilation rules are in wmake, they do exist for some compiler (and mpi), might be added for other ones. Configuration files in etc, like bashrc, might need to be adapted as well.
fra76 is offline   Reply With Quote

Old   October 30, 2021, 12:07
Default
  #9
New Member
 
Ali Baratian
Join Date: Oct 2013
Location: Kuhsangi, Mashhad, Iran
Posts: 22
Rep Power: 12
baratian is on a distinguished road
You mean it is possible for example to copy paste OF codes in a generic c++ compiler and run?
If that is! I am really wondered by that.
baratian is offline   Reply With Quote

Old   October 31, 2021, 08:13
Default
  #10
Senior Member
 
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18
fra76 is on a distinguished road
Quote:
Originally Posted by baratian View Post
You mean it is possible for example to copy paste OF codes in a generic c++ compiler and run?
If that is! I am really wondered by that.

No, I am not saying that. To be honest, I'm not sure I understood what you mean with that.


What I am saying is that you can use different compilers to recompile the whole OpenFOAM package, including your custom libraries and applications.
OpenFOAM is C++ code, although with a unique code style, but you cannot take just a solver source, it includes headers and imports lots of libraries from the openfoam source directories that must be recompiled as well.
fra76 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
A general question on using UDF for defining reaction kinetics Morijef Fluent UDF and Scheme Programming 0 September 19, 2018 15:37
question about complete code of airfoil batuning Main CFD Forum 0 October 26, 2017 03:24
General question regarding convergence raviramesh10 CFD Freelancers 0 June 20, 2017 07:09
Debugging technics - CFD code developing leo_NM Main CFD Forum 2 June 9, 2016 11:22
general question Madhukar Rapaka FLUENT 1 June 28, 2006 08:03


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