CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Artificial Intelligence in CFD

Register Blogs Community New Posts Updated Threads Search

Like Tree60Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 15, 2021, 12:49
Default
  #61
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,195
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by acf46545 View Post
not sure if this is exactly what you are asking for, but attached. k1 is resolved, k2 not, kc is fixed to 24 in this example. k1 and k2 have some variance about their mean.



5000 samples, very simple network. trained to RMS loss of about 0.02. input: aliased function values on kc grid, output: k1, k2.

unzip, run in jupyter notebook. clear kernel and output first.



if this is what you want, great. if not, please clarify. not tested extensively, just for demonstration.
I don't use python, but let me ask this: what does it mean that "k1 and k2 have some variance about their mean"?

Also, would you be able to use it for me if I pass you a vector of 24 values?
sbaffini is offline   Reply With Quote

Old   February 15, 2021, 12:52
Default
  #62
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
The example that Paolo asked for is sneaky ... It is what you can see reported in this example
https://upload.wikimedia.org/wikiped...asing-plot.png


You can also simplify the example and forget about using two frequencies, just use a single k for the sine function and try for values of k that are lower than the Nyquist one and then for values greater.
The key is how the aliased function is recognized.



A further exercize is to sample the function on a grid and performing the FFT to recognize the frequency. When the function is aliased you get an aliased spectrum from which you should be able to recognize the original function.
aero_head likes this.
FMDenaro is offline   Reply With Quote

Old   February 15, 2021, 12:57
Default
  #63
New Member
 
Join Date: Feb 2021
Posts: 13
Rep Power: 5
acf46545 is on a distinguished road
playing games with people is not helpful
acf46545 is offline   Reply With Quote

Old   February 15, 2021, 13:15
Default
  #64
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,195
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by acf46545 View Post
\


k1 = 4 plus minus 2, (integers)

k2 = 32 plus minus 4, (integers)
sampling from this generates the 5000 training sample pairs, e.g. (3,28), (6,30) etc


can try to make predictions with your data, but needs to be from the range specified above, sampled onto equi spaced grid (endpoints included) with 24 nodes. still not the most trustworthy way to go, you could trick me easily. Can still try, but prefer you have a look at the code and try for yourself.
Ok, thank you very much for your effort, which I appreciate, but as Filippo mentioned, I am a sneaky bastard. I was actually asking for arbitrary k1 and k2 detection, and not limited to the values from the training batch. And I was asking this, of course, knowing that it is impossible (there are an infinite numbers of possible k2 values that would fit the same aliased function) and that some ML fans, instead, don't realize this.

Note that k1 can be deterministically determined without doubts when k_C and L are known. That's what the FFT does. k2, in contrast, is lost information and, as your example helped me to clarify, cannot be determined without assuming some prior knowledge about it.

I want to stress that I see no problem at all in this very fact, that a ML algorithm needs some prior knowledge to determine things like k2 in this example.

But that's what turbulence modeling is all about, but with very limited prior knowledge, that can't realiably be used in all scenarios.
aero_head likes this.
sbaffini is offline   Reply With Quote

Old   February 15, 2021, 14:21
Default
  #65
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,195
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by acf46545 View Post
playing games with people is not helpful
I probably owe you an apology for the time you wasted, because the phrasing I used to formulate the question was such that it wouldn't filter out legitimate approaches using legitimate reasoning in ML, as your was.

But this was intentional for those that, differently from you, wouldn't recognize thr very need for prior knowledge in such experiment.

Sorry again
aero_head likes this.
sbaffini is offline   Reply With Quote

Old   February 16, 2021, 01:14
Default
  #66
New Member
 
TP
Join Date: Feb 2021
Posts: 8
Rep Power: 5
gottingen91 is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
Ok, thank you very much for your effort, which I appreciate, but as Filippo mentioned, I am a sneaky bastard. I was actually asking for arbitrary k1 and k2 detection, and not limited to the values from the training batch. And I was asking this, of course, knowing that it is impossible (there are an infinite numbers of possible k2 values that would fit the same aliased function) and that some ML fans, instead, don't realize this.

Note that k1 can be deterministically determined without doubts when k_C and L are known. That's what the FFT does. k2, in contrast, is lost information and, as your example helped me to clarify, cannot be determined without assuming some prior knowledge about it.

