From 413429e214156b724e18ddcbd639fb3310505011 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Thu, 9 Apr 2020 08:30:58 +0100 Subject: [PATCH 1/5] tutorials/.../DTCHull: Changed the atmospheric boundary condition to prghEntrainmentPressure This has removed all the noise/checkerboarding from the vicinity of the atmospheric boundary. --- tutorials/multiphase/interFoam/RAS/DTCHull/0/p_rgh.orig | 2 +- tutorials/multiphase/interFoam/RAS/DTCHullMoving/0/p_rgh.orig | 2 +- tutorials/multiphase/interFoam/RAS/DTCHullWave/0/p_rgh.orig | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tutorials/multiphase/interFoam/RAS/DTCHull/0/p_rgh.orig b/tutorials/multiphase/interFoam/RAS/DTCHull/0/p_rgh.orig index 6931b64ebf..2f8186218d 100644 --- a/tutorials/multiphase/interFoam/RAS/DTCHull/0/p_rgh.orig +++ b/tutorials/multiphase/interFoam/RAS/DTCHull/0/p_rgh.orig @@ -37,7 +37,7 @@ boundaryField atmosphere { - type totalPressure; + type prghEntrainmentPressure; p0 uniform 0; } diff --git a/tutorials/multiphase/interFoam/RAS/DTCHullMoving/0/p_rgh.orig b/tutorials/multiphase/interFoam/RAS/DTCHullMoving/0/p_rgh.orig index 6931b64ebf..2f8186218d 100644 --- a/tutorials/multiphase/interFoam/RAS/DTCHullMoving/0/p_rgh.orig +++ b/tutorials/multiphase/interFoam/RAS/DTCHullMoving/0/p_rgh.orig @@ -37,7 +37,7 @@ boundaryField atmosphere { - type totalPressure; + type prghEntrainmentPressure; p0 uniform 0; } diff --git a/tutorials/multiphase/interFoam/RAS/DTCHullWave/0/p_rgh.orig b/tutorials/multiphase/interFoam/RAS/DTCHullWave/0/p_rgh.orig index 6931b64ebf..2f8186218d 100644 --- a/tutorials/multiphase/interFoam/RAS/DTCHullWave/0/p_rgh.orig +++ b/tutorials/multiphase/interFoam/RAS/DTCHullWave/0/p_rgh.orig @@ -37,7 +37,7 @@ boundaryField atmosphere { - type totalPressure; + type prghEntrainmentPressure; p0 uniform 0; } From 0207f85191ca9c59f3049535fcca08a2d674aa83 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Thu, 9 Apr 2020 13:08:37 +0100 Subject: [PATCH 2/5] fvOptions/.../semiImplicitSource: Construct functions on read --- .../pointFields/pointFieldsFwd.H | 5 +- .../objectFunction1/objectFunction1.H | 143 ++++++++++++++++++ .../objectFunction1Templates.C | 131 ++++++++++++++++ .../fields/surfaceFields/surfaceFieldsFwd.H | 5 +- .../fields/volFields/volFieldsFwd.H | 5 +- .../semiImplicitSource/semiImplicitSource.C | 43 +++--- .../semiImplicitSource/semiImplicitSource.H | 8 +- 7 files changed, 318 insertions(+), 22 deletions(-) create mode 100644 src/OpenFOAM/primitives/functions/Function1/objectFunction1/objectFunction1.H create mode 100644 src/OpenFOAM/primitives/functions/Function1/objectFunction1/objectFunction1Templates.C diff --git a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFieldsFwd.H b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFieldsFwd.H index e656ee2e2d..9b3d9c4581 100644 --- a/src/OpenFOAM/fields/GeometricFields/pointFields/pointFieldsFwd.H +++ b/src/OpenFOAM/fields/GeometricFields/pointFields/pointFieldsFwd.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,6 +51,9 @@ class pointPatchField; template class PatchField, class GeoMesh> class GeometricField; +template +using PointField = GeometricField; + typedef GeometricField pointScalarField; typedef GeometricField pointVectorField; typedef GeometricField diff --git a/src/OpenFOAM/primitives/functions/Function1/objectFunction1/objectFunction1.H b/src/OpenFOAM/primitives/functions/Function1/objectFunction1/objectFunction1.H new file mode 100644 index 0000000000..e3aff1c97c --- /dev/null +++ b/src/OpenFOAM/primitives/functions/Function1/objectFunction1/objectFunction1.H @@ -0,0 +1,143 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::objectFunction1 + +Description + Wrapper around Function1 that constructs a function of type associated with + an object found in the database. + +SourceFiles + objectFunction1Templates.C + +\*---------------------------------------------------------------------------*/ + +#ifndef objectFunction1_H +#define objectFunction1_H + +#include "Function1.H" +#include "objectRegistry.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class objectFunction1 Declaration +\*---------------------------------------------------------------------------*/ + +class objectFunction1 +: + private autoPtr>, + private autoPtr>, + private autoPtr>, + private autoPtr>, + private autoPtr> +{ + // Private Classes + + //- Tag structure used to deduce type in the templated constructor + template + struct type + {}; + + + // Private Constructors + + //- Construct from an name and a dictionary + template + objectFunction1 + ( + const word& entryName, + const dictionary& dict, + const type& + ); + + +public: + + // Selector + + template