CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Time step data error in OpenFOAM tutorial flow around a cylinder? (https://www.cfd-online.com/Forums/openfoam-solving/237070-time-step-data-error-openfoam-tutorial-flow-around-cylinder.html)

Kendawgg22 June 28, 2021 23:51

Time step data error in OpenFOAM tutorial flow around a cylinder?
 
2 Attachment(s)
I have tried to run tutorial 2.2 flow around a cylinder for Openfoam from their website using the ./Allrun command. However the model never does show up in paraview and it gives me an error output saying that it contains no timestep data. I attached the images to this post. Does anyone know what I have to do to fix this.

piu58 June 29, 2021 00:28

Do you see time step folders after running the case? May be it crashed before finishing the first time step.

Kendawgg22 July 2, 2021 11:51

4 Attachment(s)
The 0 file is there. I opened the file and attached it to this post. Now this is a tutorial. I opened both the P and U files. Is there something missing in these files maybe an error in one of the lines?

Ship Designer July 2, 2021 17:26

Hi Ken,


If you look at the picture you posted, the solver didn't run because it says you have to remove the old log files first. Once you delete them, the solver should be able to run. It's probably a precaution mechanism to prevent loss of log files.

Kendawgg22 July 6, 2021 12:00

It actually gave me that error when I first ran it. I just ran it again and it still gives that same error. It has something to do with the 0 file but I don't see where the error is coming from in that file after looking at it?

piu58 July 7, 2021 00:51

Look in the main folder for the log files and remove them.

Kendawgg22 July 13, 2021 15:04

1 Attachment(s)
Are you talking about log.blockMesh, log.postProcess, and log.potentialFoam? Remove these?

Ship Designer July 15, 2021 13:55

Quote:

Originally Posted by Kendawgg22 (Post 808120)
Are you talking about log.blockMesh, log.postProcess, and log.potentialFoam? Remove these?

Yes, these are what Uwe is talking about. They won't be overwritten, but OpenFOAM will just abort execution instead. Remove them manually and it should start.

Kendawgg22 November 29, 2021 00:36

I know that it has been quite a while. I want to let you know that I did try deleting the log files before I tried the Allrun again and I still got the same error.

Ship Designer November 30, 2021 04:00

Hi, have you tried to execute the commands of the Allrun script individually? By doing that you should see at which point execution is stopped due to errors. I also recommend running longer commands like snappyHexMesh and solvers with both on-screen and logged output like this:
Code:

# single-core
snappyHexMesh -overwrite | tee Logs/snappyHexMesh.txt
interFoam | tee Logs/interFoam0.txt

# parallel
mpirun -np 2 interFoam -parallel | tee Logs/interFoam0.txt

This will allow you to monitor ongoing processes. I remember using Allrun or runapplication or something like that and having no on-screen output for hours whatsoever until the solver eventually finished, which I don't like at all and that's why I never use those commands. Bear in mind that if you use the above, the applications won't stop if older logs already exist, they will just be overwritten instead.

Hope this helps.

Cheers, Claudio

Kendawgg22 December 4, 2021 12:55

I don’t know how to do that. I’m honestly ready for someone to go through tutorial 2.2 which is a flow around a cylinder for windows 10 from start to finish to show me where I’m going wrong. I tried doing it the same way you do the cavity tutorial where you just type blockmesh but it gave me errors. Actually it didn’t even run. I did it using allrun because I was told it’ll run and show where the error is. I haven’t seen any decent enough tutorials online for tutorial 2.2 for some reason.

Ship Designer December 12, 2021 11:44

Can you please indicate which version of OpenFOAM you're using and in which folder the tutorial is you are trying to run?

Kendawgg22 December 13, 2021 17:44

I am using version 2012 for windows 10 with Ubuntu 20.04lts.

Ship Designer December 13, 2021 19:09

If you can provide me the exact location in the tutorials folder where the tutorial you're trying to run is, I might help you further. I simply don't have time to find it for you.

Kendawgg22 December 15, 2021 03:51

It’s located in OpenFOAM/OpenFOAM-v2012/tutorials/basic/potentialFoam/cylinder

Ship Designer December 15, 2021 18:58

1 Attachment(s)
Okay, these are the contents of the Allrun file:
Code:

#!/bin/sh
cd "${0%/*}" || exit                                # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
#------------------------------------------------------------------------------

restore0Dir
runApplication blockMesh
runApplication $(getApplication) -withFunctionObjects -writePhi -writep
runApplication postProcess -func streamFunction

#------------------------------------------------------------------------------

Instead of executing the Allrun script, run the following commands one by one in your terminal (or however it is called on Windows) by omitting the runApplication function. Then you can see where exactly errors occur and you can report them to us:
Code:

. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions
Code:

restore0Dir
Note that restore0Dir copies the 0.orig folder and renames it to 0. You can do this also manually. Background: The field files inside the 0 folder, in this case U and p, contain the initial boundary conditions for the case. When results are written or certain preprocessing steps are taken however, the boundary conditions get replaced and overwritten in the field files by a list of values for each cell in the domain. In many cases they will be left untouched and the results are written to another time step folder. Since the potentialFoam solver doesn't use time steps however, this is one of the cases where running the solver will overwrite the initial U and p files inside the 0 folder and you would loose the initial boundary conditions. To avoid that, the purpose of the 0.orig folder is therefore to serve as a template/copy for the initial conditions it contains. Solvers don't read it however because they look for the 0 folder without .orig suffix. If a solver doesn't find the 0 folder, it will complain that it doesn't find the field files. Thus, copy the 0.orig folder and rename it to 0 in order to have a copy of the initial fields that can be read by solvers and safely overwritten.

Code:

blockMesh
Code:

potentialFoam -withFunctionObjects -writePhi -writep
Note: The function getApplication in the Allrun script reads the application dictionary entry of the controlDict file, which in this case is potentialFoam.
Code:

postProcess -func streamFunction
I tried this with OpenFOAM v1912 on macOS and it worked. Only thing I had to do was change the -writePhi option of potentialFoam to -writephi, because postProcess -func streamFunction requires the phi field.

Good luck!

Kendawgg22 December 22, 2021 23:22

3 Attachment(s)
Is this how I was suppose to do those commands? I took screenshots of what I typed.

Ship Designer December 23, 2021 11:13

Yes, exactly. As you can see, blockMesh fails (and doesn't create the mesh, hence the subsequent error reported by potentialFoam not finding the points file) because the shared object (*.so) file is not found/inaccessible. The blockMeshDict of this case performs some in-dictionary calculations using codeStream to obtain parametric geometry and generates an *.so file which is then compiled. Check if this file is properly written at the specified location. My guess would be a file access permission issue which prevents OpenFOAM from writing/reading the *.so file from there.

Now you should have learned how to do basic troubleshooting for an OpenFOAM case: execute commands one by one and carefully read all error messages.

Good luck troubleshooting codeStream!

Kendawgg22 December 30, 2021 02:01

I think should explain what I am trying to do. I am trying to simulate a flow over a cylinder with mach 0.2 at sea level conditions. The radius of the cylinder is 0.04 meters and the length is 1 meter. I was hoping to modify this tutorial but that hasn't been working out. I would like to know if there is a easier way then?

Ship Designer December 30, 2021 20:11

What about the tutorial, is it working for you now? We can't help if you aren't more specific than "that hasn't been working out". Please read this: https://www.cfd-online.com/Forums/si...tml#post612025


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