Hi Christoph,
I just took a quick glance at your issue - To me it seems that you are not using the right name - you can find the name of the BC in the header file - I think it will be in TypeName - it should look like this - scaledMappedVelocity and not scaledMappedVelocityFixedValueDelta. To be clear I am talking about the U file in the 0 folder. Regarding the boundary file in the polymesh folder - you need to stick with mappedPatch and try nearestPatchFace for sampleMode. cheers |
Hi,
thanks for taking your time to have a look at my issue. I think that your answer makes sense and could solve this problem. I'll test it on monday and let you know about the result ... Best regards :) |
PS on Monday:
Your hint was perfect, OpenFOAM detects my BC without any problems. Now there seems to be another problem with a segmentation fault, but I'll try to solve it on my own before describing it here. Joachim wrote in this topic something about a very small gap in his grid and that he couldn't use blockMesh. I'm using blockMesh and I have a simple grid with equally spacing in the streamwise direction without any "gap" in my grid. Can you remember, if there has been anything special about your grid in your simulation? Thanks for your help and your patience with me, Christoph |
Please do not worry about the small gap that Joachim mentioned.
Things should work out well with a simple grid. |
In the hope that this is my last question in this thread ...
To test Lunds BC I created a very simple mesh with blockMesh. Its dimensions are from (0 0 0) to (0.28288 0.09 0.0942592) in [m]. I want to simulate a turbulent boundary layer at Re=(U_inf*delta_99)/nu = 3000 and Re_\tau=(u_tau*delta_99)/nu=160. When using U_inf=1[m/s] and delta_99=0.03[m], I have to set nu=0.00001 (this corresponds to u_tau=0.053). I'm using a coarse grid with y⁺_1~1 for testing Lunds BC, that is initialized with a disturbed DNS solution (perturbU). +++++++++++++++++++++++++++++++++ settings in OpenFOAM +++++++++++++++++++++++++++++++++ When using Lunds BC I have to adapt the following files:
Code:
... 0/U file: Code:
... Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Using this setting, my DNS (icoFoam) runs without any problems (except a probably correctable floating point error after about 150s), but the simulation results look extremely bad when plotting the nondimensionalized velocity after approximately 150s runtime. https://www.dropbox.com/home?preview=Umean_plus.pdfhttps://www.dropbox.com/s/ldb954sm1h...%3A17.png?dl=0https://www.dropbox.com/s/6mikw72xdx..._plus.pdf?dl=0https://www.dropbox.com/s/6mikw72xdx..._plus.pdf?dl=0 https://www.dropbox.com/home?preview=Umean_plus.pdf There are two possible reasons for this problem:
So my question: Is there anybody, who has already been succesful in using Lunds BC and who can give me a feedback about my settings? Are there any mistakes or weaknesses in my use of Lunds BC? An additional question arised when I tried to run this case in parallel because OpenFOAM breaks with a segmentation fault error directly at the beginning of the simulation. Do you have any experience in running a Lund BC testcase in parallel? Maybe I haven't given enough information in the presented code snippets, so you can have a closer look to my testcase in the following files: https://www.dropbox.com/sh/xlzp3e16o...UsOmR-1La?dl=0 Thanks for your help, Christoph |
Quote:
I've just got into this thread and I mailed you guys individually but unfortunately I've not received Joachim's code yet :( Would you please send me the code? |
2 Attachment(s)
Hey everyone,
sorry I have been a bit busy lately. Here is the boundary condition I implemented a while back (maybe two years ago). It seemed to work at the time (see attached figure). I also have a zipped test case (Lund's flat plate), but the file is too large to be uploaded here (14mo or so). Any idea how I could share that with you guys? Best, Joachim |
Hi Joachim,
when I get your permission I can upload it in dropbox... Christoph |
Quote:
you can also send the file to me (armehrjoo@gmail.com) and i'll take care of sharing it. thanks again for your help |
I just uploaded the files on Dropbox. Enjoy!
https://www.dropbox.com/sh/ckj3yf5e5...VKGY5UpCa?dl=0 The boundary condition was implemented roughly two years ago using OF 2.2.0. I haven't tried it with the latest releases, but some people did and it seemed to work. Please let us know if it worked for your version, etc! Best, Joachim ps: I think I also have a version where I impose the displacement/momentum thickness instead of the boundary layer thickness. I'll see if I can find it. |
When I run Lunds BC with OpenFOAM-2.2.2, my parallel running problem is solved. This is weird, because Lunds BC should also work with OpenFOAM-2.2.0. So maybe I had an installation problem.
Thanks to everybody who helped me with my problems, you have been an awesome help for me :) |
5 Attachment(s)
It figured out that I have been pleased too early. When I run Joachims uploaded test case with scaledMappedVelocityFixedValueDelta (averagingTime=100), all seems to work fine. I can't reproduce his amazing results that he presented here, but that's not the problem.
In the next step I wanted to resimulate Joachims test case with my own initial conditions. Therefore I initialized the flowfield with the averaged mean velocity field of a DNS-solution, that is perturbed with perturbU. Apart from the averagingTime, all settings are identical to that one which Joachim used. The mesh is refined a little bit in the wall-normal direction (from 45 to 60 cells) to get y⁺_wall=1 with simplegrading=60 instead of Joachims value of ~150, but this shouldn't be the problem. The boundary layer parameters are: deltaInlet = 0.243; thetaInlet = 0.028; nu = 2e-05; Ue = 1; t = 2; u_tau_expected ~0.0425 According to Lunds paper, the initial averagingTime was set to T=10*delta_99/Ue~2.5. For the first 45000 iterations (280s physical time), the simulation looks brilliant. U_tau_inlet converges to the expected value of 0.0425 and the simulation is very stable and equilibrates. Afterwards, u_tau_inlet, u_tau_recycle (image 3) and the CFL-number increase and the simulation breaks. When you have a look at the flowfield, you can see some wickles in the freestream. To stabilize the simulation, I reran the simulation beginning at 45000 iterations (280s) and increase the averagingTime, according to Lunds paper to T=100*delta_99/Ue~25. When you have a look at the attached plot (image 5), you can see, that my simulation shows exaclty the same behaviour like bevore and breaks. When I tried other Re-numbers, every simulation has shown the same behaviour. https://www.dropbox.com/s/2rktt2mwb5...esamt.png?dl=0This is very supprising for me, because Joachim never reported about this problems and his uploaded testcase works fine. I know that you really have to be careful with the averaging time, because Lunds BC uses an average with a weight that decreases exponentially backward in time, but I couldn't solve this problem. Didn't you have the same problems? Thanks in advance, Christoph |
Quote:
I have some questions regarding this BC. I have a channel flow with a humb in middle of it, already with an initial solution (fully turbulent at inlet). I want to use scaledMappedVelocity boundary condition at this stage, i.e. not from time 0. I looked upon the settings you have provided above, and the settings provided in Joachim test case. I observe that there is an Interface boundary condition in Joachim test case which is used for recycling purpose. However In my simulation, there is not such Interface bc defined. So, can I implement this boundary condition to continue my simulation?! or I should return to the grid generation tool and define an Interface bc and then start my simulation from scratch??! If the latter comes to be true (needing an interface), is there any other option to create it at this stage and not returning to grid generation tool?! Thanks, Syavash |
Dear syavash,
the scaledMappedVelocity BC is based on the mappedBC to set values from one plane to another. When you have a look at the mappedBC, you can see, that there are different possibilities to use this BC:
Cheers, Christoph |
Quote:
You answered my questions, more or less. Regarding your second statement, I do have a channel flow but not a fully developped one! So, I guess I cannot use mappedBC and nearestCell option (correct me if I am wrong). You also mentioned "the easiest way to get a patch is to use cyclic BCs". I do not fully understand what you meant to say. May I ask to elaborate further on how to get a patch using this method (I mean by using cyclic BCs)?! Another point: in your previous post, you mentioned that care must be taken regarding time average interval (T). In Joachim test case it is set to 100 through whole the simulation time, I wonder if this is a convenient value. Lund in his paper has suggested to increase this value when boundary layer reaches equilibrium. How can one assess that it has occured?! Generally, do you have any recommendation on how to adjust this parameter? Thanks, Syavash |
Hey syavash,
Do you want to simulate transition in your channel flow? Or why isn't your inflow fully developed? I think that I don't understand your setup at all :mad: When using Lunds BC, you need a patch at the recycling station. But the recycling station is somewhere in the middle of my internal field, so there is no patch. To define a patch at this recycling point, the easiest way is to use cyclic BCs, because they automatically generate patches without influencing the flow. I think that you can also generate patches with cellSet or topoSet, but they work like boundaries and you have to define values for this patches. Referring your question about the time averaging parameter T: Joachims testcase is a well developed simulation. The T3=100 in his simulation is the final step to generate his inlet profile. In this final step, T must be greater than the runTime to get a "normal" time averaging. When I use LundsBC, I set T in the final step to T3=100000 to be save, that this value will never be reached. As a consequence of the periodicity of your simulation area, it is very hard to get a stable simulation with LundsBC, especially for low Re-numbers. In contrast to a channel flow with periodic boundaries, a flat plate flow hasn't got an upper wall, which suppresses any oscillations by the no slip condition. For this reason, your periodic boundaries create oscillations in the spanwise direction which aren't suppressed by the upper boundary. This oscillations increase during runtime and will destroy your simulation. This means, that you have to keep your averaging intervals very short to survive the oscillations. For time averaging I used the averaging intervals which are recommended in Lunds paper. Step 1: Run the simulation with Lunds T1 and plot U_tau_inlet up to the time, at which U_tau_inlet reaches your desired value (maybe a little bit longer) and switch to Step 2. Step 2: Run the simulation with Lunds T2 for maybe 40-50 cycles (maybe thats not the optimum, but it worked for me). You can check your flow by plotting the turbulent energy spectrum after this time period and switch to Step 3. Step 3: Run the simulation with T3=infinity (1000000). Best regards, Christoph |
Quote:
My channel simply is like the configuration in pitzDaily tutorial, except that the upper wall is further away and the incoming flow is not fully developped but is completely turbulent and a turbulent boundary profile should be applied. Of course at this station, the boundary layer thickness and momentum thickness are both given. About the difference between the flat plate and a developping channel flow, you mean that having a stable simulation is easier in case of channel because of the upper wall, right?! I have read Lunds paper but now with your explanation, I have been confused about T!! I thought this parameter is simply the time span over which the averaging is applied. But I am not so sure now! Could you elaborate a little further about this parameter please? Thanks, Syavash |
Hi Syavash,
thats right, a cyclic channel flow is much more stable than a cyclic flat plate boundary flow, but it's absolutely not impossible to stabilize it! About the averaging Time T, that is presented in Lunds paper. Lund writes: "A convenient way to eliminate the starting transients is to use an average with a weight that decreases exponentially backward in time". The given formula includes the time parameter T.
... runTime=7 T=7; runTime=8 T=8; runTime=9 T=9; runTime=10 T=10; runTime=11 T=10; runTime=12 T=10; ... Try to understand the effect of a constant parameter T in Lunds formula. I hope that this explanation makes it clear? Cheers, Christoph |
Quote:
Your comments were really helpful. Thanks! :) Yet, I should work on it to get into that. Following our discussion regarding the intermediate patch to use for recycling, I have been struggling to generate a grid with two interfaces, using a third-party software (ICEM CFD), and really that was a pain!:( I could simply create a single patch, but I am not sure it would be enough since I have no idea what bc can be applied to this single patch in boundary file. Besides, I can see that Joachim has used two adjacent patches as cyclic boundary conditions in his test case (still wondering how he managed to separate them by a small gap!!) Now, I have two coincident cyclic patches in my boundary file (yet, checkMesh throws me bunch of warnings for translation vector being zero!). Is it enough for making the simulation work?! Can I use a single patch instead (because it is much easer for me)?! Thanks, Syavash |
Hi Syavash,
I am pretty sure that you have to define two surfaces when using cyclic BCs. Of course it is not enough to define one patch without using cyclic patches. Thats the problem I mentioned when I wrote: Quote:
Cheers, Christoph :) |
All times are GMT -4. The time now is 09:17. |