|
[Sponsors] |
How can I copy a solver/class to my directory? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 12, 2016, 04:36 |
How can I copy a solver/class to my directory?
|
#1 |
Member
Join Date: Apr 2016
Posts: 91
Rep Power: 10 |
Hi,
I am trying to run a solver which is located on a network path. I allways copy tutorials from there to my network directory and run it. This works all well. Now I would like to change some details in the source code of scr/fvOptions/sources/derived/effectivnessHeatExchangerSource/effectivnessHeatExchangerSource.H Therefore I would like to make a backup copy and change only the copy. I have to save this copy on my local computer, since I do not have writing permission on network. But how do I tell all used solvers and fvOptions etc. where my classes are now located? I read this http://www.cfd-online.com/Forums/ope...m-2-1-0-a.html But this is for the whole solver? I only want to change one class. Thank you for any help |
|
May 13, 2016, 08:56 |
|
#2 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21 |
You can trace the usage of the fvOptions file you mentioned back to
Code:
$FOAM_SRC/fvOptions/Make/files: ... derivedSources=sources/derived ... $(derivedSources)/effectivenessHeatExchangerSource/effectivenessHeatExchangerSource.C ... LIB = $(FOAM_LIBBIN)/libfvOptions --- If you want to create a custom version of the "effectiveness..."-class, you must either recompile this library (overwriting the original one), or you should create your own custom library. The latter would be a better idea. To do so, you should copy all the related .H and .C files to your machine. Then you should make a new Make/files (and Make/options) file as follows: Code:
$MY_LOCATION/effectivenessHeatExchangerSource.C LIB = $(FOAM_USER_LIBBIN)/libmyfvOptions I'm not sure, but I think you should probably rename "effectivenessHeatExchangerSource" to "myeffectivenessHeatExchangerSource"... Then you can be certain which fvOptions your case uses. Otherwise it depends on how OpenFOAM implemented it, which I reckon is "first FOAM_USER_LIBBIN, then FOAM_LIBBIN". --- If you wish to run this at your network location, you must have write access somewhere at that network location. If you don't, it is impossible to get your custom library there. If you do, store it in the network location's $FOAM_USER_LIBBIN directory (or set the FOAM_USER_LIBBIN environmental variable to where you choose to store it). Sidenote: If the network location has a different architecture than your local computer, you may need to do the compilation at the network location instead of at your local computer. |
|
May 13, 2016, 14:28 |
|
#3 | |
Senior Member
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18 |
It's as Kevin said,
it's usually a good idea to keep the same structure as the source code in your $WM_PROJECT_USER_DIR similar to $WM_PROJECT_DIR. You can use echo $... to check their address. If you keep it consistent you won't have any trouble accessing the files. It's better to rename them after you copy them, you gotta rename any occurrences inside the files too. Change the Make/file,options as Kevin mentioned. The last step is to add Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to calculate mass flow rate on patches and summation of that during the run? | immortality | OpenFOAM Post-Processing | 104 | February 16, 2021 09:46 |
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 | tlcoons | OpenFOAM Installation | 13 | April 20, 2016 18:34 |
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch | gschaider | OpenFOAM Installation | 225 | August 25, 2015 20:43 |
OpenFoam install script Error during paraFoam installation | SePe | OpenFOAM Installation | 10 | June 19, 2010 16:15 |
critical error during installation of openfoam | Fabio88 | OpenFOAM Installation | 21 | June 2, 2010 04:01 |