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

Calculation of rotational equation of motion using DPMFoam

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

Like Tree8Likes
  • 1 Post By ansubru
  • 6 Post By wyldckat
  • 1 Post By ansubru

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 15, 2014, 09:46
Default Calculation of rotational equation of motion using DPMFoam
  #1
Member
 
Ananda Kannan
Join Date: Feb 2014
Location: Göteborg, Sweden
Posts: 55
Rep Power: 12
ansubru is on a distinguished road
Hi all!!

I am working on the goldschmidt fluidized bed tutorial and realized that the torques generated by the case were below so called 'machine precision' i.e very low. Could anyone give me some insight into why the torques and corresponding angular momentum are so low?? (they are of the order 10^-8)

Moreover, by looking through pairspringsliderdashpot.C I was able to infer that tangential contact force and corresponding torque are calculated as follows -

Code:
vector USlip_AB =
            U_AB - (U_AB & rHat_AB)*rHat_AB
          + (pA.omega() ^ (dAEff/2*-rHat_AB))
          - (pB.omega() ^ (dBEff/2*rHat_AB));
......

// Tangential force
            vector fT_AB;

.....

 pA.torque() += (dAEff/2*-rHat_AB) ^ fT_AB;
            pB.torque() += (dBEff/2*rHat_AB) ^ -fT_AB;
Could someone tell me where and how this 'omega' is being calculated??

Additionally, i am quite aware that no rotational equation of motion being solved hence it is quite hard to determine the source of 'omega'.

Thanks

ansubru
maysmech likes this.
ansubru is offline   Reply With Quote

Old   November 1, 2014, 11:42
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,978
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi ansubru,

I moved this thread of yours to the programming sub-forum, because this is a programming-heavy question you're asking. The "heavy" part is that where this code is located, is in a template class, which means that it's just a conceptual implementation and that the real implementation depends on which class is used for the replacement definition of "CloudType". For more on this topic: http://www.cplusplus.com/doc/tutorial/templates/ - search for the section entitled "Class templates"

OK, the "pA" and "pB" variables are defined as follows:
Code:
template<class CloudType>
void Foam::PairSpringSliderDashpot<CloudType>::evaluatePair
(
    typename CloudType::parcelType& pA,
    typename CloudType::parcelType& pB
) const
which means that "parcelType" is the specific named type within the generic type definition "CloudType".

The trick is to now trail back where this template class "PairSpringSliderDashpot" is being implemented. A quick search lead me to the file "src/lagrangian/intermediate/parcels/include/makeParcelCollisionModels.H", where it lets us know that we should be looking for occurrences of "makeParcelCollisionModels".

By looking for occurrences, it lead me to only the one in the file "src/lagrangian/intermediate/parcels/derived/basicKinematicCollidingParcel/makeBasicKinematicCollidingParcelSubmodels.C", where it states that the "CloudType" to be used is "basicKinematicCollidingCloud".

Which in turn lead me to the file "src/lagrangian/intermediate/clouds/derived/basicKinematicCollidingCloud/basicKinematicCollidingCloud.H", which indicates that the actual definition of "basicKinematicCollidingCloud" is this:
Code:
namespace Foam
{
    typedef CollidingCloud
    <
        KinematicCloud
        <
            Cloud
            <
                basicKinematicCollidingParcel
            >
        >
    > basicKinematicCollidingCloud;
}
Wow... this is going to be messy... OK, in theory, the "parcelType" we're looking for should be defined on the first template layer "CollidingCloud". So let us look for the respective class file...

OK, the file where it's defined indicates that what were looking for is this:
Code:
typedef typename CloudType::particleType parcelType;
which means that we're actually looking for
Code:
KinematicCloud::particleType
The file we're now looking for is "src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H", which indicates this:
Code:
        typedef typename CloudType::particleType parcelType
Oh my... this means that we have to go even deeper... we're looking for
Code:
Cloud::particleType
It's in file "src/lagrangian/basic/Cloud/Cloud.H"... where is states that:
Code:
//...

template<class ParticleType>
class Cloud
:
    public cloud,
    public IDLList<ParticleType>

//...

typedef ParticleType particleType;

//...
It tells us that we're not there yet!
It tells us we're actually looking for "basicKinematicCollidingParcel". OK, more looking for the file where it's defined...

