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

Adding fluid damping to linearSpring class (get access to drag coefficient)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 11, 2017, 04:40
Question Adding fluid damping to linearSpring class (get access to drag coefficient)
  #1
New Member
 
Join Date: Feb 2017
Posts: 4
Rep Power: 9
icab is on a distinguished road
Dear Foamers,

I need to implement fluid damping to the sixDoFRigidBodyMotionRestraints linearSpring class.
I copied, renamed and compiled the new class (linearSpringFluidDamping) and implemented most of the necessary code (worked fine).

However, I need to get access to the instantaneous drag coefficient Cd from forceCoeffs::write() during the calculation of the fluid damping.

So I created a new member function in forceCoeffs.C
Code:
double Foam::forceCoeffs::getCdrag()
{
    
    forcesMoments fm = forces::calcForcesMoment();

    scalar pDyn = 0.5*rhoRef_*magUInf_*magUInf_;

    vector totForce = fm.first().first() + fm.first().second();

    scalar dragForce = totForce & dragDir_;

    scalar Cd = dragForce/(Aref_*pDyn);

    return Cd;
}
which returns the drag coefficient (its basically the forceCoeffs::write() function).

How is it possible to get access to this (Foam::forceCoeffs::getCdrag()) function from within the void Foam::sixDoFRigidBodyMotionRestraints::linearSprin gFluidDamping::restrain function from my new class (linearSpringFluidDamping) where I calculate the fluid damping (I tried a lot, but I am not so familiar with C++)?

Kind regards,

icab
icab is offline   Reply With Quote

Reply


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
Multiphase heat transfer pkladisios CFX 8 June 7, 2016 01:41
error about adding Constant damping coefficient stickjohnson ANSYS 0 January 25, 2012 03:49
Two-Phase Buoyant Flow Issue Miguel Baritto CFX 4 August 31, 2006 12:02
How to apply negtive pressure to outlet bioman66 CFX 5 June 3, 2006 01:40
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 09:11


All times are GMT -4. The time now is 23:46.