MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Accumulator Class Reference

#include <hutils.h>

Inheritance diagram for Accumulator:
Collaboration diagram for Accumulator:

Public Member Functions

 Accumulator (unsigned int uL, const DofOwner *pD, HydraulicFluid *hf, const PressureNode *p1, doublereal St, doublereal start, doublereal As, doublereal A_pipe, doublereal ms, doublereal h_in, doublereal h_out, doublereal P0, doublereal Pmax, doublereal k, doublereal Wg, doublereal Kspr, doublereal force0, doublereal cs, doublereal cv, doublereal ca, flag fOut)
 
 ~Accumulator (void)
 
virtual HydraulicElem::Type GetHydraulicType (void) const
 
virtual std::ostream & Restart (std::ostream &out) const
 
virtual unsigned int iGetNumDof (void) const
 
virtual DofOrder::Order GetDofType (unsigned int i) const
 
virtual void WorkSpaceDim (integer *piNumRows, integer *piNumCols) const
 
VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
SubVectorHandlerAssRes (SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Output (OutputHandler &OH) const
 
virtual void SetValue (DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
 
virtual void GetConnectedNodes (std::vector< const Node * > &connectedNodes) const
 
- Public Member Functions inherited from Elem
 Elem (unsigned int uL, flag fOut)
 
virtual ~Elem (void)
 
virtual std::ostream & DescribeDof (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeDof (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual std::ostream & DescribeEq (std::ostream &out, const char *prefix="", bool bInitial=false) const
 
virtual void DescribeEq (std::vector< std::string > &desc, bool bInitial=false, int i=-1) const
 
virtual void AssMats (VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual bool bInverseDynamics (void) const
 
void SetInverseDynamicsFlags (unsigned uIDF)
 
unsigned GetInverseDynamicsFlags (void) const
 
bool bIsErgonomy (void) const
 
bool bIsRightHandSide (void) const
 
virtual VariableSubMatrixHandlerAssJac (VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
 
virtual SubVectorHandlerAssRes (SubVectorHandler &WorkVec, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr, const VectorHandler &XPrimePrimeCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
 
virtual int GetNumConnectedNodes (void) const
 
- Public Member Functions inherited from WithLabel
 WithLabel (unsigned int uL=0, const std::string &sN="")
 
virtual ~WithLabel (void)
 
void PutLabel (unsigned int uL)
 
void PutName (const std::string &sN)
 
unsigned int GetLabel (void) const
 
const std::string & GetName (void) const
 
- Public Member Functions inherited from SimulationEntity
 SimulationEntity (void)
 
virtual ~SimulationEntity (void)
 
virtual bool bIsValidIndex (unsigned int i) const
 
virtual DofOrder::Order GetEqType (unsigned int i) const
 
virtual HintParseHint (DataManager *pDM, const char *s) const
 
virtual void BeforePredict (VectorHandler &, VectorHandler &, VectorHandler &, VectorHandler &) const
 
virtual void AfterPredict (VectorHandler &X, VectorHandler &XP)
 
virtual void Update (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void DerivativesUpdate (const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
 
virtual void Update (const VectorHandler &XCurr, InverseDynamics::Order iOrder)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP)
 
virtual void AfterConvergence (const VectorHandler &X, const VectorHandler &XP, const VectorHandler &XPP)
 
virtual unsigned int iGetNumPrivData (void) const
 
virtual unsigned int iGetPrivDataIdx (const char *s) const
 
virtual doublereal dGetPrivData (unsigned int i) const
 
virtual std::ostream & OutputAppend (std::ostream &out) const
 
virtual void ReadInitialState (MBDynParser &HP)
 
- Public Member Functions inherited from ToBeOutput
 ToBeOutput (flag fOut=fDefaultOut)
 
virtual ~ToBeOutput (void)
 
virtual void OutputPrepare (OutputHandler &OH)
 
virtual void Output (OutputHandler &OH, const VectorHandler &X, const VectorHandler &XP) const
 
virtual flag fToBeOutput (void) const
 
virtual bool bToBeOutput (void) const
 
virtual void SetOutputFlag (flag f=flag(1))
 
- Public Member Functions inherited from HydraulicElem
 HydraulicElem (unsigned int uL, const DofOwner *pDO, HydraulicFluid *hf, flag fOut)
 
virtual ~HydraulicElem (void)
 
virtual Elem::Type GetElemType (void) const
 
- Public Member Functions inherited from ElemWithDofs
 ElemWithDofs (unsigned int uL, const DofOwner *pDO, flag fOut)
 
virtual ~ElemWithDofs (void)
 
- Public Member Functions inherited from DofOwnerOwner
 DofOwnerOwner (const DofOwner *pDO)
 
virtual ~DofOwnerOwner ()
 
virtual const DofOwnerpGetDofOwner (void) const
 
virtual integer iGetFirstIndex (void) const
 
virtual void SetInitialValue (VectorHandler &X)
 

Private Attributes

const PressureNodepNode1
 
doublereal stroke
 
doublereal start
 
doublereal area
 
doublereal area_pipe
 
doublereal mass
 
doublereal press0
 
doublereal press_max
 
doublereal Kappa
 
doublereal weight
 
doublereal spring
 
doublereal force0
 
doublereal h_in
 
doublereal h_out
 
doublereal h
 
doublereal density
 
doublereal s_min_gas
 
doublereal s_max
 
doublereal ratio2
 
doublereal c_spost
 
doublereal c_vel
 
doublereal c_acc
 
doublereal c1
 
doublereal c2
 
doublereal c3
 
doublereal c4
 
doublereal cf1
 
doublereal cf2
 
doublereal cf3
 
doublereal cf4
 
doublereal s
 
doublereal v
 
doublereal sp
 
doublereal vp
 
doublereal pgas
 
doublereal flow
 

Additional Inherited Members

- Public Types inherited from Elem
enum  Type {
  UNKNOWN = -1, AIRPROPERTIES = 0, INDUCEDVELOCITY, AUTOMATICSTRUCTURAL,
  GRAVITY, BODY, JOINT, JOINT_REGULARIZATION,
  BEAM, PLATE, FORCE, INERTIA,
  ELECTRICBULK, ELECTRIC, THERMAL, HYDRAULIC,
  BULK, LOADABLE, DRIVEN, EXTERNAL,
  AEROMODAL, AERODYNAMIC, GENEL, SOCKETSTREAM_OUTPUT,
  RTAI_OUTPUT = SOCKETSTREAM_OUTPUT, LASTELEMTYPE
}
 
- Public Types inherited from SimulationEntity
typedef std::vector< Hint * > Hints
 
- Public Types inherited from ToBeOutput
enum  { OUTPUT = 0x1U, OUTPUT_MASK = 0xFU, OUTPUT_PRIVATE = 0x10U, OUTPUT_PRIVATE_MASK = ~OUTPUT_MASK }
 
- Public Types inherited from HydraulicElem
enum  Type {
  UNKNOWN = -1, MINOR_LOSS = 0, THREEWAYMINORLOSS, CONTROL_VALVE,
  DYNAMIC_CONTROL_VALVE, PRESSURE_FLOW_CONTROL_VALVE, PRESSURE_VALVE, FLOW_VALVE,
  ORIFICE, ACCUMULATOR, TANK, PIPE,
  DYNAMIC_PIPE, HYDRAULIC_ACTUATOR, ACTUATOR, LASTHYDRAULICTYPE
}
 
- Protected Attributes inherited from WithLabel
unsigned int uLabel
 
std::string sName
 
- Protected Attributes inherited from ToBeOutput
flag fOutput
 
- Protected Attributes inherited from HydraulicElem
HydraulicFluidHF
 

Detailed Description

Definition at line 44 of file hutils.h.

Constructor & Destructor Documentation

Accumulator::Accumulator ( unsigned int  uL,
const DofOwner pD,
HydraulicFluid hf,
const PressureNode p1,
doublereal  St,
doublereal  start,
doublereal  As,
doublereal  A_pipe,
doublereal  ms,
doublereal  h_in,
doublereal  h_out,
doublereal  P0,
doublereal  Pmax,
doublereal  k,
doublereal  Wg,
doublereal  Kspr,
doublereal  force0,
doublereal  cs,
doublereal  cv,
doublereal  ca,
flag  fOut 
)

Definition at line 46 of file hutils.cc.

References area, area_pipe, ASSERT, PressureNode::GetNodeType(), Node::HYDRAULIC, Kappa, pNode1, grad::pow(), press0, press_max, ratio2, s_max, s_min_gas, and stroke.

56 : Elem(uL, fOut),
57 HydraulicElem(uL, pDO, hf, fOut),
58 pNode1(p1),
59 stroke(St), start(start), area(As), area_pipe(A_pipe), mass(ms),
60 press0(P0), press_max(Pmax),
61 Kappa(k), weight(Wg), spring(Kspr),force0(F0), h_in(h_in), h_out(h_out),
62 c_spost(cs), c_vel(cv), c_acc(ca)
63 {
64  ASSERT(pNode1 != NULL);
66  ASSERT(St > std::numeric_limits<doublereal>::epsilon());
67  ASSERT(As > std::numeric_limits<doublereal>::epsilon());
68  ASSERT(A_pipe > std::numeric_limits<doublereal>::epsilon());
69  ASSERT(ms > std::numeric_limits<doublereal>::epsilon());
70  ASSERT(P0 >= 0.);
71  ASSERT(Pmax >= 0.);
72  ASSERT(k >= 0.);
73  ASSERT(Wg >= 0.);
74  ASSERT(Kspr >= 0.);
75  ASSERT(F0 >= 0.);
76 
77  s_min_gas = 0.;
78 
79  if (Kappa > 0. && press_max > 0.) {
81  }
82 
83  s_max = .999*stroke-s_min_gas; /* ho messo 0.999 perchè se uso un accumulatore senza gas avrei un termine che va a +infinito */
84  ratio2 = area*area/(area_pipe*area_pipe); /* rapporto (area accumulatore/area tubo)^2 */
85 }
doublereal h_in
Definition: hutils.h:58
doublereal weight
Definition: hutils.h:55
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2961
doublereal press0
Definition: hutils.h:52
doublereal press_max
Definition: hutils.h:53
doublereal c_acc
Definition: hutils.h:69
doublereal spring
Definition: hutils.h:56
doublereal stroke
Definition: hutils.h:47
doublereal s_max
Definition: hutils.h:65
doublereal area
Definition: hutils.h:49
doublereal h_out
Definition: hutils.h:59
doublereal force0
Definition: hutils.h:57
HydraulicElem(unsigned int uL, const DofOwner *pDO, HydraulicFluid *hf, flag fOut)
Definition: preselem.cc:54
doublereal c_spost
Definition: hutils.h:67
doublereal s_min_gas
Definition: hutils.h:64
#define ASSERT(expression)
Definition: colamd.c:977
doublereal start
Definition: hutils.h:48
doublereal mass
Definition: hutils.h:51
virtual Node::Type GetNodeType(void) const
Definition: presnode.h:54
const PressureNode * pNode1
Definition: hutils.h:46
doublereal Kappa
Definition: hutils.h:54
Elem(unsigned int uL, flag fOut)
Definition: elem.cc:41
doublereal ratio2
Definition: hutils.h:66
doublereal area_pipe
Definition: hutils.h:50
doublereal c_vel
Definition: hutils.h:68

Here is the call graph for this function:

Accumulator::~Accumulator ( void  )

Definition at line 88 of file hutils.cc.

References NO_OP.

89 {
90  NO_OP;
91 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

VariableSubMatrixHandler & Accumulator::AssJac ( VariableSubMatrixHandler WorkMat,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 129 of file hutils.cc.

References area, c1, c2, c3, cf1, cf2, cf3, DEBUGCOUT, density, HydraulicFluid::dGetDensity(), grad::fabs(), h, HydraulicElem::HF, Node::iGetFirstColIndex(), DofOwnerOwner::iGetFirstIndex(), Node::iGetFirstRowIndex(), Kappa, mass, pNode1, grad::pow(), press0, FullSubMatrixHandler::PutCoef(), FullSubMatrixHandler::PutColIndex(), FullSubMatrixHandler::PutRowIndex(), ratio2, FullSubMatrixHandler::Resize(), s, s_max, VariableSubMatrixHandler::SetFull(), spring, stroke, v, and weight.

133 {
134  DEBUGCOUT("Entering Accumulator::AssJac()" << std::endl);
135 
136  FullSubMatrixHandler& WM = WorkMat.SetFull();
137  WM.Resize(3, 3);
138 
139  integer iNode1RowIndex = pNode1->iGetFirstRowIndex()+1;
140  integer iNode1ColIndex = pNode1->iGetFirstColIndex()+1;
141  integer iFirstIndex = iGetFirstIndex();
142 
143  WM.PutRowIndex(1, iNode1RowIndex);
144  WM.PutColIndex(1, iNode1ColIndex);
145  WM.PutRowIndex(2, iFirstIndex+1);
146  WM.PutColIndex(2, iFirstIndex+1);
147  WM.PutRowIndex(3, iFirstIndex+2);
148  WM.PutColIndex(3, iFirstIndex+2);
150 
151  /* unused? doublereal p1 = pNode1->dGetX(); */
152  s = XCurr(iFirstIndex+1); /* spostamento */
153  v = XCurr(iFirstIndex+2); /* velocita' */
154 
155  doublereal Jac11 = 0;
156  doublereal Jac12 = 0;
157  doublereal Jac13 = 0;
158  doublereal Jac21 = 0;
159  doublereal Jac22 = 0;
160  doublereal Jac23 = 0;
161  doublereal Jac31 = 0;
162  doublereal Jac32 = 0;
163  doublereal Jac33 = 0;
164 
165  if (s > s_max) {
166 #ifdef HYDR_DEVEL
167  DEBUGCOUT("AssJac(): ho superato la s_max: s" << s <<std::endl);
168 #endif
169  s = s_max;
170  } else if(s < 0.) {
171 #ifdef HYDR_DEVEL
172  DEBUGCOUT("AssJac(): sono negativo: s" << s <<std::endl);
173 #endif
174  s = 0.;
175  }
176 
177  Jac11 = 0.;
178  Jac12 = 0.;
179  Jac13 = -density*area*dCoef;
180 
181  Jac21 = area;
182  Jac22 = -press0*area*Kappa*dCoef*pow(stroke/(stroke-s), Kappa+1.)/stroke
183  -c1*dCoef-cf1*dCoef+dCoef*spring;
184  Jac23 = -mass-weight-h*density*area*ratio2*fabs(v)*dCoef
185  -c2*dCoef-c3-cf2*dCoef-cf3;
186 
187  Jac31 = 0.;
188  Jac32 = -1.;
189  Jac33 = dCoef;
190 
191 #ifdef HYDR_DEVEL
192  DEBUGCOUT("Jac11: " << Jac11 << std::endl);
193  DEBUGCOUT("Jac12: " << Jac12 << std::endl);
194  DEBUGCOUT("Jac13: " << Jac13 << std::endl);
195  DEBUGCOUT("Jac21: " << Jac21 << std::endl);
196  DEBUGCOUT("Jac22: " << Jac22 << std::endl);
197  DEBUGCOUT("Jac23: " << Jac23 << std::endl);
198  DEBUGCOUT("Jac31: " << Jac31 << std::endl);
199  DEBUGCOUT("Jac32: " << Jac32 << std::endl);
200  DEBUGCOUT("Jac33: " << Jac33 << std::endl);
201 #endif
202 
203  WM.PutCoef(1, 1, Jac11);
204  WM.PutCoef(1, 2, Jac12);
205  WM.PutCoef(1, 3, Jac13);
206  WM.PutCoef(2, 1, Jac21);
207  WM.PutCoef(2, 2, Jac22);
208  WM.PutCoef(2, 3, Jac23);
209  WM.PutCoef(3, 1, Jac31);
210  WM.PutCoef(3, 2, Jac32);
211  WM.PutCoef(3, 3, Jac33);
212 
213  return WorkMat;
214 }
doublereal cf1
Definition: hutils.h:74
doublereal s
Definition: hutils.h:79
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
doublereal weight
Definition: hutils.h:55
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2961
doublereal press0
Definition: hutils.h:52
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
doublereal spring
Definition: hutils.h:56
doublereal c2
Definition: hutils.h:71
doublereal stroke
Definition: hutils.h:47
void Resize(integer iNewRow, integer iNewCol)
Definition: submat.cc:138
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:672
doublereal s_max
Definition: hutils.h:65
doublereal h
Definition: hutils.h:60
doublereal area
Definition: hutils.h:49
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
Definition: gradient.h:2973
doublereal c3
Definition: hutils.h:72
virtual doublereal dGetDensity(void) const =0
doublereal v
Definition: hutils.h:80
HydraulicFluid * HF
Definition: preselem.h:79
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual integer iGetFirstRowIndex(void) const
Definition: node.cc:82
doublereal cf2
Definition: hutils.h:75
doublereal mass
Definition: hutils.h:51
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
doublereal density
Definition: hutils.h:61
doublereal cf3
Definition: hutils.h:76
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
const PressureNode * pNode1
Definition: hutils.h:46
doublereal Kappa
Definition: hutils.h:54
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
doublereal ratio2
Definition: hutils.h:66
doublereal c1
Definition: hutils.h:70
virtual integer iGetFirstColIndex(void) const
Definition: node.cc:88

Here is the call graph for this function:

SubVectorHandler & Accumulator::AssRes ( SubVectorHandler WorkVec,
doublereal  dCoef,
const VectorHandler XCurr,
const VectorHandler XPrimeCurr 
)
virtual

Implements Elem.

Definition at line 218 of file hutils.cc.

References area, area_pipe, c1, c2, c3, c4, c_acc, c_spost, c_vel, cf1, cf2, cf3, cf4, copysign(), DEBUGCOUT, density, HydraulicFluid::dGetDensity(), ScalarAlgebraicNode::dGetX(), flow, force0, h, h_in, h_out, HydraulicElem::HF, DofOwnerOwner::iGetFirstIndex(), Node::iGetFirstRowIndex(), Kappa, mass, pgas, pNode1, grad::pow(), press0, press_max, SubVectorHandler::PutItem(), ratio2, VectorHandler::Resize(), s, s_max, s_min_gas, sp, spring, stroke, v, vp, and weight.

222 {
223  DEBUGCOUT("Entering Accumulator::AssRes()" << std::endl);
224 
225  WorkVec.Resize(3);
226 
227  integer iNode1RowIndex = pNode1->iGetFirstRowIndex()+1;
228  integer iFirstIndex = iGetFirstIndex();
229 
230  doublereal p1 = pNode1->dGetX();
231  s = XCurr(iFirstIndex+1); /* spostamento */
232  v = XCurr(iFirstIndex+2); /* velocita' */
233  sp = XPrimeCurr(iFirstIndex+1); /* velocita' */
234  vp = XPrimeCurr(iFirstIndex+2); /* accelerazione */
235 
236  doublereal Res_1 = 0.;
237  doublereal Res_2 = 0.;
238  doublereal Res_3 = 0.;
239  pgas = 0.;
240  doublereal x0;
241  doublereal x0spring;
243 
244  x0 = (stroke*(pow(p1/press0, 1./Kappa)-1.))/pow(p1/press0, 1./Kappa);
245  x0spring = (p1*area-force0)/spring;
246 
247  if (s < 0.) {
248  c1 = c_spost;
249  if (sp < 0.) {
250  c2 = c_vel; /* ho v negativa devo smorzare */
251  } else {
252  c2 = 0.;
253  }
254 
255  if (vp < 0.) {
256  c3 = c_acc; /* ho acc negativa devo smorzare */
257  } else {
258  c3 = 0.;
259  }
260 
261  c4 = 0.;
262  } else {
263  c1 = 0.;
264  c2 = 0.;
265  c3 = 0.;
266  c4 = 0.;
267  }
268 
269  if (s > s_max) {
270  cf1 = c_spost;
271 
272  if (sp > 0.) {
273  cf2 = c_vel; /* ho v positiva devo smorzare */
274  } else {
275  cf2 = 0.;
276  }
277 
278  if (vp > 0.) {
279  cf3 = c_acc; /* ho acc positiva devo smorzare */
280  } else {
281  cf3 = 0.;
282  }
283 
284  cf4 = 0.;
285  } else {
286  cf1 = 0.;
287  cf2 = 0.;
288  cf3 = 0.;
289  cf4 = 0.;
290  }
291 
292  if (sp > 0.) {
293  h = h_in; /* perdita concentrata fluido entra nell'accumulatore */
294  } else {
295  h = h_out; /* perdita concentrata fluido esce dall'accumulatore */
296  }
297 
298  if (s > s_max) {
299  pgas = press_max;
300 #ifdef HYDR_DEVEL
301  DEBUGCOUT("AssJac(): ho superato la s_max: s " << s <<std::endl);
302 #endif
303  } else if (s < 0.) {
304  pgas = press0;
305 #ifdef HYDR_DEVEL
306  DEBUGCOUT("AssJac(): sono negativo: s " << s <<std::endl);
307 #endif
308  } else {
310  }
311 
312  Res_1 = density*v*area;
313  Res_2 = (mass+weight)*vp-p1*area+pgas*area+force0+spring*s
314  +copysign(h*.5*density*area*ratio2*pow(v, 2), v)+c1*s
315  +c2*sp+c3*vp+c4+cf1*(s-s_max)+cf2*sp+cf3*vp+cf4;
316  Res_3 = sp-v;
317 
318  flow = -Res_1; /* portata nodo 1 (per l'output) */
319 
320 #ifdef HYDR_DEVEL
321  DEBUGCOUT("x0: " << x0 << std::endl);
322  DEBUGCOUT("x0spring: " << x0spring << std::endl);
323  DEBUGCOUT("s: " << s << std::endl);
324  DEBUGCOUT("sp: " << sp << std::endl);
325  DEBUGCOUT("v: " << v << std::endl);
326  DEBUGCOUT("vp: " << vp << std::endl);
327  DEBUGCOUT("p1: " << p1 << std::endl);
328  DEBUGCOUT("pgas: " << pgas << std::endl);
329  DEBUGCOUT("smorzatore: "
330  << copysign(h*.5*density*area*ratio2*pow(v, 2), v) << std::endl);
331  DEBUGCOUT("stroke: " << stroke << std::endl);
332  DEBUGCOUT("area: " << area << std::endl);
333  DEBUGCOUT("area_pipe: " << area_pipe << std::endl);
334  DEBUGCOUT("mass: " << mass << std::endl);
335  DEBUGCOUT("press0: " << press0 << std::endl);
336  DEBUGCOUT("press_max: " << press_max << std::endl);
337  DEBUGCOUT("Kappa: " << Kappa << std::endl);
338  DEBUGCOUT("weight: " << weight << std::endl);
339  DEBUGCOUT("spring: " << spring << std::endl);
340  DEBUGCOUT("force0: " << force0 << std::endl);
341  DEBUGCOUT("s_min_gas: " << s_min_gas << std::endl);
342  DEBUGCOUT("s_max: " << s_max << std::endl);
343  DEBUGCOUT("c1: " << c1 << std::endl);
344  DEBUGCOUT("c2: " << c2 << std::endl);
345  DEBUGCOUT("c3: " << c3 << std::endl);
346  DEBUGCOUT("c4: " << c4 << std::endl);
347  DEBUGCOUT("cf1: " << cf1 << std::endl);
348  DEBUGCOUT("cf2: " << cf2 << std::endl);
349  DEBUGCOUT("cf3: " << cf3 << std::endl);
350  DEBUGCOUT("cf4: " << cf4 << std::endl);
351  DEBUGCOUT("-Res_1 (portata nodo1): " << -Res_1 << std::endl);
352  DEBUGCOUT("Res_2: " << Res_2 << std::endl);
353  DEBUGCOUT("Res_3: " << Res_3 << std::endl);
354 #endif
355 
356  WorkVec.PutItem(1, iNode1RowIndex, Res_1);
357  WorkVec.PutItem(2, iFirstIndex+1, Res_2);
358  WorkVec.PutItem(3, iFirstIndex+2, Res_3);
359 
360  return WorkVec;
361 }
doublereal h_in
Definition: hutils.h:58
doublereal cf1
Definition: hutils.h:74
doublereal s
Definition: hutils.h:79
doublereal weight
Definition: hutils.h:55
GradientExpression< BinaryExpr< FuncPow, LhsExpr, RhsExpr > > pow(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2961
doublereal press0
Definition: hutils.h:52
doublereal press_max
Definition: hutils.h:53
doublereal c_acc
Definition: hutils.h:69
doublereal spring
Definition: hutils.h:56
doublereal c2
Definition: hutils.h:71
doublereal stroke
Definition: hutils.h:47
doublereal s_max
Definition: hutils.h:65
doublereal h
Definition: hutils.h:60
doublereal area
Definition: hutils.h:49
virtual void PutItem(integer iSubRow, integer iRow, const doublereal &dCoef)
Definition: submat.h:1445
doublereal h_out
Definition: hutils.h:59
doublereal force0
Definition: hutils.h:57
doublereal c3
Definition: hutils.h:72
virtual doublereal dGetDensity(void) const =0
virtual const doublereal & dGetX(void) const
Definition: node.h:492
doublereal v
Definition: hutils.h:80
doublereal pgas
Definition: hutils.h:83
HydraulicFluid * HF
Definition: preselem.h:79
doublereal c4
Definition: hutils.h:73
doublereal vp
Definition: hutils.h:82
doublereal copysign(doublereal x, doublereal y)
Definition: gradient.h:97
#define DEBUGCOUT(msg)
Definition: myassert.h:232
doublereal sp
Definition: hutils.h:81
virtual integer iGetFirstRowIndex(void) const
Definition: node.cc:82
doublereal c_spost
Definition: hutils.h:67
doublereal s_min_gas
Definition: hutils.h:64
doublereal cf2
Definition: hutils.h:75
doublereal mass
Definition: hutils.h:51
doublereal density
Definition: hutils.h:61
doublereal cf3
Definition: hutils.h:76
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
const PressureNode * pNode1
Definition: hutils.h:46
doublereal Kappa
Definition: hutils.h:54
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
doublereal flow
Definition: hutils.h:84
doublereal ratio2
Definition: hutils.h:66
doublereal c1
Definition: hutils.h:70
doublereal area_pipe
Definition: hutils.h:50
doublereal cf4
Definition: hutils.h:77
doublereal c_vel
Definition: hutils.h:68
virtual void Resize(integer iNewSize)=0

Here is the call graph for this function:

virtual void Accumulator::GetConnectedNodes ( std::vector< const Node * > &  connectedNodes) const
inlinevirtual

Reimplemented from Elem.

Definition at line 127 of file hutils.h.

References pNode1.

127  {
128  connectedNodes.resize(1);
129  connectedNodes[0] = pNode1;
130  };
const PressureNode * pNode1
Definition: hutils.h:46
DofOrder::Order Accumulator::GetDofType ( unsigned int  i) const
virtual

Reimplemented from Elem.

Definition at line 115 of file hutils.cc.

References ASSERT, and DofOrder::DIFFERENTIAL.

116 {
117  ASSERT(i >= 0 && i <= 1);
118  return DofOrder::DIFFERENTIAL;
119 }
#define ASSERT(expression)
Definition: colamd.c:977
HydraulicElem::Type Accumulator::GetHydraulicType ( void  ) const
virtual

Implements HydraulicElem.

Definition at line 95 of file hutils.cc.

References HydraulicElem::ACCUMULATOR.

unsigned int Accumulator::iGetNumDof ( void  ) const
virtual

Reimplemented from Elem.

Definition at line 109 of file hutils.cc.

110 {
111  return 2;
112 }
void Accumulator::Output ( OutputHandler OH) const
virtual

Reimplemented from ToBeOutput.

Definition at line 365 of file hutils.cc.

References ToBeOutput::bToBeOutput(), density, flow, WithLabel::GetLabel(), OutputHandler::Hydraulic(), pgas, s, v, and vp.

366 {
367  if (bToBeOutput()) {
368  std::ostream& out = OH.Hydraulic();
369  out << std::setw(8) << GetLabel()
370  << " " << s << " " << v << " " << vp << " " << pgas
371  << " " << flow << " " << density << std::endl;
372  }
373 }
doublereal s
Definition: hutils.h:79
virtual bool bToBeOutput(void) const
Definition: output.cc:890
doublereal v
Definition: hutils.h:80
doublereal pgas
Definition: hutils.h:83
doublereal vp
Definition: hutils.h:82
doublereal density
Definition: hutils.h:61
std::ostream & Hydraulic(void) const
Definition: output.h:492
doublereal flow
Definition: hutils.h:84
unsigned int GetLabel(void) const
Definition: withlab.cc:62

Here is the call graph for this function:

std::ostream & Accumulator::Restart ( std::ostream &  out) const
virtual

Implements Elem.

Definition at line 102 of file hutils.cc.

103 {
104  return out << " Accumulator not implemented yet!" << std::endl;
105 }
void Accumulator::SetValue ( DataManager pDM,
VectorHandler X,
VectorHandler XP,
SimulationEntity::Hints ph = 0 
)
virtual

Reimplemented from SimulationEntity.

Definition at line 376 of file hutils.cc.

References DofOwnerOwner::iGetFirstIndex(), VectorHandler::PutCoef(), and start.

379 {
380  integer i = iGetFirstIndex();
381 
382  X.PutCoef(i+1, start);
383  X.PutCoef(i+2, 0.);
384  XP.PutCoef(i+1, 0.);
385  XP.PutCoef(i+2, 0.);
386 }
virtual void PutCoef(integer iRow, const doublereal &dCoef)=0
doublereal start
Definition: hutils.h:48
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

void Accumulator::WorkSpaceDim ( integer piNumRows,
integer piNumCols 
) const
virtual

Implements Elem.

Definition at line 122 of file hutils.cc.

123 {
124  *piNumRows = 3;
125  *piNumCols = 3;
126 }

Member Data Documentation

doublereal Accumulator::area
private

Definition at line 49 of file hutils.h.

Referenced by Accumulator(), AssJac(), and AssRes().

doublereal Accumulator::area_pipe
private

Definition at line 50 of file hutils.h.

Referenced by Accumulator(), and AssRes().

doublereal Accumulator::c1
private

Definition at line 70 of file hutils.h.

Referenced by AssJac(), and AssRes().

doublereal Accumulator::c2
private

Definition at line 71 of file hutils.h.

Referenced by AssJac(), and AssRes().

doublereal Accumulator::c3
private

Definition at line 72 of file hutils.h.

Referenced by AssJac(), and AssRes().

doublereal Accumulator::c4
private

Definition at line 73 of file hutils.h.

Referenced by AssRes().

doublereal Accumulator::c_acc
private

Definition at line 69 of file hutils.h.

Referenced by AssRes().

doublereal Accumulator::c_spost
private

Definition at line 67 of file hutils.h.

Referenced by AssRes().

doublereal Accumulator::c_vel
private

Definition at line 68 of file hutils.h.

Referenced by AssRes().

doublereal Accumulator::cf1
private

Definition at line 74 of file hutils.h.

Referenced by AssJac(), and AssRes().

doublereal Accumulator::cf2
private

Definition at line 75 of file hutils.h.

Referenced by AssJac(), and AssRes().

doublereal Accumulator::cf3
private

Definition at line 76 of file hutils.h.

Referenced by AssJac(), and AssRes().

doublereal Accumulator::cf4
private

Definition at line 77 of file hutils.h.

Referenced by AssRes().

doublereal Accumulator::density
private

Definition at line 61 of file hutils.h.

Referenced by AssJac(), AssRes(), and Output().

doublereal Accumulator::flow
private

Definition at line 84 of file hutils.h.

Referenced by AssRes(), and Output().

doublereal Accumulator::force0
private

Definition at line 57 of file hutils.h.

Referenced by AssRes().

doublereal Accumulator::h
private

Definition at line 60 of file hutils.h.

Referenced by AssJac(), and AssRes().

doublereal Accumulator::h_in
private

Definition at line 58 of file hutils.h.

Referenced by AssRes().

doublereal Accumulator::h_out
private

Definition at line 59 of file hutils.h.

Referenced by AssRes().

doublereal Accumulator::Kappa
private

Definition at line 54 of file hutils.h.

Referenced by Accumulator(), AssJac(), and AssRes().

doublereal Accumulator::mass
private

Definition at line 51 of file hutils.h.

Referenced by AssJac(), and AssRes().

doublereal Accumulator::pgas
private

Definition at line 83 of file hutils.h.

Referenced by AssRes(), and Output().

const PressureNode* Accumulator::pNode1
private

Definition at line 46 of file hutils.h.

Referenced by Accumulator(), AssJac(), AssRes(), and GetConnectedNodes().

doublereal Accumulator::press0
private

Definition at line 52 of file hutils.h.

Referenced by Accumulator(), AssJac(), and AssRes().

doublereal Accumulator::press_max
private

Definition at line 53 of file hutils.h.

Referenced by Accumulator(), and AssRes().

doublereal Accumulator::ratio2
private

Definition at line 66 of file hutils.h.

Referenced by Accumulator(), AssJac(), and AssRes().

doublereal Accumulator::s
private

Definition at line 79 of file hutils.h.

Referenced by AssJac(), AssRes(), and Output().

doublereal Accumulator::s_max
private

Definition at line 65 of file hutils.h.

Referenced by Accumulator(), AssJac(), and AssRes().

doublereal Accumulator::s_min_gas
private

Definition at line 64 of file hutils.h.

Referenced by Accumulator(), and AssRes().

doublereal Accumulator::sp
private

Definition at line 81 of file hutils.h.

Referenced by AssRes().

doublereal Accumulator::spring
private

Definition at line 56 of file hutils.h.

Referenced by AssJac(), and AssRes().

doublereal Accumulator::start
private

Definition at line 48 of file hutils.h.

Referenced by SetValue().

doublereal Accumulator::stroke
private

Definition at line 47 of file hutils.h.

Referenced by Accumulator(), AssJac(), and AssRes().

doublereal Accumulator::v
private

Definition at line 80 of file hutils.h.

Referenced by AssJac(), AssRes(), and Output().

doublereal Accumulator::vp
private

Definition at line 82 of file hutils.h.

Referenced by AssRes(), and Output().

doublereal Accumulator::weight
private

Definition at line 55 of file hutils.h.

Referenced by AssJac(), and AssRes().


The documentation for this class was generated from the following files: