Well, okay, I don't know probably we should we should be starting now or somebody from the organizers will just give me a go Okay, okay. I've got to go so so we can go and start I hope I'll be talking fast so we don't ruin the schedule more than Then it's necessary. Okay, so let me introduce myself first. I'm magic proknyak. I came from Warsaw From Poland. It's my first time in Madrid. I'm quite happy about it and I walk for almost 10 years It's not so small software holes called toke We're working for different different platforms from content delivery networks through various enterprise grade systems to installing some Hadoop plasters Doing stream processing and so on but my our main focus is on integration in in large enterprises And one of our largest customers are based in the communication sector We're working for I would say half of the largest polish mobile operators So they are not as big as telephonic. Yeah, as I've had many times At this conference because they are based mostly in Poland, but still they have quite a lot Interesting data to process right so let's let us remind us What are the data that the mobile operators are processing in kind of real-time streaming way? Because this is what we are going to talk about. So the first of them necessarily our various Events connected to you making false and call sending SMSes and so on like content deliver records And then various billing events will they charge you for that call not? And also because everybody now is online various data on network usage Did you go to booking come or Google stuff or or whatever and also a lot of lot of Localization data from a mobile phone either from GPS or for kind of more network connected Stuff how close you are to bait transmitter station and so on So as I've said our customers are not as large as what I found or telecom telephonic But still they have quite a large of amounts of data and in terms of calls in Poland's like three to five thousand per sec and peaks and When it comes to network usage and localizations and the situation is a little bit kind of complicated because you can measure localization data in various ways either it's active or passive and so on and if you track Your local your customers localization in big with biggest granularity you can easily end up with why like 100,000 events per sec So what we are using this data for well, I'm going to talk about two menus cases one and it's fraud detection There are many many interesting ways that fraudsters tend to to use telcos for once frauds on premise premium Usages and other spamming people of SMS's and also some more elaborate stuff like for example Cloning sim cards or simbox them in nation fraud. I won't go into the details because I don't even frankly speaking I don't understand how all of those frauds works But still we want to detect them very quickly. We want to compute for example aggregates How many SMS is to unique unique our numbers? You've said in in last hour if it's like three thousand and probably something is going on And also where have you been during your last location and last but one location because in like if you like in the five seconds You've moved from I don't know to magic to build by all then probably again. You're up to something It's just not possible and then if you detect that you are probably fraudster We want to probably to block your account as fast as possible Maybe send you an alert beforehand so so you can react But the most important thing is that we want to react very quickly and another important kind of area Or use cases is marketing right? We want to Find an interesting event. For example, you're running low on your balance or you are approaching our point of sales And we want to offer you a brand new Mac with a coffee We have to check that you are the customer that we want to interact with for example You're not some kind of low-income pre-pied customer, but real post-paid one that we want to offer something nice and Again, we have to react very quickly quickly in runtime in real time because if you Just move past our point of sales then probably it's no use sending this SMS like in a few hours okay So on this conference you hear a lot about official intelligence Machine learning algorithms as own but for many cases at least at our customers for them. It's kind of Enough in the first place To be able to filter the events to enrich them in context probably also score them with some Who have some machine learning models? But first thing is to filter out the interesting events and to enrich them with some kind of context of Of the customer and with fraught detection, of course It's also very important to be able to compute in real time some kind of windows aggregates how much Then without using how many calls are you are you making and the interesting thing is that? Mobile operators did similar stuff for many many years in their core billing systems, right? If you run out of balance on your prepaid account, you are blocked in the real time, right? So why do we need any kind of more? Advanced or modern system for that the the thing is that billing system is a core system And it's kind of very hard to change people are afraid to touch it because it's at the core of the company so Nobody's allowed just like that to touch the billing system as and to change the rules For example when to block accounts and so on on the other hand they have many many analytical tools, right? Warehouses data likes you name it, right? And it's quite easy to get some data from that You write SQL probably probably you can use some more elaborate Visualization tools and so on and they are easy to use but on the other hand The data flows to to to those places not in real time and they tend to have kind of low SLAs So they they are not necessarily fit for kind of I would say production use by production I mean sending real SMS is blocking cry real client accounts So the thing that we want to do is To be as fast as the billing system to be in real time and have really good SLAs But on the other hand we want the users to be able to interact with it as easily and as they do with any kind of analytical Systems, right? So so so this is kind of a challenge and how do you approach it? Well, and most of deployments of of similar systems. We end up with kind of Architecture more or less like that. So in the center, there's the screen processing engine in our cases Apache flink and then the data flows from kind of source systems through usually Apache Kafka and Again on the right We perform some actions over directly all we send it to to to some kind of output topics and Probably you have some fast real-time client profile to to enrich to enrich events with with some kind of more static date and at the above we have something That's our own that I'm going to talk about right So this is kind of not so special probably many of you have seen such architecture but the two core I would say Components are on one hand. It's Apache Kafka's standard method broker and Apache flink as our powerful stream processing engine, right? Apache flink is probably a little bit less Well-known better for example spark string But nevertheless, you should really check it out if you haven't heard or used it At this conference that's aliyah shakratek who's one of the creators So he's a great person to to ask about it. He's staying right here. I think So why we've chosen flink because at the point when we started there was really almost no no real competition and we want to have very low latency like in I know in milliseconds or tens of milliseconds it had really Impressive window API that allowed you to to define very complex state processing it also Could give and of course currently also can give guarantees on That the data processed from Kafka and sent to Kafka will be processed exactly once no matter if if the job that you are You created failed or not or you redeployed it And also can handle pretty pretty large states in real time. This is especially important for for example Fraud detection because for example, you have to keep running aggregates of for example all All the unique numbers that people are calling in in the last few hours So this state can get easily out of control that can be Wow people sometimes even reach terabytes We were very rich like tens of gigabytes, but still it's quite quite quite large So think is great But as you look at all those points you can see that they are mainly about operational excellence and the API's for the developers to to work with right I Don't know if this appeals to for example your business users or stock stakeholders Of course if you if you tell them what that means then it's okay But how do you actually use let let user design their crowd detection rules and so on so now we'll talk a bit about how to create fling jobs because Like spark or or similar frameworks fling comes with really nice Scala DSL and let's you write a kind of concise and self explaining Self-explaining definitions of jobs, but of course it's self-explained by the for developers and for poor business analysts Who are used to I don't know in our case many times to excel and SQL probably not so much probably they won't Necessarily understand. What is this underscore before customer and so on and the situation is even harder in our case because we are not part of the Of the mobile operator. We are independent software vendor and that At our customers they have their own silo's is right. They have business people Analysts IT teams and heaven forbid ops and their boundaries between each of these kind of departments But you can tear all those boundaries, but you cannot tear this one We are separate entity and it's always better for our customers to design rules themselves then go to us Prepare change request put it into JIRA and wait when we have time, right? So we want to let users or at least analysts define the business rules and This is kind of our history like more than half two and half years ago We started proof of concept of such solution with fling. We achieved of course great results But then of course all the processes where hand code is right hard-coded and then our client approached us and said, okay, and if you want to To write new processes, what would we do or change it? Well, you will have configurations and you can change it But configurations is not enough for us, right? For example, we have to add new rules add new conditions and so on So we said Okay, so we'll let you configure a little bit more. You will write this call expression stuff And we'll just integrate it. We'll compile it integrated. You'll learn it fast. Scala is easy is an easy language So I said, hmm. Yeah really Maybe we could do it But they still didn't look to convince and we were also not convinced that they will be able to do to write Scala code So we thought, okay, we'll prepare you a graphical user interface where you can just Drag-drop and see and on some kind of diagram what you're doing and they said, okay And this is how we created our open source project called no snucker I know the name is kind of strange But it comes from the fact that flink is from Germany and it has square in its logo and For some stuff you probably need some more something more than square to to crack a nut Okay, so yeah, if you like it, I have stickers with it. So just grab me afterwards So what we wanted to achieve What we still want to achieve and I think at some of our customers we managed to do it Is to create some kind of closed feedback loop. So first our analysis will come up with some idea Maybe do some explorator Explorer data exploration and in static warehouses and so on then we want them to be able To design the process to run on flink test it kind of locally in some kind of sandbox testing then we want them to be able to deploy it in kind of I would say staging environments let it run for like two or three days and see what happens and After what we want them to be kind of courageous enough to click the deploy button and to gather the results from from production, right? so this is kind of At that time we thought it was a bit ambitious goal to to let the user deploy stuff in production We are talking about kind of analysts who who were more Used to writing SQL queries But at some of our clients we managed to do that and the main assumptions what that we started with were first all the expressions and Well, generally generally all this user interface should be accessible for people with kind of semi technical skills a little bit of SQL Excel but no programming right and Also, we had to make it very easy for them to be able to test and experiments. So they won't Be afraid to click test to click deploy and see what happens, right and the the last point is That we still assume that some parts of the code will be written in scholar Java, right by us developers The integration the model and so on the things that usually don't change that often and if they change Then you probably need some some coding anyway because We've seen some of I would say graphical tools for designing stuff like that, but once they decide to be Totally zero code they tend to be very very complex and we feel that maybe it's better to To stop somewhere somewhere in the middle so that we still need developers from time to time to read to write new Integrations newer aggregates and so on but still we want to let users do most most of the stuff So we end up with something more or less Like this so this is kind of the graph of one of processing jobs right this a toolbox and users just drag stuff and Can do some filtering enrichment aggregations and so on right so in the toolbox and the users have Both kind of common stuff like filtering defining variables and so on but also They have blocks that are unique for their use case like for example get client data from Redis or compute This scoring model and these are Developed beforehand Right and once the user is drags and drop this stuff. They have to configure the filter Write some expression and so on so after a while we thought That we'll use something called spring expression language for those of you who are Java based They probably know that it's simple expression language used for configuration files And we are quite amazed to find out that it can perform very very well in fact we We execute such expressions like I would say 200,000 or 300,000 times per second and it can deal with it and the language is Simply enough to be able to do some kind of basic code completion in the browser So the users can know what they are up to and if they they make the mistake we can correct them Even before they save the process, right? So we do some kind of static analysis of both the whole graph and and the expressions I think it's it's kind of nice way to To to operate with with your users to let them know that they made some syntactic mistakes I think with languages with such as Python. It's kind of more more problematic But underneath we use scala so we can do quite a lot of stuff static nice static type Okay, but how all these kind of custom parts Will arrive and appear in our toolbox? Well, the idea is pretty simple. The idea is that when you kind of deploy Deploy this new snacker at your organization. You prepare a jar file with Java scala or whatever JVM classes containing your business logic and then you're you do it just once Of course, you can update it later and then the users just write processes They are safe as JSON files and together The model the code and the JSON will be deployed to to flink and live happily there Right. So so idea is pretty simple. Of course under the hood many many different things can happen and in this model The developers can define the data be they can be static like pojos or a class files Oh can be they can be kind of automatically discovered if you use avro and some kind of things like schema registry and also some Sources of data things of data There we just kind of more or less mimic flink API's and Also some various services for enrichment doing some actions like blocking accounts and because messes and so on and also some custom transformations will talk about it just a little bit later because They involve kind of more advanced flink concepts so when We deploy in snucker at one of our customers. We have to just implement this kind of This kind of trade we have to define services sources things some kind of global functions and so on And let's look now how to how do we define for example a new ways to To to enrich the data for example to to go to Redis and fetch some stuff. Well, we just write Normal Scala or Java if you like code We annotate it with with some kind of parameters and this is kind of the API of this Component that will appear in user still box right for developers. It's very easy to to write and then the user the end user would just have to parameterize it with some kind of Expressions for example, where does the customer ID come from right? So the idea that it's just kind of function. It's very powerful because we can You can use it for many many way many different things. For example, as I've said you can get some additional data on the customer from kind of second Second storage you can use it to To perform some actions like block client the cloud accounts and SMS and so on and so on but you can also use it to To score your data with some models. For example, if you've been to yesterday to the talk about PFA This is also something that you can do so you can integrate for example models export it from I don't know our or spark and embed it it into your Java code and then just Useless knacker to to to to score your models right, okay, of course these are just kind of Simple stateless functions, but what about stuff more advanced stateful fling stuff like windows handling state and our our fling goodies, so we figured out that we what don't want to expose the vast is Flink APIs to our users Because they will be overwhelmed by that right the the amount of different windows that you can configure with flink is It's very very large and easy to make mistakes. So currently we just exposed some kind of preconfigured windows Where the users can define for example the length or the key by which the windows are partitioned and also some some nitty gritty details of fling jobs But the idea is that most of the stuff is pre-configured So they don't fill of them well and they don't do too many mistakes and we the developers We can write this normal fling code and again annotate it with some kind of parameters and then it will be integrated into the flink Flink process that will be deployed when the user Decides to to deploy his or her His or her process right but nevertheless we can reach pretty interesting results with that because we can Configure not only simple stuff like keys or length of the window, but how do we aggregate stuff and in the meantime we've learned We managed for example to teach our analysts to use stuff like Like hyper log log to compute kind of approximations of unique numbers that client called Of course, they don't know that's hyper log log because it's called like just unique count approximation You don't have to understand the in nitty gritty details. Otherwise, you wouldn't be here, right? But they are able to use it and it's kind of works. I mean it works not only kind of so so the stuff that that William Told us yesterday about it can be used also in in such graphical user interfaces Okay, so now Our users can define this nice process Colorful it looks okay But what now? Of course, we don't want them to deploy it in production immediately. We want them first to be able to test and then when they are really Really sure that it won't break then they should deploy it so we need some testing and We come up with we came up with two two different kind of flavors of testing So the first one I wouldn't call it using testing but maybe kind of standard box testing So this is how kind of normal production Production pipeline looks like we take data from Kafka We we process it with flink we enrich it with some kind of different data from different data sources And then we can perform some actions invoke some services on put it into or put it into different Kafka topics But now we don't want to take real data we want to take data from kind of file with with our prepared test data and then we want to Create some kind of a sandbox flink mini cluster with within our user interface and take the data from from From the test data file again take real data about the customer So so that the results are kind of more or less like real, but then mock out Output Kafka and mock out external actions, but let the users just check what would be invoked So, yeah, they have this This test data file They test it and then they can see how many events passed through which nodes What were the results if if everything was filtered out or if we decided that That all the events were a fraudulent and then they can kind of dig inside and see what were the results of invoking all expressions Did they made a mistake or should they just adjust? I don't know adjust thresholds for detecting fraudsters and so on and so forth Right and it wouldn't be so easy for them because sometimes the data is kind of Kind of complex but fortunately because most of their data comes from Kafka We found an easy and nice way to generate this data That is we just take I don't know 10 or 10 10 or 100 of Latest events from particular Kafka topic we downloaded let the users let the user look a bit a bit on Them and then they can tweak them a little bit for example enter their own phone number and then test Do the sandbox testing using these prepared data? Okay, so this is this is kind of a nice feature that led them Test easily in some kind of that sandbox testing after reassure that there are no large mistakes We want them of course to deploy stuff to some kind of real environment and again Thanks to the nature of fling Kafka ready since one especially the nature of Kafka we can do a simple step that allow us To to do some kind of more like user acceptance or integration testing that is we take our production environment and we make a small copy of that in kind of like Staging environment we don't want to Run all of their processing there Just the process is that they are worked on at the moment because it's smaller environment, but still they should be able to process The whole amount of data for one process and then we duplicate duplicate the event stream right so our users can deploy The processes they are working on on the staging environments when they can see on on the real data Just duplicate it between our cast Kafka clusters and to see for example for a day or two How do they perform before? To analyze the outcomes Because before they click the migrate button and deploy stuff to production and again we use The exact clone of our customer profile so we can replicate the production environment as much as As we can and then of course there comes the big day when they really want or big afternoon When they really want to deploy stuff on on a real production environment and block some clients And at our largest largest deployment, they did it quite a few times we have like more than 50 fling jobs running both in fraud management and real-time marketing and the Amount of events processed by by all those processes Are more than I would say more than 100 500 thousand per seconds in during some peaks and they Were able to draw quite large diagrams. So it's kind of not so easy to To see what goes wrong if something goes wrong So what do we need to have we need to have of course good monitoring, right? Use grafana for that usually influence db and grafana is our kind of default monitoring stack So when somebody Creates such diagram and deploys it We kind of automatically create some simple grafana dashboard when they can track some basic statistics Like throughput latencies amount of errors and so on And for many for many Errors, this is kind of enough of course for kind of more detailed analysis they need to have All those data puts to I don't know some kind of elastic searcher or whatever cluster more advanced tool so that they can look at At the particular events and analyze if they were handled correctly, but for kind of First monitoring These simple Simple grafana dashboards are enough. For example, this is this is a case from the last months at one of our deployments This is the minute that one of our users deployed A version of a diagram that couldn't handle the load because it tried to To invoke some kind of expensive web service to to get some data and He could see more or less immediately. Of course, he didn't go to the metrics web page, but still He could see that the performance Dropped dramatically and after he corrected his mistake because he just created some additional filter and so on So it was kind of simple fix. We can see that performance is okay again, right? So some simple metrics accounts and latencies can can help really really a lot To to detect some kind of bigger errors Okay, now we still have a little bit of time. So I'll try to show you how it works I will try to show you I hope so Kind of it So you can see this is kind of Maybe resolution is not perfect, but I hope that you can see something So this is kind of simple A simple diagram that tries to detect some fraudsters that we take Our source of data that is the cause made at mobile operators We do some first filtering We can see There are some fields that we can use for example the balance charge or Yeah, or mssdn that was calling that the phone number that was calling the phone number that was called and so on and so on We can do some basic aggregations For example here. We want to detect how many unique numbers the customer called in last four hours And this this number is large enough. Okay larger than two probably. This is not good in real use case We can take his customer profile See if it's a post bay or postpaid or prepaid account And then maybe even prepare some kind of in my case This is very simple Exported to to to this pfa format and score it to to see if we need to Iver Send just him an alert that he calls too much Or if we are sure he's a fraudster just blocks his account, right? So this diagram is pretty simple, but nevertheless It can save our customers quite a lot of money So now we're probably not really sure that it's working yet So let's generate some test data Like 20 samples. Okay, we have We have a file with With the data that came from the kafka. We won't be looking at them too much and then we drag drop And now flink mini cluster is spawned inside inside our environment and we can see how many of these samples Just went through through our filters, right? So this is the filter that filters out the largest amount because this is the filter of How many unique numbers we're called and now we can see Here, okay, this is jason. So this is again something that your customers have to get used to What were the outcomes of of which expression cell and filters, right? And if we are sure we can push the deploy button. I've did it Sometime ago and see the matrix. I have some random data generator that works pretty well And we can see so how many events per second we are processing on which Which nodes the events were ejected how many nodes? Received this final notes. How many of them? Received how many events and some basic latencies for example, how much time will pass from from the From the call to the moment when we process the data, right? And after a while, for example, if we If we left the Our process for a day or two, we can check how many For example, events passed through Each of the nodes in I don't know in last hour I had some problems with time zone. So we'll see today and we can see that through our process like 160 Thousand events passed but only Only 100 50 hundred passed through through all those filters and so on so we can Hide it and this is kind of more or less how our clients Are used to work nowadays. Probably they also want to migrate stuff to production and so on but I think you should Get the idea of how is this working? We don't have Much more time, but it's good because I don't have much more to say I want you to remember this this idea that we want to That we want to close the feedback loop and let our users With minimal help from developers come from the idea to process design Testing in sandbox testing in kind of integration environment and then deployment to production and monitoring This is very important that there's minimal aid from From developers who are like me usually well expensive lazy and they are Kind of not not always ready to help when when business needs it But on the other hand probably even if you can Manage to to to achieve 80 percent of your stuff with ui You still have to remember that you have to have competent Expensive developers to do the last 20 percent of that with the code because You cannot just go with zero code systems. Some code needs to be written Right and I think solutions such as ours can be used mainly in kind of on the middle ground between Between cases when you want to do some kind of ad hoc analysis that have exploration visualization And between places when you have to be real sure that your processes are working correctly when you probably want to have Real kind of coding practices like reviews continuous integration deployment And on the middle ground you have processes just like marketing stuff or fraud detection that You need Production ready stuff Good production slas, but on the other hand if your user makes a mistake, probably it would want Have kind of dramatic consequences of how of course you can you have to do some stuff to make sure that it It's more or less safe, but still most of the processes They can just be designed for kind of by analysts or business people And if you want to learn something more about How we do it and and whereas it is on the github and this RFID code should point you to some kind of case studies I don't have much experience with RFID code. So I don't know if it works, but hopefully it does We still have I think almost two minutes for questions So thank you very much for coming and listening to me and enjoy the rest of the conference Yes, how long did it take to build this and Was this a customer initiative or your initiative? Well, well, it kind of was Joe I would say joint initiative I mean we came up with the idea to build it and the customer accepted the idea that we will build it and open source it and we kind of We cover part of the coast they cover part of the coast But you know, it was surprisingly easy easy to build because flink is really great a great framework and In scala it was quite easy to to do it and also they are, you know, mature Frontend frameworks that let you do this this kind of user interfaces well Most of the stuff that I've shown you it was like, I don't know Less than a year by Team of two or three people. So I think it was kind of worthy Okay, thank you very much. I'll be around if you if you have any more questions You


In the previous lecture, we appreciated that in a turbulent layer the inner layer can be nearly universal at least when pressure gradients are moderate, but the outer layer universality is very difficult to establish. It is here that we principally need the turbulence models and that is the topic of discussion today. So, I will explain what the main task is of modeling. I will take up the so called ad viscosity models and in that there are three variants. One is called the general mixing length model. The second one is higher and also number one equation model and higher and also number two equation model. You will understand the meanings of this as we go along. So, in multidimensional turbulent flows, even if inner layer universality is exploited, Rans equations must be solved in the outer layers through modeling and that means that the turbulent stresses u i prime u j prime and heat fluxes rho c p u prime i prime t prime must be modeled to recover lost information through averaging. Remember these terms arise because of Reynolds averaging. This recovery however must be carried out in a general way so that the model need not be changed from one flow situation to another. Now, it is this imparting absolute generality to a turbulence model has however been found to be quite difficult task, but nonetheless we will see as we go along what progress has been made. Thirdly, the model must be economical that is the computational expense or the ease must be must not be very much in excess of that which would be required for computation of say a laminar flow under the same situation. So, with these premises we begin to look at what are the possible turbulence models. There are two main approaches to modeling a stress. One is to say that the stress is related to the mean strain rate through a property called turbulent or ad viscosity. This is very analogous to Stokes's stress strain relationships. Alternatively, the stresses can be recovered from solution of transport equations for the quantity u i prime u j prime in which the convection and diffusion of this quantity is principally balanced by the rates of its reduction and dissipation. In this lecture, I am going to concentrate on the so called ad viscosity turbulence models the first type. The second one we will take up in the next lecture. So, the main idea is behind turbulent viscosity mu t is to model a turbulent stress minus rho u prime u i prime u j prime. Exactly analogous to the laminar stress is except that mu is replaced now by a turbulent viscosity mu t. This is the strain rate and then minus 2 3 rho kinetic energy e into delta i j. Delta i j is the chronicle of delta. Its value is 0 when i is not equal to j, but when i is equal to j it is equal to 1. Remember mu t is the property of the flow and not that of the fluid. Mu t is also isotropic that is mu t in all directions x i is identical at a point, but at different points in the flow its magnitude may vary. The term involving chronicle delta this one is necessary in turbulent modeling because the sum of the normal stresses when i is equal to j. Remember this will be d u i d x i and this will be also d u i d x i. So, this will become 2 mu d u i d x i, but that is equal to 0 in a incompressible flow. Therefore, we are left with minus rho u i prime square equal to that quantity which means it should equal to rho e. That is why that quantity is included in the equations just to make sure that the kinetic energy is balanced in this representation of a stress and strain relationship. Using this model the number of unknowns u i and p in the Rans equation equals the number of unknowns, but then the value of mu t now must be provided somehow and that is the modeling part characterizing mu t. So, from kinetic theory laminar viscosity mu is written in dimensionally correct form as mu times rho into the mean free path length l into the average molecular velocity u mole over bar. Analogously we say mu t would be modeled as rho times some length scale multiplied by a velocity scale u i u dash and these are representative length and velocity scales of turbulent fluctuations. So, then the main task now is in modeling mu t is to model l and u i prime. Let us see how we can do that in a as universal manner as possible. So, for example, the simplest model of u i prime which is called the general mixing line model is to say it is proportional to some quant length scale l m multiplied by the mean velocity gradient and in a three dimensional flow this would be given as so that mu t would become rho m times l m multiplied by l m into d u i by d x j into d u i by d x j into d u i by d x j d u j by d x i raised to point five with summation. So, that this is really phi v if you like or the average mean velocity gradient l is equal to l m is called the Prentzels mixing length and l m is given as you will recall from our lecture on near wall flows kappa times near wall distance y or n in here into 1 minus e raised to minus xi where xi is 1 by 26 n plus that is n plus by 26 and l m the is equal to point 2 into k in the kappa into r where r may be the radius of the pipe or it may be the boundary layer thickness if n plus is greater than 26. Now, the wall shear stress that is required here is calculated simply by the product of mu multiplied by the total velocity gradient at the wall that is the normal velocity gradient at the wall. So, the model is now implementable because the velocity distributions would be available from solution of momentum equations and the stresses in them would be modeled through mu t times this and therefore, tau wall can always be recovered. For two dimensional boundary layers of course, this mu t which we had represented here for the general three dimensional flows would become simply rho l m square d u by d y. Now for inner and outer layer boundary layers from lecture 24 we say l m is equal to kappa y 1 minus exponential of minus y plus by a plus and a plus was given by this quantity where a and b were sensitized to value of the suction or blowing parameter or the pressure gradient parameter p plus and of course, when y plus exceeds a plus it would simply be equal to what we have shown here point 2 times kappa times the length dimension of the flow. When we encounter free shear layers like the a turbulent jet or a turbulent wake then there is no wall present in that case how do we specify a mixing length well it is specified as l m time equal to beta times the half width of the jet. Let us say the jet emerging then this would be the velocity profile and this would be u max and we say wherever u divided by u max is equal to half that is the distance y half this is called the half jet width in a free shear layer likewise for a wake also. As I said y half is the half width of the shear layer and beta takes different values this has been observed from experiments as well as has been tuned by numerical experiments. Beta equal to 0.225 if the jet was a plane jet if it was a round jet it would be 0.1875 and if it was a plane wake it would be 0.4. These are the typical values for free shear layers this is just as an aside we are not dealing here in this course with the free shear layers but then the less it is useful to document this prescription. Remember there is no presence of wall in a free shear layer and therefore there is no notion of a y plus. So with this prescription l m is now available and therefore the equations can be solved as I said earlier. The mixing length model unfortunately predicts that rho u prime u i prime u j prime will be 0 where the strain rate S i j will be 0 as you can appreciate from this figure if the mean strain rate was 0 at any point mu t would automatically be 0. In many situations this is not found to be the case for example if I were to take the case of a annulus let us say this is the inner wall and that is the outer wall then we would have a velocity profile which will look something like and let us say the outer wall is rough and the inner wall is smooth this is the smooth wall and we would expect a velocity profile to be something of this variety something of this variety. So the plane of zero shear which is here let us say this is where d u by d r will be equal to 0 tends to be closer to and if I were to measure now in this case rho u prime v prime then I would find that the plane of zero shear tends to be closer this is where rho u prime v prime will be 0 then to the smooth wall then the plane of zero velocity gradient. So in fact the shear stress does not really go with the velocity or the velocity gradient or the strain rate and there is a separation here whereas the mixing length model would predict zero shear stress here also whereas the true zero shear turbulent stress is 0 here. Now in order to meet with such asymmetric situations that we need refinements in the models. If we for example represent velocity scale u i prime equal to square root of kinetic energy then mu t will be called rho times L square root of E where L is now has a different meaning and it would be called the integral length scale which we defined earlier and the turbulent kinetic energy equation E must be obtained from turbulent kinetic energy equation which is as you will recall given by the convection terms here that this is the turbulent diffusion due to pressure fluctuations and velocity fluctuation and then there will be the laminar diffusion. This should be the rate at which energy is extracted from the mean motion to produce turbulence and this with the rate at which the energy will be dissipated that we called rho times epsilon. The model of the one equation type goes like this it is mu t is equal to rho L square root of E where E would be obtained from a differential equation whereas L would be now specified algebraically again like in the mixing length and because we have to now solve this equation additional equation along with the Rans equation it is called the one equation model. Now the turbulent term cannot be directly measured turbulent diffusion term which contains pressure fluctuations and the triple velocity correlation these cannot be measured directly because no probe can simultaneously measure pressure fluctuations and velocity fluctuations and therefore, we need to model it. So, but noting the redistributive character of this term you will recall that when we did the energy balance we noted that this term is redistributed and therefore, we will assume a gradient diffusion for this. So, minus u j prime p prime rho u i prime u i prime by 2 would be simply mu put as mu t divided by sigma E d E by d x j where sigma E is the turbulent transfer number of turbulent kinetic energy. Now when r e t is high dissipation can be represented in terms of large scale fluctuation this is what we had observed when we looked at the formal aspects of turbulence and therefore, this mu times d u i prime by d x j prime which we had modeled as rho epsilon can be written as C d times rho times e raise to 3 by 2 divided by L. This is now the representative v dash cubed if you recall we had said that the rho times epsilon should be proportional to v dash cube divided by L and that is what I am writing here. So, v dash being square out of u we have said that that is equal to rho e raise to 3 by 2 by L. If we now replace minus rho u prime u j prime equal to mu t times s i j then the model turbulent kinetic energy equation would be simply convection terms here plus mu plus mu t divided by sigma which is into this gradient of e which would be the turbulent diffusion and then there would be the generation term energy production term by replacing this and then there would be the dissipation term where C d and sigma epsilon are expected to be universal constant when r e t is high that is away from the wall and beyond the transitional layer. How do we get C d and sigma epsilon? Recall that in the fully turbulent inner layer production is very nearly equal to dissipation as we saw in lecture 24 and the equilibrium conditions prevail. In this layer tau t is equal to mu t d v by d n and hence tau t d v by d n which would be the production term. This term would be the production term in the two dimensional boundary layer or very close to the wall minus equal to rho square root of e L d v by d n whole square equal to C d rho e raise to 3 by 2 by L which is the dissipation and where v is the velocity parallel to the wall and n is the normal distance. Now, in this layer we are also said that tau t is very much close to tau w that is the wall shear stress and hence tau w divided by rho divided by e would be u tau square by e equal to square root of C d. Now, you will recall that we had shown from the experimental data that tau w is approximately equal to 0.3 rho times e and therefore, C d takes the value about 0.09. Sigma epsilon sigma e is taken equal to 1 from numerical experiment in several flow situations like a pipe flow or a boundary layer and so on and so forth. Hence, the model turbulent kinetic energy equation can be solved. We must now specify the length scale L. How do we do that? Well, L is determined as follows. Consider equilibrium condition again production is equal to dissipation then mu t will be equal to rho e raise to and the definition of mu t is now rho e raise to half L which is the definition. If I combine these two equations and eliminate e from them, I would get mu t equal to C d raise to minus half rho L square d v by d L. Now, if I compare this equation with the equation of the mixing length model, then I would see that L would be you recall the mixing length model mu t equal to rho L m square into d u d y. So, L would now equal C d raise to 0.25 into L m which is 0.5477 L m and L m equal to kappa y times the function that we normally use. With these specifications L mu t C d n sigma epsilon d a turbulent kinetic energy solution along with the Rand's equations and in general flows however, further refinements become necessary and in the next slide we will show you why this is so. Although kinetic energy can equation can take care of the non-coincidence of 0 velocity gradient and the shear stress, it is not a very good approximation in some other situation as we shall see shortly. For the more general flows involving strong and variable pressure gradients or even recirculations or swirl or buoyancy effects, it is necessary to devise means for determining distribution of L in a multidimensional flow. So, recall the energy spectrum E k in wave number space with wave number k and if we divide this E k by k and integrate from 0 to infinity, an equation for L in the spectral space can indeed be derived since L is equal to 1 over E 0 to infinity E k by k d k. Unfortunately, this equation is not known as not tractable in physical space and therefore, we need to find some alternative means of determining the length scale. So, direct equation for a length scale is not possible which is the need in multidimensional flows with all the effects that I mentioned here, but then a length scale equation need not necessarily we have L as its itself as its dependent variable. Any combination of the form z equal to E raise to m L raise to n will suffice since E can be known from the solution of the model turbulent kinetic energy equation. There have been some proposals for equation for a z which is a composite variable E raise to m L raise to m. The model equation for z is postulated like this, there would be convection of z, there would be laminar and turbulent diffusion of z, there would be appropriately scaled production of z and there would be dissipation of z plus a additional source term as z. So, where p as you recall is the turbulent kinetic energy generation and C 1 C 2 are constants when R e t is high. Now, there have been some proposals for this for them for the first one took m equal to 3 by 2 and L equal to minus 1 and that would mean that z is equal to or proportional to E raise to 3 by 2 divided by L which is exactly would mean z would imply dissipation and therefore, it is called the dissipation equation. Equations for m equal to 1 and L equal to 1 has also been derived, but then that equation requires an additional s z term which I am not mentioned here. Likewise, you can also have a E raise to 1 divided by L square that is n equal to minus 2 and 1 which again requires another type of s z term and you can also have E raise to half multiplied by L which would be the turbulent viscosity equation itself, but that also requires an s z term. It is the dissipation rate equation is the only one which does not require s z and that is equal to 0. So, we have if we take z equal to E raise to 3 by 2 divided by L we would have a nice convection term, a diffusion term, a production term minus dissipation term with s z equal to 0 and this is the most preferred alternative because this s z equal to 0 term is an attractive feature whereas, in all other models s z has to be tuned as it were and has to be modeled separately. Therefore, the most preferred choice is the dissipation equation with E raise to 3 by 2 and L raise to minus 1. So, one solves the z equation along with the E equation and simply recovers the L that we need at each point in the flow so as to form the turbulent viscosity. How do we justify the dissipation equation about which I just mentioned? Now, at high r e t local isotropic prevails and an equation for nu d u i prime by d x j square can be derived by differentiating instantaneous terms on Navier-Stokes equation for u i dash with x j and then multiplying by 2 nu d u i dash by d x j. If you then time average this nu equation then you get an exact equation for epsilon the quantity that we have chosen for the second variable z and that equation looks like this. It is a convection term and then there is a these two terms constitute diffusion of epsilon firstly due to pressure gradient or the pressure fluctuations and secondly due to the velocity fluctuation. This is the laminar diffusion, this is the production of epsilon, this contributes to the production of kinetic energy and these two are the dissipation of epsilon itself. Now, the complex correlations can be discerned from the DNS. So, how can we model these complex terms that you see here? That has been done by looking at computations of direct numerical simulation. So, the diffusion term apparently can be modeled as d by d x k into c 3 time e square by epsilon d epsilon by d x k in which u j dash u j k dash has been taken proportional to e and this is an assumption in this modeling. The production term about which I mentioned this is the production term is modeled as simply c 1 times the u i dash u j dash multiplied by strain rate multiplied by the time scale epsilon by e and then the last two terms are simply modeled as c 2 times epsilon square by e. Remember this term would not be relevant in the highest wave numbers space, but relevant in the inertial sub range whereas, this term would be dominant in the highest wave numbers where dissipation really occurs. These two terms can be grouped together and modeled as c 2 times epsilon square by epsilon e. Remember all this modeling work has been done earlier was made possible from measured turbulence data, but now it is also possible from direct numerical simulation data. Therefore, we get the dissipation equation which reach like this. This is the convective term of the dissipation equation, this is the diffusion term, this is the turbulent diffusion, this is laminar diffusion and then we get the production term and the dissipation term itself. Mu t is rho square root e into L and therefore, this will simply become c d rho e square by epsilon because epsilon is proportional to e raise to 3 by 2 by L. Hence, the dissipation equation would be written as d by dx k of diffusion gradient of epsilon into c 1 times production minus c 2 times rho epsilon square by e and where u i dash u k the strain rate multiplied by the viscosity. This is the model that we choose to model the stress which appears here. Sigma epsilon is the turbulence frontal number for dissipation rate. It absorbs constant c d and c 3, this c 3 and having modeled u i dash u j dash by this as c d times u i dash u j dash by this c d times so the mu t is this whole term is replaced by mu t by sigma epsilon and c 3 and c d are absorbed near. So, this is then the final form of the epsilon equation which we shall choose. The so called two equation model is essentially this. There is the kinetic energy equation which you have already appreciated earlier and this would be the dissipation equation now written with u i dash u dash replaced by the strain rate and the boundary layer form of this would be this are the convection terms of e diffusion terms, generation term minus dissipation and for dissipation this would be the convection term, this will be the diffusion term and this will simply be mu t d u by d y whole square minus c 2 rho epsilon. The question now is how do we determine c 1 and c 2 and sigma epsilon? These are determined from observation of experimental data in decay of homogeneous turbulence. So, what is done is that in a wind tunnel you have you put a screen like so and the air flows through the screen and you simply because of the screen high production of energy would take place and the energy kinetic energy will go on with x it will go on declining. If you look at d e by d t in this case in this flow both production and diffusion are absent and v the normal velocity component is 0 and therefore, d e by d t would be simply you will see in this case d e by d t would be simply equal to minus rho epsilon. So, rate of change of energy is simply balanced by the dissipation and that is what I have written here and likewise d epsilon by d t would be equal to minus c 2 epsilon square by e. If we solve these two equations d e by d t with the observed fact that e is proportional to t to the power of minus n it follows from this d e by d t is equal to minus epsilon and d epsilon by d t is equal to minus c 2 times epsilon square by e and therefore, inter substitution shows that e should vary as t raise to minus n and if you look at the experimental data you find that n varies between 1 and 2 and 1 n into 1.2 at least in the early part for small times and for later times n is of the order of 1.8 or so which we shall look at a little later. So, in the initial times at least it is between n equal to 1 and 1.2 and therefore, the solution gives c 2 equal to n plus 1 divided by n simultaneous solution and therefore, taking n equal to 1.1 say we will get c 1 equal to about 1.91. To determine c 1 we consider the inner turbulent layer where convection is 0, nu t is very much greater than nu and production nu t d u by d y square is equal to dissipation and hence if epsilon equation this is 0 almost and therefore, production is equal to dissipation because that is also 0. Since convection is 0 we will get the total diffusion equal to that term and which we have modeled as e epsilon square equal to and remember production would now be nu t d u by d y whole square equal to dissipation and therefore, epsilon square by epsilon e into c 2 minus c 1. In the inner layer the logarithmic law suggests that u plus equal to l n e y plus by kappa gives d u by d y equal to u tau by kappa y and that is equal to tau all over rho nu t and that is also equal to u tau square over nu t which gives nu t equal to u tau kappa y and hence since production is equal to dissipation epsilon would be nu t d u by d y whole square equal to u tau by kappa y which is gives relationship between epsilon and y and therefore, d epsilon by d y would be minus u tau cube over k y square. So, if we now substitute d epsilon by d y here in this equation and also take mu t appropriately as shown here and d epsilon by d y as shown here. So, then you will get d by d y of u tau kappa y by sigma epsilon into this quantity equal to u tau square by sigma epsilon y square equal to all this or kappa square over sigma epsilon y square epsilon would be c 2 minus c 1 u tau square by e and therefore, c 1 would be equal to c 2 minus kappa square over sigma epsilon over c d and that would turn out to be equal to 1.44 because c d recall was equal to 0.09 kappa was 0.41 and sigma epsilon has been found from numerical experiments to be approximately 1.3. Therefore, c 1 will be equal to c 2 minus kappa square over this equal to 1.44. So, with this we conclude how c 1 and c 2 are determined. Remember we had said c 2 was equal to 1.91 and therefore, c 1 can now be determined from this and it turns out to be about 1.44. Now of course, these equations apply as I said to high turbulent Reynolds number region which means beyond the transitional layer and therefore, in a practical flow the layer up to the transitional layer must be somehow captured in a computation. That is done as I have shown here. So, in a the equations I have solved let us say by a finite difference procedure then if this is the wall then you will take the this will be the grid node at the wall, but the next grid node would be taken at a distance substantially away from the wall. So, that y p plus would be say anywhere between third and fourth t and 100 and you are sure that you are in the inner turbulent layer. So, the point p must be in the inner turbulent layer. So, that is the most important part and then you only solve for the outer layer which is beyond point p. So, all the boundary conditions must be applied at p. Now of course, we do not know the exact boundary conditions for e and epsilon at p, but they can be derived. So, for example, if we take tau wall equal to mu effective d u by d y p equal to mu effective u p by y p and hence mu effective by y p becomes simply rho u tau kappa ln e y plus p where u tau is equal to c d raised to point 25 e p raised to half, you will recall that we had shown this for the inner layer or the turbulent part of the inner layer and therefore, u tau can be estimated like this in rather than from mu d u d y equal to 0 because we are not computing up to this point. We are computing from this point onwards. u would be of course, obtained from the ranch equations at this point. So, in the e equation if we say production equal to that and equate it to an average dissipation over this length epsilon bar p would be equal to y p raised to minus 1 0 to y p epsilon d y. Substituting for epsilon equal to production we get that and that would integrate to simply this and therefore, the source term of e is simply mu effective u p by y p whole squared minus rho epsilon bar which is what I have shown here what epsilon bar is and epsilon p itself would be simply c d raised to 0.75 e p raised to half 1.5 into kappa y p. So, what is done is the source term at point p is modified in the k and epsilon equations. So, these are the source terms in the k and epsilon equation then at the point p these two source terms are simply modified to read as I have shown here. Now, with this the region where very sharp gradients of velocity kinetic energy and other quantities take place is completely circumvented and everything begins from here and we have essentially exploited the universality of the inner layer in dimensionless quantities. This gives enormous savings in computational time and therefore, it is routinely used in two equation turbulence model and this is called the wall function approach to solving the two equation turbulence model equations. In the next lecture I will consider further refinements for situations in which the eddy viscosity models do not quite apply in a precise manner and therefore, one has to turn to the modeling of the turbulent stresses themselves are obtaining turbulent stresses through transport equations for U i prime U j prime.