I've gotten to this file "src/lagrangian/intermediate/parcels/derived/basicKinematicCollidingParcel/basicKinematicCollidingParcel.H", where it states this:
Code:
    typedef CollidingParcel<KinematicParcel<particle> >
        basicKinematicCollidingParcel;
We are still not there yet!! By the way, I'm using the text editor Kate (part of KDE) for helping me look for these files.

Alrighty... we now have to keep in mind that we have a new template combo to look for, namely "CollidingParcel<KinematicParcel<particle> >"...

  • "src/lagrangian/intermediate/parcels/Templates/CollidingParcel/CollidingParcel.H":
    Code:
    template<class ParcelType>
    class CollidingParcel
    :
        public ParcelType
    • "src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H"
      Code:
      template<class ParcelType>
      class KinematicParcel
      :
          public ParcelType
      • "src/lagrangian/basic/particle/particle.H"
        Code:
        class particle
        :
            public IDLList<particle>::link
        OK, this is as far as I go, because this is essentially a list handling mechanism, so we won't dwell on more details.
OK, this template structure is essential for figuring out how on Earth is "omega()" being calculated. It first appears in the template class "CollidingParcel", which defines "omega()" like this:
Code:
template<class ParcelType>
inline Foam::vector Foam::CollidingParcel<ParcelType>::omega() const
{
    return angularMomentum_/this->momentOfInertia();
}
OK... more stuff to look for:
  • The variable "angularMomentum_" lets us know that this is something defined here on this template class "CollidingParcel". So it's just a matter at looking for where it's used.
  • "momentOfInertia()" is a method, very likely defined in one of the other two classes.
    • It's defined in "KinematicParcel", as this:
      Code:
      template<class ParcelType>
      inline Foam::scalar Foam::KinematicParcel<ParcelType>::momentOfInertia() const
      {
          return 0.1*mass()*sqr(d_);
      }
      • "d_" is a local variable in this template class.
      • "mass()" is another method. Most likely, it's defined in "particle".
        • Nope, it's defined on the same template class "KinematicParcel":
          Code:
          template<class ParcelType>
          inline Foam::scalar Foam::KinematicParcel<ParcelType>::mass() const
          {
              return rho_*volume();
          }
          • "rho_" is another local variable within this template class "KinematicParcel".
          • "volume()" is a method here as well:
            Code:
            template<class ParcelType>
            inline Foam::scalar Foam::KinematicParcel<ParcelType>::volume() const
            {
                return volume(d_);
            }
            
            
            template<class ParcelType>
            inline Foam::scalar Foam::KinematicParcel<ParcelType>::volume(const scalar d)
            {
                return pi/6.0*pow3(d);
            }
OK, ever wondered why OpenFOAM is so complex? This is one of the reasons why!

I'll let the exercise of figuring out the full expression for "omega()" on your own!

Best regards,
Bruno
maysmech, jherb, Bana and 3 others like this.
__________________
wyldckat is offline   Reply With Quote

Old   November 1, 2014, 11:49
Default
  #3
Member
 
Ananda Kannan
Join Date: Feb 2014
Location: Göteborg, Sweden
Posts: 55
Rep Power: 12
ansubru is on a distinguished road
Omg... Unbelievable... M truly in ur debt..... I had actually looked at each of those files you looked at, but I really couldn't figure it out... Guess that's why you are the openfoam god :P... Thank you so much for answering that....

BR
Ananda
ansubru is offline   Reply With Quote

Old   November 1, 2014, 11:56
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,978
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by ansubru View Post
Guess that's why you are the openfoam god :P...
Nope, I'm just a mere mortal that likes to study OpenFOAM through helping others
wyldckat is offline   Reply With Quote

Old   November 1, 2014, 11:57
Default
  #5
Member
 
Ananda Kannan
Join Date: Feb 2014
Location: Göteborg, Sweden
Posts: 55
Rep Power: 12
ansubru is on a distinguished road
Well ur expertise is helping a lot of guys in this forum... Thank you. ...
wyldckat likes this.
ansubru is offline   Reply With Quote

Reply

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
Calculation of motion continuity error sasanghomi OpenFOAM Programming & Development 2 March 12, 2016 16:15
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 06:27
Dynamic mesh motion based on calculation Detian Liu OpenFOAM Running, Solving & CFD 0 January 13, 2014 07:09
MRF and Heat transfer calculation Susan YU FLUENT 0 June 2, 2010 08:46
Warning 097- AB Siemens 6 November 15, 2004 04:41


All times are GMT -4. The time now is 07:37.