CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Best Approach for Force vs Velocity

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By tomf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 20, 2021, 21:52
Default Best Approach for Force vs Velocity
  #1
New Member
 
Lee
Join Date: Jul 2021
Posts: 3
Rep Power: 5
CFDinfant is on a distinguished road
Hello Openfoam forum members!

I am seeking some advice on the best method for deriving a Force vs Velocity curve in Openfoamv8 for an automobile.

I have adapted the simpleFoam motorbike example to suit the geometry & volume of my vehicle. And, I have copied this case and run it at different inlet velocities which yields an increase in cd or forces (I don't really understand why Cd changes with velocity, but I can ask that later) roughly proportional to v^2 which makes sense.

I expect there is a more efficient method for doing this analysis where I can start one run that vary the simpleFoam steady state inlet conditions over multiple steps, but I am struggling to find a good example where someone has done something similar, could you point me to a good example?

I get the impression I could do a transient solution of this problem, and ramp the velocity, but that seems like overkill for my problem.

Thank You!
CFDinfant is offline   Reply With Quote

Old   July 23, 2021, 06:16
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 646
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi,

For the single simpleFoam run you could specify your inlet with the uniformFixedValue boundary condition, which is constant in space, but can vary as a (patch)Function1. For instance you could use a table that specifies the velocity as a function of time/iteration like:

Code:
inlet
{
    type    uniformFixedValue;
    uniformValue    table
    (
         (0 (1 0 0))
         (3000 (1 0 0))
         (3001 (2 0 0))
         (4000 (2 0 0))
         (4001 (3 0 0))
         (5000 (3 0 0))
    );
}
This assumes you will need 3000 iterations to converge with an inlet velocity of 1 m/s in the x-direction and then switches to 2 m/s, keeping that steady for 1000 iterations (where we assume convergence to the new velocity) and then to 3 m/s.

You should check if the forces/residuals converge within these 1000 iterations. Probably you also want to use inlet conditions for k and epsilon/omega (or whatever turbulence quantities you have) that scale with the velocity, e.g.

Code:
k: turbulentIntensityKineticEnergyInlet
epsilon: turbulentMixingLengthDissipationRateInlet
omega:  turbulentMixingLengthFrequencyInlet
Just look for examples of the italic text in the online documentation
CFDinfant likes this.
tomf is offline   Reply With Quote

Old   July 23, 2021, 08:55
Default
  #3
New Member
 
Lee
Join Date: Jul 2021
Posts: 3
Rep Power: 5
CFDinfant is on a distinguished road
Thank you!
That makes a lot of sense, I will try it out today!
CFDinfant is offline   Reply With Quote

Old   July 25, 2021, 21:20
Default Update Tried
  #4
New Member
 
Lee
Join Date: Jul 2021
Posts: 3
Rep Power: 5
CFDinfant is on a distinguished road
Your explanation made sense, and from the examples I find online, I would think it would work, but upon making that modification, cleaning and attempting to run I get this error

Code:
FOAM FATAL IO ERROR:
wrong token type - expected Scalar, found on line 14 the punctuation token '('
file: /home/openfoam/OpenFoam/openfoam-8/run/cube_multispeed/0/k/boundaryField/inlet/uniformValue at line 14.

Where line 14 is the beginning of this uniformFixedValue table we are creating.

Do I need to make changes elsewhere in my code so that it is expecting a table rather than a scalar value?

I have tried adjusting the controldict iterations to match the table, but to no success.

Thank you again. If uploading my files would be helpful let me know. Currently it is just a simple cube I was using to do some basic F=Cd*A*v^2 correlation with.
CFDinfant is offline   Reply With Quote

Old   July 26, 2021, 07:03
Default
  #5
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 646
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi,

The error you post is in regards to the k file, which is indeed a scalar and not a vector (like U is):

Quote:
Code:
file: /home/openfoam/OpenFoam/openfoam-8/run/cube_multispeed/0/k/boundaryField/inlet/uniformValue at line 14.
So for k you could also use this uniformFixedValue but than with a table for scalars:

Code:
inlet
{
    type    uniformFixedValue;
    uniformValue    table
    (
         (0 0.1)
         (3000 0.1)
         (3001 0.4)
         (4000 0.4)
         (4001 0.9)
         (5000 0.9)
    );
}
Note that those values are just made-up by me and you should modify them for your case.

Or like I said in my first reply use the turbulent inlet conditions based on intensity and mixingLength instead of tables.

Hope this helps.
Cheers,
Tom
tomf is offline   Reply With Quote

Reply

Tags
force, simplefoam, vehicle aerodynamics, velocity

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DEFINE_DPM_DRAG - fluid phase velocity correction tarjeivs Fluent UDF and Scheme Programming 0 March 20, 2021 07:25
atmBoundaryLayerInletVelocity - Velocity Profile not continuous through domain sdfij6354 OpenFOAM Running, Solving & CFD 3 July 26, 2017 17:16
Multiphase flow - incorrect velocity on inlet Mike_Tom CFX 6 September 29, 2016 02:27
Velocity in Porous medium : HELP! HELP! HELP! Kali Sanjay Phoenics 0 November 6, 2006 07:10
what the result is negatif pressure at inlet chong chee nan FLUENT 0 December 29, 2001 06:13


All times are GMT -4. The time now is 15:06.