Code for modelling thin liquid films controlled by baseplate actuators. Written for LQR control of falling liquid films by Oscar Holroyd, supervised by Radu Cimpeanu and Susana Gomes.
- The code relies on Basilisk to model the Navier-Stokes equations. See the installation page for instructions. Note that bview is not required. Make sure that qcc (or a symlink to it) is on your PATH.
- The LQR controls require a functioning LAPACKE implementation.
Once these are installed, the executables can be generated:
git clone https://github.com/OaHolroyd/falling-film-control
cd falling-film-control
make source
makeNote that on some systems (eg the University of Warwick's SCRTP resources) the LAPACK library is linked with -lopenblas. If compilation fails, try linking with -llapacke.
The three resulting executables (film-ns, film-wr, and film-benney) use the specified system to model the thin film. Note that the option to finish the NS simulation early (in the case of failure to control or successful stabilisation) is set to true by default. To change this, change the value of EARLY_EXIT in src/params.h and recompile the code.
For a given set of parameters, the code will print the total cost
to stdout. All other outputs (dimensionless numbers, simulation progress etc.) are printed to stderr.
The code requires an input JSON file containing physical parameters, solver settings and output details. An example of such a file (containing parameters corresponding to a thin liquid water film) is included in params.json. If you wish to use an alternative file, pass its' path as the first (and only) argument to film-<model>.
The code outputs 0D, 1D, and 2D data under the directory 'out', and full variable outputs under 'dump'. These directories must exist for the code to run (and are created by make).
The output data is stored as plain text, timestamped on the first line and subsequently in a format easily read by gnuplot or pgfplots. The Python helper script analysis.py includes basic plotting functionality.
Basilisk includes the option to 'dump' the entire simulation to a single file, which can then be restored to continue the simulation from the output time. By default this occurs every 100 time-units. Since stable travelling waves take a long time to develop for most parameter regimes it is strongly suggested that a single run without controls is performed to generate a dump-file with a travelling wave before loading it and beginning controls after this point. To do this set the value "t0" to correspond to the file at dump/dump-<time>.
Included in the repo is the helper script analysis.py. It is currently set up to perform multiple runs across ranges of Reynolds and capillary numbers. However, the base class FilmModel should be relatively simple to rework if you need to iterate over other sets of parameters.
All of the parameters are either in SI units or dimensionless. The keys in params.json are hopefully fairly self-explanatory. However, below is a full description.
h0the thickness of a uniform film - mLxthe ratio of film thickness to domain lengthLythe ratio of film thickness to domain height (including air layer)thetathe angle of the plate from horizontal - radtmaxthe simulation end time - dimensionlesst0the start time (either 0 or matching a dump file) - dimensionless
rho_lfluid-phase density - kg m^-3rho_ggas-phase density - kg m^-3mu_lfluid-phase dynamic viscosity - kg m^-1 s^-1mu_ggas-phase dynamic viscosity - kg m^-1 s^-1gammasurface tension - N m^-1gravgravitational acceleration - m s^-2
levelthe grid refinement level (resulting in 2^level gridcells)dtoutoutput timestep - dimensionlessoutputoutput dimension (0, 1 or 2 dimensional data)
Mnumber of actuators - integerPnumber of observers - integerstartcontrol start time - dimensionlesswidthactuator and observer width parameter. As this approaches 0 the actuators and observers tend towards Dirac delta distributions. If this is too small for the grid to resolve this may cause unexpected results. - dimensionlessalphacontrol strength parameter - dimensionlessdelactuator/actuator upstream offset - dimensionlessmuinterface/control cost weighting - dimensionlessromthe reduced order model to use for the control strategy - "benney" or "wr"strategythe type of control to use - "pair" or "lqr"
The purpose of this code is to control a thin liquid film to the flat, Nusselt solution. The Navier-Stokes equations are too complex to apply any established control theoretical results to, and so we instead turn to a hierarchical control method, using reduced order models.
We currently consider two ROMs. Instead of describing the evolution of velocity and pressure, they describe the evolution of the film height
To close the system, the Benney equation slaves the flux to the height
and the weighted-residual system requires an additional evolution equation for
We can then implement control strategies to control the Navier-Stokes system by making the assumption that it is well-approximated by one of these simpler models and applying controls as if we were aiming to control the alternative system rather than the original.
There are two strategies that we consider.
Here we simply couple an equal number of observers and actuators, with a fixed shift between them. The control is then simply
If we relax the restriction of discrete observers, giving the control access to the full interface, we can further simplify the problem by linearising it:
The control operator