I want to stress that I see no problem at all in this very fact, that a ML algorithm needs some prior knowledge to determine things like k2 in this example.

But that's what turbulence modeling is all about, but with very limited prior knowledge, that can't realiably be used in all scenarios.
I dont see how this provides more information than what we already know about ML/AI: the models are as good as the sampling frequencies as well as the range of data provided. "Hidden" dynamics will always be lost when your sampling frequency is not high enough, thus requiring AI practitioners to know what the heck they're trying to accomplish.
gottingen91 is offline   Reply With Quote

Old   February 16, 2021, 01:21
Default
  #67
New Member
 
TP
Join Date: Feb 2021
Posts: 8
Rep Power: 5
gottingen91 is on a distinguished road
we're exploring different use cases of AI in CFD at my company. Please feel free to roast me as I am a novice in CFD (was stupid enough to listen to my advisor to focus on freaking lubrication theory for my thesis. This is another case of intellectual masturbation circle that Paolo kind of mentioned above) and ML:

1. In manufacturing control, it's nice to have CFD result online to develop control schemes. But a typical CFD simulation takes too long -> ML to interpolate the cases in between.

2. Design: do not need to run a new CFD sim each time we want to try a new geometry.
gottingen91 is offline   Reply With Quote

Old   February 16, 2021, 04:38
Default
  #68
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by gottingen91 View Post
I dont see how this provides more information than what we already know about ML/AI: the models are as good as the sampling frequencies as well as the range of data provided. "Hidden" dynamics will always be lost when your sampling frequency is not high enough, thus requiring AI practitioners to know what the heck they're trying to accomplish.



What Paolo addressed is something resembling what a "perfect" LES should do, that is resolving a range of frequency up to Kc and "deducing" the contribute of the unresolved frequency for k>Kc.



The question is: what new contribution AI is able to do in this framework?
aero_head likes this.
FMDenaro is offline   Reply With Quote

Old   February 16, 2021, 12:11
Default
  #69
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,195
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Let me start this post with an apology, again. I want to stress that none of the points I am going to elaborate further is, in any way, related to any particular individual. Still, I might generically refer to the situation of someone that, while practicing in a certain field, might not be sufficiently equipped, for a mere lack of time invested, to do so. This reference, again, is not to anyone here in particular, hence the apology in case anyone might feel otherwise.

I already did this in one of the early posts in this thread, but let me recap how, today, is ML applied in CFD, to the best of my knowledge, with my perceived pros and cons.

1) To produce a reduced order model (ROM) of the CFD case under investigation, where few relevant input parameters are mapped to few relevant output parameters. That is, few scalars as input and few scalars as output. This is one of the oldest ways ML has been applied to CFD and, probably, one of the most legit and sound. ROM are a necessity in several kind of studies, and ML techniques are very well suited to this. Still, there is a plethora of statistical/mathematical techniques that achieve the exact same result (some actually linked to the ML ones). So, one thing is if you know all of them (as I would expect from a professional) and can legitimately suggest to use a very specific ML one for a number of reasons; it is different instead if you just know ML approaches and just propose them.

2) To produce some sort of classification of the flow field in a given CFD case or for different CFD cases. Not only this is probably older than the previous use case, but almost all the techniques in unsupervised ML were actually known previously from other fields and extensively applied in CFD way before ML was. Here I must be tougher: if someone doesn't recognize an svd, a pod or an fft for what they are, can't we say that he hasn't a proper recognition of the field? Again, there probably are ML techinques that don't compare to previous ones but, from a CFD expert, I expect to see an informed decision, whatever technique is picked up in the end.

3) As surrogate of a specific model entering the CFD computation. This might be the turbulence model, or the combustion model, etc., but I don't have the competences to judge anything beyond the turbulence modeling, to which I'll stick strictly. Also, I don't expect the same criticalities to be present in every domain of application.

First of all, this existed since before google. Some of the people working on this today were around back then as well but couldn't care less. As for the points above, what the last decade essentially bringed to the table is availability at large of computational resources, data (i.e., DNS and LES data, which again have flourished because of the availability of computational resources) and specialized tools. Which, however, I agree are good incentives.

