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

Adding Temperature Field to mhdFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 22, 2019, 11:29
Default Adding Temperature Field to mhdFoam
  #1
Member
 
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 8
ErenC is on a distinguished road
Greetings!

I am really new to OpenFOAM. I am trying to add energy equation to mhdFoam. I found this (energy equation for icofoam) and I am trying to adapt that to mhdFoam. I created files and created a folder named "mymhdFoam" but "wmake" doesnt work at all. So I can't even run a case to diagnose my errors. Error is related to being root user but sudo not working. I made an google search tried everything. Still nothing.

Error is:
"
mkdir: cannot create directory '/opt/openfoam6/platforms/linux64ccDPInt320pt/aplications' : Permission denied


/opt/openfoam6/wmake/wmake: line 410: make: command not found


/opt/openfoam6/wmake/wmake: line 413: make: command not found


wmake error: file '/opt/openfoam6/platforms/linux64ccDPInt320pt/aplications/solvers/electromagnetics/mymhdFoam/sourceFiles' could not be created in /opt/openfoam6/applications/solvers/electromagnetics/mymhdFoam
"







Any help would be great.
ErenC is offline   Reply With Quote

Old   April 22, 2019, 11:55
Default
  #2
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 206
Rep Power: 16
t.teschner is on a distinguished road
looks like you are writing to the install directory of openfoam, not to your local directory. what does your "files" file say inside your Make folder?

it should look something like

mymhdFoam.C

EXE = $(FOAM_USER_APPBIN)/mymhdFoam

(notice here that i changed FOAM_APPBIN to FOAM_USER_APPBIN as well). You should not need to use sudo privileges to compile your solver.

Another reason could be that OpenFOAM (for some reason, probably related to write permission issues) can not create the folder to place your solver into. I had this issue once (I think) and a "hack" was to simply create the folder myself, i.e. inside your local openfoam folder you would need to create the folders "platforms/linux64ccDPInt320pt/aplications" ... by the way, are you sure that it is aplications and not applications? maybe there is a type somewhere in your script and this could cause the issue?
t.teschner is offline   Reply With Quote

Old   April 22, 2019, 12:34
Default
  #3
Member
 
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 8
ErenC is on a distinguished road
Quote:
Originally Posted by t.teschner View Post
looks like you are writing to the install directory of openfoam, not to your local directory. what does your "files" file say inside your Make folder?

it should look something like

mymhdFoam.C

EXE = $(FOAM_USER_APPBIN)/mymhdFoam

(notice here that i changed FOAM_APPBIN to FOAM_USER_APPBIN as well). You should not need to use sudo privileges to compile your solver.

Another reason could be that OpenFOAM (for some reason, probably related to write permission issues) can not create the folder to place your solver into. I had this issue once (I think) and a "hack" was to simply create the folder myself, i.e. inside your local openfoam folder you would need to create the folders "platforms/linux64ccDPInt320pt/aplications" ... by the way, are you sure that it is aplications and not applications? maybe there is a type somewhere in your script and this could cause the issue?

Dr. Teschner,

Thank you for your quick reply. Yes it is "applications" I am using ubuntu in a different computer so I typed all the statements above, so it is a typo.

I changed "mhdFoam" statements inside the Make/files with "mymhdFoam" no mistake there. I just added the USER statement inside the "EXE = $(FOAM_USER_APPBIN)/mymhdFoam" as you recommended But error still consists.

wmake error: file "Make/linux64ccDPInt320Opt/sourceFiles coul not be created in /correspondingpath(this is not what terminal says)"

I think its about:
/opt/openfoam6/wmake/wmake: line 410 make: command not found
/opt/openfoam6/wmake/wmake: line 413 make: command not found

I checked that lines but I don't know what to do there.

Last edited by ErenC; April 22, 2019 at 15:54.
ErenC is offline   Reply With Quote

Old   April 22, 2019, 13:48
Default
  #4
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 206
Rep Power: 16
t.teschner is on a distinguished road
hmm, but you are invoking wmake in the terminal inside the folder where your source code is located? did you load the openfoam environment variables before? i.e. did you type something like this before into your terminal: source /opt/openfoam6/etc/bashrc ?
t.teschner is offline   Reply With Quote

Old   April 22, 2019, 14:47
Default
  #5
Member
 
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 8
ErenC is on a distinguished road
Quote:
Originally Posted by t.teschner View Post
hmm, but you are invoking wmake in the terminal inside the folder where your source code is located? did you load the openfoam environment variables before? i.e. did you type something like this before into your terminal: source /opt/openfoam6/etc/bashrc ?

Oh, I am sorry I should have mentioned all the steps. Yes, I am opening "mymhdFoam" folder in GUI, and by right clicking inside the folder I am opening terminal, after that I am executing bashrc file like you said "source /opt/openfoam6/etc/bashrc" I am also executing "mkdir -p $FOAM_RUN"
but "mkdir -p $FOAM_RUN" but I think mkdir step doesn't have a significance at this step because error message doesn't change in either way.

