From 84aa391403c12f9185a3ea4d78db8a8ea24f7ad7 Mon Sep 17 00:00:00 2001
From: Andrew Heather <a.heather@opencfd.co.uk>
Date: Fri, 10 Feb 2017 13:57:36 +0000
Subject: [PATCH] BUG: noise - updated creation of control dictionary to allow
 -case option and env variables.  Fixes #402

---
 .../utilities/postProcessing/noise/noise.C    | 21 ++++++-------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/applications/utilities/postProcessing/noise/noise.C b/applications/utilities/postProcessing/noise/noise.C
index 88ef922589d..c872b1557ce 100644
--- a/applications/utilities/postProcessing/noise/noise.C
+++ b/applications/utilities/postProcessing/noise/noise.C
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
-     \\/     M anipulation  | Copyright (C) 2016 OpenCFD Ltd.
+     \\/     M anipulation  | Copyright (C) 2016-2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -106,21 +106,12 @@ int main(int argc, char *argv[])
     #include "setRootCase.H"
     #include "createTime.H"
 
-    fileName dictName(runTime.system()/"noiseDict");
-    if (args.optionFound("dict"))
-    {
-        dictName = args["dict"];
-    }
+    const word dictName("noiseDict");
+    #include "setSystemRunTimeDictionaryIO.H"
+
+    Info<< "Reading " << dictName << "\n" << endl;
 
-    IOdictionary dict
-    (
-        IOobject
-        (
-            dictName.expand(),
-            runTime,
-            IOobject::MUST_READ
-        )
-    );
+    IOdictionary dict(dictIO);
 
     autoPtr<noiseModel> model(noiseModel::New(dict));
     model->calculate();
-- 
GitLab