diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C index 5bb0617b06..44a1a2c4f2 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,10 +94,23 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io) if (cellZoneName != "none") { - zoneID_ = cellZones().findZoneID(cellZoneName); Info<< "Applying solid body motion to cellZone " << cellZoneName << endl; + zoneID_ = cellZones().findZoneID(cellZoneName); + + if (zoneID_ == -1) + { + FatalErrorIn + ( + "solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject&)" + ) + << "Unable to find cellZone " << cellZoneName + << ". Valid celLZones are:" + << cellZones().names() + << exit(FatalError); + } + const cellZone& cz = cellZones()[zoneID_];