Giter Site home page Giter Site logo

Comments (8)

chriswmackey avatar chriswmackey commented on June 27, 2024

AMAZING.

from butterfly.

stefan-buildSCI avatar stefan-buildSCI commented on June 27, 2024

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.

from butterfly.

mostaphaRoudsari avatar mostaphaRoudsari commented on June 27, 2024

@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.

from butterfly.

stefan-buildSCI avatar stefan-buildSCI commented on June 27, 2024

Just synced my changes to the study_room example

from butterfly.

TheodoreGalanos avatar TheodoreGalanos commented on June 27, 2024

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.

from butterfly.

mostaphaRoudsari avatar mostaphaRoudsari commented on June 27, 2024

@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

from butterfly.

stefan-buildSCI avatar stefan-buildSCI commented on June 27, 2024

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 <
[email protected]> 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_
.

from butterfly.

mostaphaRoudsari avatar mostaphaRoudsari commented on June 27, 2024

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

airflow

from butterfly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.