Inserting Boundary layer elements

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
trilbytim
Posts: 32
Joined: Thu Jan 05, 2023 11:52 am

Inserting Boundary layer elements

Post by trilbytim »

I'm trying to follow this tutorial for inserting boundary layer elements: https://youtu.be/VGpiWwZYrH4 I didn't know where to download the car from, so I was using a wing.

My first problem was was that my /SRC folder is completely empty, there is no EXAMPLE or REFERENCE folder as shown in the video, so no cs_user_mesh.c file. At what point are these folders supposed to be created, maybe I'm missing an earlier step that should create them?

Anyway, I created a cs_user_mesh.c file from scratch and modified it as shown in the video. The video doesn't quite explain what to do after saving the user mesh file to regenerate the mesh, but I assumed I just needed to re-run the calculation in "Mesh Preprocessing Only" mode? When I did that again then it took much longer to run than the first time (so the user mesh file must be doing something), but when I opened the new file it was exactly the same as the first time, there were no boundary layer elements. I tried various values of zone thickness and zone expansion but couldn't get any boundary elements to appear. I also tried adjusting the third value in cs_mesh_boundary_layer_insert() from 0.2 but that also did nothing until I put it above 1, which did at least do something, but it created some really weird shapes around the aerofoil surface that definitely weren't boundary layer elements! What am I missing here? I've attached the cs_user_mesh file that I created and the mesh that I was using.

Also, even if I get the boundary layer elements added then I think my mesh will still be pretty terrible. Do you have any tips for making this mesh better?
Image
Attachments
P7-vol.cgns
(1.95 MiB) Downloaded 46 times
cs_user_mesh.c
(1.39 KiB) Downloaded 48 times
Guillaume THIRIET
Posts: 14
Joined: Fri Dec 23, 2022 9:50 am

Re: Inserting Boundary layer elements

Post by Guillaume THIRIET »

Hello,

I am still not very familiar with code Saturne so I won't be able for now to answer the second part of your question.

