Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
Calculate Drag Coefficient
Posted Apr 19, 2016, 3:39 a.m. EDT Fluid & Heat, Computational Fluid Dynamics (CFD) 9 Replies
Please login with a confirmed email address before reporting spam
I have read the following post
www.comsol.de/blogs/how-do-i-compute-lift-and-drag/
and looked at the flow over an Ahmed body example
which shows that the total drag force in the Y direction is: spf.T_stressy
To calculate c_d i need to calculate
(en.wikipedia.org/wiki/Drag_coefficient)
where (please correct if wrong):
= spf.T_stressy
= spf.rho
u = spf.u
Is the above correct? How do I calculate Area? The area should only be the surface exposed in the Y direction (spf.nymesh?)?
thanks in advance!
Jess
Please login with a confirmed email address before reporting spam
Best regards,
Jeff
Please login with a confirmed email address before reporting spam
I have updated my post
Please login with a confirmed email address before reporting spam
is the drag force, i.e. the integral over the surfaces of the vehicle of the y component of the forces applied by the air flow onto the vehicle. You can compute it using Derived Values > Integration > Surface Integration, as explained in the blog you referenced.
You will be able to compute by integrating ny*(ny>0) over the same surfaces. ny is the y component of the outward-pointing normal vector on surfaces (Here I am assuming that you removed the volume occupied by the vehicle from the computational domain, so that ny points into the vehicle. You can always do an arrow plot of the (nx,ny,nz) vector if in doubt ). The *(ny>0) part is needed to capture only the parts of the surface of the vehicle that face forward.
Finally, in the formula, is the velocity of the vehicle, i.e. for you the velocity of the air at the inlet, whereas spf.u is the x-direction component of the velocity of the air, a field that varies from point to point in the computational domain.
I hope this helps,
Jeff
Please login with a confirmed email address before reporting spam
Thank you very much for your clear explanation.
The following is what I am using for the Surface Integration
Is this what you described?
thank you
Jesse
Please login with a confirmed email address before reporting spam
Best,
Jeff
Please login with a confirmed email address before reporting spam
I have two remaining questions,
I have two line integrations (I am first computing the drag in 2D), one computing the integral of spf2.T_stressx, and the other nx*(nx>0).
I have been looking for a way to read the result of the two out of the table and do some further postprocessing on the values. Is this possible within Comsol, or is exporting/copying the values out of Comsol the only option? (ie. Can I include a calculated drag coefficient in my Report )
Also, the simulation is set to use the in built air as the fluid, where rho is
How do I obtain this value?
thank you
Jesse
Please login with a confirmed email address before reporting spam
If you've never used Component Couplings before, you may want to read the section on them in the Reference Manual first (Although Integration component couplings are pretty intuitive to use - I would not necessarily say the same of all types of component couplings).
You can see the function used for rho by browsing through to the appropriate node in the Materials branch of the Model Builder: this will let you see the mathematical expression used for that function. If you just want to know its value at its value at a particular temperature and pressure, you can just plot it in the Results branch, like you would any other quantity.
Best,
Jeff
Please login with a confirmed email address before reporting spam
thank you for pointing out Component couplings.
I am using a global evaluation to try to evaluate
However, its not able to evaluate spf2.rho. Is this because temperature and pressure are locally different throughout the simulation? Can I use then another coupling to calculate the average density as follows?
The error is:
Variable: comp2.spf2.rho
- Global scope:
Failed to evaluate expression.
- Expression: real((comp2.intop1(comp2.spf2.T_stressx)*(-2))/(comp2.spf2.rho*(comp2.intop1(nx*(nx>0))*(V_inf^2))))
thank you
Jesse
Please login with a confirmed email address before reporting spam
You are getting this error message because your expression for the global expression involves a quantity (rho) whose scope is not global: rho is a field, possibly taking on different values at different locations. As you noted earlier (in your post of 4/22), the density of air in your model is a function of pressure and temperature, which themselves may vary from point to point.
My interpretation of the formula in the Wikipedia link you provided at the start of the thread is that it involves the density of the incoming air, i.e. rho computed at ambient temperature and atmospheric pressure.
You could make COMSOL compute it for you by using an additional Component Coupling of the Integration type defined at a point where air is at those conditions. An Integration Component Coupling defined at a point returns the value of its argument at that point. Using for that Point Integration Component Coupling a point on your inlet should be suitable. Alternatively, you could simply plug into your expression an approximate value for the density of air at standard conditions, i.e. ~1.2[kg/m^3]. Yet another way of getting that number would be to, in your expression for Cd, call the underlying function with the proper arguments "manually fed in", i.e. something like comp1.mat1.def.rho(1[atm],293.15[K]) .
Best,
Jeff
Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.