diff --git a/include/base/FoamInterface.h b/include/base/FoamInterface.h index 2ac56f28..15410643 100644 --- a/include/base/FoamInterface.h +++ b/include/base/FoamInterface.h @@ -2,9 +2,12 @@ #include -#include -#include +#include #include +#include +#include + +namespace fs = std::filesystem; /* * In theory the class through which all calls to the OpenFOAM "environment" are made @@ -78,6 +81,8 @@ class FoamInterface Foam::Time & getRuntime(); Foam::argList & getArglist(); Foam::fvMesh & getMesh(); + fs::path currentTimePath() const; + void readTime(const std::string & path); void write(); }; } diff --git a/include/base/FoamProblem.h b/include/base/FoamProblem.h index f0413f5a..f06fc5ac 100644 --- a/include/base/FoamProblem.h +++ b/include/base/FoamProblem.h @@ -30,6 +30,16 @@ class FoamProblem : public ExternalProblem virtual FoamMesh const & mesh() const override { return *_foam_mesh; } virtual FoamMesh & mesh() override { return *_foam_mesh; } + /** + * Save the current state of the OpenFOAM solve. + */ + void saveState(); + + /** + * Load the saved state of the OpenFOAM solve. + */ + void loadState(); + protected: FoamMesh * _foam_mesh = nullptr; Hippo::FoamInterface * _interface = nullptr; diff --git a/include/base/hippoApp.h b/include/base/hippoApp.h index 3cbd74ff..a6c0e2bc 100644 --- a/include/base/hippoApp.h +++ b/include/base/hippoApp.h @@ -1,12 +1,3 @@ -//* This file is part of the MOOSE framework -//* https://www.mooseframework.org -//* -//* All rights reserved, see COPYRIGHT for full restrictions -//* https://github.com/idaholab/moose/blob/master/COPYRIGHT -//* -//* Licensed under LGPL 2.1, please see LICENSE for details -//* https://www.gnu.org/licenses/lgpl-2.1.html - #pragma once #include @@ -21,4 +12,7 @@ class hippoApp : public MooseApp static void registerApps(); static void registerAll(Factory & f, ActionFactory & af, Syntax & s); + + void preBackup() override; + void postRestore(const bool /* for_restart */) override; }; diff --git a/src/base/FoamInterface.C b/src/base/FoamInterface.C index 71db9dea..4c47abff 100644 --- a/src/base/FoamInterface.C +++ b/src/base/FoamInterface.C @@ -134,6 +134,18 @@ FoamInterface::getArglist() return _impl->_args.args; } +fs::path +FoamInterface::currentTimePath() const +{ + return fs::path(_impl->_runtime.timePath()); +} + +void +FoamInterface::readTime(const std::string & path) +{ + getRuntime().read(); +} + void FoamInterface::write() { diff --git a/src/base/FoamProblem.C b/src/base/FoamProblem.C index 9bcbc0e2..8ea7d42b 100644 --- a/src/base/FoamProblem.C +++ b/src/base/FoamProblem.C @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -101,6 +102,29 @@ FoamProblem::externalSolve() { } +void +FoamProblem::saveState() +{ + _interface->write(); + _backup_foam_timestep_dir = _interface->currentTimePath().string(); + printf("saveState() -> %s", _backup_foam_timestep_dir.c_str()); +} + +void +FoamProblem::loadState() +{ + if (_backup_foam_timestep_dir.empty()) + { + mooseError("Cannot load OpenFOAM state: the backup state path is not set."); + } + if (!fs::is_directory(_backup_foam_timestep_dir)) + { + mooseError("Cannot load OpenFOAM state: the backup state path does not exist."); + } + printf("loadState() -> %s", _backup_foam_timestep_dir.c_str()); + _interface->readTime(_backup_foam_timestep_dir); +} + InputParameters BuoyantFoamProblem::validParams() { diff --git a/src/base/hippoApp.C b/src/base/hippoApp.C index 9a32c2d7..bc15b3cb 100644 --- a/src/base/hippoApp.C +++ b/src/base/hippoApp.C @@ -1,8 +1,12 @@ #include "hippoApp.h" -#include "Moose.h" -#include "AppFactory.h" -#include "ModulesApp.h" -#include "MooseSyntax.h" +#include "FoamProblem.h" + +#include +#include +#include +#include + +#include InputParameters hippoApp::validParams() @@ -38,6 +42,96 @@ hippoApp::registerApps() registerApp(hippoApp); } +void +hippoApp::preBackup() +{ + auto problem = reinterpret_cast(&feProblem()); + if (!problem) + { + mooseError("FoamProblem must be used with a Hippo App"); + } + printf("preBackup()\n"); + problem->saveState(); + + // auto problem = reinterpret_cast(&feProblem()); + // if (!problem) + // { + // mooseError("FoamProblem must be used with a Hippo App"); + // } + // auto * foam_interface = problem->mesh().getFoamInterface(); + // foam_interface->write(); + + // // std::string temp_dir = std::getenv("TMP"); + // // if (temp_dir.empty()) + // // { + // // temp_dir = "/tmp"; + // // } + + // auto backup_dir = fs::path("./backup"); + // if (!fs::is_directory(backup_dir)) + // { + // fs::create_directory(backup_dir); + // } + // auto time_path = foam_interface->currentTimePath(); + // auto backup_path = backup_dir / time_path.filename(); + // printf("backup %s -> %s\n", time_path.c_str(), backup_path.c_str()); + // fs::copy( + // time_path, backup_path, fs::copy_options::overwrite_existing | + // fs::copy_options::recursive); + + // // auto tid = parameters().get("_tid"); + // // THREAD_ID tid = processor_id(); + // // auto * app = + // // reinterpret_cast(AppFactory::instance().registeredObjects().at("hippoApp").get()); + // // std::vector vol_scalar_fields; + // // for (const auto & obj_name : app->feProblem()) + + // // _restartable_data[tid].addData(std::move(foam_data)); + // // printf("tid=%u\n", tid); + // // printf("_restartable_data.size()=%lu\n", _restartable_data.size()); + + // // // TODO: look at 'readCheckpoint' and 'writeCheckpoint' in precice adapter. + // // // OR: + // // // _interface->getMesh().writeObject( + // // // IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp, ) + // // } +} + +void +hippoApp::postRestore(const bool for_restart) +{ + auto problem = reinterpret_cast(&feProblem()); + if (!problem) + { + mooseError("FoamProblem must be used with a Hippo App"); + } + printf("postRestore()\n"); + problem->loadState(); + + // auto problem = reinterpret_cast(&feProblem()); + // if (!problem) + // { + // mooseError("FoamProblem must be used with a Hippo App"); + // } + // auto * foam_interface = problem->mesh().getFoamInterface(); + + // auto time_path = foam_interface->currentTimePath(); + // auto backup_dir = fs::path("./backup"); + // auto backup_path = backup_dir / time_path.filename(); + // if (!fs::is_directory(backup_path)) + // { + // return; + // } + // printf("restoring %s -> %s\n", backup_path.c_str(), time_path.c_str()); + // fs::copy( + // backup_path, time_path, fs::copy_options::overwrite_existing | + // fs::copy_options::recursive); + // foam_interface->readTime(""); + // // std::vector _; + // // foam_interface->getWallHeatFlux(_, 0); +} + /*************************************************************************************************** *********************** Dynamic Library Entry Points - DO NOT MODIFY ****************************** **************************************************************************************************/ diff --git a/test/tests/restart/restart_from_transient_serial/.gitignore b/test/tests/restart/restart_from_transient_serial/.gitignore new file mode 100644 index 00000000..6a78ae32 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/.gitignore @@ -0,0 +1,13 @@ +# Files generated by running the buoyantFoam tests +**/processor*/* +**/postProcessing/* +**/constant/polyMesh/* +**/buoyantCavity/[1-9]/* +**/buoyantCavity/[1-9][0-9]/* +*.blockMesh +*.buoyantFoam +*.createGraphs +*.postProcess.* + +# Files for displaying OpenFOAM meshes in paraview +**/buoyantCavity/*.foam diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/T b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/T new file mode 100644 index 00000000..d66e2ef8 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/T @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 293; + +boundaryField +{ + topAndBottom + { + type zeroGradient; + } + frontAndBack + { + type zeroGradient; + } + hot + { + type fixedValue; + value uniform 307.75; + } + cold + { + type fixedValue; + value uniform 288.15; + } +} + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/U b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/U new file mode 100644 index 00000000..5d3b392b --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/U @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volVectorField; + location "0"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + topAndBottom + { + type noSlip; + } + frontAndBack + { + type noSlip; + } + hot + { + type noSlip; + } + cold + { + type noSlip; + } +} + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/alphat b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/alphat new file mode 100644 index 00000000..51fc3869 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/alphat @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + topAndBottom + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } + frontAndBack + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } + hot + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } + cold + { + type compressible::alphatWallFunction; + Prt 0.85; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/epsilon b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/epsilon new file mode 100644 index 00000000..888eefc9 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/epsilon @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 4e-06; + +boundaryField +{ + frontAndBack + { + type epsilonWallFunction; + value uniform 4e-06; + } + topAndBottom + { + type epsilonWallFunction; + value uniform 4e-06; + } + hot + { + type epsilonWallFunction; + value uniform 4e-06; + } + cold + { + type epsilonWallFunction; + value uniform 4e-06; + } +} + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/k b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/k new file mode 100644 index 00000000..1c8e8236 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/k @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.000375; + +boundaryField +{ + topAndBottom + { + type kqRWallFunction; + value uniform 0.000375; + } + frontAndBack + { + type kqRWallFunction; + value uniform 0.000375; + } + hot + { + type kqRWallFunction; + value uniform 0.000375; + } + cold + { + type kqRWallFunction; + value uniform 0.000375; + } +} + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/nut b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/nut new file mode 100644 index 00000000..f10bb671 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/nut @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0.003125; + +boundaryField +{ + topAndBottom + { + type nutUWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + frontAndBack + { + type nutUWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + hot + { + type nutUWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + cold + { + type nutUWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/omega b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/omega new file mode 100644 index 00000000..d7dd3f10 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/omega @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform 0.12; + +boundaryField +{ + topAndBottom + { + beta1 0.075; + blended 0; + type omegaWallFunction; + value uniform 0.12; + } + frontAndBack + { + beta1 0.075; + blended 0; + type omegaWallFunction; + value uniform 0.12; + } + hot + { + beta1 0.075; + blended 0; + type omegaWallFunction; + value uniform 0.12; + } + cold + { + beta1 0.075; + blended 0; + type omegaWallFunction; + value uniform 0.12; + } +} + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/p b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/p new file mode 100644 index 00000000..f2e57d0e --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/p @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 100000; + +boundaryField +{ + topAndBottom + { + type calculated; + value uniform 100000; + } + frontAndBack + { + type calculated; + value uniform 100000; + } + hot + { + type calculated; + value uniform 100000; + } + cold + { + type calculated; + value uniform 100000; + } +} + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/p_rgh b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/p_rgh new file mode 100644 index 00000000..8c91dd23 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/p_rgh @@ -0,0 +1,1342 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField nonuniform List +630 +( +0.423711853436544 +0.423711853436544 +0.423711853436544 +0.423711853436544 +0.423711853436544 +0.423711853436544 +0.423711853436544 +1.27113556029508 +1.27113556029508 +1.27113556029508 +1.27113556029508 +1.27113556029508 +1.27113556029508 +1.27113556029508 +2.11855926715361 +2.11855926715361 +2.11855926715361 +2.11855926715361 +2.11855926715361 +2.11855926715361 +2.11855926715361 +2.9659829740267 +2.9659829740267 +2.9659829740267 +2.9659829740267 +2.9659829740267 +2.9659829740267 +2.9659829740267 +3.81340668088524 +3.81340668088524 +3.81340668088524 +3.81340668088524 +3.81340668088524 +3.81340668088524 +3.81340668088524 +4.66083038775832 +4.66083038775832 +4.66083038775832 +4.66083038775832 +4.66083038775832 +4.66083038775832 +4.66083038775832 +5.50825409461686 +5.50825409461686 +5.50825409461686 +5.50825409461686 +5.50825409461686 +5.50825409461686 +5.50825409461686 +6.35567780147539 +6.35567780147539 +6.35567780147539 +6.35567780147539 +6.35567780147539 +6.35567780147539 +6.35567780147539 +7.20310150834848 +7.20310150834848 +7.20310150834848 +7.20310150834848 +7.20310150834848 +7.20310150834848 +7.20310150834848 +8.05052521520702 +8.05052521520702 +8.05052521520702 +8.05052521520702 +8.05052521520702 +8.05052521520702 +8.05052521520702 +8.8979489220801 +8.8979489220801 +8.8979489220801 +8.8979489220801 +8.8979489220801 +8.8979489220801 +8.8979489220801 +9.74537262893864 +9.74537262893864 +9.74537262893864 +9.74537262893864 +9.74537262893864 +9.74537262893864 +9.74537262893864 +10.5927963357972 +10.5927963357972 +10.5927963357972 +10.5927963357972 +10.5927963357972 +10.5927963357972 +10.5927963357972 +11.4402200426703 +11.4402200426703 +11.4402200426703 +11.4402200426703 +11.4402200426703 +11.4402200426703 +11.4402200426703 +12.2876437495288 +12.2876437495288 +12.2876437495288 +12.2876437495288 +12.2876437495288 +12.2876437495288 +12.2876437495288 +13.1350674563873 +13.1350674563873 +13.1350674563873 +13.1350674563873 +13.1350674563873 +13.1350674563873 +13.1350674563873 +13.9824911632604 +13.9824911632604 +13.9824911632604 +13.9824911632604 +13.9824911632604 +13.9824911632604 +13.9824911632604 +14.829914870119 +14.829914870119 +14.829914870119 +14.829914870119 +14.829914870119 +14.829914870119 +14.829914870119 +15.677338576992 +15.677338576992 +15.677338576992 +15.677338576992 +15.677338576992 +15.677338576992 +15.677338576992 +16.5247622838506 +16.5247622838506 +16.5247622838506 +16.5247622838506 +16.5247622838506 +16.5247622838506 +16.5247622838506 +17.3721859907091 +17.3721859907091 +17.3721859907091 +17.3721859907091 +17.3721859907091 +17.3721859907091 +17.3721859907091 +18.2196096975822 +18.2196096975822 +18.2196096975822 +18.2196096975822 +18.2196096975822 +18.2196096975822 +18.2196096975822 +19.0670334044407 +19.0670334044407 +19.0670334044407 +19.0670334044407 +19.0670334044407 +19.0670334044407 +19.0670334044407 +19.9144571112993 +19.9144571112993 +19.9144571112993 +19.9144571112993 +19.9144571112993 +19.9144571112993 +19.9144571112993 +20.7618808181724 +20.7618808181724 +20.7618808181724 +20.7618808181724 +20.7618808181724 +20.7618808181724 +20.7618808181724 +21.6093045250309 +21.6093045250309 +21.6093045250309 +21.6093045250309 +21.6093045250309 +21.6093045250309 +21.6093045250309 +22.456728231904 +22.456728231904 +22.456728231904 +22.456728231904 +22.456728231904 +22.456728231904 +22.456728231904 +23.3041519387625 +23.3041519387625 +23.3041519387625 +23.3041519387625 +23.3041519387625 +23.3041519387625 +23.3041519387625 +24.1515756456211 +24.1515756456211 +24.1515756456211 +24.1515756456211 +24.1515756456211 +24.1515756456211 +24.1515756456211 +24.9989993524941 +24.9989993524941 +24.9989993524941 +24.9989993524941 +24.9989993524941 +24.9989993524941 +24.9989993524941 +0.423711853436544 +0.423711853436544 +0.423711853436544 +0.423711853436544 +0.423711853436544 +0.423711853436544 +0.423711853436544 +1.27113556029508 +1.27113556029508 +1.27113556029508 +1.27113556029508 +1.27113556029508 +1.27113556029508 +1.27113556029508 +2.11855926715361 +2.11855926715361 +2.11855926715361 +2.11855926715361 +2.11855926715361 +2.11855926715361 +2.11855926715361 +2.9659829740267 +2.9659829740267 +2.9659829740267 +2.9659829740267 +2.9659829740267 +2.9659829740267 +2.9659829740267 +3.81340668088524 +3.81340668088524 +3.81340668088524 +3.81340668088524 +3.81340668088524 +3.81340668088524 +3.81340668088524 +4.66083038775832 +4.66083038775832 +4.66083038775832 +4.66083038775832 +4.66083038775832 +4.66083038775832 +4.66083038775832 +5.50825409461686 +5.50825409461686 +5.50825409461686 +5.50825409461686 +5.50825409461686 +5.50825409461686 +5.50825409461686 +6.35567780147539 +6.35567780147539 +6.35567780147539 +6.35567780147539 +6.35567780147539 +6.35567780147539 +6.35567780147539 +7.20310150834848 +7.20310150834848 +7.20310150834848 +7.20310150834848 +7.20310150834848 +7.20310150834848 +7.20310150834848 +8.05052521520702 +8.05052521520702 +8.05052521520702 +8.05052521520702 +8.05052521520702 +8.05052521520702 +8.05052521520702 +8.8979489220801 +8.8979489220801 +8.8979489220801 +8.8979489220801 +8.8979489220801 +8.8979489220801 +8.8979489220801 +9.74537262893864 +9.74537262893864 +9.74537262893864 +9.74537262893864 +9.74537262893864 +9.74537262893864 +9.74537262893864 +10.5927963357972 +10.5927963357972 +10.5927963357972 +10.5927963357972 +10.5927963357972 +10.5927963357972 +10.5927963357972 +11.4402200426703 +11.4402200426703 +11.4402200426703 +11.4402200426703 +11.4402200426703 +11.4402200426703 +11.4402200426703 +12.2876437495288 +12.2876437495288 +12.2876437495288 +12.2876437495288 +12.2876437495288 +12.2876437495288 +12.2876437495288 +13.1350674563873 +13.1350674563873 +13.1350674563873 +13.1350674563873 +13.1350674563873 +13.1350674563873 +13.1350674563873 +13.9824911632604 +13.9824911632604 +13.9824911632604 +13.9824911632604 +13.9824911632604 +13.9824911632604 +13.9824911632604 +14.829914870119 +14.829914870119 +14.829914870119 +14.829914870119 +14.829914870119 +14.829914870119 +14.829914870119 +15.677338576992 +15.677338576992 +15.677338576992 +15.677338576992 +15.677338576992 +15.677338576992 +15.677338576992 +16.5247622838506 +16.5247622838506 +16.5247622838506 +16.5247622838506 +16.5247622838506 +16.5247622838506 +16.5247622838506 +17.3721859907091 +17.3721859907091 +17.3721859907091 +17.3721859907091 +17.3721859907091 +17.3721859907091 +17.3721859907091 +18.2196096975822 +18.2196096975822 +18.2196096975822 +18.2196096975822 +18.2196096975822 +18.2196096975822 +18.2196096975822 +19.0670334044407 +19.0670334044407 +19.0670334044407 +19.0670334044407 +19.0670334044407 +19.0670334044407 +19.0670334044407 +19.9144571112993 +19.9144571112993 +19.9144571112993 +19.9144571112993 +19.9144571112993 +19.9144571112993 +19.9144571112993 +20.7618808181724 +20.7618808181724 +20.7618808181724 +20.7618808181724 +20.7618808181724 +20.7618808181724 +20.7618808181724 +21.6093045250309 +21.6093045250309 +21.6093045250309 +21.6093045250309 +21.6093045250309 +21.6093045250309 +21.6093045250309 +22.456728231904 +22.456728231904 +22.456728231904 +22.456728231904 +22.456728231904 +22.456728231904 +22.456728231904 +23.3041519387625 +23.3041519387625 +23.3041519387625 +23.3041519387625 +23.3041519387625 +23.3041519387625 +23.3041519387625 +24.1515756456211 +24.1515756456211 +24.1515756456211 +24.1515756456211 +24.1515756456211 +24.1515756456211 +24.1515756456211 +24.9989993524941 +24.9989993524941 +24.9989993524941 +24.9989993524941 +24.9989993524941 +24.9989993524941 +24.9989993524941 +0.423711853436544 +0.423711853436544 +0.423711853436544 +0.423711853436544 +0.423711853436544 +0.423711853436544 +0.423711853436544 +1.27113556029508 +1.27113556029508 +1.27113556029508 +1.27113556029508 +1.27113556029508 +1.27113556029508 +1.27113556029508 +2.11855926715361 +2.11855926715361 +2.11855926715361 +2.11855926715361 +2.11855926715361 +2.11855926715361 +2.11855926715361 +2.9659829740267 +2.9659829740267 +2.9659829740267 +2.9659829740267 +2.9659829740267 +2.9659829740267 +2.9659829740267 +3.81340668088524 +3.81340668088524 +3.81340668088524 +3.81340668088524 +3.81340668088524 +3.81340668088524 +3.81340668088524 +4.66083038775832 +4.66083038775832 +4.66083038775832 +4.66083038775832 +4.66083038775832 +4.66083038775832 +4.66083038775832 +5.50825409461686 +5.50825409461686 +5.50825409461686 +5.50825409461686 +5.50825409461686 +5.50825409461686 +5.50825409461686 +6.35567780147539 +6.35567780147539 +6.35567780147539 +6.35567780147539 +6.35567780147539 +6.35567780147539 +6.35567780147539 +7.20310150834848 +7.20310150834848 +7.20310150834848 +7.20310150834848 +7.20310150834848 +7.20310150834848 +7.20310150834848 +8.05052521520702 +8.05052521520702 +8.05052521520702 +8.05052521520702 +8.05052521520702 +8.05052521520702 +8.05052521520702 +8.8979489220801 +8.8979489220801 +8.8979489220801 +8.8979489220801 +8.8979489220801 +8.8979489220801 +8.8979489220801 +9.74537262893864 +9.74537262893864 +9.74537262893864 +9.74537262893864 +9.74537262893864 +9.74537262893864 +9.74537262893864 +10.5927963357972 +10.5927963357972 +10.5927963357972 +10.5927963357972 +10.5927963357972 +10.5927963357972 +10.5927963357972 +11.4402200426703 +11.4402200426703 +11.4402200426703 +11.4402200426703 +11.4402200426703 +11.4402200426703 +11.4402200426703 +12.2876437495288 +12.2876437495288 +12.2876437495288 +12.2876437495288 +12.2876437495288 +12.2876437495288 +12.2876437495288 +13.1350674563873 +13.1350674563873 +13.1350674563873 +13.1350674563873 +13.1350674563873 +13.1350674563873 +13.1350674563873 +13.9824911632604 +13.9824911632604 +13.9824911632604 +13.9824911632604 +13.9824911632604 +13.9824911632604 +13.9824911632604 +14.829914870119 +14.829914870119 +14.829914870119 +14.829914870119 +14.829914870119 +14.829914870119 +14.829914870119 +15.677338576992 +15.677338576992 +15.677338576992 +15.677338576992 +15.677338576992 +15.677338576992 +15.677338576992 +16.5247622838506 +16.5247622838506 +16.5247622838506 +16.5247622838506 +16.5247622838506 +16.5247622838506 +16.5247622838506 +17.3721859907091 +17.3721859907091 +17.3721859907091 +17.3721859907091 +17.3721859907091 +17.3721859907091 +17.3721859907091 +18.2196096975822 +18.2196096975822 +18.2196096975822 +18.2196096975822 +18.2196096975822 +18.2196096975822 +18.2196096975822 +19.0670334044407 +19.0670334044407 +19.0670334044407 +19.0670334044407 +19.0670334044407 +19.0670334044407 +19.0670334044407 +19.9144571112993 +19.9144571112993 +19.9144571112993 +19.9144571112993 +19.9144571112993 +19.9144571112993 +19.9144571112993 +20.7618808181724 +20.7618808181724 +20.7618808181724 +20.7618808181724 +20.7618808181724 +20.7618808181724 +20.7618808181724 +21.6093045250309 +21.6093045250309 +21.6093045250309 +21.6093045250309 +21.6093045250309 +21.6093045250309 +21.6093045250309 +22.456728231904 +22.456728231904 +22.456728231904 +22.456728231904 +22.456728231904 +22.456728231904 +22.456728231904 +23.3041519387625 +23.3041519387625 +23.3041519387625 +23.3041519387625 +23.3041519387625 +23.3041519387625 +23.3041519387625 +24.1515756456211 +24.1515756456211 +24.1515756456211 +24.1515756456211 +24.1515756456211 +24.1515756456211 +24.1515756456211 +24.9989993524941 +24.9989993524941 +24.9989993524941 +24.9989993524941 +24.9989993524941 +24.9989993524941 +24.9989993524941 +) +; + +boundaryField +{ + topAndBottom + { + type fixedFluxPressure; + gradient uniform 0; + value nonuniform List +42 +( +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +25.4227112059161 +) +; + } + frontAndBack + { + type fixedFluxPressure; + gradient uniform 0; + value nonuniform List +420 +( +0.423711853436544 +1.27113556029508 +2.11855926715361 +2.9659829740267 +3.81340668088524 +4.66083038775832 +5.50825409461686 +6.35567780147539 +7.20310150834848 +8.05052521520702 +8.8979489220801 +9.74537262893864 +10.5927963357972 +11.4402200426703 +12.2876437495288 +13.1350674563873 +13.9824911632604 +14.829914870119 +15.677338576992 +16.5247622838506 +17.3721859907091 +18.2196096975822 +19.0670334044407 +19.9144571112993 +20.7618808181724 +21.6093045250309 +22.456728231904 +23.3041519387625 +24.1515756456211 +24.9989993524941 +0.423711853436544 +1.27113556029508 +2.11855926715361 +2.9659829740267 +3.81340668088524 +4.66083038775832 +5.50825409461686 +6.35567780147539 +7.20310150834848 +8.05052521520702 +8.8979489220801 +9.74537262893864 +10.5927963357972 +11.4402200426703 +12.2876437495288 +13.1350674563873 +13.9824911632604 +14.829914870119 +15.677338576992 +16.5247622838506 +17.3721859907091 +18.2196096975822 +19.0670334044407 +19.9144571112993 +20.7618808181724 +21.6093045250309 +22.456728231904 +23.3041519387625 +24.1515756456211 +24.9989993524941 +0.423711853436544 +1.27113556029508 +2.11855926715361 +2.9659829740267 +3.81340668088524 +4.66083038775832 +5.50825409461686 +6.35567780147539 +7.20310150834848 +8.05052521520702 +8.8979489220801 +9.74537262893864 +10.5927963357972 +11.4402200426703 +12.2876437495288 +13.1350674563873 +13.9824911632604 +14.829914870119 +15.677338576992 +16.5247622838506 +17.3721859907091 +18.2196096975822 +19.0670334044407 +19.9144571112993 +20.7618808181724 +21.6093045250309 +22.456728231904 +23.3041519387625 +24.1515756456211 +24.9989993524941 +0.423711853436544 +1.27113556029508 +2.11855926715361 +2.9659829740267 +3.81340668088524 +4.66083038775832 +5.50825409461686 +6.35567780147539 +7.20310150834848 +8.05052521520702 +8.8979489220801 +9.74537262893864 +10.5927963357972 +11.4402200426703 +12.2876437495288 +13.1350674563873 +13.9824911632604 +14.829914870119 +15.677338576992 +16.5247622838506 +17.3721859907091 +18.2196096975822 +19.0670334044407 +19.9144571112993 +20.7618808181724 +21.6093045250309 +22.456728231904 +23.3041519387625 +24.1515756456211 +24.9989993524941 +0.423711853436544 +1.27113556029508 +2.11855926715361 +2.9659829740267 +3.81340668088524 +4.66083038775832 +5.50825409461686 +6.35567780147539 +7.20310150834848 +8.05052521520702 +8.8979489220801 +9.74537262893864 +10.5927963357972 +11.4402200426703 +12.2876437495288 +13.1350674563873 +13.9824911632604 +14.829914870119 +15.677338576992 +16.5247622838506 +17.3721859907091 +18.2196096975822 +19.0670334044407 +19.9144571112993 +20.7618808181724 +21.6093045250309 +22.456728231904 +23.3041519387625 +24.1515756456211 +24.9989993524941 +0.423711853436544 +1.27113556029508 +2.11855926715361 +2.9659829740267 +3.81340668088524 +4.66083038775832 +5.50825409461686 +6.35567780147539 +7.20310150834848 +8.05052521520702 +8.8979489220801 +9.74537262893864 +10.5927963357972 +11.4402200426703 +12.2876437495288 +13.1350674563873 +13.9824911632604 +14.829914870119 +15.677338576992 +16.5247622838506 +17.3721859907091 +18.2196096975822 +19.0670334044407 +19.9144571112993 +20.7618808181724 +21.6093045250309 +22.456728231904 +23.3041519387625 +24.1515756456211 +24.9989993524941 +0.423711853436544 +1.27113556029508 +2.11855926715361 +2.9659829740267 +3.81340668088524 +4.66083038775832 +5.50825409461686 +6.35567780147539 +7.20310150834848 +8.05052521520702 +8.8979489220801 +9.74537262893864 +10.5927963357972 +11.4402200426703 +12.2876437495288 +13.1350674563873 +13.9824911632604 +14.829914870119 +15.677338576992 +16.5247622838506 +17.3721859907091 +18.2196096975822 +19.0670334044407 +19.9144571112993 +20.7618808181724 +21.6093045250309 +22.456728231904 +23.3041519387625 +24.1515756456211 +24.9989993524941 +0.423711853436544 +1.27113556029508 +2.11855926715361 +2.9659829740267 +3.81340668088524 +4.66083038775832 +5.50825409461686 +6.35567780147539 +7.20310150834848 +8.05052521520702 +8.8979489220801 +9.74537262893864 +10.5927963357972 +11.4402200426703 +12.2876437495288 +13.1350674563873 +13.9824911632604 +14.829914870119 +15.677338576992 +16.5247622838506 +17.3721859907091 +18.2196096975822 +19.0670334044407 +19.9144571112993 +20.7618808181724 +21.6093045250309 +22.456728231904 +23.3041519387625 +24.1515756456211 +24.9989993524941 +0.423711853436544 +1.27113556029508 +2.11855926715361 +2.9659829740267 +3.81340668088524 +4.66083038775832 +5.50825409461686 +6.35567780147539 +7.20310150834848 +8.05052521520702 +8.8979489220801 +9.74537262893864 +10.5927963357972 +11.4402200426703 +12.2876437495288 +13.1350674563873 +13.9824911632604 +14.829914870119 +15.677338576992 +16.5247622838506 +17.3721859907091 +18.2196096975822 +19.0670334044407 +19.9144571112993 +20.7618808181724 +21.6093045250309 +22.456728231904 +23.3041519387625 +24.1515756456211 +24.9989993524941 +0.423711853436544 +1.27113556029508 +2.11855926715361 +2.9659829740267 +3.81340668088524 +4.66083038775832 +5.50825409461686 +6.35567780147539 +7.20310150834848 +8.05052521520702 +8.8979489220801 +9.74537262893864 +10.5927963357972 +11.4402200426703 +12.2876437495288 +13.1350674563873 +13.9824911632604 +14.829914870119 +15.677338576992 +16.5247622838506 +17.3721859907091 +18.2196096975822 +19.0670334044407 +19.9144571112993 +20.7618808181724 +21.6093045250309 +22.456728231904 +23.3041519387625 +24.1515756456211 +24.9989993524941 +0.423711853436544 +1.27113556029508 +2.11855926715361 +2.9659829740267 +3.81340668088524 +4.66083038775832 +5.50825409461686 +6.35567780147539 +7.20310150834848 +8.05052521520702 +8.8979489220801 +9.74537262893864 +10.5927963357972 +11.4402200426703 +12.2876437495288 +13.1350674563873 +13.9824911632604 +14.829914870119 +15.677338576992 +16.5247622838506 +17.3721859907091 +18.2196096975822 +19.0670334044407 +19.9144571112993 +20.7618808181724 +21.6093045250309 +22.456728231904 +23.3041519387625 +24.1515756456211 +24.9989993524941 +0.423711853436544 +1.27113556029508 +2.11855926715361 +2.9659829740267 +3.81340668088524 +4.66083038775832 +5.50825409461686 +6.35567780147539 +7.20310150834848 +8.05052521520702 +8.8979489220801 +9.74537262893864 +10.5927963357972 +11.4402200426703 +12.2876437495288 +13.1350674563873 +13.9824911632604 +14.829914870119 +15.677338576992 +16.5247622838506 +17.3721859907091 +18.2196096975822 +19.0670334044407 +19.9144571112993 +20.7618808181724 +21.6093045250309 +22.456728231904 +23.3041519387625 +24.1515756456211 +24.9989993524941 +0.423711853436544 +1.27113556029508 +2.11855926715361 +2.9659829740267 +3.81340668088524 +4.66083038775832 +5.50825409461686 +6.35567780147539 +7.20310150834848 +8.05052521520702 +8.8979489220801 +9.74537262893864 +10.5927963357972 +11.4402200426703 +12.2876437495288 +13.1350674563873 +13.9824911632604 +14.829914870119 +15.677338576992 +16.5247622838506 +17.3721859907091 +18.2196096975822 +19.0670334044407 +19.9144571112993 +20.7618808181724 +21.6093045250309 +22.456728231904 +23.3041519387625 +24.1515756456211 +24.9989993524941 +0.423711853436544 +1.27113556029508 +2.11855926715361 +2.9659829740267 +3.81340668088524 +4.66083038775832 +5.50825409461686 +6.35567780147539 +7.20310150834848 +8.05052521520702 +8.8979489220801 +9.74537262893864 +10.5927963357972 +11.4402200426703 +12.2876437495288 +13.1350674563873 +13.9824911632604 +14.829914870119 +15.677338576992 +16.5247622838506 +17.3721859907091 +18.2196096975822 +19.0670334044407 +19.9144571112993 +20.7618808181724 +21.6093045250309 +22.456728231904 +23.3041519387625 +24.1515756456211 +24.9989993524941 +) +; + } + hot + { + type fixedFluxPressure; + gradient uniform 0; + value nonuniform List +90 +( +0.403403974181856 +1.21021192256012 +2.01701987092383 +2.8238278193021 +3.63063576766581 +4.43744371604407 +5.24425166440778 +6.05105961278605 +6.85786756114976 +7.66467550952802 +8.47148345789174 +9.27829140627 +10.0850993546337 +10.891907303012 +11.6987152513757 +12.505523199754 +13.3123311481177 +14.1191390964959 +14.9259470448596 +15.7327549932379 +16.5395629416016 +17.3463708899799 +18.1531788383436 +18.9599867867219 +19.7667947350856 +20.5736026834638 +21.3804106318275 +22.1872185802058 +22.9940265285695 +23.8008344769478 +0.403403974181856 +1.21021192256012 +2.01701987092383 +2.8238278193021 +3.63063576766581 +4.43744371604407 +5.24425166440778 +6.05105961278605 +6.85786756114976 +7.66467550952802 +8.47148345789174 +9.27829140627 +10.0850993546337 +10.891907303012 +11.6987152513757 +12.505523199754 +13.3123311481177 +14.1191390964959 +14.9259470448596 +15.7327549932379 +16.5395629416016 +17.3463708899799 +18.1531788383436 +18.9599867867219 +19.7667947350856 +20.5736026834638 +21.3804106318275 +22.1872185802058 +22.9940265285695 +23.8008344769478 +0.403403974181856 +1.21021192256012 +2.01701987092383 +2.8238278193021 +3.63063576766581 +4.43744371604407 +5.24425166440778 +6.05105961278605 +6.85786756114976 +7.66467550952802 +8.47148345789174 +9.27829140627 +10.0850993546337 +10.891907303012 +11.6987152513757 +12.505523199754 +13.3123311481177 +14.1191390964959 +14.9259470448596 +15.7327549932379 +16.5395629416016 +17.3463708899799 +18.1531788383436 +18.9599867867219 +19.7667947350856 +20.5736026834638 +21.3804106318275 +22.1872185802058 +22.9940265285695 +23.8008344769478 +) +; + } + cold + { + type fixedFluxPressure; + gradient uniform 0; + value nonuniform List +90 +( +0.430843564303359 +1.29253069292463 +2.1542178215459 +3.01590495016717 +3.87759207877389 +4.73927920739516 +5.60096633601643 +6.4626534646377 +7.32434059324441 +8.18602772186568 +9.04771485048695 +9.90940197910822 +10.7710891077149 +11.6327762363362 +12.4944633649575 +13.3561504935788 +14.2178376221855 +15.0795247508067 +15.941211879428 +16.8028990080493 +17.664586136656 +18.5262732652773 +19.3879603938985 +20.2496475225198 +21.1113346511265 +21.9730217797478 +22.8347089083691 +23.6963960369903 +24.5580831655971 +25.4197702942183 +0.430843564303359 +1.29253069292463 +2.1542178215459 +3.01590495016717 +3.87759207877389 +4.73927920739516 +5.60096633601643 +6.4626534646377 +7.32434059324441 +8.18602772186568 +9.04771485048695 +9.90940197910822 +10.7710891077149 +11.6327762363362 +12.4944633649575 +13.3561504935788 +14.2178376221855 +15.0795247508067 +15.941211879428 +16.8028990080493 +17.664586136656 +18.5262732652773 +19.3879603938985 +20.2496475225198 +21.1113346511265 +21.9730217797478 +22.8347089083691 +23.6963960369903 +24.5580831655971 +25.4197702942183 +0.430843564303359 +1.29253069292463 +2.1542178215459 +3.01590495016717 +3.87759207877389 +4.73927920739516 +5.60096633601643 +6.4626534646377 +7.32434059324441 +8.18602772186568 +9.04771485048695 +9.90940197910822 +10.7710891077149 +11.6327762363362 +12.4944633649575 +13.3561504935788 +14.2178376221855 +15.0795247508067 +15.941211879428 +16.8028990080493 +17.664586136656 +18.5262732652773 +19.3879603938985 +20.2496475225198 +21.1113346511265 +21.9730217797478 +22.8347089083691 +23.6963960369903 +24.5580831655971 +25.4197702942183 +) +; + } +} + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/phi b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/phi new file mode 100644 index 00000000..5657a15b --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/0/phi @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class surfaceScalarField; + location "0"; + object phi; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 0 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + topAndBottom + { + type calculated; + value uniform 0; + } + frontAndBack + { + type calculated; + value uniform 0; + } + hot + { + type calculated; + value uniform 0; + } + cold + { + type calculated; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/Allclean b/test/tests/restart/restart_from_transient_serial/buoyantCavity/Allclean new file mode 100755 index 00000000..bb7f5888 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +rm -f validation/*.eps + +#------------------------------------------------------------------------------ diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/constant/g b/test/tests/restart/restart_from_transient_serial/buoyantCavity/constant/g new file mode 100644 index 00000000..72d18dc9 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/constant/g @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 -9.81 0); + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/constant/momentumTransport b/test/tests/restart/restart_from_transient_serial/buoyantCavity/constant/momentumTransport new file mode 100644 index 00000000..55c2d61e --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/constant/momentumTransport @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + model kOmegaSST; + + turbulence on; + + printCoeffs on; +} + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/constant/pRef b/test/tests/restart/restart_from_transient_serial/buoyantCavity/constant/pRef new file mode 100644 index 00000000..fc25cd80 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/constant/pRef @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class uniformDimensionedScalarField; + location "constant"; + object pRef; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; +value 1e5; + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/constant/physicalProperties b/test/tests/restart/restart_from_transient_serial/buoyantCavity/constant/physicalProperties new file mode 100644 index 00000000..6005622f --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/constant/physicalProperties @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object physicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectGas; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + molWeight 28.96; + } + thermodynamics + { + Cp 1004.4; + Hf 0; + } + transport + { + mu 1.831e-05; + Pr 0.705; + } +} + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/system/blockMeshDict b/test/tests/restart/restart_from_transient_serial/buoyantCavity/system/blockMeshDict new file mode 100644 index 00000000..6b76c4b7 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/system/blockMeshDict @@ -0,0 +1,76 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.001; + +vertices +( + ( 0 0 -260) + (76 0 -260) + (76 2180 -260) + ( 0 2180 -260) + ( 0 0 260) + (76 0 260) + (76 2180 260) + ( 0 2180 260) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (7 30 3) simpleGrading (1 1 1) +); + +boundary +( + topAndBottom + { + type wall; + faces + ( + (0 1 5 4) + (2 3 7 6) + ); + } + + frontAndBack + { + type wall; + faces + ( + (4 5 6 7) + (3 2 1 0) + ); + } + + hot + { + type wall; + faces + ( + (6 5 1 2) + ); + } + + cold + { + type wall; + faces + ( + (4 7 3 0) + ); + } +); + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/system/controlDict b/test/tests/restart/restart_from_transient_serial/buoyantCavity/system/controlDict new file mode 100644 index 00000000..a13e9ca6 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/system/controlDict @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application buoyantFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1; + +deltaT 0.25; + +writeControl timeStep; + +writeInterval 1; + +purgeWrite 1; + +writeFormat ascii; + +writePrecision 15; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/system/fvSchemes b/test/tests/restart/restart_from_transient_serial/buoyantCavity/system/fvSchemes new file mode 100644 index 00000000..dad97318 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/system/fvSchemes @@ -0,0 +1,60 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + + div(phi,U) bounded Gauss limitedLinear 0.2; + div(phi,K) bounded Gauss limitedLinear 0.2; + div(phi,h) bounded Gauss limitedLinear 0.2; + div(phi,k) bounded Gauss limitedLinear 0.2; + div(phi,epsilon) bounded Gauss limitedLinear 0.2; + div(phi,omega) bounded Gauss limitedLinear 0.2; + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear orthogonal; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default orthogonal; +} + +wallDist +{ + method meshWave; +} + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/system/fvSolution b/test/tests/restart/restart_from_transient_serial/buoyantCavity/system/fvSolution new file mode 100644 index 00000000..f94499f3 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/system/fvSolution @@ -0,0 +1,72 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p_rgh + { + solver GAMG; + tolerance 1e-7; + relTol 0.01; + + smoother DICGaussSeidel; + + } + + "(U|h|k|epsilon|omega)" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-8; + relTol 0.1; + } +} + +PIMPLE +{ + momentumPredictor no; + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; + + residualControl + { + p_rgh 1e-4; + U 1e-4; + h 1e-4; + + // possibly check turbulence fields + "(k|epsilon|omega)" 1e-3; + } +} + +relaxationFactors +{ + fields + { + rho 1.0; + p_rgh 0.7; + } + equations + { + U 0.3; + h 0.3; + "(k|epsilon|omega)" 0.7; + } +} + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/buoyantCavity/system/sample b/test/tests/restart/restart_from_transient_serial/buoyantCavity/system/sample new file mode 100644 index 00000000..fdfd92cc --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/buoyantCavity/system/sample @@ -0,0 +1,99 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 10 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object sample; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type sets; +libs ("libsampling.so"); + +interpolationScheme cellPointFace; + +setFormat raw; + +sets +( + y0.1 + { + type lineFace; + axis x; + start (-1 0.218 0); + end (1 0.218 0); + } + y0.2 + { + type lineFace; + axis x; + start (-1 0.436 0); + end (1 0.436 0); + } + y0.3 + { + type lineFace; + axis x; + start (-1 0.654 0); + end (1 0.654 0); + } + y0.4 + { + type lineFace; + axis x; + start (-1 0.872 0); + end (1 0.872 0); + } + y0.5 + { + type lineFace; + axis x; + start (-1 1.09 0); + end (1 1.09 0); + } + y0.6 + { + type lineFace; + axis x; + start (-1 1.308 0); + end (1 1.308 0); + } + y0.7 + { + type lineFace; + axis x; + start (-1 1.526 0); + end (1 1.526 0); + } + y0.8 + { + type lineFace; + axis x; + start (-1 1.744 0); + end (1 1.744 0); + } + y0.9 + { + type lineFace; + axis x; + start (-1 1.962 0); + end (1 1.962 0); + } +); + +fields +( + T + U +); + + +// ************************************************************************* // diff --git a/test/tests/restart/restart_from_transient_serial/first.i b/test/tests/restart/restart_from_transient_serial/first.i new file mode 100644 index 00000000..2b4b3eb8 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/first.i @@ -0,0 +1,58 @@ +[Mesh] + type = FoamMesh + foam_args = '-case buoyantCavity' + foam_patch = 'topAndBottom frontAndBack' + dim = 2 +[] + +[Variables] + [Dummy] + initial_condition = 3.14 + [] +[] + +[AuxVariables] + [T] + initial_condition = 111 + family = MONOMIAL + order = CONSTANT + [] + + [foam_T] + initial_condition = 999 + family = MONOMIAL + order = CONSTANT + [] + + [foam_hf] + initial_condition = -999 + family = MONOMIAL + order = CONSTANT + [] +[] + +[Problem] + type=BuoyantFoamProblem + temp = T + foam_temp = foam_T + foam_heat_flux = foam_hf +[] + +[Executioner] + type = Transient + start_time = 0 + end_time = 2 + dt = 0.25 + solve_type = 'PJFNK' + petsc_options_iname = '-pc_type -pc_hypre_type' + petsc_options_value = 'hypre boomeramg' + + [TimeStepper] + type = FoamTimeStepper + [] +[] + +[Outputs] + exodus = true + checkpoint = true +[] diff --git a/test/tests/restart/restart_from_transient_serial/tests b/test/tests/restart/restart_from_transient_serial/tests new file mode 100644 index 00000000..c6610a40 --- /dev/null +++ b/test/tests/restart/restart_from_transient_serial/tests @@ -0,0 +1,31 @@ +[Tests] + [restart_from_transient_serial] + # Test that we can create a checkpoint and restart from it. + # The final reference mesh was generated by running the solve for the full + # 2 seconds, whereas each stage of this tests runs 1 second. + [setup] + type = RunCommand + command = '(cd buoyantCavity && ./Allclean && blockMesh)' + [] + [first] + type = Exodiff + prereq = restart_from_transient_serial/setup + input = first.i + cli_args = '--half-transient' + exodiff = first_out.e + gold_dir = gold_1 + delete_output_before_running = true + [] + # TODO: issue here is that the output file is frozen at the midway point. + # The file doesn't seem to be being written to after the restart. + [restart] + type = Exodiff + prereq = restart_from_transient_serial/first + input = first.i + cli_args = '--recover first_out_cp/LATEST' + exodiff = first_out.e + gold_dir = gold_2 + delete_output_before_running = false + [] + [] +[]