Hey everyone, welcome back to Nintendo Prime. We're just gonna be talking about one story in this video, but it's an embarrassing story in regards to a major release on Nintendo Switch. And I just, I'm kind of at a loss for words. The reason we're really doing one story today is I actually have a lot going on. My kids are out of school this week, so I gotta go take them and go do something here in a little bit. So we're just gonna get this out the door because I think this is a really important story to talk about. Before we do, I wanna remind you that we do have a giveaway event happening this Sunday called Prime Giving. It'll be a Switch OLED, a satisfied grip, special edition Switch lights, and Zelda Game & Watches and a whole lot more being given away starting Sunday at 8.30 PM Central Time live during our Prime Giving event. By the way, if you wanna enter for the grand prize, which includes a Switch OLED, we actually have a separate entry form for that. You can enter in the entry form down in the description or the pinned comment. Also, I implore people to please check out our podcast channel. I haven't been getting my old podcast up there as quickly as I want, but eventually our entire Nintendo Prime podcast will be migrating over to that channel. That being said, let's get into this really strange story. All right, so you guys know about the Grand Theft Auto Trilogy on Switch, right? I mean, it's come out on all platforms and basically been a mess on every platform it's been on. In fact, it was removed from sale on PC for a while and PlayStation Store was offering refunds. So it's been a mess on everything, but bar none the worst version has been on Switch. And Digital Foundry did a really big deep dive for showing all of the additional issues that are happening on the Nintendo Switch version. Well, today, I guess really late last night, probably they released a patch or at least patch notes. I don't know if the patch is live yet because I'm not spending my money on this garbage tier port job, but they did release what's going to be patch notes. And I'm reading this off of Nintendo Live and it says following on from an update on the weekend for other platforms because they did get a weekend update switched in. Rockstar now appears to have pushed the latest updates for the Grand Theft Auto Trilogy, the definitive edition on Nintendo Switch Live. So they should be up supposedly. There are a handful of Switch specific fixes and various general fixes across all platforms. These are the current versions of each game on Switch as of the 23rd of November update. So the current version should be GTA3 version 1.0.3, Vice City version 1.0.4, and San Andreas version 1.0.3. And then let's get into the patch notes. So Grand Theft Auto Trilogy, the definitive edition, update notes 1.0.2 for PlayStation 5, PlayStation 4, Xbox Series X, Xbox One and Switch. So here's a general all platform update. Fixed multiple localization issues, fixed multiple instances of missing or misaligned collisions, fixed multiple instances of holes in the map. Yes, holes in the map. Fixed multiple instances of incorrect or misplaced textures, fixed multiple instances of the camera clipping through objects, fixed multiple instances of incorrect subtitles being displayed, fixed multiple instances of incorrect help text being displayed, fixed multiple instances of misplaced objects, Fixed multiple instances of issues with character models in cutscenes. And fixed multiple instances of audio lines being skipped, delayed, or repeated. Those are just general fixes. All those were bugs in every version of the game. Here's Grand Theft Auto 3 Definitive Edition fixes. Fixed issues with blurry camera cuts and transitions during Grand Theft Arrow cutscenes. Fixed issues where play and spray doors were closed preventing the player from being able to enter. Fixed issues where game stalls and prop pops into the gone fishing cutscene. Fixed issues where the player would fail the mission on the thieves with a message a thief's dead after the cutscene plays. Fixed issues with failing the mission the last request due to a sukkah falling out of the boat. Fixed issues with a missing GPS route when driving curly bob in the taxi during the mission cutting the grass. Fixed issues where the damage meter is not displaying correctly in the mission escort service. Fixed issues with a hole in the map that allow players to access Stanton Island very early. Fixed issues with the clawed floating in the cutscene for the mission big invading. Fixed issues where character models were not animating during the cutscene for the mission Luigi's Girls. Fixed issues where character models were not animating during the cutscene for the mission Give Me Liberty. Fixed issues where the player can boost their running speed by quickly swapping through weapons. Fixed issues where in the mid mission cutscene would then fade to black before restarting again during the mission Sayardah Selvator. Fixed issues where the game would crash when entering a vehicle after completing the Triad War. Fixed issues where the achievement disposing of the evidence does not unlock after completing the dead skunk in the trunk mission for the Xbox Series X slash S and Xbox One version. Fixed an issue with the changes to language settings not being retained after reboot a Nintendo Switch specific fix. That's just one game. Here's a look at notes for Vice City. Now here's a look at notes for San Andreas. Do you not see a problem? These are insane patches patches you should not need to this extent. Fundamental gameplay issues things not animating issue with rain visual effects having to get fixed the issue with invincibility issues with holes in the map. I don't know how these games released. I literally I mean look at a couple of these Nintendo Switch ones on uh what is this on the uh the San Andreas you know fix an issue with changes to language not being retained to reboot fix an issue with pedestrian weapon weapon accuracy. How is there an issue with their weapon accuracy? I don't understand it fix an issue where the game would restart from the beginning when selecting to retry from the last checkpoint on the mission highs how does that happen how do you have a game restart from the very beginning when you're trying to restart a mission that that blows my mind that's fundamentally broken you have taken these three well-regarded games and broke them people would have rather just had them straight up ported I think at this point versus the new visuals in enhanced gameplay no these are garbage tier now look maybe after this patch everything's much better but Rockstar should have never let this happen and I know Rockstar did not internally develop these games I had in another studio but they allow these games to come out in this state so whether it's the fault of deadlines the fault the Rockstar not doing quality checks or maybe the studio just isn't very good I don't know where all the fault lies I only know that Rockstar and 2k bear a lot of responsibility since they controlled whether or not this game these this collection even came out this was a cash grab they attempted to do a cheap and my lord this these patch notes show how fundamentally broken these games were I mean some people have complained they were so broken on switch it was basically unplayable to them and when you have animations not working you have a literal retry in a mission booting you back to the very beginning of the game like that is going to feel broken that's going to feel unplayable when you have holes multiple holes in the map it's going to feel like a broken unplayable mess and that should be happening in 2021 on one of the largest IPs in the world at least Pokemon Brilliant Diamond and Shiny Pearl for whatever criticisms you want to throw there's not holes in the map there's not broken animations there's not things that boot you back to the very beginning of the game where you're selecting one of your three starter Pokemon again like we could be critical but the difference between criticism and broken and these games released in a broken state on all platforms even more broken on Nintendo switch we as gamers shouldn't accept such mediocrity we should be accepting such mediocrity I hope that this is a lesson not only to developers but to gamers then no matter how excited you might be for a potential release like this we can't trust it wait for the reviews a lot of people pre-bought this game are going to buy this game well now when they buy at this holiday maybe it won't be as bad assuming that this these patch notes actually address most everything then maybe the game is okay to buy now so I'm not going to tell you don't buy the game now but we should always wait at launch to buy games until reviews are out especially from companies that don't have a stellar track record like can you confidently buy Breath of the Wild 2 probably because we've never had these fundamental issues with Zelda games in the past that being said there have been bugs in Zelda games there was the cannon room bug in Twilight Princess where if you saved in the cannon room you couldn't leave you'd be stuck in the cannon room that's a pretty damn big bug there was actually a bug in certain versions of a drawers mask back in the day that if you saved it a certain owl statue it would wipe your save data so like there have been bugs like this it's just few and far between so people might be more trusting even then wait for reviews because this stuff would not have got past reviews this is bad and we shouldn't be supporting bad now if you want to buy it now after it's patched I'm not gonna you know fault anyone for getting into the games they're really good games and I'm sure after the patch they're much more playable I just I find this to be an embarrassment rock star should be ashamed and and it just reminds us that we need to be a lot more careful of where we spend our money because we all have a finite amount of money we all have a finite amount of time and I think the time parts of I live in the most because you could argue finite amount of money but as long as you have a job there's always another paycheck there's always another you know more money coming around the corner but when it comes to your time you can't get that back so if you spend your hard-earned money on the Grand Theft Auto trilogy and you end up wasting hours of your life frustrated you can't get that time back and I wish that some of these video game developers realize that if someone is choosing to spend a portion of their life no matter how small it is playing your games respect that that time can't be given back alright books I'm Nathan Robojans from Nintendo Prime thank you so much for tuning in and I'll catch you in the next video


