diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/AverageIOField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/AverageIOField.C index 2f079100a5..d0c312ff00 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/AverageIOField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/AverageIOField.C @@ -51,7 +51,7 @@ Foam::AverageIOField::AverageIOField : regIOobject(io), Field(size), - average_(0) + average_(pTraits::zero) {} diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C index f5d9a1a7c7..b89971b17f 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C @@ -45,13 +45,6 @@ void Foam::sixDoFRigidBodyMotion::applyRestraints() restraints_[rI].restrain(*this, rP, rF, rM); - if (report_) - { - Info<< "Restraint " << restraints_[rI].name() << ": " - << "force " << rF << " moment " << rM - << endl; - } - a() += rF/mass_; // Moments are returned in global axes, transforming to @@ -104,23 +97,6 @@ void Foam::sixDoFRigidBodyMotion::applyConstraints(scalar deltaT) allConverged = allConverged && constraintConverged; - if (report_) - { - Info<< "Constraint " << constraints_[cI].name() - << ": force " << cF << " moment " << cM; - - if (constraintConverged) - { - Info<< " - converged"; - } - else - { - Info<< " - not converged"; - } - - Info<< endl; - } - // Accumulate constraint force cFA += cF; diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedAxis/fixedAxis.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedAxis/fixedAxis.C index 02eb2eb307..9993dfcece 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedAxis/fixedAxis.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedAxis/fixedAxis.C @@ -119,7 +119,28 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedAxis::constrain constraintForceIncrement = vector::zero; - return (mag(theta) < tolerance_); + bool converged(mag(theta) < tolerance_); + + if (motion.report()) + { + Info<< "Constraint " << this->name() + << " angle " << theta + << " force " << constraintForceIncrement + << " moment " << constraintMomentIncrement; + + if (converged) + { + Info<< " converged"; + } + else + { + Info<< " not converged"; + } + + Info<< endl; + } + + return converged; } diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedLine/fixedLine.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedLine/fixedLine.C index b5cee9ecc2..635267a259 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedLine/fixedLine.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedLine/fixedLine.C @@ -105,7 +105,28 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedLine::constrain constraintMomentIncrement = vector::zero; - return (mag(error) < tolerance_); + bool converged(mag(error) < tolerance_); + + if (motion.report()) + { + Info<< "Constraint " << this->name() + << " error << " << error + << " force " << constraintForceIncrement + << " moment " << constraintMomentIncrement; + + if (converged) + { + Info<< " converged"; + } + else + { + Info<< " not converged"; + } + + Info<< endl; + } + + return converged; } diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedOrientation/fixedOrientation.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedOrientation/fixedOrientation.C index 4a15e3e549..74112ab3b4 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedOrientation/fixedOrientation.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedOrientation/fixedOrientation.C @@ -146,7 +146,28 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedOrientation::constrain constraintForceIncrement = vector::zero; - return (mag(maxTheta) < tolerance_); + bool converged(mag(maxTheta) < tolerance_); + + if (motion.report()) + { + Info<< "Constraint " << this->name() + << " max angle " << maxTheta + << " force " << constraintForceIncrement + << " moment " << constraintMomentIncrement; + + if (converged) + { + Info<< " converged"; + } + else + { + Info<< " not converged"; + } + + Info<< endl; + } + + return converged; } diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPlane/fixedPlane.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPlane/fixedPlane.C index fad22e7c13..6d5ba4962b 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPlane/fixedPlane.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPlane/fixedPlane.C @@ -105,7 +105,28 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedPlane::constrain constraintMomentIncrement = vector::zero; - return (mag(error) < tolerance_); + bool converged(mag(error) < tolerance_); + + if (motion.report()) + { + Info<< "Constraint " << this->name() + << " error " << error + << " force " << constraintForceIncrement + << " moment " << constraintMomentIncrement; + + if (converged) + { + Info<< " converged"; + } + else + { + Info<< " not converged"; + } + + Info<< endl; + } + + return converged; } diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPoint/fixedPoint.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPoint/fixedPoint.C index cfe8b5421d..5d03ab411f 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPoint/fixedPoint.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPoint/fixedPoint.C @@ -114,7 +114,28 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedPoint::constrain constraintMomentIncrement = vector::zero; - return (mag(error) < tolerance_); + bool converged(mag(error) < tolerance_); + + if (motion.report()) + { + Info<< "Constraint " << this->name() + << " error " << error + << " force " << constraintForceIncrement + << " moment " << constraintMomentIncrement; + + if (converged) + { + Info<< " converged"; + } + else + { + Info<< " not converged"; + } + + Info<< endl; + } + + return converged; } diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearAxialAngularSpring/linearAxialAngularSpring.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearAxialAngularSpring/linearAxialAngularSpring.C index 373d2ea7d8..5aa198f2b7 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearAxialAngularSpring/linearAxialAngularSpring.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearAxialAngularSpring/linearAxialAngularSpring.C @@ -133,6 +133,15 @@ Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::restrain // Not needed to be altered as restraintForce is zero, but set to // centreOfMass to be sure of no spurious moment restraintPosition = motion.centreOfMass(); + + if (motion.report()) + { + Info<< "Restraint " << this->name() + << " angle " << theta + << " force " << restraintForce + << " moment " << restraintMoment + << endl; + } } diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearSpring/linearSpring.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearSpring/linearSpring.C index 966e911c6e..8067233e1c 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearSpring/linearSpring.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearSpring/linearSpring.C @@ -93,6 +93,15 @@ void Foam::sixDoFRigidBodyMotionRestraints::linearSpring::restrain restraintForce = -stiffness_*(magR - restLength_)*r - damping_*(r & v)*r; restraintMoment = vector::zero; + + if (motion.report()) + { + Info<< "Restraint " << this->name() + << " spring length " << magR + << " force " << restraintForce + << " moment " << restraintMoment + << endl; + } } diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sphericalAngularSpring/sphericalAngularSpring.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sphericalAngularSpring/sphericalAngularSpring.C index af11dcb421..a961e5591a 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sphericalAngularSpring/sphericalAngularSpring.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sphericalAngularSpring/sphericalAngularSpring.C @@ -110,6 +110,14 @@ Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularSpring::restrain // Not needed to be altered as restraintForce is zero, but set to // centreOfMass to be sure of no spurious moment restraintPosition = motion.centreOfMass(); + + if (motion.report()) + { + Info<< "Restraint " << this->name() + << " force " << restraintForce + << " moment " << restraintMoment + << endl; + } } diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C index c1609e9df3..159419d44a 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C @@ -133,6 +133,15 @@ Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::restrain // Not needed to be altered as restraintForce is zero, but set to // centreOfMass to be sure of no spurious moment restraintPosition = motion.centreOfMass(); + + if (motion.report()) + { + Info<< "Restraint " << this->name() + << " angle " << theta + << " force " << restraintForce + << " moment " << restraintMoment + << endl; + } } diff --git a/src/randomProcesses/fft/kShellIntegration.C b/src/randomProcesses/fft/kShellIntegration.C index 846de03802..9cfdcb8b95 100644 --- a/src/randomProcesses/fft/kShellIntegration.C +++ b/src/randomProcesses/fft/kShellIntegration.C @@ -29,12 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -graph kShellIntegration +Foam::graph Foam::kShellIntegration ( const complexVectorField& Ek, const Kmesh& K @@ -55,8 +50,8 @@ graph kShellIntegration // now scale this to get the energy in a box of side l0 - scalar l0(K.sizeOfBox()[0]*(scalar(K.nn()[0])/(scalar(K.nn()[0]) - 1.0))); - scalar factor = pow3(l0/constant::mathematical::twoPi); + scalar l0(K.sizeOfBox()[0]*(scalar(K.nn()[0])/(scalar(K.nn()[0])-1.0))); + scalar factor = pow((l0/(2.0*constant::mathematical::pi)),3.0); y *= factor; @@ -72,7 +67,7 @@ graph kShellIntegration // kShellMean : average over the points in a k-shell to evaluate the // radial part of the energy spectrum. -graph kShellMean +Foam::graph Foam::kShellMean ( const complexVectorField& Ek, const Kmesh& K @@ -136,13 +131,8 @@ graph kShellMean } } - return graph("E(k)", "k", "E(k)", Ek1D, k1D); + return graph("E(k)", "k", "E(k)", k1D, Ek1D); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // - diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/constant/dsmcProperties b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/constant/dsmcProperties index b912643d7d..71f793e9de 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/constant/dsmcProperties +++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/constant/dsmcProperties @@ -59,7 +59,6 @@ moleculeProperties mass 46.5e-27; diameter 4.17e-10; internalDegreesOfFreedom 2; - viscosityCoefficient 1.656e-5; omega 0.74; } @@ -68,7 +67,6 @@ moleculeProperties mass 53.12e-27; diameter 4.07e-10; internalDegreesOfFreedom 2; - viscosityCoefficient 1.919e-5; omega 0.77; } } diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/constant/dsmcProperties b/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/constant/dsmcProperties index f6c41d5c6f..273e2b2cbe 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/constant/dsmcProperties +++ b/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/constant/dsmcProperties @@ -69,7 +69,6 @@ moleculeProperties mass 46.5e-27; diameter 4.17e-10; internalDegreesOfFreedom 2; - viscosityCoefficient 1.656e-5; omega 0.74; } @@ -78,7 +77,6 @@ moleculeProperties mass 53.12e-27; diameter 4.07e-10; internalDegreesOfFreedom 2; - viscosityCoefficient 1.919e-5; omega 0.77; } } diff --git a/tutorials/discreteMethods/dsmcFoam/supersonicCorner/constant/dsmcProperties b/tutorials/discreteMethods/dsmcFoam/supersonicCorner/constant/dsmcProperties index 0b7f802209..6fd38ae2e6 100644 --- a/tutorials/discreteMethods/dsmcFoam/supersonicCorner/constant/dsmcProperties +++ b/tutorials/discreteMethods/dsmcFoam/supersonicCorner/constant/dsmcProperties @@ -80,7 +80,6 @@ moleculeProperties mass 66.3e-27; diameter 4.17e-10; internalDegreesOfFreedom 0; - viscosityCoefficient 2.117e-5; omega 0.81; } } diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/dsmcProperties b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/dsmcProperties index 1b010199f5..d338013dcc 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/dsmcProperties +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/dsmcProperties @@ -71,7 +71,6 @@ moleculeProperties mass 46.5e-27; diameter 4.17e-10; internalDegreesOfFreedom 2; - viscosityCoefficient 1.656e-5; omega 0.74; } @@ -80,7 +79,6 @@ moleculeProperties mass 53.12e-27; diameter 4.07e-10; internalDegreesOfFreedom 2; - viscosityCoefficient 1.919e-5; omega 0.77; } }