Rick's Blog
OpenFOAM Baby Steps - Chapter 2: Cavity Flow, Part 3
Keeping track of the physical properties, so that results can be compared to other calculations or real-world data, is difficult for me. So this section dealing with changes to the Reynolds number needed to be its own section.
DISCLAIMER:
This is not intended as a tutorial. This is my process for working through the available documentation in a manner that makes sense to me. Feel free to follow along, but realize that I am interpreting documentation that already exists.Paragraph 2.1.7.1 takes only one sentence to change the Reynolds number,
"Since the Reynolds number is required to be increased by a factor of 10, decrease the kinematic viscosity by a factor of 10, i.e. to 1x10^-1 m^2/s."
Keeping track of the physical property, along with the appropriate units, is difficult for me. It probably gets easier the more frequently one works with these cases. In the meantime, I will probably add my own comment header to the physicalProperties file in the constant directory. This is my version 1.0:
/*-------------------------- Properties Cheat Sheet-------------------------*\
Re = d|U| / ν
Re = Reynolds Number = 100
d = characteristic length = 0.1 m
|U|= characteristic velocity = 1 m/s
ν = nu (kinematic viscosity) = 0.0001 m^2/s
properties in order:
[
NA
Length
Time
NA
NA
NA
NA
]
\*---------------------------------------------------------------------------*/
With that in place, the last part of part of paragraph 2.1.7.1 talks about setting the controlDict startFrom value to latestTime. Although not specified either way, I assumed the value for startTime was irrelevant when using latestTime. I assumed it would look for the folder containing the latest time. That was incorrect; I still needed to st the startTime value to 0.5.
I was interested to see what a higher Reynolds number would look like with a finer grid. So, I increased the Reynolds number to 100 (by decreasing nu to 0.001 in the constant file. I then used the graded cube from that portion of the tutorial and increased the number of cells in each sub-block to 30. The solver was unable to find a solution like that because I failed to change the timeStep after changing the cell size. I added a memory jogger, similar to the physical properties one, to place in the controlDict file. I also had the solver start at 0, rather than mess with re-mapping.
/*---------------------------- Reminders ------------------------------------*\
Co = δt|U|/δx; Co < 1
so δt = Co δx/|U|
if the cell size is graded, the smallest cell size, δxs, is:
δxs = l*(r-1)/(αr-1)
r = R^(1/(n-1))
α = R for R>1 and α = 1 - r^-2 + r^-1 for R<1
l = the length along which the cells are graded
n = number of cells
r = ratio between one cell size and the next
R = Ration between the last and first cells
For this case:
l = 0.05m (0.1m cube divided into quarters)
R = 4
α = 4
n = 20
r = 1.0757
so δxs = 0.001146
and δt = 0.001s (rounded) since |U| = 1 m/s
\*---------------------------------------------------------------------------*/
The initial run entTime was 2.0 seconds, which wasn't long enough. I changed that value to 10.0 seconds, but the solver converged just before 5 seconds. As noted in the User Guide, the velocity converged before the pressures, somewhere around 2.5 seconds.
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.
Comments