|
[Sponsors] |
March 28, 2017, 04:14 |
Drag Components in OpenFoam
|
#1 |
New Member
anthony
Join Date: Oct 2016
Posts: 5
Rep Power: 10 |
Hello partners;
I'm new in OpenFoam and I would like to know how to calculate the components of the drag coefficient, the viscous component (Cdv) and the pressure component (Cdp). I have this postprocessing, for example for a NACA profile with angle of attack 5: //////////////////////////////////////////////////////// # Force coefficients # liftDir : (-8.715574e-02 9.961947e-01 0.000000e+00) # dragDir : (9.961947e-01 8.715574e-02 0.000000e+00) # pitchAxis : (0.000000e+00 0.000000e+00 1.000000e+00) # magUInf : 1.000000e+00 # lRef : 1.000000e+00 # Aref : 1.000000e+00 # CofR : (2.500000e-01 0.000000e+00 0.000000e+00) # Time Cm Cd Cl Cl(f) Cl(r) 50 -3.381931e-02 2.525614e-02 1.507514e-01 4.155637e-02 1.091950e-01 100 2.877479e-02 2.730709e-02 3.181085e-01 1.878291e-01 1.302795e-01 //////////////////////////////////////////////////////////// # Forces # CofR : (2.500000e-01 0.000000e+00 0.000000e+00) # Time forces(pressure viscous porous) moment(pressure viscous porous) 50 ((-4.093538e-03 7.591890e-02 1.893935e-21) (1.010413e-02 2.705541e-04 -1.629982e-19) (0.000000e+00 0.000000e+00 0.000000e+00)) ((-3.795945e-02 -2.046769e-03 -1.683966e-02) (-1.352770e-04 5.052067e-03 -6.999131e-05) (0.000000e+00 0.000000e+00 0.000000e+00)) 100 ((-6.673421e-03 1.594468e-01 1.740584e-21) (6.412519e-03 1.921648e-04 2.494450e-20) (0.000000e+00 0.000000e+00 0.000000e+00)) ((-7.972341e-02 -3.336711e-03 1.443917e-02) (-9.608239e-05 3.206260e-03 -5.177497e-05) (0.000000e+00 0.000000e+00 0.000000e+00)) ///////////////////////////////////////////////////////////// Furthemore I have this parameters for the simulation: rho rhoInf; // Indicates incompressible log true; rhoInf 1; // Redundant for incompressible liftDir (0 1 0); dragDir (1 0 0); CofR (0.25 0 0); // Center of rotation for Cm Calculation pitchAxis (0 0 1); // Axis of rotation for Cm Calculation magUInf 1; lRef 1; // Chord Aref 1; // Chord*Span (our cell width is 1!) } //////////////////////////////////////////////////////// Can anyone help me calculate the components of the drag? THANKS A LOT. |
|
March 29, 2017, 11:58 |
|
#2 | ||
Senior Member
|
Hi,
Just use the output from forces to calculate your separated components: Cdv= 2*Fvx/(rho*V²*A) Cdp= 2*Fpx/(rho*V²*A) Where Fp is the first entry in forces Quote:
Similar for Fv = Quote:
You probably want to write a script or do this with a spreadsheat program or whatever. Cheers, Tom |
|||
March 29, 2017, 14:34 |
|
#3 |
Senior Member
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15 |
OF can calculate the drac coefficient for you. Simply include in controlDict lines like
Code:
functions { forces { type forceCoeffs; functionObjectLibs ( "libforces.so" ); outputControl timeStep; outputInterval 1; patches ( cylinder ); pName p; UName U; rhoName rhoInf; log true; rhoInf 1; liftDir (0 1 0); dragDir (1 0 0); CofR (-0.5 0 0); pitchAxis (0 1 0); magUInf 1; lRef 1; Aref 1; } } The result is in the postProcessing/forces folder.
__________________
Uwe Pilz -- Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950) |
|
March 30, 2017, 07:32 |
|
#4 |
New Member
anthony
Join Date: Oct 2016
Posts: 5
Rep Power: 10 |
Hi Tom;
Thank you very much for answering so quickly. I finally did what you told me and using a spreadsheet to automate all the angles of attack. Runs perfectly Thanks!!! |
|
March 30, 2017, 07:35 |
|
#5 |
New Member
anthony
Join Date: Oct 2016
Posts: 5
Rep Power: 10 |
Hi Piu58;
Thanks for your reply, I will try to adapt the code for my case to simplify the postprocessing. Code:
functions { forces { type forceCoeffs; functionObjectLibs ( "libforces.so" ); outputControl timeStep; outputInterval 1; patches ( cylinder ); pName p; UName U; rhoName rhoInf; log true; rhoInf 1; liftDir (0 1 0); dragDir (1 0 0); CofR (-0.5 0 0); pitchAxis (0 1 0); magUInf 1; lRef 1; Aref 1; } } |
|
March 29, 2020, 04:17 |
|
#6 |
New Member
damu
Join Date: Feb 2017
Posts: 24
Rep Power: 9 |
Hi,
This seems to be a thread I have been looking for. Can anybody suggest how to calculate the viscous and pressure drag separately for flow over a cylinder? I am simulating a 2D case in pisoFoam. I have copied the code to controlDict and run the case. In postProcessing/forceCoefficients, I get the drag coefficient for each deltaT whereas I need the viscous and pressure components. I understand it is possible to calculate these components using ParaView which I am not sure about. I would be grateful to have your suggestions. Thank you |
|
March 29, 2020, 11:54 |
|
#7 |
Senior Member
|
Hi,
The forceCoeff functionObject does not always print this out, use the forces and calculate the coefficients yourself as explained in the second post. In ParaView you would need to have the wallShearStress and the pressure to calculate the viscous and pressure force per patch, use integrate variables to get the correct forces. If your case is laminar and you do not have the wallShearStress available you may be able to calculate the wallNormal gradient in ParaView and use that to get the viscous force instead. If you case runs quickly however I would encourage you to use the forces option and parse that file with a script to get the pressure and viscous coefficients. Cheers, Tom |
|
March 29, 2020, 13:26 |
|
#8 |
New Member
damu
Join Date: Feb 2017
Posts: 24
Rep Power: 9 |
Hi Tom,
Many thanks for the swift response. I understand you are pointing towards including a script in controlDict which can print the coefficients directly(please correct me if wrong). If that is the case, I presume such a script is not readily available in OF hence, I need to manipulate the source code. If you have come across any such scripts, please share. As you said, am simulating laminar cases. |
|
March 30, 2020, 04:57 |
|
#9 |
Senior Member
|
Hi,
No this is a script you write yourself, no OpenFOAM code. It can be python, bash, or simply copying the fields into a spreadsheat and work on the data there. You have the resulting data in some format, but you need it in a different format. You need to find something that works best for you, I am just giving you some ideas. Hope this helps, Tom |
|
February 8, 2021, 05:47 |
edit drag coefficients
|
#10 |
New Member
David
Join Date: Jan 2021
Posts: 13
Rep Power: 5 |
Hi there, Id like to edit the drag coefficients in a solver, to represent microplastics. Is this possible?
|
|
Tags |
drag, forces, lift, openfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Getting Started with OpenFOAM | wyldckat | OpenFOAM | 26 | June 21, 2024 07:54 |
OpenFOAM v3.0+ ?? | SBusch | OpenFOAM | 22 | December 26, 2016 15:24 |
Adding new DRAG MODEL for TwoPhaseEulerFoam In OpenFOAM 2.3.x | vishal3 | OpenFOAM Programming & Development | 1 | September 11, 2014 08:08 |
Velocity cylindrical components from OpenFOAM | aerospain | OpenFOAM | 2 | October 17, 2012 08:09 |
Components of Drag | Matja90 | FLUENT | 0 | August 20, 2012 04:57 |