|
[Sponsors] |
Making changes to the files under /opt/openfoam directory |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 2, 2013, 11:01 |
Making changes to the files under /opt/openfoam directory
|
#1 |
Senior Member
|
Hi dear Foamers,
I am trying to modify some utilities and make some small changes in them, but I do not want to make new utilities, because changes are so small. For example I am trying to write out "Total cell numbers" while I am running "checkMesh" utility. I don't want to make a new "checkMesh2" utility to do this. Just want to make the small change in the source file and compiling "checkMesh" utility again. My openFOAM is installed in /opt directory. is it possible to do this? Best regards, Mojtaba
__________________
Learn OpenFOAM in Persian SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member Complex Heat & Flow Simulation Research Group If you can't explain it simply, you don't understand it well enough. "Richard Feynman" |
|
August 2, 2013, 13:01 |
|
#2 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24 |
as opt is writing protected for user , you should be root,
i guess using sudo wmake will solve your problem, or you may want to compile it as usual, then put your binary file where present checkMesh binary file is placed
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
|
August 2, 2013, 15:01 |
|
#3 | |
Senior Member
|
Quote:
Well actually sudo wmake doesn't help, I don't know why yet. I was thinking about deleting compiled binaries of checkMesh (or maybe wclean it) and then compile my new utility with the same name (checkMesh) in FOAM_USER_APPBIN. Your second idea is interesting. I will report back the results. best
__________________
Learn OpenFOAM in Persian SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member Complex Heat & Flow Simulation Research Group If you can't explain it simply, you don't understand it well enough. "Richard Feynman" |
||
August 2, 2013, 15:11 |
salam
|
#4 |
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 13 |
Greetings Mojtaba,
following instruction: Code:
1. cp -r $FOAM_UTILITIES/mesh/manipulation/checkMesh $FOAM_RUN/checkMesh2 2. cd $FOAM_RUN/checkMesh2 3. making your changes in the relevant source file 4. Change your Make/files to: printMeshStats.C checkTopology.C checkGeometry.C checkMesh.C EXE = $(FOAM_USER_APPBIN)/checkMesh2 5. Compile: wclean rm –r Make/linux* wmake Hassan |
|
August 2, 2013, 15:21 |
|
#5 | |
Senior Member
|
Quote:
Well this procedure doesn't actually replace the utility "checkMesh". I think it simply makes a new utility named "checkMesh2". I prefer to have the old checkMesh utility with some new changes, without compiling a whole new utility named "checkMesh2". best, Mojtaba
__________________
Learn OpenFOAM in Persian SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member Complex Heat & Flow Simulation Research Group If you can't explain it simply, you don't understand it well enough. "Richard Feynman" |
||
August 2, 2013, 15:48 |
|
#6 |
Senior Member
|
Problem is solved,
Thank you Nima and Hassan for your suggestions. Well actually solution was quite easy as Nimasam said. Here is the step by step procedure: 1- Copy your desired utility into $WM_PROJECT_USER_DIR/applications/utilities 2- modify the code and make your desired modifications. 3- Do not change *.C file name and do not change the name in /Make/files 4- run wmake 5- sudo rm /opt/openfoam---/platforms/linux64GccDPOpt/bin/utility i.e: sudo rm /opt/openfoam---/platforms/linux64GccDPOpt/bin/checkMesh Note: --- is your Of version 6- sudo cp $WM_PROJECT_USER_DIR/applications/utilities/utility /opt/openfoam---/platforms/linux64GccDPOpt/bin/ i.e: sudo cp $WM_PROJECT_USER_DIR/applications/utilities/checkMesh /opt/openfoam---/platforms/linux64GccDPOpt/bin/ And you are done Best Wishes, Mojtaba
__________________
Learn OpenFOAM in Persian SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member Complex Heat & Flow Simulation Research Group If you can't explain it simply, you don't understand it well enough. "Richard Feynman" |
|
September 27, 2013, 15:46 |
|
#7 |
Senior Member
|
Hi, I want to make some little modifications to my previous post.
Here is the updated procedure: 1- Copy your desired utility into $WM_PROJECT_USER_DIR/applications/utilities 2- modify the code and make your desired modifications. ***3- Do not change *.C file name and do not change the name in /Make/files but instead change FOAM_APPBIN into FOAM_USER_APPBIN 4- run wmake 5- sudo rm /opt/openfoam<version>/platforms/linux64GccDPOpt/bin/utility i.e: sudo rm /opt/openfoam221/platforms/linux64GccDPOpt/bin/checkMesh ***6- sudo cp $WM_PROJECT_USER_DIR/platforms/linux64GccDPOpt/bin/utility /opt/openfoam<version>/platforms/linux64GccDPOpt/bin/ i.e: ***sudo cp $WM_PROJECT_USER_DIR/platforms/linux64GccDPOpt/bin/checkMesh /opt/openfoam221/platforms/linux64GccDPOpt/bin/ I hope it helps a bit. Best.
__________________
Learn OpenFOAM in Persian SFO (StarCCM+ FLUENT OpenFOAM) Project Team Member Complex Heat & Flow Simulation Research Group If you can't explain it simply, you don't understand it well enough. "Richard Feynman" |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Release of a Wave Generation and Absorption Toolbox for OF | ngj | OpenFOAM Announcements from Other Sources | 65 | September 4, 2022 14:01 |
[waves2Foam] Waves2Foam Related Topics | ngj | OpenFOAM Community Contributions | 660 | August 20, 2018 12:39 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 13:59 |
OpenFoam install script Error during paraFoam installation | SePe | OpenFOAM Installation | 10 | June 19, 2010 15:15 |
Gerris software installation | mer | Main CFD Forum | 2 | November 12, 2005 08:50 |