|
[Sponsors] |
July 15, 2014, 00:04 |
calculating work in sixDoFRigidBodyMotion
|
#1 |
Member
Join Date: Jul 2010
Posts: 55
Rep Power: 16 |
hi All,
I am doing a simulation of a restricted body in waves using OF2.3 and waves2foam. I am modifying the LinearSpring restriction to be able to calculate work done by the Spring. The total work is the sum of previous work and the current and it requires the length of the restraint in the past time. My problem is saving the previous length of my tether (restraint) and the work done till current time. To do so I am using State code. But when I compile my solver I get the following error: Code:
CETORigidBodyMotion/restraints/Tether/Tether.C: In member function ‘virtual void Foam::CETORigidBodyMotionRestraints::Tether::restrain(const Foam::CETORigidBodyMotion&, Foam::vector&, Foam::vector&, Foam::vector&, Foam::scalar&) const’: CETORigidBodyMotion/restraints/Tether/Tether.C:89:38: error: invalid initialization of reference of type ‘Foam::vector& {aka Foam::Vector<double>&}’ from expression of type ‘const vector {aka const Foam::Vector<double>}’ vector &oldR = tetherState_.oldR(); ^ CETORigidBodyMotion/restraints/Tether/Tether.C:90:40: error: invalid initialization of reference of type ‘Foam::scalar& {aka double&}’ from expression of type ‘const scalar {aka const double}’ scalar &power = tetherState_.power(); ^ CETORigidBodyMotion/restraints/Tether/Tether.C:91:38: error: invalid initialization of reference of type ‘Foam::scalar& {aka double&}’ from expression of type ‘const scalar {aka const double}’ scalar &work = tetherState_.work(); I would highly appreciate any comments as I am very new in programming in OpenFOAM. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Does CX_Interpret_String work in parallel? | 86lolo | Fluent UDF and Scheme Programming | 2 | June 30, 2014 05:36 |
Companies that lease software & hardware for cloud-based work? | Catthan | ANSYS | 0 | June 18, 2014 11:53 |
Do all CFD analysts have to do some hands-on work except PhDs? | e13drd | Main CFD Forum | 2 | March 17, 2014 15:56 |
Why do the Plant library cases don't work? | Alumna | Phoenics | 6 | June 22, 2004 13:08 |
why my In-Form doesn't work? | green | Phoenics | 2 | May 27, 2004 22:03 |