Nevertheless, assuming that you are currently working on a Linux Ubuntu distribution, the installation step (which is quite complicated, that's true) must have created a folder where all the data for code_saturne are located.

For instance, mine is located at this adress
/home/guillaume/Code_Saturne/7.0.5-patch/code_saturne-7.0.5-patch/arch/Linux_x86_64/share/code_saturne/user_sources
There, you will find EXAMPLES and REFERENCE

It should maybe help you with the second part of your question.

If these two folders are not here, then I guess it must be a problem with the installation process but I can't help more unfortunately...
From my side, I used the youtube video of "Cyprien Rusu" - (TUTORIAL) Installing Salome CFD in 2022 with Code Saturne 7.0.
I did not succed to get the Salome CFD module but both software (Salome / Code Saturne) are running efficiently separately so I am fine with that.

Hope it can help

Yours faithfully
Guillaume THIRIET
Posts: 14
Joined: Fri Dec 23, 2022 9:50 am

Re: Inserting Boundary layer elements

Post by Guillaume THIRIET »

Dear trilbytim,

I tried to run a case using your mesh but for an unknown reason, I can't even launch the case (the "run" button is greyed and unusable). Seems the format of the mesh is not recognised by my code_saturne version. Could you eventually please provide it using .MED format ?

For information for future readers,
- I am running code_saturne v7.0.5 with Salome 9.9.0.

Yours faithfully
trilbytim
Posts: 32
Joined: Thu Jan 05, 2023 11:52 am

Re: Inserting Boundary layer elements

Post by trilbytim »

Thank you for your help.

I did find the example user mesh file at the location you suggested and I used this as a template. However it makes no difference. Again it takes longer over the mesh preprocessing as if it is doing something, but no boundary layer elements appear.

The reason I exported .cgns was simply that it was the format shown in the tutorial video, I don't know why. I have also exported it as .med and attached that, however this also makes no difference, I don't see any boundary elements when I run the mesh preprocessing on this one either. I have also attached a pre-processor log from trying to create this. I found that the 'Run' option was greyed out also the first time I tried to do this 'Mesh preprocessing only' step. I found that if I clicked the mesh in the List of meshes so that it was blue selected then I had the option to Run. I only seemed to need to do that for the first time, after that then the Run option was available whether the mesh was selected or not.

I also followed the same tutorial to install Code_saturne within Salome and also couldn't get get CFD Study to work inside Salome. With help from this forum I did succeed eventually, see viewtopic.php?f=3&t=3073. However I don't recommend that it is worth the time and trouble. You can do all the same things with Salome and Code Saturne used separately. Also I found that Salome crashed several times when I had the CFD study version open and neither Salome nor Code Saturne have ever crashed for me when used separately. So now even after the effort of installing it within Salome, I still don't use it!
Attachments
preprocessor.log
(5.36 KiB) Downloaded 45 times
P7_vol.med
(5.13 MiB) Downloaded 41 times
trilbytim
Posts: 32
Joined: Thu Jan 05, 2023 11:52 am

Re: Inserting Boundary layer elements

Post by trilbytim »

Also @Guillaume THIRIET , have you successfully used this boundary layers insert method at all? If so then can you share a mesh that it works on and I can see if it works for me on the same mesh?
trilbytim
Posts: 32
Joined: Thu Jan 05, 2023 11:52 am

Re: Inserting Boundary layer elements

Post by trilbytim »

Actually, it seems to work fine for me for primitive shapes (cube and sphere created in the Geometry workbench), so it must be some problem with my wing shape geometry. I'll try breaking it down into simpler units and see which ones work.
Guillaume THIRIET
Posts: 14
Joined: Fri Dec 23, 2022 9:50 am

Re: Inserting Boundary layer elements

Post by Guillaume THIRIET »

Dear trilbytim,

I am a very newcomer on Code_Saturne so actually, I did not have so much experience on it and I am currently spending times on tutorial cases to be familiar with the soft as you are currently doing ^^'. Unfortunately, I still did not have tried to implement this kind of mesh for now.

I found the reason why I was not able to run a case. It was simply because I forgot the ***.xml at the end of my code_saturne save file... silly mistake.... So, I finally tried to run your case but as you guess, I have the same mistake...

Considering your tests on simple geometries, I would guess that maybe the issue come from the part where you modify the line const char *sel_criteria[] = {"Group_1"}; because this is the only line of the source code where the geometry (something coming from the geometry actually) is called. So, my first idea would be to have an eye on this part whatever it is from the preprocessing part (creation of the geometry) / the processing part (modification of the cs_user_mesh.c file).

If it works with very simple geometries, there is no reason why it should not work with more complex ones
Guillaume THIRIET
Posts: 14
Joined: Fri Dec 23, 2022 9:50 am

Re: Inserting Boundary layer elements

Post by Guillaume THIRIET »

Thank you for your post on the implementation of Salome_CFD.
As you said, it is not worth the time spending on it. I already spent two days on it... The two software work fine separately and as long as there is not an easier way to make it, I do not see the point to make that operation.

Regarding the mesh format, I am not familiar with that so I am just doing like you.... which means doing what I am being told in tutorial... I think it can be interesting in the case of you want to use another CFD software where the mesh format is important to make the file readable. As Salome is designed to fit with Code_Saturne I guess all mesh format are fine.

Yours faithfully
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Inserting Boundary layer elements

Post by Yvan Fournier »

Hello,

In the mesh shown a few posts above, does thevairfoil seem full because of perspective or is the foil volume meshed also ? In this case, do you have boundary faces where you expect them ?

I did not have time to check the mesh so far.

Best regards,

Yvan
trilbytim
Posts: 32
Joined: Thu Jan 05, 2023 11:52 am

Re: Inserting Boundary layer elements

Post by trilbytim »

Hi, no the it is only perspective that is making the aerofoil look full, it is empty and there definitely is a boundary face called "aerofoil_surf" on the wing surface. This mesh has a very high density at the stagnation point of the aerofoil, I wonder if that is throwing off the boundary element insertion routine. The 3D elements in this area are extremely distorted. I will experiment with changing the geometry. Now I have got it to work for primitive shapes then I will try increasing complexity of shape until I get to my wing shape.

However I do still think I need a zone of finer elements around my wing graded to coarser as it gets further away. I know that in gmsh as a standalone application then you can set a local mesh density target on points, is there a way to have this control of it when called through Code Saturne?
Post Reply