Output forces on surface
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
Re: Output forces on surface
Setup and run solver log. The mesh is too large to attach, but it's simply a fluid domain with a wing subtracted from it, there's an inlet an outlet, symmetry conditions and a wall for the wing surface. The faces are labelled with names that are these. All I would like to do is for those to be preserved in the output so that I can query them, for example to read the lift, drag and moment of the wing.
- Attachments
-
- preprocessor.log
- (7.07 KiB) Downloaded 850 times
-
- setup.xml
- (7.92 KiB) Downloaded 842 times
-
- Posts: 4210
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Output forces on surface
Hello,
The selection criteria for the postprocessing mesh is incorrect. You must either:
- Use "wing.Wing_surf".
or
- Switch the mesh type from "boundary faces" to "boundary zone," and keep the "wing" selection.
Best regards,
Yvan
The selection criteria for the postprocessing mesh is incorrect. You must either:
- Use "wing.Wing_surf".
or
- Switch the mesh type from "boundary faces" to "boundary zone," and keep the "wing" selection.
Best regards,
Yvan
Re: Output forces on surface
Thank you for this, I can now output the wing as a separate result. However I cannot get the pressure distribution of the surface from this. I need to get the total force and moment on the wing.
The wing result has a field called "Stress", but I'm not sure what this is? Possibly the viscous component? It definitely doesn't look right for the pressure. Is there no simple way of outputting the overall force and moment on a surface?
The wing result has a field called "Stress", but I'm not sure what this is? Possibly the viscous component? It definitely doesn't look right for the pressure. Is there no simple way of outputting the overall force and moment on a surface?
-
- Posts: 4210
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Output forces on surface
Hello,
The stress should contain both the viscous and pressure components, with pressure usually dominant. It might also conttain the hydrostatic component of the pressure if you have non-zero gravity. If that still does not explain the results I would need to check on a small case.
Best regards,
Yvan
The stress should contain both the viscous and pressure components, with pressure usually dominant. It might also conttain the hydrostatic component of the pressure if you have non-zero gravity. If that still does not explain the results I would need to check on a small case.
Best regards,
Yvan
Re: Output forces on surface
Ah, thank you, yes I hadn't noticed that the stress had x, y and z components. Now by integrating them on the wing surface I do get figures for lift and drag. Unfortunately they don't seem right! I've been using Siemens Star CCM+ at work but am looking for something that I can use for my own non-work projects, so I've been trying to learn Code Saturne and also OpenFOAM (through the FreeCAD gui). This elliptical wing case is one that I have a semi analytical solution, also have modelled using a Vortex Lattice method. The analytical solution gives a L/D of about 20, the VLM is giving 18 and both OpenFOAM and Star CCM+ are giving about 19. However Code Saturne is giving 9.6! This is both due to the lift being too low (358 as opposed to 485N) AND the drag being too high (37 as opposed to 25N) compared to all the other solutions. I'm using the mesh that was generated in Star CCM+ and I believe that I've set all the physical constants the same and I'm using the same turbulence model. I've attached the setup and the mesh is on the link below. Can you see anything obviously wrong with this that could be making the L/D so bad and so different to running what should be an identical simulation in different software?
Thanks,
https://drive.google.com/file/d/1d_ZxKu ... sp=sharing
Thanks,
https://drive.google.com/file/d/1d_ZxKu ... sp=sharing
- Attachments
-
- setup.xml
- (7.79 KiB) Downloaded 886 times
-
- Posts: 4210
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Output forces on surface
Hello,
Thanks for the test case. I'll try to give it a look, but will probably need help from colleagues who know some of the numerical aspects better.
Regarding the drag, a colleague pointed out to me a few days ago that there is a turbulence model related term which is added in all cases and should be only added in one case (I need to check which). So it might be interesting to compare results between k-epsilon and k-omega, in case one of the 2 is buggy.
But most importantly, you used a rough wall instead of a smooth wall law, which might make a significant difference (there are actually 2 models in code_saturne, and I think this option least to the older one). So using a smooth wall will probably improve the drag.
I'll keep you informed, though I don't guarantee it will be before a couple of weeks.
Best regards,
Yvan
Thanks for the test case. I'll try to give it a look, but will probably need help from colleagues who know some of the numerical aspects better.
Regarding the drag, a colleague pointed out to me a few days ago that there is a turbulence model related term which is added in all cases and should be only added in one case (I need to check which). So it might be interesting to compare results between k-epsilon and k-omega, in case one of the 2 is buggy.
But most importantly, you used a rough wall instead of a smooth wall law, which might make a significant difference (there are actually 2 models in code_saturne, and I think this option least to the older one). So using a smooth wall will probably improve the drag.
I'll keep you informed, though I don't guarantee it will be before a couple of weeks.
Best regards,
Yvan
-
- Posts: 4210
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Output forces on surface
Hello,
Are you sure your computation is converged ? Using your setup and an smooth wall, I have divergence right away. With a smaller reference time step and local time step, I can get results, but have not checked for convergence or looked in detail yet.
Regards,
Yvan
Are you sure your computation is converged ? Using your setup and an smooth wall, I have divergence right away. With a smaller reference time step and local time step, I can get results, but have not checked for convergence or looked in detail yet.
Regards,
Yvan
Re: Output forces on surface
Hi there, I've tried it with kε, kωSST and with rough (height 0.0001m) and smooth walls. All do seem to converge for me within the 500 steps of 0.05s. Here's the plot of kε with a smooth wall:
Turb Wall L D CL CD L/D
kε Smooth 408 33 0.81 0.07 12.4
kε Rough 358 37 0.71 0.07 9.7
kωSST Smooth 386 33 0.77 0.07 11.8
kωSST Rough 373 34 0.74 0.07 10.9
The correct CL should be 0.97, CD 0.05 and L/D = 20
kωSST does seem to converge quicker for the smooth wall case:
However for the rough wall then there are some odd jumps:
However, none of these give numbers that are anywhere close to the results from my other sofware (although they are all quite consistent with each other). I would assume this is my fault with setting up the model rather than a bug, but it seems very odd. Turb Wall L D CL CD L/D
kε Smooth 408 33 0.81 0.07 12.4
kε Rough 358 37 0.71 0.07 9.7
kωSST Smooth 386 33 0.77 0.07 11.8
kωSST Rough 373 34 0.74 0.07 10.9
The correct CL should be 0.97, CD 0.05 and L/D = 20
Re: Output forces on surface
Sorry, can't work out how to format a table to post here. Here are the results in a bit more readable way:
-
- Posts: 4210
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Output forces on surface
Hello,
Yes, this seems strange, especially as code_saturne may be a bit less robust than Star-CCM+ regarding some meshes, but usually gives results quite similar to OpenFoam, FLUENT, or Star-CCM in most comparisons to date.
If you have a second (even coarser) mesh, comparing results with that mesh could be interesting.
But adding a postprocessing output directly into the code (see attached file) seems to provide results closer to your expectations, so I suspect something in the integration by ParaView is incorrect (i.e. not weighted correctly).
If you add the attached file in your SRC directory, and look at the "lift_and_drag.txt" file produced, things may be closer to what you expect. Can you try this ? The fist couple of values is computed using the stresses, the second simply by integrating the pressure forces on the adjacent cells (you will see they are very close).
With smooth wall k-epslion and default wall law, I get 460 lift, 25 drag.
Best regards,
Yvan
Yes, this seems strange, especially as code_saturne may be a bit less robust than Star-CCM+ regarding some meshes, but usually gives results quite similar to OpenFoam, FLUENT, or Star-CCM in most comparisons to date.
If you have a second (even coarser) mesh, comparing results with that mesh could be interesting.
But adding a postprocessing output directly into the code (see attached file) seems to provide results closer to your expectations, so I suspect something in the integration by ParaView is incorrect (i.e. not weighted correctly).
If you add the attached file in your SRC directory, and look at the "lift_and_drag.txt" file produced, things may be closer to what you expect. Can you try this ? The fist couple of values is computed using the stresses, the second simply by integrating the pressure forces on the adjacent cells (you will see they are very close).
With smooth wall k-epslion and default wall law, I get 460 lift, 25 drag.
Best regards,
Yvan
- Attachments
-
- cs_user_extra_operations.c
- (4.3 KiB) Downloaded 862 times