|
[Sponsors] |
May 7, 2012, 11:49 |
Using forces in other classes
|
#1 |
Senior Member
Join Date: Apr 2010
Posts: 151
Rep Power: 16 |
Hello,
I have a mesh motion class that works very well for prescribed motion. I would like to use this class to do rigid body displacements, under the influence of the fluid forces. I can also calculate the forces using the standard forces function. How can I take the results from this force calculation at each time step, and bring them into my mesh motion class for further use? |
|
May 8, 2012, 08:14 |
|
#2 |
Senior Member
David Boger
Join Date: Mar 2009
Location: Penn State Applied Research Laboratory
Posts: 146
Rep Power: 17 |
One way would be to instantiate a forces object from within your class and use the calcForcesMoment() method to get the forces and moments acting on your object.
__________________
David A. Boger |
|
May 8, 2012, 08:40 |
|
#3 |
Senior Member
Join Date: Apr 2010
Posts: 151
Rep Power: 16 |
Excellent! I saw that in the sixDoFRigidBodyDisplacement class, but was not sure if this was what I was looking for. I'll try and learn to use it.
Many thanks! |
|
May 8, 2012, 11:22 |
|
#4 |
Senior Member
Join Date: Apr 2010
Posts: 151
Rep Power: 16 |
Do you know more about objectRegistry? I am trying to instantiate a forces object, as you suggested:
Code:
dictionary forcesDict; forcesDict.add("patches", "block"); forcesDict.add("rhoName", "rhoInf"); forcesDict.add("rhoInf", 1000); vector centreOfMass_(0.0,0.0,0.0); forcesDict.add("CofR", centreOfMass_); forces f("forces", db(), forcesDict); |
|
June 5, 2012, 11:38 |
|
#5 |
Senior Member
Join Date: Apr 2010
Posts: 151
Rep Power: 16 |
Can anybody tell me how to instantiate a forces object in a new class, or give an example where it is done?
|
|
June 5, 2012, 13:56 |
|
#6 |
Senior Member
Join Date: Apr 2010
Posts: 151
Rep Power: 16 |
Simply writing
Code:
forces f("forces", db(), forcesDict); Code:
hppGgiFvMesh.C: In member function ‘void Foam::hppGgiFvMesh::getMoment()’: hppGgiFvMesh.C:358: error: reference to ‘db’ is ambiguous /home/jmatthei/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/IOobject.H:236: error: candidates are: const Foam::objectRegistry& Foam::IOobject::db() const /home/jmatthei/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/IOobject.H:236: error: const Foam::objectRegistry& Foam::IOobject::db() const /home/jmatthei/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/IOobject.H:236: error: const Foam::objectRegistry& Foam::IOobject::db() const hppGgiFvMesh.C:358: error: reference to ‘db’ is ambiguous /home/jmatthei/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/IOobject.H:236: error: candidates are: const Foam::objectRegistry& Foam::IOobject::db() const /home/jmatthei/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/IOobject.H:236: error: const Foam::objectRegistry& Foam::IOobject::db() const |
|
August 19, 2016, 11:32 |
|
#7 |
New Member
Brecht Devolder
Join Date: Oct 2014
Posts: 2
Rep Power: 0 |
Have you found a solution for this problem?
|
|
August 26, 2016, 12:57 |
|
#8 |
New Member
Giovanni Stabile
Join Date: Sep 2014
Location: Trieste (Italy) - Florence (Italy)
Posts: 14
Rep Power: 12 |
I have also the same problem
|
|
November 3, 2017, 13:41 |
|
#9 |
Senior Member
|
||
Tags |
forces, rigid body motions |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Reading forces from previous time step within solver | SD@TUB | OpenFOAM Programming & Development | 5 | April 24, 2023 12:51 |
how to get forces on Iso-Clip Surfaces and How to get forces in cylindrical coordinat | CFD XUE | FLUENT | 3 | March 18, 2015 04:28 |
forces in interFoam | Svensson | OpenFOAM Post-Processing | 2 | May 9, 2012 14:31 |
FORCES don't run! | C12Carbon | OpenFOAM | 0 | September 10, 2011 08:34 |
Valve Forces in CFdesign | Mike Clapp | Main CFD Forum | 3 | March 8, 2001 15:09 |