Got errors copying OpenFOAM tutorial files to a local folder

I’ve installed the latest OpenFOAM v1706 for windows.

I want to copy all the default OpenFOAM tutorial files into a local folder: C:\users\USER_Name\OpenFOAM_tut.

However, I got the following errors, and the 3 files mentioned in the error were not copied:

[ofuser@default workingDir]$ cd ./OpenFOAM_tut
[ofuser@default OpenFOAM_tut]$ dir
[ofuser@default OpenFOAM_tut]$ cp -r $FOAM_TUTORIALS/ ./
cp: cannot create regular file './tutorials/combustion/PDRFoam/flamePropagationWithObstacles/0.orig/b': File exists
cp: cannot create regular file './tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/0.orig/solid/jouleHeatingSource:V': Protocol error
cp: cannot create regular file './tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/0.orig/solid/jouleHeatingSource:sigma': Protocol error
[ofuser@default OpenFOAM_tut]$

May I ask the source of the problem here?

Thanks.

It’s most likely a permission issue. Try sudo your command!

Related drawing!: :wink:

sudo make me a sandwich

Thanks, Mostapha.

However, it seems that the sudo command is not installed in this virtual command line environment to run OpenFOAM:
Image 9

I ran the “OpenFOAM_Start” command as administrator in the first place …

Appreciate your suggestion.

It is not in the path. You can try /usr/bin/su command. The password is ofuser2017

Also now that I read your command again you need to copy the files to a folder that you have writing access to. Change the target from ./ to ./workingDir/butterfly or a similar folder. For copying the files that should be enough.

Thank, Mostapha.

I tried the /usr/bin/su command, and after I input the password, the command window seems to remain in a waiting status forever:

So, I used Ctrl-C to quit this command, and it seems that I’m in a kind of “root” status, so I tried to copy the tutorial files again:

Now a bunch of irrelevant files were copied to the OF_tut folder I created previously in the workingDir, i.e. my user directory:
Image 31

This OF_tut folder quickly became very huge, up to 3GB in size, and I have to close the terminal window, as I don’t know what is going on …

I don’t want to “mess up” my system unless I understand these linux commands. So, I restarted OpenFOAM and tried to copy the files as you suggested by using ./workingDir/OF_tut and ./workingDir/butterfly as the target folders. However, I still got those errors:

I may pause for now on this matter, so long as OpenFOAM+Butterfly is running correctly. But I do hope to find out the source of this issue later.

Thanks.

…BTW, I restarted OpenFOAM, and tried the /usr/bin/su command and input the password.

After quite a while, I got the following error messages, although the prompter changed from [ofuser@default ~]$ to [root@default ofuser]#