Hello everyone, welcome to the Cube Conversations here in Palo Alto Studios for theCUBE. I'm John Furrier, the co-host of theCUBE, co-founder of SiliconANGLE Media. We are here for Thought Leader Thursday with Mitzi Chang. She's a securities attorney and partner at Goodwin, formerly Goodwin Proctor. Goodwin Proctor is the name. Again, great to have you on. Thanks for coming in, talking about some of the securities around blockchain ICOs. You guys are doing a lot of work. Thanks for coming in. Thanks for having me. So obviously, blockchain is the hottest thing we've seen, AI obviously is hot as well, IOT. All this is about a new decentralized internet. And it's the Wild West. And we know because we're looking at doing our blockchain and tokens for theCUBE and all that good stuff. So we're totally loved the new environment. Everyone, although like tier one entrepreneurs are licking their chops and go, wow man, good action. And a lot of the Thought Leaders are saying this is a fundamental shift. So it's cool we get that. But now, okay, is the technology ahead of the law? And just today, the news is breaking. The SEC is now putting a clamp down on a new thing. Celebrity endorsements into ICOs initial coin offering.   Right. What's going on? I mean, so is the law behind the tech? How are you guys managing it? What's the flow look like for you? Yeah, I mean, I think that the law is almost always behind the technology, right? That's just how it works. I mean, from our perspective, we represent tons of companies on normal securities law or securities issuances. And this can be similar depending on how the token is structured. So the SEC said in its July guidance that tokens can be securities depending on the facts. So part of what we do as lawyers is review the facts of the token, right? What does the token do? How do you treat the token? How are you issuing the token? How are you marketing the token? Are there securities like features of the token? So for example, does it have profit sharing features? Does it have voting features? Those are pretty obviously more security like features. But also, in the token ecosystem, are you treating it like you would equity? So for example, are you putting investing conditions on there? Are you marketing it to VCs who may never use your network? Those are some factors that make it look like more security versus a utility.  And the entrepreneur is always three feet in a cloud of dust, breaking things and bulling the China shop as they say. And they have to give the lawyers to kind of clean things up or set things straight. Securities is a known practice, but now there's some kind of bumps on the road, but still people are moving forward. So I got to ask you, what's the test?  What are some of the things that entrepreneurs should know around where to pay attention, kind of where to put their head down and drive? Because there are known practices on the security side, you mentioned a few of them, but where's the test? What's the one thing? Is it the Howie test? What is this Howie test concept? And what are the things that entrepreneurs didn't know about? Right, so I think the Howie test is a test that was in case law that basically explains what is an investment contract. And an investment contract is what is considered a security. So basically the payment of money based on the efforts of others where you kind of have the reasonable expectation of obtaining profits from those efforts of others versus yourself. So that's the general gist of it. So I think from a securities law perspective, that's really important because there has been so much focus from the SEC. But there's also other regulatory agencies who are focused on this. Some of those are money transmitter laws. There's potential commodities law issues. So there's definitely other regulatory regimes that could implicate the token or the token could be implicated in that regime. But I think the securities law one is one that I focus on and it's important to look at. All right, so the first test is, okay, obviously new internet infrastructure, different conversation, but the real law test is, is this token going to be an investment, making money or is it going to be a utility, one that provides values to the participants? Did I get that right? Yes, I would say generally speaking, right? Is the token, you know, is it a use case or is it an investment, right? Am I expecting profits from that token or am I using it like an access fee or a membership or, you know, to obtain services? Exactly. And Arcade Game is probably your best example. Yeah, okay, so then the next test is, I've heard some things that I'd like to get you to explain what anti-money laundering or AML is and KYC know your customer. And obviously Bitcoin has been kind of, you know, we've heard silk road stores under belly, a lot of things are happening, but anonymous is good. But here, financially know your customer is a specific thing that means something and then AML anti-money laundering. How does that factor into this whole thing? Yeah, so I think for, you know, when you open a bank account, for example, right, your bank wants to know who you are.  I mean, that's part of the know your customer anti-money laundering activity. And identity behind the face of something. So part of it is because cryptocurrency can be very anonymous, right? There are anonymous wallets that you're sending cryptocurrency to and from. You don't know who these people are. So part of it is making sure that you understand who your purchasers are.  The U.S. government has several lists that, you know, they have online that you can search for names of folks that, you know, you don't need to be doing business with. So there's a lot of, you know, there's a lot of structures already in place and part of that is just understanding who your purchasers are. And these are requirements on certain things. And the anti-money laundering, I suppose, is just audit trailing and certain things that you got to have as compliance thing. Correct, correct. And so I think in America, you know, we don't normally, I would say, you know, if you were kind of outside of the U.S., this is probably a little bit more normal, right? People are used to doing it. I think in America, you know, maybe we're not as used to it, but these are not, you know, kind of new guidelines. This is always existed. All right, so sometimes entrepreneurs are fast and loose with their clients. Ah, screw the anti-money laundering thing. Well, they get, I don't understand, that's too much work. I don't understand.  When do they have to not blow it off? When do you have to worry about like all these anti-money laundering things? Cause you have to obviously do more work. Right. Gotta make sure you're checking the boxes, complying. That probably is overhead, cost money, or maybe buy some new software. So we've been recommending that all of our clients who are in the token space and kind of obtaining, you know, digital currency, go through KYC and AML. Some of the digital currency can, you know, exchanges, right? So in order, when you're receiving your digital currency and you need an account, in order to exchange the digital currency into US dollars, for example, it's essentially like opening a bank account. So they're going to ask for all of, you know, the information with respect to how did you, you know, receive your digital currency? So part of that is you need to have that in place prior to actually launching your token sale so that you can kind of follow the flow of funds. So I was trying to find this image I would put up, but I can't find it because that's not on this computer. But I saw our thing on a conference. It might have been BlockCon that you guys were at. I think you guys sponsored that event, or might have won it in Europe, where the cost of doing an ICO can range from, they said on the cheap, and they use the word cheap, not an expensive cheap, probably implying, not getting a good lawyer, 100K up to $750,000. So range of cost between $100,000 and $750,000, from cheap to done right, or expensive. Is that right, or is that, what's the cost range? Yeah, I mean, I think there's a lot of players in the ecosystem, right? So there's the lawyers, and typically lawyers bill by the hour, so it's kind of how much time, we're looking at documents and things and helping you structure. There's the tax accountants, so part of that is also how much time they're spending, but some of it can be very complicated from a tax structuring perspective. Then there's the technical people, right? Unless you have that in-house, to actually build your blockchain network, kind of help you with all of that, the technical aspects of that. So software engineers, for example. Then there's the ICO consultants, someone to kind of help you manage, quarterback the process, maybe help you with marketing, the tokens to certain different websites, or help you with that. So all of those together, I mean, yes, it can be very expensive, it kind of depends on how much of that you want to outsource, and how much of that you can do yourself. Obviously, you can't really do what you want yourself. So it's in the ranges, it could be in the ranges. I mean, tax alone could kill you if you're looking at all kinds of complicated schemes or licensing agreements. Right. All of that you want to make sure you're structuring the entity appropriately before you start it. Okay, so where do you get involved? So let's just say, let's just walk through the day-in-day operations of, say, Goodwin. Okay, we've got a client, and okay, you come in for the securities component. What does that mean? You just make sure they're incorporated properly, all the laws on the stock, and then the tokens, treatment. What specific things do you do? Sure, so once we kind of have brought the client in after our conflicts procedures, and we've agreed to the engagement, part of it depends on where they are. If they don't have a company, we'll help you form the company, right? And make sure that all of those startup documents have been appropriately done. Sometimes people are an actual company, right? We don't need to form them, they're already in existence. So then we look at, pass the formation items and we look at the token issuance. So we'll look at your white paper. The white paper typically describes how the token works in the ecosystem, and you get involved in that, just to kind of check if it sounds... From a high level, from a structuring perspective, do we think this is a security, or do we think it is leaning towards utility? And the SEC obviously has not said, what is a utility and what is a security. So that's the gray area. So the gray area is watch the language, don't be careful what you say. But also what you do, right? It's not just what you say, it's also what you do. So part of it is talking to the clients about, what are you thinking? How are you envisioning this? Where can we help you kind of restructure or decrease your risk? And you guys become a safety net, help defend that too, obviously, as attorneys, but the clients still own... Correct, I mean, part of it is we give you advice, right? And the clients can take, or not take our advice, but that's what we're here for. Do you guys offer legal opinions behind these? I'm sure you don't. We don't offer legal opinions. We do do research memos on kind of where we think your token lies, but we don't do legal opinions. So have you guys talked to the SEC at Goodwin and you guys have conversations? I don't know what goes on behind the curtain of the big law firms, but I'm assuming that you guys are up to speed on all the file and all the notes and everything, but do you guys actually talk to people at the SEC, or do you guys, is that how it works? Because this is a cutting edge here. I'm sure you guys have to be on the cutting edge. Yeah, I mean, we haven't had any clients knock on wood that have had to go through any of the SEC investigations on this, so we have not had, on behalf of our clients, had to talk to them about it. So that's good news. So you guys doing good. And I know you guys doing like over a more close to 30 plus ICOs, so congratulations. Is there a pattern that you've seen from a legal standpoint that you've seen emerging? Obviously it's pretty clear out in the marketplace, certainly the celebrity endorsement, Paris Hilton to the boxer dude, and all kinds of stuff was going on where people were endorsing a thing. So kind of, I don't want to say pump and dump, it's a worry that's been used in the dot com bubble, but people are saying a lot of these things are scams and the majority of them aren't going to work out. So we've said editorially here on theCUBE and Silicon Angle that failure doesn't mean scams, we have some failures, but certainly there are some scams. So has that caused people to pull back a little bit and say, whoa, we're not going to go forward fast enough or is nothing stopping this? What's the pattern? I mean, I would say from compared to a year ago where there was no SEC guidance, right? And there was no guidance from kind of other regulatory agencies. People were definitely going very quickly. I think now what we're seeing are more sophisticated clients. Clients who really want to make sure that they're following all of the legal requirements to the best that they can, right? Given the greatness in the securities laws and other regimes. And a lot more of a thoughtfulness about, well, let's make sure that this works, right? We're not going to get into trouble. Have you seen any co-mingling between some of the traditional VC venture capital investors or hedge funds that are emerging who want to come in and participate on the pure equity side of the preferred stock or common, mostly prefer we see them. But also play in the tokens. Is there coexistence between participation or is it mostly they line up on the preferred and then let the tokens go here? Is there a pattern there that you see around how those securities are playing out? Yeah, I mean, I think a lot of people see value, right? In the token ecosystem and they want to participate in that and a lot of our venture capital clients or our token clients who have VC investors, they want to participate. So we are definitely seeing people are very excited about it and want to kind of be a part of it. What about the pre-sale concept? We're seeing a lot of people jump on the pre-sale bandwagon because it allows them to, you know, it's not an inexpensive process. You guys obviously don't work for free. You guys have deals where obviously startups can come in and you guys have a good, great startup program and can testify that you guys do have a good, you know, good community participation there. But at the end of the day, this is a legitimate process now. It costs money and you guys have to get paid and service providers like the tax attorneys got to get paid. So there's a lot, we see a lot of entrepreneurs doing this pre-sale where they try to offer this kind of discount. How is that working out and has that been going well? Yeah, I mean, I think, you know, while the SEC has not commented on this, the practitioners and kind of the ecosystem, most people I think are considering that pre-sale agreement prior to a network actually being live as a security. And so people are going out to accredited investors. You know, sometimes that's VC, sometimes that's, you know, high net worth individuals that's usually done through a SAFT, which stands for Simple Agreement for Future Tokens or a pre-sale or contribution agreement. So part of that is it's like a, you can liken it to a preferred stock financing, but it's not preferred stock. But it's a known vehicle for financing. It's not like it's tied to the ICO in a new vehicle. It's just like, okay, we're going to do something down the road, there's risk associated, all that stuff is closed. Right, it's an investment contract. I'm giving you a million dollars to invest, to build out the platform at the end of, you know, when the platform launches and hopefully when the network has utility and your token has utility, then you'll receive tokens. And this is good for innovation because it gets everyone rolling a little bit.  That's probably a really good example. It's a seed round to get something started. That thing is not your company, it is, you know, your network. And it also sets the community. I mean, I've noticed on the blockchain, these ICO communities are a very big part of it. Goodwin's got a great reputation, certainly here in Silicon Valley and, you know, around the world as a law firm. This is a big part of it. So the pre-sale is also kind of a gesture of credibility for the opportunity. And I think, I mean, you know, people I talked to, like, hey, I look at what's going on in the pre-sale, kind of as an indicator of who's involved, judged by the company that you're keep kind of thing. So that's interesting. Have you seen that pre-sale not dominating more than just going right to the ICO, given the market conditions of the ICOs? Yeah, I mean, I think it depends, right? Some of our clients have existing businesses, right? Where the, this is very complimentary. The blockchain network is complimentary to their existing business. And so they may not need to have this big pre-sale, right? Part of the pre-sale could be, you know, two weeks before your general crowd-sale, you have folks who kind of get in early. To me, that is not necessarily, I mean, it really depends on obviously fact specific, but that's a little bit different than doing a, quote, pre-sale agreement, like a year before, six months before your token launch. That's a little bit different. Yeah, so also you brought up a good point. Existing businesses versus kind of like people who just need the cash to get going. We're seeing a lot of companies that either have a successful business like Kik and then to KinToken was one example we talk about all the time. The other one is Pivots. We're seeing a lot of entrepreneurs take companies that were Pivots, AKA going out of business, where the token timing of a token and decentralized blockchain actually is great for their business model.  That's your world, right? You've got to get involved in those areas. Yeah, I mean, I think anything that has to do with kind of changing your capital structure, right?  Exemptions that you're taking, typically from a private placement exemption for most of our private company clients. Is there any new trends that are popping out of that kind of pivot? Or wow, this is really, I was out there, I got some funding from Y Combinator or some sort of venture and we're kind of just barely staying alive. But oh my, this blockchain can really accelerate. There's no momentum. Is there any trends that you see from your work, standpoint, work products that are happening that are obvious new things that are coming out of this? It's just always a standard recap the cap table, normal corporate work. Well, I mean, I think there is a tension, right? Between doing a normal, you know, stock finance, preferred stock or common stock financing, you know, whatever you would typically do, whether that's a convertible security or convertible note. And then, you know, raising funds through a token sale, right? And so from my perspective, it's obviously cleaner to do it the traditional way, right? Because you're not dealing with unclear SEC rules, right? You know, it's very clear how you do a preferred stock financing. We do that every day. So to the extent that, you know, companies are in that position where they can choose, it's certainly cleaner to do it the traditional way.  Right. There's no equity to token, right? Okay, so I was reading about the Delaware, corporate Delaware was allowing companies to use blockchain. This is right up your alley. So they're not doing ICOs. So can you clarify the Delaware situation with the blockchain? Because they're using a blockchain from a ledger standpoint, but there's no ICO, it's not an ICO haven yet. So talk about the Delaware situation. Correct, so the Delaware amendments, which I believe are now approved as of a couple of months ago over the summer, essentially allow the cap table ledger to be on the blockchain. So it's, you know, they're kind of ahead of everything, right? Because, you know, so for like, for example, a few years ago, no one had, you know, uncertificated stock certificates. Everybody wanted the physical stock certificates. And now most companies that we represent, you know, have exactly digital uncertificated stock certificates, but there is a ledger and there is a, there's a record of it. You just don't have the fancy paper with the pretty legend on it. So I think, you know, technology is moving and the law needs to as well. So part of that is, you know, Delaware kind of getting, getting on board. Yeah, Delaware's got a great opportunity to nail the ICOs. Well, Missy, thanks for coming and really appreciate any other observations that you'd like, that you see in the market that you'd like to share. Take a minute to talk about what you're doing, a good one as well. What's going on? What's happening?  We're really excited to be a part of it. It's cutting edge work. I think that, you know, there's, there's a lot of, I guess, what I would call kind of your more traditional clients that we have, that we take calls from every day, whether that's investment banks, or, you know, VC funds, private equity funds, or just, you know, our venture-backed companies that, you know, are curious as to what, what is this all about? So I think it's really exciting and I'm glad to be a part of it. I don't think that it is going to stop. I think that certainly there's likely to be more regulation about how you do one of these ICOs, one of these token generation events, you know, within the confines of the law, but I don't see it stopping. You don't see it stopping at all. No. I mean, I think, you know, once there's more regulation, there'll be more clarity about how to do it and how to do it within the confines of the law, which we try to do, obviously, you know, given that there's not a ton of clear guidance, but I think that, I think the ship has sailed. Yeah. Well, this is a great conversation here with Goodwin, formerly Goodwin Productive, Mitzi Chang, partner. She's a securities attorney. We should call this show Billable Hours because we're getting some free legal opinions and conversations. Thanks for coming on. Appreciate it. Thanks for having me. A lot of entrepreneurs are using it. All the top tier one entrepreneurs are looking at this as a great opportunity, similar to the Web 1.0, the TCPIP era, the internet, blockchain as fundamental infrastructure for the future decentralized agent. So, great opportunities, causing lots of innovation. Check with your attorneys, obviously Goodwin and a few others all doing great ICOs, great potential fundraising, but also great business opportunity. Thanks again. Appreciate it. Thank you. It's theCUBE Conversations here in Palo Alto. I'm John Furrier. Thanks for watching.