|
[Sponsors] |
March 18, 2022, 12:21 |
|
#21 | |
Member
Tony Zhang
Join Date: Nov 2019
Location: soton
Posts: 45
Rep Power: 7 |
Quote:
Many thanks for your reply. Basically, I want to plot the hull pitch angle and heave along with the simulation time. So from the logfile I have the following information: Code:
Courant Number mean: 0.00587552 max: 0.999287 Interface Courant Number mean: 2.52283e-05 max: 0.554831 deltaT = 0.000732041 Time = 11.5344 PIMPLE: Iteration 1 forces forces: Not including porosity effects Restraint translationDamper: force (-0 -0 -6.68788) Restraint rotationDamper: moment (-0 7.0894 -0) 6-DoF rigid body motion Centre of rotation: (1.86617 -4.84309e-07 0.15847) Centre of mass: (1.86617 -4.84309e-07 0.15847) Orientation: (0.999954 0 0.00954438 0 1 0 -0.00954438 0 0.999954) Linear velocity: (0 0 0.000927669) Angular velocity: (0 -0.000730012 0) GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.000796647, No Iterations 5 time step continuity errors : sum local = 1.35111e-11, global = 3.33221e-12, cumulative = 1.80929e-08 smoothSolver: Solving for alpha.water, Initial residual = 1.44068e-06, Final residual = 8.86336e-12, No Iterations 2 Phase-1 volume fraction = 0.536594 Min(alpha.water) = -7.72742e-21 Max(alpha.water) = 1 Applying the previous iteration compression flux MULES: Correcting alpha.water MULES: Correcting alpha.water MULES: Correcting alpha.water MULES: Correcting alpha.water Phase-1 volume fraction = 0.536594 Min(alpha.water) = -1.177e-09 Max(alpha.water) = 1 GAMG: Solving for p_rgh, Initial residual = 0.000313061, Final residual = 2.24666e-08, No Iterations 3 time step continuity errors : sum local = 5.17601e-11, global = -9.04222e-12, cumulative = 1.80839e-08 PIMPLE: Iteration 2 forces forces: Not including porosity effects Restraint translationDamper: force (-0 -0 -6.69499) Restraint rotationDamper: moment (-0 7.10083 -0) 6-DoF rigid body motion Centre of rotation: (1.86617 -4.84309e-07 0.15847) Centre of mass: (1.86617 -4.84309e-07 0.15847) Orientation: (0.999954 0 0.00954438 0 1 0 -0.00954438 0 0.999954) Linear velocity: (0 0 0.000927761) Angular velocity: (0 -0.000730041 0) GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.000546164, No Iterations 5 time step continuity errors : sum local = 9.445e-12, global = -3.36602e-12, cumulative = 1.80805e-08 smoothSolver: Solving for alpha.water, Initial residual = 1.43412e-06, Final residual = 8.81716e-12, No Iterations 2 Phase-1 volume fraction = 0.536594 Min(alpha.water) = -7.72727e-21 Max(alpha.water) = 1 Applying the previous iteration compression flux MULES: Correcting alpha.water MULES: Correcting alpha.water MULES: Correcting alpha.water MULES: Correcting alpha.water Phase-1 volume fraction = 0.536594 Min(alpha.water) = -1.32948e-09 Max(alpha.water) = 1 GAMG: Solving for p_rgh, Initial residual = 1.42924e-06, Final residual = 1.78075e-08, No Iterations 2 time step continuity errors : sum local = 4.10253e-11, global = 4.71189e-13, cumulative = 1.8081e-08 PIMPLE: Iteration 3 forces forces: Not including porosity effects Restraint translationDamper: force (-0 -0 -6.69565) Restraint rotationDamper: moment (-0 7.10111 -0) 6-DoF rigid body motion Centre of rotation: (1.86617 -4.84309e-07 0.15847) Centre of mass: (1.86617 -4.84309e-07 0.15847) Orientation: (0.999954 0 0.00954438 0 1 0 -0.00954438 0 0.999954) Linear velocity: (0 0 0.000927775) Angular velocity: (0 -0.000730046 0) GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.000765161, No Iterations 5 time step continuity errors : sum local = 1.29848e-11, global = 2.79613e-12, cumulative = 1.80838e-08 smoothSolver: Solving for alpha.water, Initial residual = 1.43408e-06, Final residual = 8.8173e-12, No Iterations 2 Phase-1 volume fraction = 0.536594 Min(alpha.water) = -7.72725e-21 Max(alpha.water) = 1 Applying the previous iteration compression flux MULES: Correcting alpha.water MULES: Correcting alpha.water MULES: Correcting alpha.water MULES: Correcting alpha.water Phase-1 volume fraction = 0.536594 Min(alpha.water) = -1.32747e-09 Max(alpha.water) = 1 GAMG: Solving for p_rgh, Initial residual = 1.32453e-07, Final residual = 2.10085e-08, No Iterations 1 time step continuity errors : sum local = 4.83998e-11, global = -9.64363e-12, cumulative = 1.80741e-08 PIMPLE: Iteration 4 forces forces: Not including porosity effects Restraint translationDamper: force (-0 -0 -6.69575) Restraint rotationDamper: moment (-0 7.10116 -0) 6-DoF rigid body motion Centre of rotation: (1.86617 -4.84309e-07 0.15847) Centre of mass: (1.86617 -4.84309e-07 0.15847) Orientation: (0.999954 0 0.00954438 0 1 0 -0.00954438 0 0.999954) Linear velocity: (0 0 0.000927777) Angular velocity: (0 -0.000730045 0) GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.000555095, No Iterations 5 time step continuity errors : sum local = 9.39265e-12, global = -3.4139e-12, cumulative = 1.80707e-08 smoothSolver: Solving for alpha.water, Initial residual = 1.43408e-06, Final residual = 8.81732e-12, No Iterations 2 Phase-1 volume fraction = 0.536594 Min(alpha.water) = -7.72725e-21 Max(alpha.water) = 1 Applying the previous iteration compression flux MULES: Correcting alpha.water MULES: Correcting alpha.water MULES: Correcting alpha.water MULES: Correcting alpha.water Phase-1 volume fraction = 0.536594 Min(alpha.water) = -1.32894e-09 Max(alpha.water) = 1 GAMG: Solving for p_rgh, Initial residual = 3.92688e-08, Final residual = 3.92688e-08, No Iterations 0 time step continuity errors : sum local = 9.04682e-11, global = -2.86723e-11, cumulative = 1.8042e-08 PIMPLE: Iteration 5 forces forces: Not including porosity effects Restraint translationDamper: force (-0 -0 -6.69576) Restraint rotationDamper: moment (-0 7.10115 -0) 6-DoF rigid body motion Centre of rotation: (1.86617 -4.84309e-07 0.15847) Centre of mass: (1.86617 -4.84309e-07 0.15847) Orientation: (0.999954 0 0.00954438 0 1 0 -0.00954438 0 0.999954) Linear velocity: (0 0 0.000927777) Angular velocity: (0 -0.000730045 0) GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.000764826, No Iterations 5 time step continuity errors : sum local = 1.29589e-11, global = 2.72512e-12, cumulative = 1.80448e-08 smoothSolver: Solving for alpha.water, Initial residual = 1.43408e-06, Final residual = 8.81733e-12, No Iterations 2 Phase-1 volume fraction = 0.536594 Min(alpha.water) = -7.72725e-21 Max(alpha.water) = 1 Applying the previous iteration compression flux MULES: Correcting alpha.water MULES: Correcting alpha.water MULES: Correcting alpha.water MULES: Correcting alpha.water Phase-1 volume fraction = 0.536594 Min(alpha.water) = -1.33009e-09 Max(alpha.water) = 1 GAMG: Solving for p_rgh, Initial residual = 4.06946e-08, Final residual = 4.06946e-08, No Iterations 0 time step continuity errors : sum local = 9.37529e-11, global = -2.87026e-11, cumulative = 1.80161e-08 smoothSolver: Solving for omega, Initial residual = 4.60429e-06, Final residual = 1.6717e-09, No Iterations 1 smoothSolver: Solving for k, Initial residual = 0.000148782, Final residual = 2.15968e-08, No Iterations 1 ExecutionTime = 114820 s ClockTime = 115202 s forces totForce write: sum of forces: pressure : (-4.81482 -0.0370846 2258.52) viscous : (-7.34272 0.00989957 -0.0580179) porous : (0 0 0) sum of moments: pressure : (0.00511215 3.71011 -0.115732) viscous : (0.00273009 1.46312 -0.0146114) porous : (0 0 0) I can use the script to extract the linear, angular velocities and orientation from the logfile, but since I have 3 nOuterCorrectors loops inside PIMPLE, so for each timestep, I have 3 linear, angular velocities and orientations, I am confused how to plot the pitch and heave along the simulation time. And for pitch angle, I think it should be the sin(pitch_angle) value from the third component of orientation (Orientation: (0.999954 0 0.00954438 0 1 0 -0.00954438 0 0.999954)). But for heave, I have no idea how to derive it. I have attached the pitch angle variation plot along the simulation time, please correct me if I am wrong. I will try your suggestion of adding function of sixDoFRigidBodyState in controlDict file. Many thanks and have a good weekend Tony |
||
March 18, 2022, 13:43 |
|
#22 |
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 21 |
The function object i listed should do just that. But learning awk is extremly helpful for linux and OpenFOAM postProcessing in general.
Hence this is extremly long and not the cleanest implementation, but hopefully readable und learnable. Put this inside an createPlot.sh file and execute it. Code:
#!/bin/sh awk '{ gsub(/[()]/,""); if ($0 ~ "Centre of rotation:") {corx=$4;cory=$5;corz=$6}; if ($0 ~ "Centre of mass:") {comx=$4;comy=$5;comz=$6}; if ($0 ~ "Linear velocity:") {velx=$3;vely=$4;velz=$5}; if ($1 == "Time") {currentTime=$3}; if ($0 ~ "ExecutionTime") { print currentTime,comy*sin(velz) } }' log.dat > resultForPlotting.dat And currently it prints those variables if it s in a line that has ExecutionTime in it. Hence at the end of a time step into a file resultForPlotting.dat. I'll leave it to you to figure out your formula. Awk can use sin cos etc (not in degrees but radians before you are searching for errors). Shouldn't the heave just be the centre of mass? |
|
September 19, 2022, 04:27 |
|
#23 |
New Member
Zhang zf.
Join Date: May 2022
Posts: 2
Rep Power: 0 |
hey guys,
I just wonder when the density = 1, if the value of mass is just the volume? |
|
September 19, 2022, 04:34 |
|
#24 | |
New Member
Zhang zf.
Join Date: May 2022
Posts: 2
Rep Power: 0 |
Quote:
hey guys, I just wonder when the density = 1, if the value of mass is just the volume? |
||
September 14, 2023, 01:23 |
|
#25 | |
New Member
Aero_Cats!
Join Date: Jul 2021
Location: Indonesia
Posts: 7
Rep Power: 5 |
Quote:
Hello I would like to ask to clarify my understanding. Suppose we want to simulate ship motion in heave and pitch movement for towing tank test validation. In towing tank experiment, the centre of rotation for pitch movement is being fixed at a point (not in ship's CG). Can the moment inertia resulted from surfaceInertia file.stl being used directly in the dynamicMeshDict.sixDoF or should the moment inertia transformed first from ship's CG to the rotation point? |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fatal error with rho in rigidBodyMotion! | monnda | OpenFOAM Running, Solving & CFD | 1 | November 3, 2023 10:39 |
Defining centre of mass/rotation in rigidBodyMotion solver | tok3rat0r | OpenFOAM Running, Solving & CFD | 1 | November 26, 2018 10:44 |
linearAxialAngularSpring restraint in rigidBodyMotion solver | jiadongw | OpenFOAM Running, Solving & CFD | 4 | August 13, 2018 22:33 |
Inertia in 6DOF | pabsandoval | FLUENT | 0 | March 13, 2013 19:06 |
Mass moment of inertia | Cluain | CFX | 4 | July 18, 2012 10:36 |