[MUSIC] Welcome again to the third Week of the course on simulation and modelling of natural processes. In this module, I want to extend a bit the notions we saw in the previous module by giving you an insight on balance equations which are not only depending on time, but also on space. So sometimes just having time dependent systems is not enough. For example, imagine you want to focus the weather In your country. Of course, the weather in a specific part of the country is hugely dependent on what happens in the neighborhood of the place you want to study the weather. So you really need to add some kind of special dependency in your system. So now instead of looking at quantities that will only depend on time, we'll add a special dependence. In particular, we will study what happens in a given volume of our space, and we will then have to make a balance of the things that happen in this volume, so creation or destruction processes in this volume, but the interaction with the neighbourhood will be done by the fluxes of our quantity through the surface of our volume. So the flux here will be the central concept we add with respect to the only time dependent balance equations. So let's introduce a concept that is central to many modelling processes, which is the control volume. So we define control volume, which is noted V here, which is all the gray space and we define also it's surface. So the black curve here is representing the surface of our volume and is noted dv. So inside this volume, we will have destruction and creation processes maybe and we also have our quantity of interest which can maybe leave the domain. So here in blue and red and green, you have arrows representing this flux, so it's our quantity of interest which will move through the surface of our volume per unit time. So the surface is described as an ensemble of small surface elements which are called dS, which also have a direction. This direction is always directed towards the exterior of our volume. So here you can see a small dS, which is in dark gray. So it is important [COUGH] to note that the flux or the quantity that really leaves the domain is only the component which is parallel to these small elements of surface. So for instance, our green arrow here is tangential to our surface, so it will not have any exchange with the outside world of V, so it has no contribution, whereas the red and blue arrows have normal components to the surface, so they really will exchange information with the outside world. So with this in mind, we introduce a function which is called rho of t and x, which is the volume density of the property we want to study in our volume. It can be anything. It can be density of mass, of electric charge, anything and so, our state variable s of t is now equal to the integral over the volume of rho. Now our balance equation for s is the time derivative of s which is equal to the volumic destruction and creation rates in our volume v minus the flux through the surface. Why is there a minus here? It's because our flux through our surface is always defined as the flux that is leaving the domain. So a positive flux will decrease the quantity of s present in the domain. So let's go to the continuity equation. So this is basically a more formal way to write the equation that we just saw. So let us define capital sigma, which is the integral of lower case sigma over the volume, so sigma is the density of creation or destruction rate in our volume and we define the flux of our surface as the integral over a surface of the volume of the flux times the normal of the surface times dS. So the first equation here gives us the time variation of the S in terms of the flux and the creation or destruction of our quantity in the volume. So this is a really very generic equation that you find in many, many domains of physics, for example. So this form of the equation is not very easy to handle because it involves derivatives and integrations. So for some cases, it is very handy but for some others, it is not so. We can rewrite it in an orderly differential way by using the Gauss-Ostrogradski theorem which is also known as a diversion theorem. Here I will not talk about it. It's just a way to translate the integral over the surface of the flux on a volume integral. So basically, you just replace our surface integral by a volume integral of the divergence of the flux. And so you have the second equation of this slide, which is the integral of the time derivative of rho over a volume plus the integral over volume of the divergence of your flux, is equal to the integral over the volume of your density of creation- destruction rate. So, since the volume we chose was completely arbitrary, we can simply remove of the integrals and we end with the differential form of the continuity equation which is the time derivative of rho plus the divergence of the flux is equal to the density of creation rate. So, this equation we will now see different examples that are used throughout this course, but it's really a very completely generic way of stating especially conservation of different quantities, conservation of mass, of energy, of momentum, of almost whatever you want. So, let's go with the diffusion equation. So now if we say that rho is some concentration of a given kind of particles in anti-space, we replace our rho by a capital C. In the absence of any flow, basically what you will have is that the system will tend to equilibrate. So if you have variations of C in your system, the natural behavior of your system is to drive all your system to have a constant, C. So this will make your C move from a place to another and the way it moves has been derived empirically by Fick and it's basically proportional to the variation of your concentration. So if we just take this constitutive flow for the flux j, and assume that there is no concentration creation in your system, you will simply have the time derivative of your concentration is equal to D, the diffusion coefficient times the Laplacian of C. So this D is exactly the same as you saw in the In the second module sorry, on random walks and is the diffusion coefficient. Another example that you will use on a later week of the course is the Navier-Stokes equation. So the Navier-Stokes equation is nothing else and the balance equation for the momentum in a fluid. So here we have the vector u which is the velocity of our fluid and rho which is the density of the fluid. So the rho we had on the first slide is simply replaced by the density of momentum which is rho times u. Here I will not enter into the details of the flux of the momentum, but it's equal to the first theorem which is rho u, so the density of momentum's time u, so which is really the transport of this density with a velocity u plus a pressure which will be an isotropic term, which will exert a force on a given volume of your fluid, minus the deviator extrasensor which is basically all the sheer actions that will be exerted on the surface of your fluid. So with this, we get the momentum conservation equation for fluids in the absence of force. This is the generic form of the first equation, and assuming that you have an incompressible and Newtonian fluid, so where you have viscosity, internal friction in your fluid which is represented by the kinematic viscosity nu, we get the second equation. What you see in this equation is that basically, the left hand side of this equation will present the time space variation of your velocity and it is proportional to gradients of pressure plus a term which is a diffusion of momentum. If we identify this last term with the diffusion equation we had before, you see that this is really a diffusion of momentum and the diffusion coefficient here is represented by the viscosity, nu. So with this, I end this balance equation module, and in the next module, we'll start to see a bit how to implement these dynamical systems we have talked about in the previous modules on our computer. Thank you for your attention. [MUSIC]