From 1878a019db4e2f803b63f9386d8e7b975a0a0721 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 1 May 2014 14:58:18 +0100 Subject: [PATCH] fvOptions: Support reading the fvOptions file from constant or system directories --- src/fvOptions/fvOptions/fvIOoptionList.C | 28 +++++++++++++++---- .../{system => constant}/fvOptions | 0 .../{system => constant}/fvOptions | 0 .../{system => constant}/fvOptions | 0 4 files changed, 22 insertions(+), 6 deletions(-) rename tutorials/multiphase/driftFluxFoam/ras/mixerVessel2D/{system => constant}/fvOptions (100%) rename tutorials/multiphase/interFoam/laminar/mixerVessel2D/{system => constant}/fvOptions (100%) rename tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/{system => constant}/fvOptions (100%) diff --git a/src/fvOptions/fvOptions/fvIOoptionList.C b/src/fvOptions/fvOptions/fvIOoptionList.C index 0a7ab4e6fc..45da968363 100644 --- a/src/fvOptions/fvOptions/fvIOoptionList.C +++ b/src/fvOptions/fvOptions/fvIOoptionList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,7 +37,7 @@ Foam::IOobject Foam::fv::IOoptionList::createIOobject IOobject io ( "fvOptions", - mesh.time().system(), + mesh.time().constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE @@ -45,7 +45,8 @@ Foam::IOobject Foam::fv::IOoptionList::createIOobject if (io.headerOk()) { - Info<< "Creating finite volume options from " << io.name() << nl + Info<< "Creating finite volume options from " + << io.instance()/io.name() << nl << endl; io.readOpt() = IOobject::MUST_READ_IF_MODIFIED; @@ -53,10 +54,25 @@ Foam::IOobject Foam::fv::IOoptionList::createIOobject } else { - Info<< "No finite volume options present" << nl << endl; + // Check if the fvOptions file is in system + io.instance() = mesh.time().system(); - io.readOpt() = IOobject::NO_READ; - return io; + if (io.headerOk()) + { + Info<< "Creating finite volume options from " + << io.instance()/io.name() << nl + << endl; + + io.readOpt() = IOobject::MUST_READ_IF_MODIFIED; + return io; + } + else + { + Info<< "No finite volume options present" << nl << endl; + + io.readOpt() = IOobject::NO_READ; + return io; + } } } diff --git a/tutorials/multiphase/driftFluxFoam/ras/mixerVessel2D/system/fvOptions b/tutorials/multiphase/driftFluxFoam/ras/mixerVessel2D/constant/fvOptions similarity index 100% rename from tutorials/multiphase/driftFluxFoam/ras/mixerVessel2D/system/fvOptions rename to tutorials/multiphase/driftFluxFoam/ras/mixerVessel2D/constant/fvOptions diff --git a/tutorials/multiphase/interFoam/laminar/mixerVessel2D/system/fvOptions b/tutorials/multiphase/interFoam/laminar/mixerVessel2D/constant/fvOptions similarity index 100% rename from tutorials/multiphase/interFoam/laminar/mixerVessel2D/system/fvOptions rename to tutorials/multiphase/interFoam/laminar/mixerVessel2D/constant/fvOptions diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/system/fvOptions b/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/constant/fvOptions similarity index 100% rename from tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/system/fvOptions rename to tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/constant/fvOptions