Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check default values for the case #21

Closed
mostaphaRoudsari opened this issue Jun 22, 2016 · 8 comments
Closed

Check default values for the case #21

mostaphaRoudsari opened this issue Jun 22, 2016 · 8 comments

Comments

@mostaphaRoudsari
Copy link
Member

@TheodoreGalanos, @stefan-buildSCI,

I uploaded a new folder study_room which is generated from scratch using butterfly.

I did a test and meshed it and ran it successfully but I'm not sure if the results is necessary accurate.

image

Can you please take a look and let me know your feedback? In particular I need to know your input on the default values for boundary conditions, etc. It's quite easy to create series of default values (similar to radianceParameters in Honeybee) but I don't have the expertise to come up with the values.

@chriswmackey
Copy link
Member

AMAZING.

@stefan-buildSCI
Copy link
Collaborator

Looking at the sample file

The controlDict has the file set to run for 1,000 timesteps. This might not be enough to achieve convergence.

The fVSolution is missing it's convergence criteria section for residual control. A residual is what is reported in the command line for every timestep. This is essentially measuring how much the solution for each variable has changed in comparison with the previous timestep. Once these changes become sufficiently small, we assume the solution has potentially achieved convergence. Commonly these will be set to 1e-5 for all variables. Often i'll set pressure to 1e-4 since it takes the longest to converge. Consider adding this as a default in the Butterfly component, but I think these should be user controllable as well. Faster simulations may use 1e-3 for criteria but this is likely not enough to achieve a converged solution.

Most CFD softwares include a way to visualize the residuals. Here's a painful image of a solution that is not converging very well
image

And here's an image of one that converged well
image

The simulation ends once the max timestep specified in the controlDict is reached, or when the convergence criteria is reached, whichever happens first.

I believe the boundary condition error in this sim is with p. All p boundary conditions are set to zeroGradient except the west_window which is set to a uniform 0. in U, it's clear the the west_window is the inlet. Setting the pressure to 0 should be for the window outlet. Think of the 0 as like setting the pressure of this area as the atmospheric pressure. For the flow in the room to be pushed out the east window, we want the entire room to have a higher pressure than what is outside.

Changing the p boundary condition in my sim made the results look much more physical
image

TLDR: the 0 pressure boundary condition should be specified at the outlet. in p, change west_window to zeroGradient type, and east_window to uniform 0 type.

@mostaphaRoudsari
Copy link
Member Author

@stefan-buildSCI thanks for checking! 💯 Very helpful. Can you attach the updated folder here or upload it to github. It's much easier to update the code based on the files.

There is an open issues for convergence criteria #27 (comment). We should find a solution to plot the values as you mentioned. Reading text outputs won't really work. I will add that as a wish so we can add it soon.

@stefan-buildSCI
Copy link
Collaborator

Just synced my changes to the study_room example

@TheodoreGalanos
Copy link
Collaborator

TheodoreGalanos commented Jul 11, 2016

Hello @mostaphaRoudsari @stefan-buildSCI

Thanks very much for your comments and additions, and for finding out the error stefan! It's certainly not a good idea to prepare CFD cases way past bedtime.

As Mostapha referenced, we are already planning to include the residual control as an exposed parameter to the user.

Concerning plotting the residuals there are a couple of choices here.

1.Using the pyFoam libraries and the pyFoamPlotRunner.py utility. This works in Linux but I haven't tested in windows. If we can setup pyFoam in windows I don't see why not (even though we'd probably need to link it to a plotting environment). Or wait, this is a VM so it should run smh. The command would be (for a parallel run of a simpleFoam case):

pyFoamPlotRunner.py mpirun -np 4 simpleFoam -parallel

This nifty utility will pop up different charts exactly like the ones you showed for residuals and continuity. pyFoam even allows the user to save vector (or image) files of the plots at the end!

2.We replicate the functionality of pyFoam library by following the terminal output (> log.txt kind of thing), extracting the necessary information from the output (e.g. the number for each residual in each iteration) and then plotting that with a windows (?) software. Now obviously this looks, and is really, like it is rediscovering the wheel. However, a way to visualize run-time information in Windows would be extremely valuable for the visualization of information created from function objects.

3.Third way, which is a compromise between the two or rather the most efficient way to go about no. 2 is to use the -residual function object of OF. This would write out residuals for each timestep in a file. This file (which would have a standard format) can then be visualized smh.

Hope this helps.

Kind regards,
Theodore.

@mostaphaRoudsari
Copy link
Member Author

@stefan-buildSCI thanks! Are you sure that you synced the changes with github. It's not up here yet: https://github.com/mostaphaRoudsari/Butterfly/commits/master

@stefan-buildSCI
Copy link
Collaborator

Not sure why it didn't show up, looks like it synced now though.

On Sun, Jul 10, 2016 at 7:17 PM, Mostapha Sadeghipour Roudsari <
notifications@github.com> wrote:

@stefan-buildSCI https://github.com/stefan-buildSCI thanks! Are you
sure that you synced the changes with github. It's not up here yet:
https://github.com/mostaphaRoudsari/Butterfly/commits/master


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#21 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AHafD2dtveUstrTgAES1kaRHXeosyw_9ks5qUae7gaJpZM4I7UL_
.

@mostaphaRoudsari
Copy link
Member Author

@stefan-buildSCI @TheodoreGalanos I fixed the default values. Please open a new discussion for plotting residuals. Thank you for your help.

airflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants