|
[Sponsors] |
Changing the initial Omega value in sixDoFRigidBodyMotionI.H |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 13, 2019, 03:52 |
Changing the initial Omega value in sixDoFRigidBodyMotionI.H
|
#1 |
Member
Ilan
Join Date: Dec 2018
Posts: 52
Rep Power: 7 |
Hey Foamers,
I need your help : I am stuck for few days now : I am trying to impose an initial angular speed in my simulation using sidDoFRigidBody. I don't want to modify the physics behind equations. This variable is representing the angular velocity in sixDoFRigidBodyMotionI.H : Code:
inline Foam::vector Foam::sixDoFRigidBodyMotion::omega() const { return Q() & (inv(momentOfInertia_) & pi()); } Do someone has any idea to add for exemple this vector to omega (0 0 50) ? Thanks a lot. Best regards, Magi |
|
February 13, 2019, 05:40 |
|
#2 | |
Senior Member
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 12 |
Quote:
Code:
inline Foam::tensor& Foam::sixDoFRigidBodyMotion::Q() { return motionState_.Q(); } I'm not sure what it means actually, I'd have to dig deeper and the problem I'm seeing is how would you add that vector to a tensor even if you just simply tried something like adding them, and also making physical sense. I guess the diagonals of a tensor are the coordinates x,y,z? So that might be it? momentOfInertia_ is probably a tensor as well. |
||
February 13, 2019, 05:57 |
|
#3 |
Member
Ilan
Join Date: Dec 2018
Posts: 52
Rep Power: 7 |
Hello,
Q_ is the orientation matrice. I do not know exactly what it is but openFoam documentation recommand to get it using the surfaceInertia function. So I guess it is a geometry dependant parameter. Changing it is not really an option. momentOfInertia could be a tensor, but its description is also geometry related... Isn't it possible to initialize omega too (0 0 50) and then to use this formula without touching it? Thanks ! |
|
February 13, 2019, 07:30 |
|
#4 | |
Senior Member
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 12 |
Quote:
Here's you constructor initializer list Code:
Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion ( const dictionary& dict, const dictionary& stateDict ) : motionState_(stateDict), motionState0_(), restraints_(), constraints_(), tConstraints_(tensor::I), rConstraints_(tensor::I), initialCentreOfMass_ ( dict.lookupOrDefault ( "initialCentreOfMass", vector(dict.lookup("centreOfMass")) ) ), initialCentreOfRotation_(initialCentreOfMass_), initialQ_ ( dict.lookupOrDefault ( "initialOrientation", dict.lookupOrDefault("orientation", tensor::I) ) ), mass_(readScalar(dict.lookup("mass"))), momentOfInertia_(dict.lookup("momentOfInertia")), aRelax_(dict.lookupOrDefault<scalar>("accelerationRelaxation", 1.0)), aDamp_(dict.lookupOrDefault<scalar>("accelerationDamping", 1.0)), report_(dict.lookupOrDefault<Switch>("report", false)), solver_(sixDoFSolver::New(dict.subDict("solver"), *this)) In order to get omega(0 0 50) from that perspective is to somehow initialize the variables that are looked up in those dictionary files so that the initial state of omega is that. That's probably the best case scenario without pulling hairs trying to find a needle in a haystack going through lines of code and seeing what each line does to calculate omega and then changing that code flow to initialize omega. Or I could be wrong and there is a solution but I'm not seeing it. EDIT: Here's another initializer list Code:
Foam::sixDoFRigidBodyMotionState::sixDoFRigidBodyMotionState ( const dictionary& dict ) : centreOfRotation_ ( dict.lookupOrDefault ( "centreOfRotation", dict.lookupOrDefault("centreOfMass", vector::zero) ) ), Q_(dict.lookupOrDefault("orientation", tensor::I)), v_(dict.lookupOrDefault("velocity", vector::zero)), a_(dict.lookupOrDefault("acceleration", vector::zero)), pi_(dict.lookupOrDefault("angularMomentum", vector::zero)), tau_(dict.lookupOrDefault("torque", vector::zero)) {} I'm not sure where this is (what dictionary file) pi_(dict.lookupOrDefault("angularMomentum", vector::zero)), but you could maybe do pi_(dict.lookupOrDefault("angularMomentum", omega (0 0 50))) //basically insert the vector there. |
||
February 13, 2019, 07:57 |
|
#5 | ||
Member
Ilan
Join Date: Dec 2018
Posts: 52
Rep Power: 7 |
Well, I really would like to do so, I already changed the moment of inertia to create an huge acceleration at the beginning... But all of these variables are called in other functions not related to omega and it change all the physics properties behind the calcul...
The only change I can do is on Q_ (orientation) but it also has an huge impact on the simulation : this is the rotation matrice. This is physicaly a non-sens to modify this. Only pi() could be change. I'll look into it but I think that it is time dependant, so potentially has an impact on each simulation steps. UP : pi() contains pi0() Quote:
Quote:
Moment of inertia only depend of the geometry. So omega is proportional to pi_. |
|||
February 13, 2019, 08:22 |
|
#6 | |
Senior Member
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 12 |
Quote:
Here's another interesting piece of code you should look at in sixDoFRigidBodyMotionSolver.C Code:
bool Foam::sixDoFRigidBodyMotionSolver::writeObject ( IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, const bool valid ) const { IOdictionary dict ( IOobject ( "sixDoFRigidBodyMotionState", mesh().time().timeName(), "uniform", mesh(), IOobject::NO_READ, IOobject::NO_WRITE, false ) ); motion_.state().write(dict); return dict.regIOobject::write(); } |
||
February 13, 2019, 08:23 |
|
#7 | |
Member
Ilan
Join Date: Dec 2018
Posts: 52
Rep Power: 7 |
Up.
My Bad. After adding this line in the dynMeshDict: Quote:
Thanks a lot |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Maximum number of iterations exceeded chtmultiregionsimpleFoam | Moncef | OpenFOAM Running, Solving & CFD | 28 | July 13, 2020 14:26 |
decompose dependent solution | arionfard | OpenFOAM | 3 | December 10, 2018 09:36 |
HeatSource BC to the whole region in chtMultiRegionHeater | xsa | OpenFOAM Running, Solving & CFD | 3 | November 7, 2016 05:07 |
Cannot run the code properly: very large time step continuity error | crst15 | OpenFOAM Running, Solving & CFD | 9 | December 14, 2014 18:17 |
Micro Scale Pore, icoFoam | gooya_kabir | OpenFOAM Running, Solving & CFD | 2 | November 2, 2013 13:58 |