diff --git a/applications/solvers/modules/fluid/isothermalFluid/moveMesh.C b/applications/solvers/modules/fluid/isothermalFluid/moveMesh.C index 5cdfaf71b0..d6dc2b9aaa 100644 --- a/applications/solvers/modules/fluid/isothermalFluid/moveMesh.C +++ b/applications/solvers/modules/fluid/isothermalFluid/moveMesh.C @@ -55,7 +55,7 @@ bool Foam::solvers::isothermalFluid::moveMesh() CorrectPhi ( phi, - p, + buoyancy.valid() ? p_rgh : p, rho, thermo.psi(), dimensionedScalar("rAUf", dimTime, 1), diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/Make/files b/applications/solvers/multiphase/potentialFreeSurfaceFoam/Make/files deleted file mode 100644 index a027148d26..0000000000 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -potentialFreeSurfaceFoam.C - -EXE = $(FOAM_APPBIN)/potentialFreeSurfaceFoam diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/Make/options b/applications/solvers/multiphase/potentialFreeSurfaceFoam/Make/options deleted file mode 100644 index 915fc1b676..0000000000 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/Make/options +++ /dev/null @@ -1,17 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ - -I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \ - -I$(LIB_SRC)/physicalProperties/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude - -EXE_LIBS = \ - -lphysicalProperties \ - -lmomentumTransportModels \ - -lincompressibleMomentumTransportModels \ - -lfiniteVolume \ - -lmeshTools \ - -lfvModels \ - -lfvConstraints \ - -lsampling diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/UEqn.H b/applications/solvers/multiphase/potentialFreeSurfaceFoam/UEqn.H deleted file mode 100644 index 1234a78660..0000000000 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/UEqn.H +++ /dev/null @@ -1,20 +0,0 @@ -tmp tUEqn -( - fvm::ddt(U) + fvm::div(phi, U) - + MRF.DDt(U) - + turbulence->divDevSigma(U) - == - fvModels.source(U) -); -fvVectorMatrix& UEqn = tUEqn.ref(); - -UEqn.relax(); - -fvConstraints.constrain(UEqn); - -if (pimple.momentumPredictor()) -{ - solve(UEqn == -fvc::grad(p_gh)); - - fvConstraints.constrain(U); -} diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/correctPhi.H b/applications/solvers/multiphase/potentialFreeSurfaceFoam/correctPhi.H deleted file mode 100644 index 852b778642..0000000000 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/correctPhi.H +++ /dev/null @@ -1,21 +0,0 @@ -// Calculate absolute flux -// from the mapped surface velocity -phi = mesh.Sf() & Uf(); - -correctUphiBCs(U, phi, true); - -CorrectPhi -( - phi, - U, - p_gh, - surfaceScalarField("rAUf", fvc::interpolate(rAU)), - geometricZeroField(), - pressureReference, - pimple -); - -#include "continuityErrs.H" - -// Make the flux relative to the mesh motion -fvc::makeRelative(phi, U); diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/createFields.H b/applications/solvers/multiphase/potentialFreeSurfaceFoam/createFields.H deleted file mode 100644 index 7929e63c38..0000000000 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/createFields.H +++ /dev/null @@ -1,65 +0,0 @@ -Info<< "Reading field p (kinematic)\n" << endl; -volScalarField p -( - IOobject - ( - "p", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); - -Info<< "Reading field U\n" << endl; -volVectorField U -( - IOobject - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); - -#include "createPhi.H" - - -autoPtr viscosity(viscosityModel::New(mesh)); - -autoPtr turbulence -( - incompressible::momentumTransportModel::New(U, phi, viscosity) -); - -#include "readGravitationalAcceleration.H" - -Info<< "Creating field p_gh\n" << endl; -volScalarField p_gh -( - IOobject - ( - "p_gh", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); - -// Force p_gh to be consistent with p -// Height is made relative to field 'refLevel' -p_gh = p - (g & mesh.C()); - -pressureReference pressureReference(p_gh, pimple.dict()); - -mesh.schemes().setFluxRequired(p_gh.name()); - -#include "createMRF.H" -#include "createFvModels.H" -#include "createFvConstraints.H" diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/initCorrectPhi.H b/applications/solvers/multiphase/potentialFreeSurfaceFoam/initCorrectPhi.H deleted file mode 100644 index 7b49b74f22..0000000000 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/initCorrectPhi.H +++ /dev/null @@ -1,15 +0,0 @@ -if (!runTime.restart() &&correctPhi) -{ - correctUphiBCs(U, phi, true); - - CorrectPhi - ( - phi, - U, - p_gh, - surfaceScalarField("rAUf", fvc::interpolate(rAU)), - geometricZeroField(), - pressureReference, - pimple - ); -} diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H b/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H deleted file mode 100644 index 1927b3f803..0000000000 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/pEqn.H +++ /dev/null @@ -1,66 +0,0 @@ -rAU = 1.0/UEqn.A(); -surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); -volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_gh)); - -if (pimple.nCorrPiso() <= 1) -{ - tUEqn.clear(); -} - -surfaceScalarField phiHbyA -( - "phiHbyA", - fvc::flux(HbyA) - + MRF.zeroFilter(rAUf*fvc::ddtCorr(U, phi, Uf)) -); - -MRF.makeRelative(phiHbyA); - -if (p_gh.needReference()) -{ - fvc::makeRelative(phiHbyA, U); - adjustPhi(phiHbyA, U, p_gh); - fvc::makeAbsolute(phiHbyA, U); -} - -// Update the pressure BCs to ensure flux consistency -constrainPressure(p_gh, U, phiHbyA, rAUf); - -// Non-orthogonal pressure corrector loop -while (pimple.correctNonOrthogonal()) -{ - fvScalarMatrix p_ghEqn - ( - fvm::laplacian(rAUf, p_gh) == fvc::div(phiHbyA) - ); - - p_ghEqn.setReference - ( - pressureReference.refCell(), - pressureReference.refValue() - ); - - p_ghEqn.solve(); - - if (pimple.finalNonOrthogonalIter()) - { - phi = phiHbyA - p_ghEqn.flux(); - - // Explicitly relax pressure for momentum corrector - p_gh.relax(); - - U = HbyA - rAU*fvc::grad(p_gh); - U.correctBoundaryConditions(); - fvConstraints.constrain(U); - } -} - -#include "continuityErrs.H" - -// Correct Uf if the mesh is moving -fvc::correctUf(Uf, U, phi, MRF); - -// Make the fluxes relative to the mesh motion -fvc::makeRelative(phi, U); - -p = p_gh + (g & mesh.C()); diff --git a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceFoam.C b/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceFoam.C deleted file mode 100644 index 29a8e28aaf..0000000000 --- a/applications/solvers/multiphase/potentialFreeSurfaceFoam/potentialFreeSurfaceFoam.C +++ /dev/null @@ -1,165 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 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 . - -Application - potentialFreeSurfaceFoam - -Description - Incompressible Navier-Stokes solver with inclusion of a wave height field - to enable single-phase free-surface approximations, with optional mesh - motion and mesh topology changes. - - Wave height field, zeta, used by pressure boundary conditions. - - Optional mesh motion and mesh topology changes including adaptive - re-meshing. - - Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "viscosityModel.H" -#include "incompressibleMomentumTransportModels.H" -#include "pimpleControl.H" -#include "pressureReference.H" -#include "fvModels.H" -#include "fvConstraints.H" -#include "CorrectPhi.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "postProcess.H" - - #include "setRootCaseLists.H" - #include "createTime.H" - #include "createMesh.H" - #include "initContinuityErrs.H" - #include "createDyMControls.H" - #include "createFields.H" - - volScalarField rAU - ( - IOobject - ( - "rAU", - runTime.timeName(), - mesh, - IOobject::READ_IF_PRESENT, - IOobject::AUTO_WRITE - ), - mesh, - dimensionedScalar(dimTime, 1.0) - ); - - #include "initCorrectPhi.H" - - #include "createUfIfPresent.H" - - turbulence->validate(); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (pimple.run(runTime)) - { - #include "readDyMControls.H" - #include "CourantNo.H" - #include "setDeltaT.H" - - fvModels.preUpdateMesh(); - - const scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); - - // Update the mesh for topology change, mesh to mesh mapping - const bool topoChanged = mesh.update(); - - if (topoChanged) - { - Info<< "Execution time for mesh.update() = " - << runTime.elapsedCpuTime() - timeBeforeMeshUpdate - << " s" << endl; - } - - runTime++; - - Info<< "Time = " << runTime.userTimeName() << nl << endl; - - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) - { - if (pimple.firstPimpleIter() || pimple.moveMeshOuterCorrectors()) - { - // Move the mesh - mesh.move(); - - if (mesh.changing()) - { - MRF.update(); - - if (correctPhi) - { - #include "correctPhi.H" - } - - if (checkMeshCourantNo) - { - #include "meshCourantNo.H" - } - } - } - - fvModels.correct(); - - #include "UEqn.H" - - // --- Pressure corrector loop - while (pimple.correct()) - { - #include "pEqn.H" - } - - if (pimple.turbCorr()) - { - viscosity->correct(); - turbulence->correct(); - } - } - - runTime.write(); - - Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" - << " ClockTime = " << runTime.elapsedClockTime() << " s" - << nl << endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/bin/SRFPimpleFoam b/bin/SRFPimpleFoam index 8ce27ad309..bf0b381887 100755 --- a/bin/SRFPimpleFoam +++ b/bin/SRFPimpleFoam @@ -35,7 +35,7 @@ cat <. +# +# Script +# potentialFreeSurfaceFoam +# +# Description +# Script to inform the user that potentialFreeSurfaceFoam has been +# superseded and replaced by the more general isothermalFluid solver +# module executed by the foamRun application. +# +#------------------------------------------------------------------------------ + +cat <("phi", "phi")), zetaName_(dict.lookupOrDefault("zeta", "zeta")), rhoName_(dict.lookupOrDefault("rho", "rho")) -{} +{ + if (!db().foundObject(zetaName_)) + { + Info << "Creating field " << zetaName_ << endl; + + tmp tzeta + ( + new volVectorField + ( + IOobject + ( + "zeta", + db().time().timeName(), + db(), + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + patch().boundaryMesh().mesh(), + dimensionedVector(dimLength, Zero) + ) + ); + + regIOobject::store(tzeta.ptr()); + } +} Foam::waveSurfacePressureFvPatchScalarField:: @@ -128,30 +152,6 @@ void Foam::waveSurfacePressureFvPatchScalarField::updateCoeffs() return; } - if (!db().foundObject(zetaName_)) - { - Info << "Creating field " << zetaName_ << endl; - - tmp tzeta - ( - new volVectorField - ( - IOobject - ( - "zeta", - db().time().timeName(), - db(), - IOobject::READ_IF_PRESENT, - IOobject::AUTO_WRITE - ), - patch().boundaryMesh().mesh(), - dimensionedVector(dimLength, Zero) - ) - ); - - regIOobject::store(tzeta.ptr()); - } - // Retrieve non-const access to zeta field from the database volVectorField& zeta = db().lookupObjectRef(zetaName_); @@ -169,6 +169,9 @@ void Foam::waveSurfacePressureFvPatchScalarField::updateCoeffs() const surfaceScalarField& phi = db().lookupObject(phiName_); + const scalarField& rhop = + patch().lookupPatchField(rhoName_); + // Cache the patch face-normal vectors tmp nf(patch().nf()); @@ -177,16 +180,11 @@ void Foam::waveSurfacePressureFvPatchScalarField::updateCoeffs() if (phi.dimensions() == dimMassFlux) { - const scalarField& rhop = - patch().lookupPatchField(rhoName_); - dZetap /= rhop; } const volVectorField& zeta0 = zeta.oldTime(); - Info << zeta0 << endl; - switch (ddtScheme) { case tsEuler: @@ -224,15 +222,14 @@ void Foam::waveSurfacePressureFvPatchScalarField::updateCoeffs() } } - - Info<< "min/max zetap = " << gMin(zetap & nf()) << ", " - << gMax(zetap & nf()) << endl; - // Update the surface pressure const uniformDimensionedVectorField& g = db().lookupObject("g"); - operator==(-g.value() & zetap); + const uniformDimensionedScalarField& pRef = + this->db().template lookupObject("pRef"); + + operator==(pRef.value() - rhop*(g.value() & zetap)); fixedValueFvPatchScalarField::updateCoeffs(); } diff --git a/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/0.orig/T b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/0.orig/T new file mode 100644 index 0000000000..91cbe7d81c --- /dev/null +++ b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/0.orig/T @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + freeSurface + { + type calculated; + value uniform 300; + } + + ".*Wall" + { + type calculated; + value uniform 300; + } + + "floatingObject.*" + { + type calculated; + value uniform 300; + } + + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/U b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/0.orig/U similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/U rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/0.orig/U diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/p b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/0.orig/p similarity index 96% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/p rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/0.orig/p index f76ed3b229..aba1ed318c 100644 --- a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/p +++ b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/0.orig/p @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 2 -2 0 0 0 0]; +dimensions [1 -1 -2 0 0 0 0]; internalField uniform 0; @@ -25,16 +25,19 @@ boundaryField type calculated; value uniform 0; } + ".*Wall" { type calculated; value uniform 0; } + "floatingObject.*" { type calculated; value uniform 0; } + frontAndBack { type empty; diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/p_gh b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/0.orig/p_rgh similarity index 87% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/p_gh rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/0.orig/p_rgh index 87c4bd139f..ed100c9a03 100644 --- a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/p_gh +++ b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/0.orig/p_rgh @@ -10,11 +10,11 @@ FoamFile format ascii; class volScalarField; location "0"; - object p_gh; + object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 2 -2 0 0 0 0]; +dimensions [1 -1 -2 0 0 0 0]; internalField uniform 0; @@ -25,15 +25,19 @@ boundaryField type waveSurfacePressure; value uniform 0; } + ".*Wall" { - type zeroGradient; + type fixedFluxPressure; + value uniform 0; } + "floatingObject.*" { type fixedFluxPressure; value uniform 0; } + frontAndBack { type empty; diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/pointDisplacement b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/0.orig/pointDisplacement similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/0.orig/pointDisplacement rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/0.orig/pointDisplacement diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/Allclean b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/Allclean similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/Allclean rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/Allclean diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/Allrun b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/Allrun similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/Allrun rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/Allrun diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/dynamicMeshDict b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/constant/dynamicMeshDict similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/dynamicMeshDict rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/constant/dynamicMeshDict diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/g b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/constant/g similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/g rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/constant/g diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/momentumTransport b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/constant/momentumTransport similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/momentumTransport rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/constant/momentumTransport diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/physicalProperties b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/constant/physicalProperties similarity index 53% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/physicalProperties rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/constant/physicalProperties index 028998592f..2b4cfaaf61 100644 --- a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/constant/physicalProperties +++ b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/constant/physicalProperties @@ -9,13 +9,43 @@ FoamFile { format ascii; class dictionary; + location "constant"; object physicalProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -viscosityModel constant; +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} -nu [0 2 -1 0 0 0 0] 1e-06; +mixture +{ + specie + { + molWeight 18; + } + equationOfState + { + rho 1000; + } + thermodynamics + { + Cv 4184; + Hf 0; + } + transport + { + mu 1e-3; + Pr 1; + } +} // ************************************************************************* // diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/extractHeightData b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/extractHeightData similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/extractHeightData rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/extractHeightData diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/blockMeshDict b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/blockMeshDict similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/blockMeshDict rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/blockMeshDict diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/controlDict b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/controlDict similarity index 96% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/controlDict rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/controlDict index 40a7a8e752..86cc7882e9 100644 --- a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/controlDict +++ b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/controlDict @@ -14,7 +14,9 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application potentialFreeSurfaceFoam; +application foamRun; + +solver isothermalFluid; startFrom startTime; diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/createPatchDict b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/createPatchDict similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/createPatchDict rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/createPatchDict diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/fvSchemes b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/fvSchemes similarity index 87% rename from tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/fvSchemes rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/fvSchemes index 15e610e728..66086fee92 100644 --- a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/fvSchemes +++ b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/fvSchemes @@ -22,15 +22,16 @@ ddtSchemes gradSchemes { default Gauss linear; - grad(p) Gauss linear; - grad(U) Gauss linear; } divSchemes { default none; + div(phi,U) Gauss upwind; - div((nuEff*dev2(T(grad(U))))) Gauss linear; + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; + + div(meshPhi,p) Gauss linear; } laplacianSchemes @@ -41,7 +42,6 @@ laplacianSchemes interpolationSchemes { default linear; - interpolate(U) linear; } snGradSchemes diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/fvSolution b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/fvSolution similarity index 93% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/fvSolution rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/fvSolution index 7e24097f54..f1578e51c0 100644 --- a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/fvSolution +++ b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/fvSolution @@ -33,16 +33,21 @@ solvers maxIter 100; } - p_gh + "rho.*" + { + solver diagonal; + } + + p_rgh { $pcorr; tolerance 1e-7; relTol 0.1; } - p_ghFinal + p_rghFinal { - $p_gh; + $p_rgh; relTol 0; } diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/topoSetDict b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/topoSetDict similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/topoSetDict rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/topoSetDict diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/topoSetDict-selectBottom b/tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/topoSetDict-selectBottom similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/topoSetDict-selectBottom rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceMovingOscillatingBox/system/topoSetDict-selectBottom diff --git a/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/0/T b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/0/T new file mode 100644 index 0000000000..aac75acb47 --- /dev/null +++ b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/0/T @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + freeSurface + { + type calculated; + value uniform 300; + } + walls + { + type calculated; + value uniform 300; + } + floatingObject + { + type calculated; + value uniform 300; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/0/U b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/0/U similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/0/U rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/0/U diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/0/p b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/0/p similarity index 96% rename from tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/0/p rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/0/p index 2d4ae0a841..ac07ceb85a 100644 --- a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/0/p +++ b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/0/p @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 2 -2 0 0 0 0]; +dimensions [1 -1 -2 0 0 0 0]; internalField uniform 0; diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/0/p_gh b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/0/p_rgh similarity index 94% rename from tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/0/p_gh rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/0/p_rgh index 7284976c04..aef93cbde3 100644 --- a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/0/p_gh +++ b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/0/p_rgh @@ -10,11 +10,11 @@ FoamFile format ascii; class volScalarField; location "0"; - object p_gh; + object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 2 -2 0 0 0 0]; +dimensions [1 -1 -2 0 0 0 0]; internalField uniform 0; diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/Allrun b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/Allrun similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/Allrun rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/Allrun diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/constant/g b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/constant/g similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/constant/g rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/constant/g diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/constant/momentumTransport b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/constant/momentumTransport similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/constant/momentumTransport rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/constant/momentumTransport diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/constant/physicalProperties b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/constant/physicalProperties similarity index 53% rename from tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/constant/physicalProperties rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/constant/physicalProperties index 028998592f..2b4cfaaf61 100644 --- a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/constant/physicalProperties +++ b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/constant/physicalProperties @@ -9,13 +9,43 @@ FoamFile { format ascii; class dictionary; + location "constant"; object physicalProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -viscosityModel constant; +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo eConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} -nu [0 2 -1 0 0 0 0] 1e-06; +mixture +{ + specie + { + molWeight 18; + } + equationOfState + { + rho 1000; + } + thermodynamics + { + Cv 4184; + Hf 0; + } + transport + { + mu 1e-3; + Pr 1; + } +} // ************************************************************************* // diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/extractHeightData b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/extractHeightData similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/extractHeightData rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/extractHeightData diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/blockMeshDict b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/system/blockMeshDict similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/blockMeshDict rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/system/blockMeshDict diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/controlDict b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/system/controlDict similarity index 96% rename from tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/controlDict rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/system/controlDict index 4d3f5c491f..b3fc3bb08e 100644 --- a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/controlDict +++ b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/system/controlDict @@ -14,7 +14,9 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application potentialFreeSurfaceFoam; +application foamRun; + +solver isothermalFluid; startFrom startTime; diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/fvSchemes b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/system/fvSchemes similarity index 94% rename from tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/fvSchemes rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/system/fvSchemes index 000781bee4..6911a53651 100644 --- a/tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox/system/fvSchemes +++ b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/system/fvSchemes @@ -28,7 +28,7 @@ divSchemes { default none; div(phi,U) Gauss upwind; - div((nuEff*dev2(T(grad(U))))) Gauss linear; + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes @@ -46,4 +46,5 @@ snGradSchemes default corrected; } + // ************************************************************************* // diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/fvSolution b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/system/fvSolution similarity index 92% rename from tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/fvSolution rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/system/fvSolution index e30b50a277..2ed90311f7 100644 --- a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/fvSolution +++ b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/system/fvSolution @@ -16,7 +16,12 @@ FoamFile solvers { - p_gh + "rho.*" + { + solver diagonal; + } + + p_rgh { solver GAMG; tolerance 1e-7; @@ -25,9 +30,9 @@ solvers maxIter 100; } - p_ghFinal + p_rghFinal { - $p_gh; + $p_rgh; tolerance 1e-7; relTol 0; } diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/topoSetDict b/tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/system/topoSetDict similarity index 100% rename from tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/topoSetDict rename to tutorials/modules/isothermalFluid/potentialFreeSurfaceOscillatingBox/system/topoSetDict