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

codeStream - Break with constant torque: OFv2206

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 4, 2024, 18:52
Default codeStream - Break with constant torque: OFv2206
  #1
New Member
 
rubenparedes's Avatar
 
Ruben Paredes
Join Date: Mar 2009
Location: Guayaquil, Ecuador
Posts: 21
Rep Power: 17
rubenparedes is on a distinguished road
Send a message via MSN to rubenparedes
Hi,

I am simulating a marine turbine rotating due to incoming flow. I am trying to implement a break that applies a constant torque on a shaft using codeStream as a rigidBodyMotion restraint within a dynamicMeshDict. The sign of the torque depends only on the direction of rotation.

I tried to follow some codeStream examples without success.

Code:
restraints
{
    breakTorque
    {
        type        externalForce;
        
        body        Turbine;
        location    (1.0 0 0.11432977);
        
        force         #codeStream
        {
            codeInclude
            #{
//                #include "rigidBodyState.H"
                #include "rigidBodyMotion.H"
//                #include "rigidBodyMeshMotion.H"
            #};
            
            codeOptions
            #{
                -I$(LIB_SRC)/rigidBodyDynamics/lnInclude \
//                -I$(LIB_SRC)/rigidBodyMeshMotion/lnInclude
            #};

            codeLibs
            #{

                -lrigidBodyDynamics
 //               -lrigidBodyMeshMotion
            #};

            code
            #{                
               scalar omega = vCofR.w(v(0,Zero))[2]
               torque = 16.0 
                
                if (omega < 0)
                {
                    os  << (0 torque 0.0)
                }
                else
                {	
                    os  << (0 -torque 0.0)
                }
             #};
        };        
    }
}

Any suggestion will be appreciated.

Ruben
__________________
R.
rubenparedes 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
Chemical properties that are used in Fluent kimej FLUENT 4 August 19, 2011 12:29
How to install CGNS under windows xp? lzgwhy Main CFD Forum 1 January 11, 2011 19:44
CGNS lib and Fortran compiler manaliac Main CFD Forum 2 November 29, 2010 07:25
Really big problems when creating own materials da Jop FLUENT 0 June 28, 2007 12:15
net torque Mangnan CFX 3 June 2, 2004 15:00


All times are GMT -4. The time now is 12:14.