Source code for pyro.incompressible_viscous.problems.cavity
r"""Initialize the lid-driven cavity problem. Run on a unit square with the top wallmoving to the right with unit velocity, driving the flow. The other three wallsare no-slip boundary conditions. The initial velocity of the fluid is zero.Since the length and velocity scales are both 1, the Reynolds number is 1/viscosity.References:https://doi.org/10.1007/978-3-319-91494-7_8https://www.fluid.tuwien.ac.at/HendrikKuhlmann?action=AttachFile&do=get&target=LidDrivenCavity.pdf"""frompyro.utilimportmsgDEFAULT_INPUTS="inputs.cavity"PROBLEM_PARAMS={}
[docs]definit_data(my_data,rp):""" initialize the lid-driven cavity """ifrp.get_param("driver.verbose"):msg.bold("initializing the lid-driven cavity problem...")myg=my_data.gridif(myg.xmin!=0ormyg.xmax!=1ormyg.ymin!=0ormyg.ymax!=1):msg.fail("ERROR: domain should be a unit square")# get the velocities and set them to zerou=my_data.get_var("x-velocity")v=my_data.get_var("y-velocity")u[:,:]=0v[:,:]=0
[docs]deffinalize():""" print out any information to the user at the end of the run """