I copied all openfoam files from /opt/openfoam6 to my home folder. I tried in there, this time inside mymhdFoam/Make there is a linux64GccDPInt32Opt folder but no file inside and error message consist of permission denied.
ErenC is offline   Reply With Quote

Old   April 22, 2019, 16:18
Default
  #6
Member
 
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 8
ErenC is on a distinguished road
Apparently I had to install "make"

This thread has the answer but It's not over yet! I just created the source files, all is good. But, mymhdFoam foam still not working...

I have to mention that files inside the /Make/linux64GccDPInt32Opt are protected and owned by root. All the other files are owned by me. Something is fishy and I really, really understand why ubuntu computers doesn't usually get virus. Even I can't make a change in system files...
ErenC is offline   Reply With Quote

Old   April 23, 2019, 01:26
Default
  #7
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 206
Rep Power: 16
t.teschner is on a distinguished road
ah, we were having much more fundamental problems :3 ... ok, in this case, i would recommend to install the essentials with sudo apt-get install build-essential (which would have also installed make), in this way you will have most / all of the required development tools you need and avoid similar problems in the future.



well, it doesn't change your problem now, what does your terminal output when you type "echo $FOAM_USER_APPBIN" or "echo $FOAM_RUN"?

the mkdir -p $FOAM_RUN will just create a folder in which you can place all your simulations. The -p just says that the folder will be created if not already present, so it will not have any influence here
t.teschner is offline   Reply With Quote

Old   April 23, 2019, 14:09
Default
  #8
Member
 
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 8
ErenC is on a distinguished road
Ah, thank you! As I said I am fairly new to OpenFOAM environment.


echo $FOAM_USER_APPBIN gives:

/home/erenc/openFOAM/erenc-6/platforms/linux64GccDPInt32Opt/bin

echo $FOAM_RUN gives:

/home/erenc/OpenFOAM/erenc-6/run
ErenC is offline   Reply With Quote

Old   April 23, 2019, 15:30
Default
  #9
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 206
Rep Power: 16
t.teschner is on a distinguished road
ok, so it is in your local directory (/home/erenc/...), so i am a bit confused why you would get write permission issues. so now when you type wmake in your solver directory, it still gives you the error of write permission? that's strange, because the environmental variable $FOAM_USER_APPBIN is pointing to the right location (to your home folder /home/erenc/openFOAM/erenc-6/platforms/linux64GccDPInt32Opt/bin) while the error message says that it tries to write to a system path (/opt/openfoam6/platforms/linux64ccDPInt320pt/applications, which should be the same path as your $FOAM_APPBIN path (I would assume), you could double check by typing echo $FOAM_APPBIN) ... actually, the last folder should be bin, not applications, are you sure that you set used FOAM_USER_APPBIN and not FOAM_USER_APP ? there is a difference (but I doubt that it makes a difference).

Just to check, can you post the content of the files and options files inside your Make directory?
t.teschner is offline   Reply With Quote

Old   April 23, 2019, 15:57
Default
  #10
Member
 
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 8
ErenC is on a distinguished road
Sooo, my main files was inside the:
/opt/openfoam6
and my local files was inside the:
/home/OpenFoam/erenc-v1806 etc.

After reading your commend I created that dir "home/erenc/OpenFOAM/erenc-6 moved files there, wmake now works!

Altough I can just start to diagnose my errors but still a progress!
I kinda feel like I wasted your time till now with this newbie problems, sorry about that! and thanks a lot! If I can't make any progress I will try to bother you again!
ErenC is offline   Reply With Quote

Old   April 25, 2019, 01:14
Default
  #11
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 206
Rep Power: 16
t.teschner is on a distinguished road
no worries, glad i could help ... good luck in you endeavors with openfoam
t.teschner is offline   Reply With Quote

Old   May 24, 2020, 13:40
Default
  #12
Member
 
Join Date: Jan 2017
Posts: 71
Rep Power: 9
sadsid is on a distinguished road
Erenc: Done with adding temperature equation ? I want to discuss
sadsid is offline   Reply With Quote

Reply

Tags
energy equation, mhdfoam, openfoam, wmake error


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
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 92 May 21, 2024 07:56
Can't get chtMultiRegionSimpleFoam to working. shiromaniac OpenFOAM Running, Solving & CFD 11 October 18, 2021 08:40
chtMultiRegion not solving for velocity field obiscolly50 OpenFOAM Running, Solving & CFD 22 November 9, 2018 13:40
How to see the temperature values in Celsius along with the temperature field rogbrito COMSOL 0 July 14, 2018 16:09
Strange temperature field in Laval nozzle EvgenyMogilevskiy OpenFOAM Running, Solving & CFD 0 August 14, 2014 09:59


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