|
[Sponsors] |
December 9, 2024, 03:39 |
Writing a dns solver for periodic box
|
#1 |
New Member
Join Date: Dec 2024
Posts: 7
Rep Power: 2 |
Hi I am trying to complete my masters thesis for months now. It is focused on creating a turbulunce model using Neural Networks. I need dns data for perodic box simulation yet, the solvers I have found online are not entirely suitable for my use. And after some point I have decided to create my own solver for creating dns data for a periodic box with isotropic turbulence. Do you think this is a doable endeavour. I may invest this project 2 whole months with 12 hour shifts 6 days a week. My cfd and coding experience is good but this will be my first time creating a solver.
|
|
December 9, 2024, 04:31 |
|
#2 |
Senior Member
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 676
Rep Power: 21 |
This sounds like a bad idea, it takes much longer to write a DNS solver if you do not have experience, and then you still need to do the simulations.... Better to spend a couple of days finding a DNS solver. Surely there must be DNS solvers in your group already? Even if it is not entirely suited for your needs, it is easier to modify an existing code than to build one from scratch.
Which open source DNS codes have you looked at and why are they not suited for your needs? I have used SU2, Gerris and Nektar++, openFOAM also has DNS solvers available. Take a look at Nektar++ for instance. Why is that not suited for your needs? https://en.wikipedia.org/wiki/Nektar%2B%2B |
|
December 9, 2024, 04:52 |
|
#3 | |
New Member
Join Date: Dec 2024
Posts: 7
Rep Power: 2 |
Quote:
|
||
December 9, 2024, 05:53 |
|
#4 | |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34 |
Quote:
What is your time frame? If you are not experienced in writing CFD solvers than it could be tough task. If you have experience of writing earlier than you can try it. Also what are you trying to solve? I could have loaned you my cartesian solver (H4O) that is designed for the purposes you mentioned but it does not support periodic conditions. One day i might do taylor green vortex but its on very low priority for me. If nothing works by the end of december than do send me a pm. This was done on H4O solver (around 50 million cells) https://youtu.be/d3FWgs__yjM?si=o2aByxn7Foz86gaI |
||
December 9, 2024, 06:41 |
|
#5 | |
New Member
Join Date: Dec 2024
Posts: 7
Rep Power: 2 |
Quote:
Last edited by dxg97; December 9, 2024 at 06:44. Reason: additional question |
||
December 9, 2024, 09:16 |
|
#6 |
Senior Member
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 676
Rep Power: 21 |
The outputs will be big, no matter what code you're using. What made the outputs 'too big to handle'? Are you talking memory, computing time, storage, where is the bottleneck?
Gerris development has merged with Basilisk. Haven't used it in a while, but I found it easy to install and use, and they have a couple of simple examples online, like this one on isotropic turbulence in a box: http://basilisk.fr/src/examples/isotropic.c |
|
December 9, 2024, 10:22 |
|
#7 | |
Senior Member
andy
Join Date: May 2009
Posts: 322
Rep Power: 18 |
Quote:
DNS codes are typically only a few lines of code to solve a specific problem. The spectralDNS code you used is typical in being only 328 lines of C++ code with just a single main() function. If you understand the numerical method and how to code then this takes an afternoon to write. It will take longer to test and runs can take many days on large parallel computers because of the amount of data involved. If you have tried spectalDNS and are struggling then you may well be beaten. Can you explain what was causing difficulties? |
||
December 9, 2024, 11:56 |
|
#8 | |
New Member
Join Date: Dec 2024
Posts: 7
Rep Power: 2 |
Quote:
|
||
December 9, 2024, 12:53 |
|
#9 | |
Senior Member
andy
Join Date: May 2009
Posts: 322
Rep Power: 18 |
Quote:
How would one provide the boundary conditions that accurately represent turbulent motion around a probe? Generally a DNS code needs to place the boundaries far enough part from each other so that when assumptions like periodicity are introduced there is enough space for the motion between them to become uncorrelated. If the boundaries are too close the correlation will show up in the turbulence statistics. The 328 lines of spectralDNS C++ code include a probe that (I presume) integrates the turbulent kinetic energy after a few time steps and prints it out to monitor it's decay. A single value every few time steps is the only output. If you want a different more local probe then adding a few lines of C++ can likely provide it. Output as much or as little as you want. What do you mean by verified forcing scheme? Decades ago when I was messing about with turbulence models I used to drive flows in several different ways. If it was done via the wall stresses then one checked how the pressure drop and mass flow varied over time, if done via body forces then one checked the wall shear stresses and mass flow, etc... How the flow was forced was part of the problem definition because it was imposed. |
||
December 9, 2024, 14:22 |
|
#10 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73 |
DNS will always create a huge database to manage in post-processing, no matter about the code. The time required to run a code could be expensive.
There exist database available under request, for example https://turbulence.pha.jhu.edu/Force...urbulence.aspx |
|
December 10, 2024, 08:17 |
|
#11 | |
New Member
Join Date: Dec 2024
Posts: 7
Rep Power: 2 |
Quote:
|
||
December 10, 2024, 11:10 |
|
#12 |
Senior Member
andy
Join Date: May 2009
Posts: 322
Rep Power: 18 |
What do you mean by forcing? To me forcing would mean how a turbulent motion is maintained so it doesn't decay away but this doesn't appear to be what you mean? Are you seeking to specify an intial field that decays and moves rapidly towards to isotropic motion before it has decayed away fully? All length scales or just the smaller ones?
|
|
December 11, 2024, 03:21 |
|
#13 | |
New Member
Join Date: Dec 2024
Posts: 7
Rep Power: 2 |
Quote:
|
||
December 11, 2024, 06:13 |
|
#14 |
Senior Member
andy
Join Date: May 2009
Posts: 322
Rep Power: 18 |
How would you go about creating isotropic turbulence in a periodic box by forcing? Turbulence is generated by the flow doing work against the largest scales which typically involves shearing leading to the largest scales being anisotropic.
One approach might be to access one of the many turbulence databases that has generated a region of isotropic turbulence perhaps, for example, downstream of a grid. This is likely to be doable as part of a masters program. Another approach might be to implement one or a few of the synthetic isotropic turbulence schemes and monitor how they behave in comparison with the form/s of isotropic turbulence you wish to study. This is doable as part of a masters program although the results may not be wholly satisfactory. If honestly reported this is fine as part of a masters because most research ends up like this. If I understand correctly what you mean by forcing scheme within a periodic box, to come up with a successful one, implement and test it as sub-part of masters project does not look doable to me. If you can find one in the literature and implement that then perhaps but is there one? I cannot see how one would go about it but then I have not been actively developing turbulence for 30 years and there are some smart people around. |
|
December 11, 2024, 08:51 |
|
#15 | |
New Member
Join Date: Dec 2024
Posts: 7
Rep Power: 2 |
Quote:
|
||
December 12, 2024, 06:15 |
|
#16 |
Senior Member
andy
Join Date: May 2009
Posts: 322
Rep Power: 18 |
I don't know the abbreviation HIT. 30 years ago there were tens of turbuence databases around that universities could access. Today there are many more including online ones but you may need to get permission to access via your university. Homogeneous turbulence is common and might be what you are after although how it is generated will influence the higher order statistics.
I still don't understand what you mean by verify and it may be relevant. Turbulent motion, both synthetic and natural, varies depending on how it is generated. If you remove the work being done to sustain the motion it will decay away but from different initial conditions. The decay will be different although it is likely (I haven't studied the subject) the unsteady motion may move towards something similar in some cases before it goes out. I get the impression, perhaps wrongly, that you are seeking a universal motion on which to train your network rather than a specific motion that is a function of how it was generated? |
|
Yesterday, 10:06 |
|
#17 |
Senior Member
|
Look in the code section of cfdonline. There are several codes that could do HIT DNS and likely have some forcing. Nek5000 and Incompact are just two names that I see you haven't considered yet. But there are more.
Introducing a forcing term to sustain HIT is also, pretty much, a solved problem. I can't say which of these code will have the proper one, but I have recently read some recent paper/thesis that also focused on that. Search for it and you will find what you need (can't remember the name, but probably showed up in my researchgate feed, so it must be recent). From the implementation perspective, tough, don't expect easy rides just because it is a forcing term. Getting it right is not always obvious for a given code. In any case, data will be produced, and it will take space and time to be processed, there is no escape from this |
|
Tags |
dns, isotropic turbulence, solver development |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Turbulence flow and heat flux budgets for LES / DNS in an OpenFOAM solver | kakkapriyesh | OpenFOAM | 0 | December 21, 2022 17:07 |
Error: WorkBench Error: Could not handle event: SolutionStatusUpdate | Kieyo | Fluent Multiphase | 0 | November 10, 2022 00:58 |
Writing all continuity errors to a file using custom solver in parallel mode | saurabh1011 | OpenFOAM Running, Solving & CFD | 1 | September 14, 2022 21:44 |
[Other] refineWallLayer Error | Yuby | OpenFOAM Meshing & Mesh Conversion | 2 | November 11, 2021 12:04 |
Star cd es-ice solver error | ernarasimman | STAR-CD | 2 | September 12, 2014 01:01 |