Second, for those who need some professor words to understand their own field, here it is an excerpt from an abstract of a recent paper on the subject (which, however, I won't cite on purpose):

Quote:
While the promise of ML-augmented turbulence modeling is clear, and successes have been demonstrated in isolated scenarios, a general consensus of this paper is that truly generalizable models require model-consistent training with careful characterization of underlying assumptions and imposition of physically and mathematically informed priors and constraints to account for the inevitable shortage of data relevant to predictions of interest. Thus, machine learning should be viewed as one tool in the turbulence modeler’s toolkit.
Now, this is a very condensed, probably optimistic, statement. But, as this use case scenario was the base for my previous sin test, I want to digress more.

What we typically do in a CFD computation is solving for a dynamical system which has been deprived of some degrees of freedom. The very problem of these missing degrees of freedom is that they are completely lost in our description as no information about them is present among the degrees of freedom we retain, yet they have a relevant role in the overall dynamics of what we want to describe. What the turbulence modeling comunity has traditionally tried to do is to come up with some model that, only knowing the retained degrees of freedom, was able to mimic the overall system dynamics by embedding in the model what we know about the functional role of the missing degrees of freedom. This is the case, for example, of the Smagorinsky model (and similar ones) in LES. Depending from the case, the community also found out that the more embedded prior information we used the better it was. For example, in RANS, additional transported quantities are typically used for turbulence models, with 2 equation models tipically outperforming 1 equation or algebraic models.

What is important to recognize, however, is that such embedded prior information then automatically becomes part of the degrees of freedom that we retain. That is, if we use a k-something model with boundary conditions for k, you are automatically assuming that you know k and its boundary conditions and that you can describe its evolution (much like you do with the pressure or velocity components). This distinction is important as otherwise it might seem that having an equation for k you are automagically accessing some of the missing degrees of freedom in your representation. You are not, you are just making a promise that you also know k and how it interacts with your other equations.

Now, a very basic exercise that is usually proposed in turbulence classes is trying to derive equations for the unclosed terms in the RANS equations. You derive the Reynolds stresses equations, but they have more unclosed terms that need modeling. You derive equations for those unclosed terms, and even more unclosed terms appear, and so on indefinitely. That is, doesn't matter how many promises you make in a RANS context, as long as they are in finite amount they are not complete.

When a novice imagines a perfect turbulence model he misses this very fundamental truth. Whatever you come up with, it can't be perfect because it has a limited amount of information in it, while you would need an infinite amount, even for a single given flow.

Another thing that novices usually miss is the fact that, for a given state of the retained degrees of freedom, there are infinitely many compatible states of the missing degrees of freedom. So, independently from where you stop your promises, there will still be infinitely many possible states of the missing degrees of freedom. In practice you need an infinite amount of information that, unfortunately, is also compatible with an infinite amount of states.

Then comes the main, rethorical, question (so that I won't answer): can a ML technique learn and store an infinite amount of information? Because that's what the turbulence modeling problem is, at least in part.

In practice, the problem is not so hard and desperately destined to remain completely unsolved, but it is, and has always been, a not well posed problem.

Now, I see promises in how ML can actually advance the field in several aspects. But anyone expeting miracles from ML in this respect, I conclude, is not aware of the basics in the field and, to some extent, physics/logics in general.

The whole reasoning, when performed in LES just becomes more clear, as you have resolved and missing spatial scales, which are more easily relatable to. My sin experiment explicitly referred to LES, even if not exactly. The point being that if you don't have access to information below the grid, then you don't, end of the story. Your ML algorithm can spend years learning, but there will always be infinitely many states to learn, and the DNS data we have currently access to is also ridicolously limited with respect to the current application of CFD in industrial problems.

Have interesting results been produced in this area of ML applied to CFD? Of course, but anyone screaming miracle is out of his league.

An area where I especially see possible positive outcomes is in the wall function one, where embedding additional physics beyond the basics has always been problematic to achieve at low cost.

4) As surrogate for a real CFD computation. There are, today, techniques that allow to get the whole flow field from the same information you would use in an actual CFD computation. This, I think, is incredible, and one of the most promising applications in CFD. But, and this is really important, we need to agree on some fundamental aspects. Not only there are infinitely many states of turbulence, but also geometrical/topological configurations, combinations of physical models. So, expecting a single ML algo to be able to generalize to all the possible physical combinations is, again, overly optimistic. In the same vein of previous points however, using a ML technique to predict a potential flow is, instead, not miracolous at all (because beyond geometry it has to just learn a single kernel function) and of limited practical value.

Beyond video games, I see potential in inlet/initial value generation and some, hopefully controlled, ROM scenarios.

Quote:
Originally Posted by gottingen91 View Post
1. In manufacturing control, it's nice to have CFD result online to develop control schemes. But a typical CFD simulation takes too long -> ML to interpolate the cases in between.

2. Design: do not need to run a new CFD sim each time we want to try a new geometry.
These sound like perfect use cases, as long as you recognize that your results can't be better than the models and numerics used in the underlying CFD runs and that if you access a particular configuration that, in reality would have kicked in some effects, but these weren't present in the data used for training, you have little chance in getting correct results. Imagine compressibility effects kicking in only for very particular combinations of parameters not explored in the original simulations. Said otherwise, understanding the limitations of an interpolation and the perils of extrapolations, which you seems to do very well.

Quote:
Originally Posted by gottingen91 View Post
I dont see how this provides more information than what we already know about ML/AI: the models are as good as the sampling frequencies as well as the range of data provided. "Hidden" dynamics will always be lost when your sampling frequency is not high enough, thus requiring AI practitioners to know what the heck they're trying to accomplish.
Again, you seem to be aware of all the limitations. But then you would also understand why a ML generated answer can't be the final answer. In the same way other computational techniques aren't the final answer. They are all tools with pros and cons, and need proper CFD knowledge to be used in CFD. That's it.

Quote:
Originally Posted by FMDenaro View Post
What Paolo addressed is something resembling what a "perfect" LES should do, that is resolving a range of frequency up to Kc and "deducing" the contribute of the unresolved frequency for k>Kc.
Yes, the example was indeed very limited, but I think the issue is also more general, as I tried to elaborate above in point 3
aero_head likes this.
sbaffini is offline   Reply With Quote

Old   February 16, 2021, 13:03
Default
  #70
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,195
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
With respect to my previous sin example, I also want to add that, a recent paper in JFM, again, addresses the use of ML for the so called super-resolution LES, basically attempting at reconstructing velocity fields beyond the grid cut off k_C.

For some strange reason this not well posed problem, that is inevitably destined to produce noise (or just what is previously embedded in it), keeps having space in such a reputed journal.

You would at least expect that the most relevant information, the spectra of such super resolution reconstruction, would be central in such works, but as they just produce crap/noise, they are obviously relegated to a single picture, well hidden, where reality is just ignored and the results described with kindergarten terms.

This is just to say that nothing of what I wrote is random. There is a relevant problem in how ML is used in certain technical fields. Not sure about the reason, but still a problem.
aero_head likes this.
sbaffini is offline   Reply With Quote

Old   March 15, 2021, 00:03
Default
  #71
New Member
 
TP
Join Date: Feb 2021
Posts: 8
Rep Power: 5
gottingen91 is on a distinguished road
Has anyone seen this?

Now they want to predict weather with AI lol:

https://www-technologyreview-com.cdn...equations/amp/
gottingen91 is offline   Reply With Quote

Old   March 30, 2021, 00:32
Default
  #72
Senior Member
 
Kira
Join Date: Nov 2020
Location: Canada
Posts: 435
Rep Power: 9
aero_head is on a distinguished road
Quote:
Originally Posted by Collone_imper_ View Post
agree with 1, 3 and 4
Why do you disagree with the other points?
aero_head is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CFD Online Celebrates 20 Years Online jola Site News & Announcements 22 January 31, 2015 01:30
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 09:10
CFD JOBS and Expected Salary.... Noel Harrison Main CFD Forum 11 November 22, 2000 08:15
Which is better to develop in-house CFD code or to buy a available CFD package. Tareq Al-shaalan Main CFD Forum 10 June 13, 1999 00:27
public CFD Code development Heinz Wilkening Main CFD Forum 38 March 5, 1999 12:44


All times are GMT -4. The time now is 03:17.