From df3a560d6da9d443ade5d0487a2c880fc6fee676 Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Wed, 19 Sep 2018 14:07:42 +0100 Subject: [PATCH] ENH: surfaceInertia: print info for use in RBD. See also #1014. --- .../surface/surfaceInertia/surfaceInertia.C | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/applications/utilities/surface/surfaceInertia/surfaceInertia.C b/applications/utilities/surface/surfaceInertia/surfaceInertia.C index ca7a361234f..ab2afeae5ad 100644 --- a/applications/utilities/surface/surfaceInertia/surfaceInertia.C +++ b/applications/utilities/surface/surfaceInertia/surfaceInertia.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -384,6 +384,26 @@ int main(int argc, char *argv[]) << " momentOfInertia " << eVal << token::END_STATEMENT << nl << " orientation " << eVec.T() << token::END_STATEMENT << endl; + + + // Get inertia as a symmetric tensor + const symmTensor st + ( + eVal.xx(), + eVal.xy(), + eVal.xz(), + eVal.yy(), + eVal.yz(), + eVal.zz() + ); + + Info<< nl + << "Entries for rigidBodyDynamics dynamicMeshDict:" + << nl + << " mass " << m << token::END_STATEMENT << nl + << " centreOfMass " << cM << token::END_STATEMENT << nl + << " inertia " << st << token::END_STATEMENT << nl + << endl; } if (calcAroundRefPt) -- GitLab