From b4c8f7eafac9416b218b39e382c0bb688df6c056 Mon Sep 17 00:00:00 2001 From: Henning Scheufler Date: Fri, 1 Oct 2021 12:12:20 +0200 Subject: [PATCH 01/35] WIP: update to new version --- .../multiRegionPhaseChangeFlow.C | 2 +- src/VoF/Make/files | 2 +- src/VoF/Make/options | 3 + src/VoF/advectionSchemes/MULES/MULESScheme.C | 144 ++++++++++-------- .../markInterfaceRegion/markInterfaceRegion.C | 2 +- .../reconstructedDistanceFunction.C | 10 +- .../isoSchemes/isoSurface/isoSurface.C | 2 +- .../plicSchemes/plicRDF/plicRDF.C | 12 +- ...AlphaContactAngleJiangFvPatchScalarField.C | 12 +- ...AlphaContactAngleJiangFvPatchScalarField.H | 6 +- ...aContactAngleVoxVoinovFvPatchScalarField.C | 12 +- ...aContactAngleVoxVoinovFvPatchScalarField.H | 6 +- ...AlphaContactAngleJiangFvPatchScalarField.C | 12 +- ...AlphaContactAngleJiangFvPatchScalarField.H | 8 +- ...aContactAngleVoxVoinovFvPatchScalarField.C | 12 +- ...aContactAngleVoxVoinovFvPatchScalarField.H | 6 +- .../explicitInterfaceDiffFlux.C | 1 - .../energySourceTermModel/Schrage/Schrage.C | 1 - .../hardtWondra/hardtWondra.C | 1 - .../hardtWondraGasPhase/hardtWondraGasPhase.C | 1 - .../noPhaseChange/noPhaseChange.C | 1 - .../interfaceEnergyFluxes.C | 2 +- .../reconstructionError/reconstructionError.C | 4 +- src/postProcessing/superHeated/superHeated.C | 2 +- .../thermalResiduals/thermalResiduals.C | 2 +- .../volumeFractionError/volumeFractionError.C | 10 +- .../wallHeatFluxSolid/wallHeatFluxSolid.C | 2 +- src/surfaceForces/Make/options | 3 +- .../surfaceTensionForceModel/RDF/RDF.C | 10 +- .../constantCurvature/constantCurvature.C | 2 +- .../fitParaboloid/fitParaboloid.C | 12 +- .../gradAlpha/gradAlpha.C | 10 +- .../heightFunction/heightFunction.C | 10 +- src/thermoDynamics/Allwmake | 2 +- 34 files changed, 171 insertions(+), 156 deletions(-) diff --git a/solver/multiRegionPhaseChangeFlow/multiRegionPhaseChangeFlow.C b/solver/multiRegionPhaseChangeFlow/multiRegionPhaseChangeFlow.C index 37f2b9f3..c57489ee 100644 --- a/solver/multiRegionPhaseChangeFlow/multiRegionPhaseChangeFlow.C +++ b/solver/multiRegionPhaseChangeFlow/multiRegionPhaseChangeFlow.C @@ -57,7 +57,7 @@ Description #include "advectionSchemes.H" #include "surfaceForces.H" -#include "alphaContactAngleFvPatchScalarField.H" +#include "alphaContactAngleTwoPhaseFvPatchScalarField.H" #include "singleComponentPhaseChange.H" diff --git a/src/VoF/Make/files b/src/VoF/Make/files index 8a86a57b..8261aed3 100644 --- a/src/VoF/Make/files +++ b/src/VoF/Make/files @@ -50,6 +50,6 @@ advectionSchemes/newAdvectionSchemes.C advectionSchemes/advectionSchemes.C advectionSchemes/isoAdvection/isoAdvection.C advectionSchemes/geoAdvection/geoAdvection.C -advectionSchemes/MULES/MULESScheme.C +/*advectionSchemes/MULES/MULESScheme.C*/ LIB = $(FOAM_USER_LIBBIN)/libVoF diff --git a/src/VoF/Make/options b/src/VoF/Make/options index 7c6b2322..e00da4c3 100644 --- a/src/VoF/Make/options +++ b/src/VoF/Make/options @@ -1,12 +1,15 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/fileFormat/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude LIB_LIBS = \ -lfiniteVolume \ + -lfileFormats \ -lsurfMesh \ -lmeshTools \ -ltwoPhaseMixture \ diff --git a/src/VoF/advectionSchemes/MULES/MULESScheme.C b/src/VoF/advectionSchemes/MULES/MULESScheme.C index dceca836..5220e9b0 100644 --- a/src/VoF/advectionSchemes/MULES/MULESScheme.C +++ b/src/VoF/advectionSchemes/MULES/MULESScheme.C @@ -278,7 +278,7 @@ void Foam::advection::MULESScheme::advect() if (alphaApplyPrevCorr_) { Info<< "Applying the previous iteration compression flux" << endl; - MULES::correct(alpha1_, alphaPhi_, talphaPhiCorr0_, 1, 0); + MULES::correct(alpha1_, alphaPhi_, talphaPhiCorr0_, oneField(), zeroField()); alphaPhi_ += talphaPhiCorr0_; } @@ -342,7 +342,7 @@ void Foam::advection::MULESScheme::advect() { alphaPhi_ = talphaPhiUn; - MULES::explicitSolve(alpha1_, phiCN, alphaPhi_, 1, 0); + MULES::explicitSolve(alpha1_, phiCN, alphaPhi_, oneField(), zeroField()); } alpha2_ = 1.0 - alpha1_; @@ -390,10 +390,10 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con word alphaScheme("div(phi,alpha)"); word alpharScheme("div(phirb,alpha)"); + // Set the off-centering coefficient according to ddt scheme scalar ocCoeff = 0; { - - tmp> ddtAlpha + tmp> tddtAlpha ( fv::ddtScheme::New ( @@ -401,18 +401,17 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con mesh_.ddtScheme("ddt(alpha)") ) ); - - // Set the off-centering coefficient according to ddt scheme + const fv::ddtScheme& ddtAlpha = tddtAlpha(); if ( - isType>(ddtAlpha()) - || isType>(ddtAlpha()) + isType>(ddtAlpha) + || isType>(ddtAlpha) ) { ocCoeff = 0; } - else if (isType>(ddtAlpha())) + else if (isType>(ddtAlpha)) { if (nAlphaSubCycles_ > 1) { @@ -422,9 +421,16 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con << exit(FatalError); } - ocCoeff = - refCast>(ddtAlpha()) - .ocCoeff(); + if + ( + alphaRestart + || mesh.time().timeIndex() > mesh.time().startTimeIndex() + 1 + ) + { + ocCoeff = + refCast>(ddtAlpha) + .ocCoeff(); + } } else { @@ -434,6 +440,7 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con } } + // Set the time blending factor, 1 for Euler scalar cnCoeff = 1.0/(1.0 + ocCoeff); // Standard face-flux compression coefficient @@ -446,6 +453,14 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con phic += (cAlpha_*icAlpha_)*fvc::interpolate(mag(U_)); } + // Add the optional shear compression contribution + if (scAlpha > 0) + { + phic += + scAlpha*mag(mesh.delta() & fvc::interpolate(symm(fvc::grad(U)))); + } + + surfaceScalarField::Boundary& phicBf = phic.boundaryFieldRef(); @@ -475,8 +490,8 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con ( ( LTS_ - ? fv::localEulerDdtScheme(mesh_).fvmDdt(alpha1_) - : fv::EulerDdtScheme(mesh_).fvmDdt(alpha1_) + ? fv::localEulerDdtScheme(mesh_).fvmDdt(alpha1) + : fv::EulerDdtScheme(mesh_).fvmDdt(alpha1) ) + fv::gaussConvectionScheme ( @@ -484,8 +499,10 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con phiCN, upwind(mesh_, phiCN) ).fvmDiv(phiCN, alpha1_) - == - Su + fvm::Sp(Sp , alpha1_) + // - fvm::Sp(fvc::ddt(dimensionedScalar("1", dimless, 1), mesh) + // + fvc::div(phiCN), alpha1) + == + Su + fvm::Sp(Sp , alpha1_) ); alpha1Eqn.solve(); @@ -502,7 +519,15 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con if (alphaApplyPrevCorr_) { Info<< "Applying the previous iteration compression flux" << endl; - MULES::correct(alpha1_, alphaPhi_, talphaPhiCorr0_, 1, 0); + MULES::correct + ( + geometricOneField(), + alpha1, + alphaPhi10, + talphaPhi1Corr0.ref(), + oneField(), + zeroField() + ); alphaPhi_ += talphaPhiCorr0_; } @@ -512,7 +537,6 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con alpha2_ = 1.0 - alpha1_; - // mixture.correct(); updateNHatf(); } @@ -521,33 +545,26 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con { surfaceScalarField phir(phic*nHatf_); - tmp talphaPhiUn + tmp talphaPhi1Un + ( + fvc::flux ( - fvc::flux - ( - phi_, - alpha1_, - alphaScheme - ) - + fvc::flux - ( - -fvc::flux(-phir, alpha2_, alpharScheme), - alpha1_, - alpharScheme - ) - ); - - // Calculate the Crank-Nicolson off-centred alpha flux -// if (ocCoeff > 0) -// { -// talphaPhiUn = -// cnCoeff*talphaPhiUn + (1.0 - cnCoeff)*alphaPhi_.oldTime(); -// } + phi_, + cnCoeff*alpha1 + (1.0 - cnCoeff)*alpha1.oldTime(), + alphaScheme + ) + + fvc::flux + ( + -fvc::flux(-phir, alpha2, alpharScheme), + alpha1, + alpharScheme + ) + ); - if (MULESCorr_) + if (MULESCorr) { - tmp talphaPhiCorr(talphaPhiUn - alphaPhi_); - volScalarField alpha10("alpha10", alpha1_); + tmp talphaPhi1Corr(talphaPhi1Un - alphaPhi_); + volScalarField alpha10("alpha10", alpha1); MULES::correct ( @@ -557,14 +574,14 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con alphaPhi_, Sp, Su, - 1, - 0 + oneField(), + zeroField() ); // Under-relax the correction for all but the 1st corrector if (aCorr == 0) { - alphaPhi_ += talphaPhiCorr(); + alphaPhi_ += talphaPhi1Corr(); } else { @@ -574,30 +591,27 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con } else { - - alphaPhi_ = talphaPhiUn; - + alphaPhi_ = talphaPhi1Un; MULES::explicitSolve ( - geometricOneField(), - alpha1_, - phiCN, - alphaPhi_, - Sp, - Su, - 1, - 0 + geometricOneField(), + alpha1, + phiCN, + alphaPhi_, + Sp, + Su, + oneField(), + zeroField() ); } - alpha2_ = 1.0 - alpha1_; + alpha2 = 1.0 - alpha1; - // mixture.correct(); - updateNHatf(); + mixture.correct(); } - if (alphaApplyPrevCorr_ && MULESCorr_) + if (alphaApplyPrevCorr && MULESCorr) { talphaPhiCorr0_ = alphaPhi_ - talphaPhiCorr0_; } @@ -606,20 +620,23 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con ( word(mesh_.ddtScheme("ddt(rho,U)")) == fv::EulerDdtScheme::typeName + || word(mesh_.ddtScheme("ddt(rho,U)")) + == fv::localEulerDdtScheme::typeName ) { -// rhoPhi = alphaPhi_*(rho1 - rho2) + phiCN*rho2; + // rhoPhi = alphaPhi_*(rho1 - rho2) + phiCN*rho2; } else { if (ocCoeff > 0) { // Calculate the end-of-time-step alpha flux - alphaPhi_ = (alphaPhi_ - (1.0 - cnCoeff)*alphaPhi_.oldTime())/cnCoeff; + alphaPhi_ = + (alphaPhi_ - (1.0 - cnCoeff)*alphaPhi_.oldTime())/cnCoeff; } // Calculate the end-of-time-step mass flux - //rhoPhi = alphaPhi_*(rho1 - rho2) + phi_*rho2; + // rhoPhi = alphaPhi10*(rho1f - rho2f) + phi*rho2f; } Info<< "Phase-1 volume fraction = " @@ -629,4 +646,3 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con << endl; } - diff --git a/src/VoF/markInterfaceRegion/markInterfaceRegion.C b/src/VoF/markInterfaceRegion/markInterfaceRegion.C index ea90f6e7..b488232b 100644 --- a/src/VoF/markInterfaceRegion/markInterfaceRegion.C +++ b/src/VoF/markInterfaceRegion/markInterfaceRegion.C @@ -28,7 +28,7 @@ License #include "wedgePolyPatch.H" #include "indexedOctree.H" #include "treeDataPoint.H" -#include "alphaContactAngleFvPatchScalarField.H" +#include "alphaContactAngleTwoPhaseFvPatchScalarField.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/VoF/reconstructedDistanceFunction/reconstructedDistanceFunction.C b/src/VoF/reconstructedDistanceFunction/reconstructedDistanceFunction.C index a407acf6..c7945cb5 100644 --- a/src/VoF/reconstructedDistanceFunction/reconstructedDistanceFunction.C +++ b/src/VoF/reconstructedDistanceFunction/reconstructedDistanceFunction.C @@ -28,7 +28,7 @@ License #include "wedgePolyPatch.H" #include "indexedOctree.H" #include "treeDataPoint.H" -#include "alphaContactAngleFvPatchScalarField.H" +#include "alphaContactAngleTwoPhaseFvPatchScalarField.H" namespace Foam { @@ -693,12 +693,12 @@ void Foam::reconstructedDistanceFunction::updateContactAngle forAll(boundary, patchi) { - if (isA(abf[patchi])) + if (isA(abf[patchi])) { - alphaContactAngleFvPatchScalarField& acap = - const_cast + alphaContactAngleTwoPhaseFvPatchScalarField& acap = + const_cast ( - refCast + refCast ( abf[patchi] ) diff --git a/src/VoF/reconstructionSchemes/isoSchemes/isoSurface/isoSurface.C b/src/VoF/reconstructionSchemes/isoSchemes/isoSurface/isoSurface.C index 5ea1da50..7efc4c20 100644 --- a/src/VoF/reconstructionSchemes/isoSchemes/isoSurface/isoSurface.C +++ b/src/VoF/reconstructionSchemes/isoSchemes/isoSurface/isoSurface.C @@ -60,7 +60,7 @@ Foam::reconstruction::isoSurface::isoSurface cutCell_(mesh_,ap_), // Tolerances and solution controls - iso_(modelDict().lookupOrAddDefault("iso", 0.5,false,false)) + iso_(modelDict().lookupOrDefault("iso", 0.5)) { } diff --git a/src/VoF/reconstructionSchemes/plicSchemes/plicRDF/plicRDF.C b/src/VoF/reconstructionSchemes/plicSchemes/plicRDF/plicRDF.C index 397e2132..5d570fbc 100755 --- a/src/VoF/reconstructionSchemes/plicSchemes/plicRDF/plicRDF.C +++ b/src/VoF/reconstructionSchemes/plicSchemes/plicRDF/plicRDF.C @@ -30,7 +30,7 @@ License #include "fvc.H" #include "leastSquareGrad.H" #include "addToRunTimeSelectionTable.H" -#include "alphaContactAngleFvPatchScalarField.H" +#include "alphaContactAngleTwoPhaseFvPatchScalarField.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -321,7 +321,7 @@ void Foam::reconstruction::plicRDF::centreAndNormalBC() forAll(boundary, patchi) { - if (isA(abf[patchi])) + if (isA(abf[patchi])) { forAll(normalf.boundaryFieldRef()[patchi],i) { @@ -338,12 +338,12 @@ void Foam::reconstruction::plicRDF::centreAndNormalBC() forAll(boundary, patchi) { - if (isA(abf[patchi])) + if (isA(abf[patchi])) { - alphaContactAngleFvPatchScalarField& acap = - const_cast + alphaContactAngleTwoPhaseFvPatchScalarField& acap = + const_cast ( - refCast + refCast ( abf[patchi] ) diff --git a/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.C b/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.C index 7787f258..de373293 100644 --- a/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.C +++ b/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.C @@ -42,7 +42,7 @@ dynamicAlphaContactAngleJiangFvPatchScalarField const DimensionedField& iF ) : - alphaContactAngleFvPatchScalarField(p, iF), + alphaContactAngleTwoPhaseFvPatchScalarField(p, iF), theta0_(0.0) {} @@ -56,7 +56,7 @@ dynamicAlphaContactAngleJiangFvPatchScalarField const fvPatchFieldMapper& mapper ) : - alphaContactAngleFvPatchScalarField(gcpsf, p, iF, mapper), + alphaContactAngleTwoPhaseFvPatchScalarField(gcpsf, p, iF, mapper), theta0_(gcpsf.theta0_) {} @@ -69,7 +69,7 @@ dynamicAlphaContactAngleJiangFvPatchScalarField const dictionary& dict ) : - alphaContactAngleFvPatchScalarField(p, iF, dict), + alphaContactAngleTwoPhaseFvPatchScalarField(p, iF, dict), theta0_(readScalar(dict.lookup("theta0"))) { evaluate(); @@ -82,7 +82,7 @@ dynamicAlphaContactAngleJiangFvPatchScalarField const dynamicAlphaContactAngleJiangFvPatchScalarField& gcpsf ) : - alphaContactAngleFvPatchScalarField(gcpsf), + alphaContactAngleTwoPhaseFvPatchScalarField(gcpsf), theta0_(gcpsf.theta0_) {} @@ -94,7 +94,7 @@ dynamicAlphaContactAngleJiangFvPatchScalarField const DimensionedField& iF ) : - alphaContactAngleFvPatchScalarField(gcpsf, iF), + alphaContactAngleTwoPhaseFvPatchScalarField(gcpsf, iF), theta0_(gcpsf.theta0_) {} @@ -186,7 +186,7 @@ Foam::dynamicAlphaContactAngleJiangFvPatchScalarField::theta void Foam::dynamicAlphaContactAngleJiangFvPatchScalarField::write(Ostream& os) const { - alphaContactAngleFvPatchScalarField::write(os); + alphaContactAngleTwoPhaseFvPatchScalarField::write(os); os.writeKeyword("theta0") << theta0_ << token::END_STATEMENT << nl; writeEntry("value", os); } diff --git a/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.H b/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.H index 8fd802b9..554132aa 100644 --- a/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.H +++ b/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.H @@ -26,7 +26,7 @@ Class Description A dynamic alphaContactAngle scalar boundary condition - (alphaContactAngleFvPatchScalarField) + (alphaContactAngleTwoPhaseFvPatchScalarField) SourceFiles dynamicAlphaContactAngleJiangFvPatchScalarField.C @@ -37,7 +37,7 @@ SourceFiles #ifndef dynamicAlphaContactAngleJiangFvPatchScalarField_H #define dynamicAlphaContactAngleJiangFvPatchScalarField_H -#include "alphaContactAngleFvPatchScalarField.H" +#include "alphaContactAngleTwoPhaseFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,7 +50,7 @@ namespace Foam class dynamicAlphaContactAngleJiangFvPatchScalarField : - public alphaContactAngleFvPatchScalarField + public alphaContactAngleTwoPhaseFvPatchScalarField { // Private data diff --git a/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleVoxVoinov/dynamicAlphaContactAngleVoxVoinovFvPatchScalarField.C b/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleVoxVoinov/dynamicAlphaContactAngleVoxVoinovFvPatchScalarField.C index 7a2a1ed5..8a1c7db3 100644 --- a/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleVoxVoinov/dynamicAlphaContactAngleVoxVoinovFvPatchScalarField.C +++ b/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleVoxVoinov/dynamicAlphaContactAngleVoxVoinovFvPatchScalarField.C @@ -40,7 +40,7 @@ dynamicAlphaContactAngleVoxVoinovFvPatchScalarField const DimensionedField& iF ) : - alphaContactAngleFvPatchScalarField(p, iF), + alphaContactAngleTwoPhaseFvPatchScalarField(p, iF), theta0_(0.0), ct_(0.0) {} @@ -55,7 +55,7 @@ dynamicAlphaContactAngleVoxVoinovFvPatchScalarField const fvPatchFieldMapper& mapper ) : - alphaContactAngleFvPatchScalarField(gcpsf, p, iF, mapper), + alphaContactAngleTwoPhaseFvPatchScalarField(gcpsf, p, iF, mapper), theta0_(gcpsf.theta0_), ct_(gcpsf.ct_) {} @@ -69,7 +69,7 @@ dynamicAlphaContactAngleVoxVoinovFvPatchScalarField const dictionary& dict ) : - alphaContactAngleFvPatchScalarField(p, iF, dict), + alphaContactAngleTwoPhaseFvPatchScalarField(p, iF, dict), theta0_(readScalar(dict.lookup("theta0"))), ct_(readScalar(dict.lookup("ct"))) { @@ -83,7 +83,7 @@ dynamicAlphaContactAngleVoxVoinovFvPatchScalarField const dynamicAlphaContactAngleVoxVoinovFvPatchScalarField& gcpsf ) : - alphaContactAngleFvPatchScalarField(gcpsf), + alphaContactAngleTwoPhaseFvPatchScalarField(gcpsf), theta0_(gcpsf.theta0_), ct_(gcpsf.ct_) {} @@ -96,7 +96,7 @@ dynamicAlphaContactAngleVoxVoinovFvPatchScalarField const DimensionedField& iF ) : - alphaContactAngleFvPatchScalarField(gcpsf, iF), + alphaContactAngleTwoPhaseFvPatchScalarField(gcpsf, iF), theta0_(gcpsf.theta0_), ct_(gcpsf.ct_) {} @@ -194,7 +194,7 @@ Foam::dynamicAlphaContactAngleVoxVoinovFvPatchScalarField::theta void Foam::dynamicAlphaContactAngleVoxVoinovFvPatchScalarField::write(Ostream& os) const { - alphaContactAngleFvPatchScalarField::write(os); + alphaContactAngleTwoPhaseFvPatchScalarField::write(os); os.writeKeyword("theta0") << theta0_ << token::END_STATEMENT << nl; os.writeKeyword("ct") << ct_ << token::END_STATEMENT << nl; writeEntry("value", os); diff --git a/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleVoxVoinov/dynamicAlphaContactAngleVoxVoinovFvPatchScalarField.H b/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleVoxVoinov/dynamicAlphaContactAngleVoxVoinovFvPatchScalarField.H index c22964f1..aeacebf1 100644 --- a/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleVoxVoinov/dynamicAlphaContactAngleVoxVoinovFvPatchScalarField.H +++ b/src/boundaryConditions/dynContactAngleModel/dynamicAlphaContactAngleVoxVoinov/dynamicAlphaContactAngleVoxVoinovFvPatchScalarField.H @@ -26,7 +26,7 @@ Class Description A dynamic alphaContactAngle scalar boundary condition - (alphaContactAngleFvPatchScalarField) + (alphaContactAngleTwoPhaseFvPatchScalarField) SourceFiles dynamicAlphaContactAngleVoxVoinovFvPatchScalarField.C @@ -38,7 +38,7 @@ SourceFiles #ifndef dynamicAlphaContactAngleVoxVoinovFvPatchScalarField_H #define dynamicAlphaContactAngleVoxVoinovFvPatchScalarField_H -#include "alphaContactAngleFvPatchScalarField.H" +#include "alphaContactAngleTwoPhaseFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -51,7 +51,7 @@ namespace Foam class dynamicAlphaContactAngleVoxVoinovFvPatchScalarField : - public alphaContactAngleFvPatchScalarField + public alphaContactAngleTwoPhaseFvPatchScalarField { // Private data diff --git a/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.C b/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.C index 23644e30..c6baeeb8 100644 --- a/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.C +++ b/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.C @@ -44,7 +44,7 @@ dynamicAlphaContactAngleJiangFvPatchScalarField const DimensionedField& iF ) : - alphaContactAngleFvPatchScalarField(p, iF), + alphaContactAngleTwoPhaseFvPatchScalarField(p, iF), theta0_(0.0) {} @@ -58,7 +58,7 @@ dynamicAlphaContactAngleJiangFvPatchScalarField const fvPatchFieldMapper& mapper ) : - alphaContactAngleFvPatchScalarField(gcpsf, p, iF, mapper), + alphaContactAngleTwoPhaseFvPatchScalarField(gcpsf, p, iF, mapper), theta0_(gcpsf.theta0_) {} @@ -71,7 +71,7 @@ dynamicAlphaContactAngleJiangFvPatchScalarField const dictionary& dict ) : - alphaContactAngleFvPatchScalarField(p, iF, dict), + alphaContactAngleTwoPhaseFvPatchScalarField(p, iF, dict), theta0_(readScalar(dict.lookup("theta0"))) { evaluate(); @@ -84,7 +84,7 @@ dynamicAlphaContactAngleJiangFvPatchScalarField const dynamicAlphaContactAngleJiangFvPatchScalarField& gcpsf ) : - alphaContactAngleFvPatchScalarField(gcpsf), + alphaContactAngleTwoPhaseFvPatchScalarField(gcpsf), theta0_(gcpsf.theta0_) {} @@ -96,7 +96,7 @@ dynamicAlphaContactAngleJiangFvPatchScalarField const DimensionedField& iF ) : - alphaContactAngleFvPatchScalarField(gcpsf, iF), + alphaContactAngleTwoPhaseFvPatchScalarField(gcpsf, iF), theta0_(gcpsf.theta0_) {} @@ -174,7 +174,7 @@ Foam::dynamicAlphaContactAngleJiangFvPatchScalarField::theta void Foam::dynamicAlphaContactAngleJiangFvPatchScalarField::write(Ostream& os) const { - alphaContactAngleFvPatchScalarField::write(os); + alphaContactAngleTwoPhaseFvPatchScalarField::write(os); os.writeKeyword("theta0") << theta0_ << token::END_STATEMENT << nl; writeEntry("value", os); } diff --git a/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.H b/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.H index 59c3c05f..18e7b048 100644 --- a/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.H +++ b/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleJiang/dynamicAlphaContactAngleJiangFvPatchScalarField.H @@ -26,7 +26,7 @@ Class Description A dynamic alphaContactAngle scalar boundary condition - (alphaContactAngleFvPatchScalarField) + (alphaContactAngleTwoPhaseFvPatchScalarField) SourceFiles dynamicAlphaContactAngleJiangFvPatchScalarField.C @@ -34,14 +34,14 @@ SourceFiles Dynamics of Spreading of Liquid on Solid Surface* nach dem paper Eq15 -thetaD^3 −θ0^3 = cT Ca ct numerical +thetaD^3 −θ0^3 = cT Ca ct numerical \*---------------------------------------------------------------------------*/ #ifndef dynamicAlphaContactAngleJiangFvPatchScalarField_H #define dynamicAlphaContactAngleJiangFvPatchScalarField_H -#include "alphaContactAngleFvPatchScalarField.H" +#include "alphaContactAngleTwoPhaseFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,7 +54,7 @@ namespace Foam class dynamicAlphaContactAngleJiangFvPatchScalarField : - public alphaContactAngleFvPatchScalarField + public alphaContactAngleTwoPhaseFvPatchScalarField { // Private data diff --git a/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleVoxVoinov/compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField.C b/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleVoxVoinov/compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField.C index f61f6632..87fbfad7 100644 --- a/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleVoxVoinov/compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField.C +++ b/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleVoxVoinov/compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField.C @@ -41,7 +41,7 @@ compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField const DimensionedField& iF ) : - alphaContactAngleFvPatchScalarField(p, iF), + alphaContactAngleTwoPhaseFvPatchScalarField(p, iF), init_(true), theta0_(0.0), ct_(0.0), @@ -58,7 +58,7 @@ compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField const fvPatchFieldMapper& mapper ) : - alphaContactAngleFvPatchScalarField(gcpsf, p, iF, mapper), + alphaContactAngleTwoPhaseFvPatchScalarField(gcpsf, p, iF, mapper), init_(true), theta0_(gcpsf.theta0_), ct_(gcpsf.ct_), @@ -74,7 +74,7 @@ compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField const dictionary& dict ) : - alphaContactAngleFvPatchScalarField(p, iF, dict), + alphaContactAngleTwoPhaseFvPatchScalarField(p, iF, dict), init_(true), theta0_(readScalar(dict.lookup("theta0"))), ct_(readScalar(dict.lookup("ct"))), @@ -90,7 +90,7 @@ compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField const compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField& gcpsf ) : - alphaContactAngleFvPatchScalarField(gcpsf), + alphaContactAngleTwoPhaseFvPatchScalarField(gcpsf), init_(true), theta0_(gcpsf.theta0_), ct_(gcpsf.ct_), @@ -105,7 +105,7 @@ compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField const DimensionedField& iF ) : - alphaContactAngleFvPatchScalarField(gcpsf, iF), + alphaContactAngleTwoPhaseFvPatchScalarField(gcpsf, iF), init_(true), theta0_(gcpsf.theta0_), ct_(gcpsf.ct_), @@ -195,7 +195,7 @@ Foam::compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField::theta void Foam::compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField::write(Ostream& os) const { - alphaContactAngleFvPatchScalarField::write(os); + alphaContactAngleTwoPhaseFvPatchScalarField::write(os); os.writeKeyword("theta0") << theta0_ << token::END_STATEMENT << nl; os.writeKeyword("ct") << ct_ << token::END_STATEMENT << nl; os.writeKeyword("muFieldName") << muName_ << token::END_STATEMENT << nl; diff --git a/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleVoxVoinov/compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField.H b/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleVoxVoinov/compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField.H index c3669702..3ca7e7d6 100644 --- a/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleVoxVoinov/compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField.H +++ b/src/boundaryConditions/dynContactAngleModelComp/dynamicAlphaContactAngleVoxVoinov/compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField.H @@ -26,7 +26,7 @@ Class Description A dynamic alphaContactAngle scalar boundary condition - (alphaContactAngleFvPatchScalarField) + (alphaContactAngleTwoPhaseFvPatchScalarField) SourceFiles compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField.C @@ -37,7 +37,7 @@ SourceFiles #ifndef compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField_H #define compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField_H -#include "alphaContactAngleFvPatchScalarField.H" +#include "alphaContactAngleTwoPhaseFvPatchScalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,7 +50,7 @@ namespace Foam class compdynamicAlphaContactAngleVoxVoinovFvPatchScalarField : - public alphaContactAngleFvPatchScalarField + public alphaContactAngleTwoPhaseFvPatchScalarField { // Private data diff --git a/src/phaseChange/interfaceDiffFlux/explicitInterfaceDiffFlux/explicitInterfaceDiffFlux.C b/src/phaseChange/interfaceDiffFlux/explicitInterfaceDiffFlux/explicitInterfaceDiffFlux.C index 95319060..0fc33f4d 100644 --- a/src/phaseChange/interfaceDiffFlux/explicitInterfaceDiffFlux/explicitInterfaceDiffFlux.C +++ b/src/phaseChange/interfaceDiffFlux/explicitInterfaceDiffFlux/explicitInterfaceDiffFlux.C @@ -21,7 +21,6 @@ License #include "explicitInterfaceDiffFlux.H" #include "zeroGradientFvPatchFields.H" -#include "alphaContactAngleFvPatchScalarField.H" #include "mathematicalConstants.H" #include "surfaceInterpolate.H" #include "fvcDiv.H" diff --git a/src/phaseChange/phaseChangeModels/energySourceTermModel/Schrage/Schrage.C b/src/phaseChange/phaseChangeModels/energySourceTermModel/Schrage/Schrage.C index 11e90ec0..45a1e3ea 100644 --- a/src/phaseChange/phaseChangeModels/energySourceTermModel/Schrage/Schrage.C +++ b/src/phaseChange/phaseChangeModels/energySourceTermModel/Schrage/Schrage.C @@ -22,7 +22,6 @@ License #include "addToRunTimeSelectionTable.H" #include "zeroGradientFvPatchFields.H" -#include "alphaContactAngleFvPatchScalarField.H" #include "mathematicalConstants.H" #include "surfaceInterpolate.H" #include "fvcDiv.H" diff --git a/src/phaseChange/phaseChangeModels/massSourceTermModel/hardtWondra/hardtWondra.C b/src/phaseChange/phaseChangeModels/massSourceTermModel/hardtWondra/hardtWondra.C index c06ad646..82bbda9d 100644 --- a/src/phaseChange/phaseChangeModels/massSourceTermModel/hardtWondra/hardtWondra.C +++ b/src/phaseChange/phaseChangeModels/massSourceTermModel/hardtWondra/hardtWondra.C @@ -22,7 +22,6 @@ License #include "addToRunTimeSelectionTable.H" #include "zeroGradientFvPatchFields.H" -#include "alphaContactAngleFvPatchScalarField.H" #include "mathematicalConstants.H" #include "surfaceInterpolate.H" #include "fvcDiv.H" diff --git a/src/phaseChange/phaseChangeModels/massSourceTermModel/hardtWondraGasPhase/hardtWondraGasPhase.C b/src/phaseChange/phaseChangeModels/massSourceTermModel/hardtWondraGasPhase/hardtWondraGasPhase.C index 6ffe61a3..fdf37f69 100644 --- a/src/phaseChange/phaseChangeModels/massSourceTermModel/hardtWondraGasPhase/hardtWondraGasPhase.C +++ b/src/phaseChange/phaseChangeModels/massSourceTermModel/hardtWondraGasPhase/hardtWondraGasPhase.C @@ -22,7 +22,6 @@ License #include "addToRunTimeSelectionTable.H" #include "zeroGradientFvPatchFields.H" -#include "alphaContactAngleFvPatchScalarField.H" #include "mathematicalConstants.H" #include "surfaceInterpolate.H" #include "fvcDiv.H" diff --git a/src/phaseChange/phaseChangeModels/massSourceTermModel/noPhaseChange/noPhaseChange.C b/src/phaseChange/phaseChangeModels/massSourceTermModel/noPhaseChange/noPhaseChange.C index 30cde702..d1431009 100644 --- a/src/phaseChange/phaseChangeModels/massSourceTermModel/noPhaseChange/noPhaseChange.C +++ b/src/phaseChange/phaseChangeModels/massSourceTermModel/noPhaseChange/noPhaseChange.C @@ -22,7 +22,6 @@ License #include "addToRunTimeSelectionTable.H" #include "zeroGradientFvPatchFields.H" -#include "alphaContactAngleFvPatchScalarField.H" #include "mathematicalConstants.H" #include "surfaceInterpolate.H" #include "fvcDiv.H" diff --git a/src/postProcessing/interfaceEnergyFluxes/interfaceEnergyFluxes.C b/src/postProcessing/interfaceEnergyFluxes/interfaceEnergyFluxes.C index aabdd618..84f820f1 100644 --- a/src/postProcessing/interfaceEnergyFluxes/interfaceEnergyFluxes.C +++ b/src/postProcessing/interfaceEnergyFluxes/interfaceEnergyFluxes.C @@ -162,7 +162,7 @@ bool Foam::functionObjects::interfaceEnergyFluxes::write() if (Pstream::master()) { - writeTime(file()); + writeCurrentTime(file()); file() << token::TAB << intEnergyLiquid diff --git a/src/postProcessing/reconstructionError/reconstructionError.C b/src/postProcessing/reconstructionError/reconstructionError.C index b9ed40c8..12c4d7cf 100644 --- a/src/postProcessing/reconstructionError/reconstructionError.C +++ b/src/postProcessing/reconstructionError/reconstructionError.C @@ -200,7 +200,7 @@ void Foam::reconstructionError::write(const scalar k1, const scalar k2) if (Pstream::master()) { - writeTime(file()); + writeCurrentTime(file()); file() << token::TAB << LNormalInf_ @@ -229,7 +229,7 @@ void Foam::reconstructionError::write() if (Pstream::master()) { - writeTime(file()); + writeCurrentTime(file()); file() << token::TAB << LNormalInf_ diff --git a/src/postProcessing/superHeated/superHeated.C b/src/postProcessing/superHeated/superHeated.C index eda0fa27..12dfd470 100644 --- a/src/postProcessing/superHeated/superHeated.C +++ b/src/postProcessing/superHeated/superHeated.C @@ -160,7 +160,7 @@ bool Foam::functionObjects::superHeated::write() if (Pstream::master()) { - writeTime(file()); + writeCurrentTime(file()); file() << token::TAB << maximumValue diff --git a/src/postProcessing/thermalResiduals/thermalResiduals.C b/src/postProcessing/thermalResiduals/thermalResiduals.C index 8e3e2af3..ea73d21d 100644 --- a/src/postProcessing/thermalResiduals/thermalResiduals.C +++ b/src/postProcessing/thermalResiduals/thermalResiduals.C @@ -133,7 +133,7 @@ bool Foam::functionObjects::thermalResiduals::write() if (Pstream::master()) { - writeTime(file()); + writeCurrentTime(file()); file() << token::TAB << intVolValue diff --git a/src/postProcessing/volumeFractionError/volumeFractionError.C b/src/postProcessing/volumeFractionError/volumeFractionError.C index b61609b9..8ca8167a 100644 --- a/src/postProcessing/volumeFractionError/volumeFractionError.C +++ b/src/postProcessing/volumeFractionError/volumeFractionError.C @@ -74,7 +74,7 @@ Foam::functionObjects::volumeFractionError::volumeFractionError Field_(), dict_(dict), initMass_(0), - initCentre_(dict.lookup("origin")) + initCentre_(dict.get("origin")) { @@ -98,7 +98,7 @@ bool Foam::functionObjects::volumeFractionError::read(const dictionary& dict) fvMeshFunctionObject::read(dict); writeFile::read(dict); - Field_ = word(dict.lookup("field")); + Field_ = dict.get("field"); // set initial mass @@ -106,7 +106,7 @@ bool Foam::functionObjects::volumeFractionError::read(const dictionary& dict) ( implicitFunction::New ( - word(dict.lookup("function")), + dict.get("function"), dict ) ); @@ -177,7 +177,7 @@ bool Foam::functionObjects::volumeFractionError::write() const volScalarField& alpha = lookupObject(Field_); - vector centre = dict_.lookup("origin"); + vector centre = dict_.get("origin"); const volVectorField& U = mesh_.lookupObject("U"); @@ -289,7 +289,7 @@ bool Foam::functionObjects::volumeFractionError::write() if (Pstream::master()) { - writeTime(file()); + writeCurrentTime(file()); file() << token::TAB << E1 diff --git a/src/postProcessing/wallHeatFluxSolid/wallHeatFluxSolid.C b/src/postProcessing/wallHeatFluxSolid/wallHeatFluxSolid.C index c078d3a6..410f5402 100644 --- a/src/postProcessing/wallHeatFluxSolid/wallHeatFluxSolid.C +++ b/src/postProcessing/wallHeatFluxSolid/wallHeatFluxSolid.C @@ -274,7 +274,7 @@ bool Foam::functionObjects::wallHeatFluxSolid::write() if (Pstream::master()) { - writeTime(file()); + writeCurrentTime(file()); file() << token::TAB << pp.name() diff --git a/src/surfaceForces/Make/options b/src/surfaceForces/Make/options index 4ce8d08d..3ff78edb 100644 --- a/src/surfaceForces/Make/options +++ b/src/surfaceForces/Make/options @@ -8,7 +8,8 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/compressibleTransportModel \ - -I$(LIB_SRC)/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle + -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude + LIB_LIBS = \ -lfiniteVolume \ diff --git a/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/RDF/RDF.C b/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/RDF/RDF.C index 21fecb1f..90d505f6 100644 --- a/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/RDF/RDF.C +++ b/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/RDF/RDF.C @@ -20,7 +20,7 @@ License #include "RDF.H" #include "addToRunTimeSelectionTable.H" -#include "alphaContactAngleFvPatchScalarField.H" +#include "alphaContactAngleTwoPhaseFvPatchScalarField.H" #include "mathematicalConstants.H" #include "surfaceInterpolate.H" #include "fvcDiv.H" @@ -207,12 +207,12 @@ void Foam::RDF::correctContactAngle forAll(boundary, patchi) { - if (isA(abf[patchi])) + if (isA(abf[patchi])) { - alphaContactAngleFvPatchScalarField& acap = - const_cast + alphaContactAngleTwoPhaseFvPatchScalarField& acap = + const_cast ( - refCast + refCast ( abf[patchi] ) diff --git a/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/constantCurvature/constantCurvature.C b/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/constantCurvature/constantCurvature.C index 2fcd1b4f..5d60f511 100644 --- a/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/constantCurvature/constantCurvature.C +++ b/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/constantCurvature/constantCurvature.C @@ -20,7 +20,7 @@ License #include "constantCurvature.H" #include "addToRunTimeSelectionTable.H" -#include "alphaContactAngleFvPatchScalarField.H" +#include "alphaContactAngleTwoPhaseFvPatchScalarField.H" #include "mathematicalConstants.H" #include "surfaceInterpolate.H" #include "fvcDiv.H" diff --git a/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/fitParaboloid/fitParaboloid.C b/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/fitParaboloid/fitParaboloid.C index 55d9a8c3..416a2480 100644 --- a/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/fitParaboloid/fitParaboloid.C +++ b/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/fitParaboloid/fitParaboloid.C @@ -20,7 +20,7 @@ License #include "fitParaboloid.H" #include "addToRunTimeSelectionTable.H" -#include "alphaContactAngleFvPatchScalarField.H" +#include "alphaContactAngleTwoPhaseFvPatchScalarField.H" #include "mathematicalConstants.H" #include "surfaceInterpolate.H" #include "fvcDiv.H" @@ -180,7 +180,7 @@ void Foam::fitParaboloid::correctContactAngle forAll(boundary, patchi) { - if (isA(abf[patchi])) + if (isA(abf[patchi])) { forAll(normalf.boundaryFieldRef()[patchi],i) { @@ -197,12 +197,12 @@ void Foam::fitParaboloid::correctContactAngle forAll(boundary, patchi) { - if (isA(abf[patchi])) + if (isA(abf[patchi])) { - alphaContactAngleFvPatchScalarField& acap = - const_cast + alphaContactAngleTwoPhaseFvPatchScalarField& acap = + const_cast ( - refCast + refCast ( abf[patchi] ) diff --git a/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/gradAlpha/gradAlpha.C b/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/gradAlpha/gradAlpha.C index c843d28d..6b76638a 100644 --- a/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/gradAlpha/gradAlpha.C +++ b/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/gradAlpha/gradAlpha.C @@ -20,7 +20,7 @@ License #include "gradAlpha.H" #include "addToRunTimeSelectionTable.H" -#include "alphaContactAngleFvPatchScalarField.H" +#include "alphaContactAngleTwoPhaseFvPatchScalarField.H" #include "mathematicalConstants.H" #include "surfaceInterpolate.H" #include "fvcDiv.H" @@ -80,12 +80,12 @@ void Foam::gradAlpha::correctContactAngle forAll(boundary, patchi) { - if (isA(abf[patchi])) + if (isA(abf[patchi])) { - alphaContactAngleFvPatchScalarField& acap = - const_cast + alphaContactAngleTwoPhaseFvPatchScalarField& acap = + const_cast ( - refCast + refCast ( abf[patchi] ) diff --git a/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/heightFunction/heightFunction.C b/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/heightFunction/heightFunction.C index 8769c21f..74dd9de4 100644 --- a/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/heightFunction/heightFunction.C +++ b/src/surfaceForces/surfaceTensionForceModels/surfaceTensionForceModel/heightFunction/heightFunction.C @@ -20,7 +20,7 @@ License #include "heightFunction.H" #include "addToRunTimeSelectionTable.H" -#include "alphaContactAngleFvPatchScalarField.H" +#include "alphaContactAngleTwoPhaseFvPatchScalarField.H" #include "mathematicalConstants.H" #include "surfaceInterpolate.H" #include "fvcDiv.H" @@ -266,12 +266,12 @@ void Foam::heightFunction::correctContactAngle forAll(boundary, patchi) { - if (isA(abf[patchi])) + if (isA(abf[patchi])) { - alphaContactAngleFvPatchScalarField& acap = - const_cast + alphaContactAngleTwoPhaseFvPatchScalarField& acap = + const_cast ( - refCast + refCast ( abf[patchi] ) diff --git a/src/thermoDynamics/Allwmake b/src/thermoDynamics/Allwmake index 6eaf8f27..87d53e3a 100755 --- a/src/thermoDynamics/Allwmake +++ b/src/thermoDynamics/Allwmake @@ -1,5 +1,5 @@ #! /bin/bash wmake libso solidTabulatedThermo -wmake libso fluidThermo +# wmake libso fluidThermo wmake libso twoPhaseModelThermo From 451bcd5db4685eb470610333e7343ba38d73fced Mon Sep 17 00:00:00 2001 From: "Scheufler, Henning" Date: Sat, 2 Oct 2021 13:48:20 +0200 Subject: [PATCH 02/35] WIP it compiles without MULES --- .../reconstructInterface.C | 7 +++--- apps/initAlphaField/initAlphaField.C | 2 -- .../phaseModel/phaseModel/phaseModel.C | 11 ++++++++++ .../phaseModel/phaseModel/phaseModel.H | 7 ++++++ .../twoPhaseModelThermo/twoPhaseModelThermo.C | 22 +++++++++++++++++-- .../twoPhaseModelThermo/twoPhaseModelThermo.H | 6 +++++ 6 files changed, 47 insertions(+), 8 deletions(-) diff --git a/apps/benchmark/reconstructInterface/reconstructInterface.C b/apps/benchmark/reconstructInterface/reconstructInterface.C index f253ba90..c0d5ee1f 100755 --- a/apps/benchmark/reconstructInterface/reconstructInterface.C +++ b/apps/benchmark/reconstructInterface/reconstructInterface.C @@ -41,7 +41,6 @@ Author #include "cutCellImpFunc.H" #include "cutCellIso.H" #include "reconstructionError.H" -#include "isoCutCell.H" #include "surfaceForces.H" @@ -171,7 +170,7 @@ int main(int argc, char *argv[]) ) ); - vector centre = initAlphaFieldDict.lookup("origin"); + vector centre = initAlphaFieldDict.get("origin"); // scalar radius = readScalar(initAlphaFieldDict.lookup("radius")); Random rndCentre(1234567); @@ -221,7 +220,7 @@ int main(int argc, char *argv[]) initAlphaFieldDict.set("origin",centrePos); } - centre = initAlphaFieldDict.lookup("origin"); + centre = initAlphaFieldDict.get("origin"); Info << "centre " << centre << endl; @@ -229,7 +228,7 @@ int main(int argc, char *argv[]) ( implicitFunction::New ( - word(initAlphaFieldDict.lookup("function")), + word(initAlphaFieldDict.get("function")), initAlphaFieldDict ) ); diff --git a/apps/initAlphaField/initAlphaField.C b/apps/initAlphaField/initAlphaField.C index 018ad878..bb737299 100755 --- a/apps/initAlphaField/initAlphaField.C +++ b/apps/initAlphaField/initAlphaField.C @@ -33,8 +33,6 @@ Author \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "isoCutFace.H" -#include "isoCutCell.H" #include "searchableCylinder.H" #include "searchableSurface.H" #include "mathematicalConstants.H" diff --git a/src/thermoDynamics/twoPhaseModelThermo/phaseModel/phaseModel/phaseModel.C b/src/thermoDynamics/twoPhaseModelThermo/phaseModel/phaseModel/phaseModel.C index dad1ad90..8acc63b9 100644 --- a/src/thermoDynamics/twoPhaseModelThermo/phaseModel/phaseModel/phaseModel.C +++ b/src/thermoDynamics/twoPhaseModelThermo/phaseModel/phaseModel/phaseModel.C @@ -207,6 +207,17 @@ Foam::tmp Foam::phaseModel::kappa(const label patchI) const return thermo().kappa(patchI); } +Foam::tmp Foam::phaseModel::alphahe() const +{ + return thermo().alphahe(); +} + + +Foam::tmp Foam::phaseModel::alphahe(const label patchI) const +{ + return thermo().alphahe(patchI); +} + Foam::tmpFoam::phaseModel::kappaEff ( diff --git a/src/thermoDynamics/twoPhaseModelThermo/phaseModel/phaseModel/phaseModel.H b/src/thermoDynamics/twoPhaseModelThermo/phaseModel/phaseModel/phaseModel.H index 2abcec68..efa37f37 100644 --- a/src/thermoDynamics/twoPhaseModelThermo/phaseModel/phaseModel/phaseModel.H +++ b/src/thermoDynamics/twoPhaseModelThermo/phaseModel/phaseModel/phaseModel.H @@ -232,6 +232,13 @@ public: //- Thermal diffusivity for temperature of phase for patch [J/m/s/K] tmp kappa(const label patchi) const; + //- Thermal diffusivity for energy of mixture [kg/m/s] + tmp alphahe() const; + + //- Thermal diffusivity for energy of mixture for patch [kg/m/s] + tmp alphahe(const label patchi) const; + + //- Effective thermal diffusivity for temperature of phase [J/m/s/K] tmp kappaEff(const volScalarField&) const; diff --git a/src/thermoDynamics/twoPhaseModelThermo/twoPhaseModelThermo.C b/src/thermoDynamics/twoPhaseModelThermo/twoPhaseModelThermo.C index 81916b9a..93d83ac5 100644 --- a/src/thermoDynamics/twoPhaseModelThermo/twoPhaseModelThermo.C +++ b/src/thermoDynamics/twoPhaseModelThermo/twoPhaseModelThermo.C @@ -356,10 +356,28 @@ Foam::tmp Foam::twoPhaseModelThermo::kappa ) const { return - phase1_().boundaryField()[patchi]*phase1_->thermo().kappa(patchi) - + phase2_().boundaryField()[patchi]*phase2_->thermo().kappa(patchi); + phase1_().boundaryField()[patchi]*phase1_->thermo().alphahe(patchi) + + phase2_().boundaryField()[patchi]*phase2_->thermo().alphahe(patchi); } +Foam::tmp Foam::twoPhaseModelThermo::alphahe() const +{ + return phase1_()*phase1_->thermo().kappa() + + phase2_()*phase2_->thermo().kappa(); +} + + +Foam::tmp Foam::twoPhaseModelThermo::alphahe +( + const label patchi +) const +{ + return + phase1_().boundaryField()[patchi]*phase1_->thermo().alphahe(patchi) + + phase2_().boundaryField()[patchi]*phase2_->thermo().alphahe(patchi); +} + + Foam::tmp Foam::twoPhaseModelThermo::kappaEff ( diff --git a/src/thermoDynamics/twoPhaseModelThermo/twoPhaseModelThermo.H b/src/thermoDynamics/twoPhaseModelThermo/twoPhaseModelThermo.H index 5638ef7b..a79e268b 100644 --- a/src/thermoDynamics/twoPhaseModelThermo/twoPhaseModelThermo.H +++ b/src/thermoDynamics/twoPhaseModelThermo/twoPhaseModelThermo.H @@ -330,6 +330,12 @@ public: const label patchi ) const; + //- Thermal diffusivity for energy of mixture [kg/m/s] + virtual tmp alphahe() const; + + //- Thermal diffusivity for energy of mixture for patch [kg/m/s] + virtual tmp alphahe(const label patchi) const; + //- Effective thermal diffusivity of mixture [J/m/s/K] virtual tmp kappaEff ( From e2334edc985192c44cefa2d85a2a7ff89b55f848 Mon Sep 17 00:00:00 2001 From: "Scheufler, Henning" Date: Sat, 2 Oct 2021 15:43:33 +0200 Subject: [PATCH 03/35] WIP everything compiles --- src/VoF/Make/files | 2 +- src/VoF/advectionSchemes/MULES/MULESScheme.C | 315 ++++--------------- src/VoF/advectionSchemes/MULES/MULESScheme.H | 33 +- 3 files changed, 85 insertions(+), 265 deletions(-) diff --git a/src/VoF/Make/files b/src/VoF/Make/files index 8261aed3..8a86a57b 100644 --- a/src/VoF/Make/files +++ b/src/VoF/Make/files @@ -50,6 +50,6 @@ advectionSchemes/newAdvectionSchemes.C advectionSchemes/advectionSchemes.C advectionSchemes/isoAdvection/isoAdvection.C advectionSchemes/geoAdvection/geoAdvection.C -/*advectionSchemes/MULES/MULESScheme.C*/ +advectionSchemes/MULES/MULESScheme.C LIB = $(FOAM_USER_LIBBIN)/libVoF diff --git a/src/VoF/advectionSchemes/MULES/MULESScheme.C b/src/VoF/advectionSchemes/MULES/MULESScheme.C index 5220e9b0..5c56dd3e 100644 --- a/src/VoF/advectionSchemes/MULES/MULESScheme.C +++ b/src/VoF/advectionSchemes/MULES/MULESScheme.C @@ -115,11 +115,6 @@ Foam::advection::MULESScheme::MULESScheme alpha1_.mesh(), dimensionedScalar("nHatf", dimArea, 0.0) ) - - - - - { //- Reference to mesh @@ -132,258 +127,59 @@ Foam::advection::MULESScheme::MULESScheme MULESCorr_ = (alphaControls.lookupOrDefault("MULESCorr", false)); -// Apply the compression correction from the previous iteration -// Improves efficiency for steady-simulations but can only be applied -// once the alpha field is reasonably steady, i.e. fully developed + // Apply the compression correction from the previous iteration + // Improves efficiency for steady-simulations but can only be applied + // once the alpha field is reasonably steady, i.e. fully developed alphaApplyPrevCorr_ = - ( - alphaControls.lookupOrDefault("alphaApplyPrevCorr", false) - ); - //Isotropic compression coefficient + ( + alphaControls.lookupOrDefault("alphaApplyPrevCorr", false) + ); + + //Isotropic compression coefficient icAlpha_ = - ( - alphaControls.lookupOrDefault("icAlpha", 0) - ); + ( + alphaControls.lookupOrDefault("icAlpha", 0) + ); cAlpha_ = readScalar(alphaControls.lookup("cAlpha")); + // Shear compression coefficient + scAlpha_ = + ( + alphaControls.getOrDefault("scAlpha", 0) + ); -} - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::advection::MULESScheme::~MULESScheme() -{} - -// * * * * * * * * * * * * * * Protected Access Member Functions * * * * * * * * * * * * * * // - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - - -// ************************************************************************* // -void Foam::advection::MULESScheme::advect() -{ - updateNHatf(); - - word alphaScheme("div(phi,alpha)"); - word alpharScheme("div(phirb,alpha)"); - - scalar ocCoeff = 0; - { - - tmp> ddtAlpha - ( - fv::ddtScheme::New - ( - mesh_, - mesh_.ddtScheme("ddt(alpha)") - ) - ); - - // Set the off-centering coefficient according to ddt scheme - - if - ( - isType>(ddtAlpha()) - || isType>(ddtAlpha()) - ) - { - ocCoeff = 0; - } - else if (isType>(ddtAlpha())) - { - if (nAlphaSubCycles_ > 1) - { - FatalErrorInFunction - << "Sub-cycling is not supported " - "with the CrankNicolson ddt scheme" - << exit(FatalError); - } - - ocCoeff = - refCast>(ddtAlpha()) - .ocCoeff(); - } - else - { - FatalErrorInFunction - << "Only Euler and CrankNicolson ddt schemes are supported" - << exit(FatalError); - } - } - - scalar cnCoeff = 1.0/(1.0 + ocCoeff); + IOobject alphaPhi10Header + ( + IOobject::groupName("alphaPhi0", alpha1.group()), + mesh_.time().timeName(), + mesh_, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ); - // Standard face-flux compression coefficient - surfaceScalarField phic(cAlpha_*mag(phi_/mesh_.magSf())); + alphaRestart_ = + alphaPhi10Header.typeHeaderOk(true); - // Add the optional isotropic compression contribution - if (icAlpha_ > 0) + if (alphaRestart_) { - phic *= (1.0 - icAlpha_); - phic += (cAlpha_*icAlpha_)*fvc::interpolate(mag(U_)); + Info << "Restarting alpha" << endl; } - surfaceScalarField::Boundary& phicBf = - phic.boundaryFieldRef(); - - // Do not compress interface at non-coupled boundary faces - // (inlets, outlets etc.) - forAll(phic.boundaryField(), patchi) - { - fvsPatchScalarField& phicp = phicBf[patchi]; - if (!phicp.coupled()) - { - phicp == 0; - } - } - - tmp phiCN(phi_); - - // Calculate the Crank-Nicolson off-centred volumetric flux - if (ocCoeff > 0) - { - phiCN = cnCoeff*phi_ + (1.0 - cnCoeff)*phi_.oldTime(); - } - - if (MULESCorr_) - { - fvScalarMatrix alpha1Eqn - ( - ( - LTS_ - ? fv::localEulerDdtScheme(mesh_).fvmDdt(alpha1_) - : fv::EulerDdtScheme(mesh_).fvmDdt(alpha1_) - ) - + fv::gaussConvectionScheme - ( - mesh_, - phiCN, - upwind(mesh_, phiCN) - ).fvmDiv(phiCN, alpha1_) - ); - - alpha1Eqn.solve(); - - Info<< "Phase-1 volume fraction = " - << alpha1_.weightedAverage(mesh_.Vsc()).value() - << " Min(" << alpha1_.name() << ") = " << min(alpha1_).value() - << " Max(" << alpha1_.name() << ") = " << max(alpha1_).value() - << endl; - - tmp talphaPhiUD(alpha1Eqn.flux()); - alphaPhi_ = talphaPhiUD(); - - if (alphaApplyPrevCorr_) - { - Info<< "Applying the previous iteration compression flux" << endl; - MULES::correct(alpha1_, alphaPhi_, talphaPhiCorr0_, oneField(), zeroField()); - - alphaPhi_ += talphaPhiCorr0_; - } - - // Cache the upwind-flux - talphaPhiCorr0_ = talphaPhiUD; - - alpha2_ = 1.0 - alpha1_; - - // mixture.correct(); - updateNHatf(); - } - - - for (int aCorr=0; aCorr talphaPhiUn - ( - fvc::flux - ( - phi_, - alpha1_, - alphaScheme - ) - + fvc::flux - ( - -fvc::flux(-phir, alpha2_, alpharScheme), - alpha1_, - alpharScheme - ) - ); - - // Calculate the Crank-Nicolson off-centred alpha flux -// if (ocCoeff > 0) -// { -// talphaPhiUn = -// cnCoeff*talphaPhiUn + (1.0 - cnCoeff)*alphaPhi_.oldTime(); -// } - - if (MULESCorr_) - { - tmp talphaPhiCorr(talphaPhiUn - alphaPhi_); - volScalarField alpha10("alpha10", alpha1_); - - MULES::correct(alpha1_, talphaPhiUn, talphaPhiCorr.ref(), 1, 0); - - // Under-relax the correction for all but the 1st corrector - if (aCorr == 0) - { - alphaPhi_ += talphaPhiCorr(); - } - else - { - alpha1_ = 0.5*alpha1_ + 0.5*alpha10; - alphaPhi_ += 0.5*talphaPhiCorr(); - } - } - else - { - alphaPhi_ = talphaPhiUn; - - MULES::explicitSolve(alpha1_, phiCN, alphaPhi_, oneField(), zeroField()); - } - - alpha2_ = 1.0 - alpha1_; - - // mixture.correct(); - updateNHatf(); - } +} - if (alphaApplyPrevCorr_ && MULESCorr_) - { - talphaPhiCorr0_ = alphaPhi_ - talphaPhiCorr0_; - } +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - if - ( - word(mesh_.ddtScheme("ddt(rho,U)")) - == fv::EulerDdtScheme::typeName - ) - { -// rhoPhi = alphaPhi_*(rho1 - rho2) + phiCN*rho2; - } - else - { - if (ocCoeff > 0) - { - // Calculate the end-of-time-step alpha flux - alphaPhi_ = (alphaPhi_ - (1.0 - cnCoeff)*alphaPhi_.oldTime())/cnCoeff; - } +Foam::advection::MULESScheme::~MULESScheme() +{} - // Calculate the end-of-time-step mass flux - //rhoPhi = alphaPhi_*(rho1 - rho2) + phi_*rho2; - } +// * * * * * * * * * * * * * * Protected Access Member Functions * * * * * * * * * * * * * * // - Info<< "Phase-1 volume fraction = " - << alpha1_.weightedAverage(mesh_.Vsc()).value() - << " Min(" << alpha1_.name() << ") = " << min(alpha1_).value() - << " Max(" << alpha1_.name() << ") = " << max(alpha1_).value() - << endl; -} +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,const volScalarField::Internal& Su) +template +void Foam::advection::MULESScheme::advect(const SpType& Sp, const SuType& Su) { updateNHatf(); @@ -423,8 +219,8 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con if ( - alphaRestart - || mesh.time().timeIndex() > mesh.time().startTimeIndex() + 1 + alphaRestart_ + || mesh_.time().timeIndex() > mesh_.time().startTimeIndex() + 1 ) { ocCoeff = @@ -454,13 +250,12 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con } // Add the optional shear compression contribution - if (scAlpha > 0) + if (scAlpha_ > 0) { phic += - scAlpha*mag(mesh.delta() & fvc::interpolate(symm(fvc::grad(U)))); + scAlpha_*mag(mesh_.delta() & fvc::interpolate(symm(fvc::grad(U_)))); } - surfaceScalarField::Boundary& phicBf = phic.boundaryFieldRef(); @@ -490,8 +285,8 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con ( ( LTS_ - ? fv::localEulerDdtScheme(mesh_).fvmDdt(alpha1) - : fv::EulerDdtScheme(mesh_).fvmDdt(alpha1) + ? fv::localEulerDdtScheme(mesh_).fvmDdt(alpha1_) + : fv::EulerDdtScheme(mesh_).fvmDdt(alpha1_) ) + fv::gaussConvectionScheme ( @@ -522,9 +317,9 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con MULES::correct ( geometricOneField(), - alpha1, - alphaPhi10, - talphaPhi1Corr0.ref(), + alpha1_, + alphaPhi_, + talphaPhiCorr0_, oneField(), zeroField() ); @@ -550,21 +345,21 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con fvc::flux ( phi_, - cnCoeff*alpha1 + (1.0 - cnCoeff)*alpha1.oldTime(), + cnCoeff*alpha1_ + (1.0 - cnCoeff)*alpha1_.oldTime(), alphaScheme ) + fvc::flux ( - -fvc::flux(-phir, alpha2, alpharScheme), - alpha1, + -fvc::flux(-phir, alpha2_, alpharScheme), + alpha1_, alpharScheme ) ); - if (MULESCorr) + if (MULESCorr_) { tmp talphaPhi1Corr(talphaPhi1Un - alphaPhi_); - volScalarField alpha10("alpha10", alpha1); + volScalarField alpha10("alpha10", alpha1_); MULES::correct ( @@ -586,7 +381,7 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con else { alpha1_ = 0.5*alpha1_ + 0.5*alpha10; - alphaPhi_ += 0.5*talphaPhiCorr(); + alphaPhi_ += 0.5*talphaPhi1Corr(); } } else @@ -596,7 +391,7 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con MULES::explicitSolve ( geometricOneField(), - alpha1, + alpha1_, phiCN, alphaPhi_, Sp, @@ -606,12 +401,12 @@ void Foam::advection::MULESScheme::advect(const volScalarField::Internal& Sp,con ); } - alpha2 = 1.0 - alpha1; + alpha2_ = 1.0 - alpha1_; - mixture.correct(); + updateNHatf(); } - if (alphaApplyPrevCorr && MULESCorr) + if (alphaApplyPrevCorr_ && MULESCorr_) { talphaPhiCorr0_ = alphaPhi_ - talphaPhiCorr0_; } diff --git a/src/VoF/advectionSchemes/MULES/MULESScheme.H b/src/VoF/advectionSchemes/MULES/MULESScheme.H index 07c77e69..880c5425 100644 --- a/src/VoF/advectionSchemes/MULES/MULESScheme.H +++ b/src/VoF/advectionSchemes/MULES/MULESScheme.H @@ -38,8 +38,10 @@ SourceFiles #include "typeInfo.H" #include "advectionSchemes.H" #include "volFields.H" +#include "volFieldsFwd.H" #include "dimensionedScalar.H" #include "autoPtr.H" +#include "zeroField.H" #include "volPointInterpolation.H" #include "reconstructionSchemes.H" @@ -92,9 +94,14 @@ private: // Isotropic compression coefficient scalar icAlpha_; + // Shear compression coefficient + scalar scAlpha_; + //- Compression coefficient scalar cAlpha_; + bool alphaRestart_; + void alphaEqn(); void updateNHatf(); @@ -133,10 +140,28 @@ public: virtual ~MULESScheme(); - - virtual void advect(); - - virtual void advect(const volScalarField::Internal& Sp,const volScalarField::Internal& Su); + //- Advect the free surface. Updates alpha field, taking into account + // multiple calls within a single time step. + template < class SpType, class SuType > + void advect(const SpType& Sp, const SuType& Su); + + //- advection of the interface + virtual void advect() + { + zeroField Sp; + zeroField Su; + advect(Sp,Su); + } + + //- advection of the interface with source terms + virtual void advect + ( + const volScalarField::Internal& Sp, + const volScalarField::Internal& Su + ) + { + advect(Sp,Su); + } }; From 02ee9e15016bbd3e9eae70df1c1cb3cb691b5ef2 Mon Sep 17 00:00:00 2001 From: Henning Scheufler <16381681+HenningScheufler@users.noreply.github.com> Date: Tue, 5 Oct 2021 21:36:27 +0200 Subject: [PATCH 04/35] ENH: CI checks compilation * Create openfoam.yml --- .github/workflows/openfoam.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/openfoam.yml diff --git a/.github/workflows/openfoam.yml b/.github/workflows/openfoam.yml new file mode 100644 index 00000000..15ac4d7e --- /dev/null +++ b/.github/workflows/openfoam.yml @@ -0,0 +1,23 @@ +name: openfoam + +on: + push: + branches: [ of2106 ] + pull_request: + branches: [ of2106 ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: setup openfoam + run: | + curl -s https://dl.openfoam.com/add-debian-repo.sh | sudo bash + wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | sudo bash + sudo apt-get install openfoam2106-dev + - name: compile library + run: | + openfoam2106 -c ./Allwmake From 9fb0631add4b3f214ff2f6a30e3a3961247202ca Mon Sep 17 00:00:00 2001 From: "Scheufler, Henning" Date: Tue, 5 Oct 2021 21:47:15 +0200 Subject: [PATCH 05/35] ENH: all tests pass in of2106 --- .gitignore | 6 +- .vscode/c_cpp_properties.json | 11 +- .vscode/settings.json | 10 +- .../reconstructInterface/Make/options | 2 + apps/initAlphaField/Make/options | 2 + apps/setFieldfromTable/Make/options | 2 + pytest.ini | 2 + src/VoF/Make/files | 21 - src/VoF/Make/options | 2 + .../composedFunctionImplicitFunction.C | 207 ---------- .../composedFunctionImplicitFunction.H | 171 -------- .../cylinder/cylinderImplicitFunction.C | 86 ---- .../cylinder/cylinderImplicitFunction.H | 138 ------- .../ellipsoid/ellipsoidImplicitFunction.C | 68 ---- .../ellipsoid/ellipsoidImplicitFunction.H | 138 ------- src/VoF/implicitFunctions/implicitFunction.C | 70 ---- src/VoF/implicitFunctions/implicitFunction.H | 126 ------ .../paraboloid/paraboloidImplicitFunction.C | 70 ---- .../paraboloid/paraboloidImplicitFunction.H | 129 ------ .../plane/planeImplicitFunction.C | 74 ---- .../plane/planeImplicitFunction.H | 130 ------ .../sin/sinImplicitFunction.C | 86 ---- .../sin/sinImplicitFunction.H | 148 ------- .../sphere/sphereImplicitFunction.C | 74 ---- .../sphere/sphereImplicitFunction.H | 132 ------ src/VoF/multiDimPolyFitter/leastSquareGrad.C | 178 --------- src/VoF/multiDimPolyFitter/leastSquareGrad.H | 112 ------ .../leastSquareInterpolate.C | 95 ----- .../leastSquareInterpolate.H | 107 ----- .../multiDimPolyFitter/multiDimPolyFitter.C | 375 ------------------ .../multiDimPolyFitter/multiDimPolyFitter.H | 169 -------- .../multiDimPolyFunctions.C | 80 ---- .../multiDimPolyFunctions.H | 141 ------- .../multiDimPolyFunctions/polyDegree1.C | 97 ----- .../multiDimPolyFunctions/polyDegree1.H | 99 ----- .../multiDimPolyFunctions/polyDegree2.C | 144 ------- .../multiDimPolyFunctions/polyDegree2.H | 96 ----- .../isoSchemes/isoSurface/isoSurface.C | 1 - src/postProcessing/Make/options | 2 + .../test-Leveque/system/setAlphaFieldDict | 2 +- .../advection/test-Leveque/test_Levque.py | 16 +- .../test_deformationSphere.py | 10 +- .../test_vortexShearedDisc.py | 6 +- .../stefanProblem/expected_results.csv | 6 +- .../stefanProblem/system/controlDict | 11 +- .../stefanProblem/system/fluid/fvSolution | 25 +- .../stefanProblem/test_stefanProblem.py | 2 +- .../suckingInterface/system/controlDict | 5 +- .../suckingInterface/system/fluid/fvSolution | 10 +- .../suckingInterface/test_suckingInterface.py | 2 +- .../surfaceTension/sinWave/getResults.py | 26 +- .../surfaceTension/sinWave/system/controlDict | 13 +- .../sinWave/system/setAlphaFieldDict | 4 +- .../sinWave/system/simulationParameter | 31 +- .../surfaceTension/sinWave/test_sinWave.py | 6 +- 55 files changed, 88 insertions(+), 3688 deletions(-) delete mode 100644 src/VoF/implicitFunctions/composedFunction/composedFunctionImplicitFunction.C delete mode 100644 src/VoF/implicitFunctions/composedFunction/composedFunctionImplicitFunction.H delete mode 100644 src/VoF/implicitFunctions/cylinder/cylinderImplicitFunction.C delete mode 100644 src/VoF/implicitFunctions/cylinder/cylinderImplicitFunction.H delete mode 100644 src/VoF/implicitFunctions/ellipsoid/ellipsoidImplicitFunction.C delete mode 100644 src/VoF/implicitFunctions/ellipsoid/ellipsoidImplicitFunction.H delete mode 100644 src/VoF/implicitFunctions/implicitFunction.C delete mode 100644 src/VoF/implicitFunctions/implicitFunction.H delete mode 100644 src/VoF/implicitFunctions/paraboloid/paraboloidImplicitFunction.C delete mode 100644 src/VoF/implicitFunctions/paraboloid/paraboloidImplicitFunction.H delete mode 100644 src/VoF/implicitFunctions/plane/planeImplicitFunction.C delete mode 100644 src/VoF/implicitFunctions/plane/planeImplicitFunction.H delete mode 100644 src/VoF/implicitFunctions/sin/sinImplicitFunction.C delete mode 100644 src/VoF/implicitFunctions/sin/sinImplicitFunction.H delete mode 100644 src/VoF/implicitFunctions/sphere/sphereImplicitFunction.C delete mode 100644 src/VoF/implicitFunctions/sphere/sphereImplicitFunction.H delete mode 100644 src/VoF/multiDimPolyFitter/leastSquareGrad.C delete mode 100644 src/VoF/multiDimPolyFitter/leastSquareGrad.H delete mode 100644 src/VoF/multiDimPolyFitter/leastSquareInterpolate.C delete mode 100644 src/VoF/multiDimPolyFitter/leastSquareInterpolate.H delete mode 100644 src/VoF/multiDimPolyFitter/multiDimPolyFitter.C delete mode 100644 src/VoF/multiDimPolyFitter/multiDimPolyFitter.H delete mode 100644 src/VoF/multiDimPolyFitter/multiDimPolyFunctions/multiDimPolyFunctions.C delete mode 100644 src/VoF/multiDimPolyFitter/multiDimPolyFunctions/multiDimPolyFunctions.H delete mode 100644 src/VoF/multiDimPolyFitter/multiDimPolyFunctions/polyDegree1.C delete mode 100644 src/VoF/multiDimPolyFitter/multiDimPolyFunctions/polyDegree1.H delete mode 100644 src/VoF/multiDimPolyFitter/multiDimPolyFunctions/polyDegree2.C delete mode 100644 src/VoF/multiDimPolyFitter/multiDimPolyFunctions/polyDegree2.H diff --git a/.gitignore b/.gitignore index 70ecc80b..1b5094aa 100644 --- a/.gitignore +++ b/.gitignore @@ -35,8 +35,10 @@ lnInclude #OpenFOAM Cases CasesTri -polyMesh/* -0.[0-9]* [1-9]* *e-* +*/polyMesh/* +0.[0-9]* +[1-9]* +*e-* processor* # Build directories - anywhere diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 53efe53e..275035c9 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -4,19 +4,12 @@ "name": "Linux", "includePath": [ "${workspaceFolder}/**", - "${FOAM_SRC}/OpenFOAM/lnInclude", - "${FOAM_SRC}/finiteVolume/lnInclude" - ], - "browse.path":[ - "${workspaceFolder}/**", - "${FOAM_SRC}/OpenFOAM/lnInclude", - "${FOAM_SRC}/finiteVolume/lnInclude" + "${FOAM_SRC}/**" ], "defines": [], "compilerPath": "/usr/bin/gcc", "cStandard": "c11", - "cppStandard": "c++17", - "intelliSenseMode": "clang-x64" + "cppStandard": "c++11" } ], "version": 4 diff --git a/.vscode/settings.json b/.vscode/settings.json index 203044b8..9f753788 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,9 +1,11 @@ { "files.associations": { "*.H": "cpp", - "*.C": "cpp", - "vector": "cpp", - "limits": "cpp" + "*.C": "cpp" }, - "C_Cpp.intelliSenseEngine": "Tag Parser" + "python.testing.pytestArgs": [ + "." + ], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true } \ No newline at end of file diff --git a/apps/benchmark/reconstructInterface/Make/options b/apps/benchmark/reconstructInterface/Make/options index 026c8c5c..013e9ab0 100755 --- a/apps/benchmark/reconstructInterface/Make/options +++ b/apps/benchmark/reconstructInterface/Make/options @@ -1,5 +1,6 @@ EXE_INC = \ -I../../../src/VoF/lnInclude \ + -I$(FOAM_UTILITIES)/preProcessing/setAlphaField/alphaFieldFunctions/lnInclude \ -I../../../src/postProcessing/lnInclude \ -I../../../src/surfaceForces/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ @@ -9,6 +10,7 @@ EXE_INC = \ EXE_LIBS = \ -L$(FOAM_USER_LIBBIN) \ + -lalphaFieldFunctions \ -lfiniteVolume \ -lmeshTools \ -lsurfMesh \ diff --git a/apps/initAlphaField/Make/options b/apps/initAlphaField/Make/options index 741f55f4..8b6a4486 100755 --- a/apps/initAlphaField/Make/options +++ b/apps/initAlphaField/Make/options @@ -1,5 +1,6 @@ EXE_INC = \ -I../../src/VoF/lnInclude \ + -I$(FOAM_UTILITIES)/preProcessing/setAlphaField/alphaFieldFunctions/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ @@ -9,6 +10,7 @@ EXE_INC = \ EXE_LIBS = \ -L$(FOAM_USER_LIBBIN) \ + -lalphaFieldFunctions \ -lfiniteVolume \ -lsurfMesh \ -lVoF \ diff --git a/apps/setFieldfromTable/Make/options b/apps/setFieldfromTable/Make/options index 0bbfb85b..37a2cbc3 100644 --- a/apps/setFieldfromTable/Make/options +++ b/apps/setFieldfromTable/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -I$(FOAM_UTILITIES)/preProcessing/setAlphaField/alphaFieldFunctions/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \ @@ -7,6 +8,7 @@ EXE_INC = \ -I../../src/VoF/lnInclude EXE_LIBS = \ + -lalphaFieldFunctions \ -lfiniteVolume \ -ldynamicMesh \ -lmeshTools \ diff --git a/pytest.ini b/pytest.ini index e2958c9b..9371bbb0 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,5 +1,7 @@ [pytest] #minversion = 6.0 +markers = + slow: marks tests as slow (deselect with '-m "not slow"') addopts = -ra -v --import-mode=importlib --tb=short --cache-clear testpaths = testsuite diff --git a/src/VoF/Make/files b/src/VoF/Make/files index 8a86a57b..41a14c80 100644 --- a/src/VoF/Make/files +++ b/src/VoF/Make/files @@ -10,28 +10,7 @@ cellCuts/cutFace/cutFaceImpFunc.C surfaceIterators/surfaceIteratorPLIC.C surfaceIterators/surfaceIteratorIso.C -/* Run-time selectable implicitFunctions */ -implicitFunctions/implicitFunction.C -implicitFunctions/sphere/sphereImplicitFunction.C -implicitFunctions/sin/sinImplicitFunction.C -implicitFunctions/ellipsoid/ellipsoidImplicitFunction.C -implicitFunctions/paraboloid/paraboloidImplicitFunction.C -implicitFunctions/plane/planeImplicitFunction.C -implicitFunctions/cylinder/cylinderImplicitFunction.C -implicitFunctions/composedFunction/composedFunctionImplicitFunction.C - -zoneDistribute/zoneStencils/zoneCellStencils.C -zoneDistribute/zoneStencils/zoneCPCStencil.C -zoneDistribute/zoneDistribute.C -zoneDistribute/zoneDistributePoints.C - -multiDimPolyFitter/multiDimPolyFunctions/multiDimPolyFunctions.C -multiDimPolyFitter/multiDimPolyFunctions/polyDegree1.C -multiDimPolyFitter/multiDimPolyFunctions/polyDegree2.C multiDimPolyFitter/multiDimPolyFunctions/paraboloid.C -multiDimPolyFitter/multiDimPolyFitter.C -multiDimPolyFitter/leastSquareGrad.C -multiDimPolyFitter/leastSquareInterpolate.C multiDimPolyFitter/leastSquareFitParabolid.C reconstructedDistanceFunction/reconstructedDistanceFunction.C diff --git a/src/VoF/Make/options b/src/VoF/Make/options index e00da4c3..fa95491e 100644 --- a/src/VoF/Make/options +++ b/src/VoF/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -I$(FOAM_UTILITIES)/preProcessing/setAlphaField/alphaFieldFunctions/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ @@ -8,6 +9,7 @@ EXE_INC = \ -I$(LIB_SRC)/transportModels/twoPhaseProperties/lnInclude LIB_LIBS = \ + -lalphaFieldFunctions \ -lfiniteVolume \ -lfileFormats \ -lsurfMesh \ diff --git a/src/VoF/implicitFunctions/composedFunction/composedFunctionImplicitFunction.C b/src/VoF/implicitFunctions/composedFunction/composedFunctionImplicitFunction.C deleted file mode 100644 index 7711f550..00000000 --- a/src/VoF/implicitFunctions/composedFunction/composedFunctionImplicitFunction.C +++ /dev/null @@ -1,207 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019 DLR -------------------------------------------------------------------------------- - -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 . - -\*---------------------------------------------------------------------------*/ - -#include "composedFunctionImplicitFunction.H" -#include "scalarField.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace implicitFunctions - { - defineTypeNameAndDebug(composedFunctionImplicitFunction, 0); - addToRunTimeSelectionTable - ( - implicitFunction, - composedFunctionImplicitFunction, - dict - ); - } -} - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -const Foam::Enum -< - Foam::implicitFunctions::composedFunctionImplicitFunction::modeType -> -Foam::implicitFunctions::composedFunctionImplicitFunction::modeTypeNames -({ - { modeType::ADD, "add" }, - { modeType::SUBTRACT, "subtract" }, - { modeType::MINDIST, "minDist" }, - { modeType::INTERSECT, "intersect" }, -}); - -Foam::label -Foam::implicitFunctions::composedFunctionImplicitFunction::selectFunction -( - const scalarField& values -) const -{ - switch (mode_) - { - case modeType::MINDIST: - { - scalarField absVal(mag(values)); - return findMin(absVal); - } - case modeType::ADD: - { - return findMax(values); - } - case modeType::SUBTRACT: - { - // Note: start at the second entry - const label idx = findMin(values, 1); - - if (values[idx] < values[0] && pos(values[0])) - { - return idx; - } - else - { - return 0; - } - } - case modeType::INTERSECT: - { - return findMin(values); - } - default: - { - FatalErrorInFunction - << "This mode is not supported only " << nl - << "Supported modes are: " << nl - << modeTypeNames - << abort(FatalError); - } - } - - return -1; -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::implicitFunctions::composedFunctionImplicitFunction:: -composedFunctionImplicitFunction -( - const dictionary& dict -) -: - functions_(dict.subDict("composedFunction").size()), - mode_(modeTypeNames.get("mode", dict)), - values_(dict.subDict("composedFunction").size()) -{ - const dictionary& funcDict = dict.subDict("composedFunction"); - label funcI = 0; - - forAllConstIters(funcDict, iter) - { - const word& key = iter().keyword(); - - if (!funcDict.isDict(key)) - { - FatalErrorInFunction - << "Found non-dictionary entry " << iter() - << " in top-level dictionary " << funcDict - << exit(FatalError); - } - - const dictionary& compFuncDict = funcDict.subDict(key); - - functions_.set - ( - funcI, - implicitFunction::New - ( - word(compFuncDict.lookup("type")), - compFuncDict - ) - ); - - ++funcI; - } -} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::scalar Foam::implicitFunctions::composedFunctionImplicitFunction::value -( - const vector& p -) const -{ - forAll(values_,i) - { - values_[i] = functions_[i].value(p); - } - - const label idx = selectFunction(values_); - - return values_[idx]; -} - - -Foam::vector Foam::implicitFunctions::composedFunctionImplicitFunction::grad -( - const vector& p -) const -{ - forAll(values_,i) - { - values_[i] = mag(functions_[i].value(p)); - } - - const label minIdx = findMin(values_); - - return functions_[minIdx].grad(p); -} - - -Foam::scalar -Foam::implicitFunctions::composedFunctionImplicitFunction::distanceToSurfaces -( - const vector& p -) const -{ - forAll(values_,i) - { - values_[i] = mag(functions_[i].value(p)); - } - - const label minIdx = findMin(values_); - - return functions_[minIdx].distanceToSurfaces(p); -} - - -// ************************************************************************* // diff --git a/src/VoF/implicitFunctions/composedFunction/composedFunctionImplicitFunction.H b/src/VoF/implicitFunctions/composedFunction/composedFunctionImplicitFunction.H deleted file mode 100644 index 782d0da1..00000000 --- a/src/VoF/implicitFunctions/composedFunction/composedFunctionImplicitFunction.H +++ /dev/null @@ -1,171 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019 DLR -------------------------------------------------------------------------------- - -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::implicitFunctions::composedFunctionImplicitFunction - -Description - Handles multiple implicit functions and offers multiple ways to combine - them - -Usage - Example of function object partial specification: - \verbatim - function composedFunctionImplicitFunction; - mode minDist; - // following mode are available: - // "add" "subtract" "minDist" "intersect" - composedFunctionImplicitFunctions - { - plane - { - function plane; - origin (0 1. 0); - normal (0 1 0); - - } - - sphere - { - function sphere; - radius 0.4; - origin (0.5 1.5 0.5); - scale 1; - } - - sphere2 - { - function sphere; - radius 0.4; - origin (0.5 0.5 0.5); - scale -1; - } - } - \endverbatim - - Original code supplied by Henning Scheufler, DLR (2019) - -SourceFiles - composedFunctionImplicitFunction.C - -\*---------------------------------------------------------------------------*/ - -#ifndef implicitFunctions_composedFunctionImplicitFunction_H -#define implicitFunctions_composedFunctionImplicitFunction_H - -#include "implicitFunction.H" -#include "scalarField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace implicitFunctions -{ - -/*---------------------------------------------------------------------------*\ - Class composedFunctionImplicitFunction Declaration -\*---------------------------------------------------------------------------*/ - -class composedFunctionImplicitFunction -: - public implicitFunction -{ -private: - - // Private Member Data - //- Enumeration defining the valid actions - enum class modeType - { - ADD, - SUBTRACT, - MINDIST, - INTERSECT - }; - - //- The setActions text representations - static const Enum modeTypeNames; - - //- Stores the functions - PtrList functions_; - - //- Mode - modeType mode_; - - //- Needed for finding the closest function. - // Note: avoid creation every call - mutable scalarField values_; - - label selectFunction(const scalarField& values) const; - - - // Private Member Functions - - //- No copy construct - composedFunctionImplicitFunction - ( - const composedFunctionImplicitFunction& - ) = delete; - - //- No bitwise assignment - void operator=(const composedFunctionImplicitFunction&) = delete; - - -public: - - //- Runtime type information - TypeName("composedFunction"); - - - // Constructors - - //- Construct from dictionary - composedFunctionImplicitFunction(const dictionary& dict); - - - //- Destructor - virtual ~composedFunctionImplicitFunction() = default; - - - // Member Functions - - virtual scalar value(const vector& p) const; - - virtual vector grad(const vector& p) const; - - virtual scalar distanceToSurfaces(const vector& p) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace implicitFunctions -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/VoF/implicitFunctions/cylinder/cylinderImplicitFunction.C b/src/VoF/implicitFunctions/cylinder/cylinderImplicitFunction.C deleted file mode 100644 index e4672c2d..00000000 --- a/src/VoF/implicitFunctions/cylinder/cylinderImplicitFunction.C +++ /dev/null @@ -1,86 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019 DLR -------------------------------------------------------------------------------- - -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 . - -\*---------------------------------------------------------------------------*/ - -#include "cylinderImplicitFunction.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace implicitFunctions - { - defineTypeNameAndDebug(cylinderImplicitFunction, 0); - addToRunTimeSelectionTable - ( - implicitFunction, - cylinderImplicitFunction, - dict - ); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::implicitFunctions::cylinderImplicitFunction::cylinderImplicitFunction -( - const point& origin, - const scalar radius, - const scalar scale, - const vector& direction -) -: - origin_(origin), - radius_(radius), - scale_(scale), - direction_(direction), - project_(tensor::I) -{ - direction_.normalise(); - project_ = tensor::I - direction_*direction_; // outer product -} - - -Foam::implicitFunctions::cylinderImplicitFunction::cylinderImplicitFunction -( - const dictionary& dict -) -: - origin_(dict.get("origin")), - radius_(dict.get("radius")), - scale_(dict.lookupOrDefault("scale", 1)), - direction_(dict.get("direction")), - project_(tensor::I) -{ - direction_.normalise(); - project_ = tensor::I - (direction_ * direction_); // outer product -} - - -// ************************************************************************* // diff --git a/src/VoF/implicitFunctions/cylinder/cylinderImplicitFunction.H b/src/VoF/implicitFunctions/cylinder/cylinderImplicitFunction.H deleted file mode 100644 index cfe98bbb..00000000 --- a/src/VoF/implicitFunctions/cylinder/cylinderImplicitFunction.H +++ /dev/null @@ -1,138 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019 DLR -------------------------------------------------------------------------------- - -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::implicitFunctions::cylinderImplicitFunction - -Description - creates a infintite long cylinderImplicitFunction - - Original code supplied by Henning Scheufler, DLR (2019) - -SourceFiles - cylinderImplicitFunction.C - -\*---------------------------------------------------------------------------*/ - -#ifndef implicitFunction_cylinderImplicitFunction_H -#define implicitFunction_cylinderImplicitFunction_H - -#include "implicitFunction.H" -#include "point.H" -#include "tensor.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace implicitFunctions -{ - -/*---------------------------------------------------------------------------*\ - Class cylinderImplicitFunction Declaration -\*---------------------------------------------------------------------------*/ - -class cylinderImplicitFunction -: - public implicitFunction -{ -private: - - // Private Member Data - - //- Origin point - const point origin_; - - //- Radius - const scalar radius_; - - const scalar scale_; - - vector direction_; - - tensor project_; - - - // Private Member Functions - - //- No copy construct - cylinderImplicitFunction(const cylinderImplicitFunction&) = delete; - - //- No bitwise assignment - void operator=(const cylinderImplicitFunction&) = delete; - - -public: - - //- Runtime type information - TypeName("cylinder"); - - - // Constructors - - //- Construct from components - cylinderImplicitFunction - ( - const point& origin, - const scalar radius, - const scalar scale, - const vector& direction - ); - - //- Construct from dictionary - cylinderImplicitFunction(const dictionary& dict); - - - //- Destructor - virtual ~cylinderImplicitFunction() = default; - - virtual scalar value(const vector& p) const - { - return (-mag(project_ & (p - origin_)) + radius_)*scale_; - } - - virtual vector grad(const vector& p) const - { - return -(project_ & (p - origin_))*scale_; - } - - virtual scalar distanceToSurfaces(const vector& p) const - { - return mag(mag(project_ & (p - origin_)) - radius_)*scale_; - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace implicitFunctions -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/VoF/implicitFunctions/ellipsoid/ellipsoidImplicitFunction.C b/src/VoF/implicitFunctions/ellipsoid/ellipsoidImplicitFunction.C deleted file mode 100644 index 6b9567ed..00000000 --- a/src/VoF/implicitFunctions/ellipsoid/ellipsoidImplicitFunction.C +++ /dev/null @@ -1,68 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019 DLR -------------------------------------------------------------------------------- - -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 . -\*---------------------------------------------------------------------------*/ - -#include "ellipsoidImplicitFunction.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace implicitFunctions - { - defineTypeNameAndDebug(ellipsoidImplicitFunction, 0); - addToRunTimeSelectionTable - ( - implicitFunction, - ellipsoidImplicitFunction, - dict - ); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::implicitFunctions::ellipsoidImplicitFunction::ellipsoidImplicitFunction -( - const vector& semiAxis -) -: - semiAxis_(semiAxis) -{} - - -Foam::implicitFunctions::ellipsoidImplicitFunction::ellipsoidImplicitFunction -( - const dictionary& dict -) -: - semiAxis_(dict.get("semiAxis")) -{} - - -// ************************************************************************* // diff --git a/src/VoF/implicitFunctions/ellipsoid/ellipsoidImplicitFunction.H b/src/VoF/implicitFunctions/ellipsoid/ellipsoidImplicitFunction.H deleted file mode 100644 index a395a297..00000000 --- a/src/VoF/implicitFunctions/ellipsoid/ellipsoidImplicitFunction.H +++ /dev/null @@ -1,138 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019-2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019-2019 DLR -------------------------------------------------------------------------------- - -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::implicitFunctions::ellipsoidImplicitFunction - -Description - creates an ellipsoidImplicitFunction - - Original code supplied by Henning Scheufler, DLR (2019) - -SourceFiles - ellipsoidImplicitFunction.C - -\*---------------------------------------------------------------------------*/ - -#ifndef implicitFunction_ellipsoidImplicitFunction_H -#define implicitFunction_ellipsoidImplicitFunction_H - -#include "implicitFunction.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace implicitFunctions -{ - -/*---------------------------------------------------------------------------*\ - Class ellipsoidImplicitFunction Declaration -\*---------------------------------------------------------------------------*/ - -class ellipsoidImplicitFunction -: - public implicitFunction -{ -private: - - // Private Member Data - - //- Axis - vector semiAxis_; - - //- Origin point - vector origin_; - - - // Private Member Functions - - //- No copy construct - ellipsoidImplicitFunction(const ellipsoidImplicitFunction&) = delete; - - //- No bitwise assignment - void operator=(const ellipsoidImplicitFunction&) = delete; - - -public: - - //- Runtime type information - TypeName("ellipsoidImplicitFunction"); - - - // Constructors - - //- Construct from components - ellipsoidImplicitFunction(const vector& semiAxis); - - //- Construct from dictionary - ellipsoidImplicitFunction(const dictionary& dict); - - - //- Destructor - virtual ~ellipsoidImplicitFunction() = default; - - virtual scalar value(const vector& p) const - { - return - -sqrt - ( - sqr((p.x() - origin_.x())/semiAxis_.x()) - + sqr((p.y() - origin_.y())/semiAxis_.y()) - + sqr((p.z() - origin_.z())/semiAxis_.z()) - ) + 1; - } - - virtual vector grad(const vector& p) const - { - // normal_ has the length of one - return vector - ( - 2*(p.x() - origin_.x())/sqr(semiAxis_.x()), - 2*(p.y() - origin_.y())/sqr(semiAxis_.y()), - 2*(p.z() - origin_.z())/sqr(semiAxis_.z()) - ); - } - - virtual scalar distanceToSurfaces(const vector& p) const - { - NotImplemented; - return GREAT; - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace implicitFunctions -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/VoF/implicitFunctions/implicitFunction.C b/src/VoF/implicitFunctions/implicitFunction.C deleted file mode 100644 index 27ea09fd..00000000 --- a/src/VoF/implicitFunctions/implicitFunction.C +++ /dev/null @@ -1,70 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019 DLR -------------------------------------------------------------------------------- - -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 . - -\*---------------------------------------------------------------------------*/ - -#include "implicitFunction.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(implicitFunction, 0); - defineRunTimeSelectionTable(implicitFunction, dict); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -Foam::autoPtr Foam::implicitFunction::New -( - const word& functionType, - const dictionary& dict -) -{ - const auto& cstrIter = dictConstructorTablePtr_->find(functionType); - - if (!cstrIter.found()) - { - FatalErrorInFunction - << "Unknown implicitFunction type " << functionType - << nl << nl - << "Valid implicitFunction types : " << nl - << dictConstructorTablePtr_->sortedToc() - << exit(FatalError); - } - - return autoPtr(cstrIter()(dict)); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::implicitFunction::implicitFunction() -{} - - -// ************************************************************************* // diff --git a/src/VoF/implicitFunctions/implicitFunction.H b/src/VoF/implicitFunctions/implicitFunction.H deleted file mode 100644 index 1d66a280..00000000 --- a/src/VoF/implicitFunctions/implicitFunction.H +++ /dev/null @@ -1,126 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019 DLR -------------------------------------------------------------------------------- - -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::implicitFunction - -Description - Base class for implicit functions - - Original code supplied by Henning Scheufler, DLR (2019) - -SourceFiles - implicitFunction.C - -\*---------------------------------------------------------------------------*/ - -#ifndef implicitFunction_H -#define implicitFunction_H - -#include "autoPtr.H" -#include "dictionary.H" -#include "vector.H" -#include "runTimeSelectionTables.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class implicitFunction Declaration -\*---------------------------------------------------------------------------*/ - -class implicitFunction -{ - // Private Member Functions - - //- No copy construct - implicitFunction(const implicitFunction&) = delete; - - //- No copy assignment - void operator=(const implicitFunction&) = delete; - - -public: - - //- Runtime type information - TypeName("implicitFunction"); - - //- Declare run-time constructor selection table - declareRunTimeSelectionTable - ( - autoPtr, - implicitFunction, - dict, - ( - const dictionary& dict - ), - (dict) - ); - - //- Constructor - implicitFunction(); - - //- Return a reference to the selected implicitFunction - static autoPtr New - ( - const word& implicitFunctionType, - const dictionary& dict - ); - - //- Destructor - virtual ~implicitFunction() = default; - - - // Member Functions - - virtual scalar value(const vector& p) const - { - return GREAT; - } - - virtual vector grad(const vector& p) const - { - return vector::max; - } - - virtual scalar distanceToSurfaces(const vector& p) const - { - return GREAT; - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/VoF/implicitFunctions/paraboloid/paraboloidImplicitFunction.C b/src/VoF/implicitFunctions/paraboloid/paraboloidImplicitFunction.C deleted file mode 100644 index 48d31a0f..00000000 --- a/src/VoF/implicitFunctions/paraboloid/paraboloidImplicitFunction.C +++ /dev/null @@ -1,70 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019 DLR -------------------------------------------------------------------------------- - -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 . - -\*---------------------------------------------------------------------------*/ - -#include "paraboloidImplicitFunction.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace implicitFunctions - { - defineTypeNameAndDebug(paraboloidImplicitFunction, 0); - addToRunTimeSelectionTable - ( - implicitFunction, - paraboloidImplicitFunction, - dict - ); - } - -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::implicitFunctions::paraboloidImplicitFunction::paraboloidImplicitFunction -( - const vector& coeffs -) -: - coeffs_(coeffs) -{} - - -Foam::implicitFunctions::paraboloidImplicitFunction::paraboloidImplicitFunction -( - const dictionary& dict -) -: - coeffs_(dict.get("coeffs")) -{} - - -// ************************************************************************* // diff --git a/src/VoF/implicitFunctions/paraboloid/paraboloidImplicitFunction.H b/src/VoF/implicitFunctions/paraboloid/paraboloidImplicitFunction.H deleted file mode 100644 index ba1a4e99..00000000 --- a/src/VoF/implicitFunctions/paraboloid/paraboloidImplicitFunction.H +++ /dev/null @@ -1,129 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019 DLR -------------------------------------------------------------------------------- - -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::implicitFunctions::paraboloidImplicitFunction - -Description - creates a paraboloid - - Original code supplied by Henning Scheufler, DLR (2019) - -SourceFiles - paraboloidImplicitFunction.C - -\*---------------------------------------------------------------------------*/ - -#ifndef implicitFunction_paraboloidImplicitFunction_H -#define implicitFunction_paraboloidImplicitFunction_H - -#include "implicitFunction.H" -#include "mathematicalConstants.H" - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace implicitFunctions -{ - -/*---------------------------------------------------------------------------*\ - class paraboloidImplicitFunction Declaration -\*---------------------------------------------------------------------------*/ - -class paraboloidImplicitFunction -: - public implicitFunction -{ -private: - - // Private Member Data - - //- Coefficients of ax^2 + bx*y + cy^2 - vector coeffs_; - - - // Private Member Functions - - //- No copy construct - paraboloidImplicitFunction(const paraboloidImplicitFunction&); - - //- No bitwise assignment - void operator=(const paraboloidImplicitFunction&); - - -public: - - //- Runtime type information - TypeName("paraboloid"); - - - // Constructors - - //- Construct from components - paraboloidImplicitFunction(const vector& coeffs); - - //- Construct from dictionary - paraboloidImplicitFunction(const dictionary& dict); - - - //- Destructor - virtual ~paraboloidImplicitFunction() = default; - - virtual scalar value(const vector& p) const - { - return - coeffs_.x()*sqr(p.x()) - + coeffs_.y()*p.x()*p.y() - + coeffs_.z()*sqr(p.y()) - - p.z(); - } - - virtual vector grad(const vector& p) const - { - NotImplemented; - return vector::zero; - } - - virtual scalar distanceToSurfaces(const vector& p) const - { - NotImplemented; - return 0; - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace implicitFunctions -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/VoF/implicitFunctions/plane/planeImplicitFunction.C b/src/VoF/implicitFunctions/plane/planeImplicitFunction.C deleted file mode 100644 index 1b05a8d5..00000000 --- a/src/VoF/implicitFunctions/plane/planeImplicitFunction.C +++ /dev/null @@ -1,74 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019 DLR -------------------------------------------------------------------------------- - -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 . - -\*---------------------------------------------------------------------------*/ - -#include "planeImplicitFunction.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace implicitFunctions - { - defineTypeNameAndDebug(planeImplicitFunction, 0); - addToRunTimeSelectionTable - ( - implicitFunction, - planeImplicitFunction, - dict - ); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::implicitFunctions::planeImplicitFunction::planeImplicitFunction -( - const vector& origin, - const vector& normal -) -: - origin_(origin), - normal_(normal) -{} - - -Foam::implicitFunctions::planeImplicitFunction::planeImplicitFunction -( - const dictionary& dict -) -: - origin_(dict.get("origin")), - normal_(dict.get("normal")) -{ - normal_.normalise(); -} - - -// ************************************************************************* // diff --git a/src/VoF/implicitFunctions/plane/planeImplicitFunction.H b/src/VoF/implicitFunctions/plane/planeImplicitFunction.H deleted file mode 100644 index 361ee18d..00000000 --- a/src/VoF/implicitFunctions/plane/planeImplicitFunction.H +++ /dev/null @@ -1,130 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019 DLR -------------------------------------------------------------------------------- - -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::implicitFunctions::planeImplicitFunction - -Description - creates a plane - - Original code supplied by Henning Scheufler, DLR (2019) - -SourceFiles - planeImplicitFunction.C - -\*---------------------------------------------------------------------------*/ - -#ifndef implicitFunction_planeImplicitFunction_H -#define implicitFunction_planeImplicitFunction_H - -#include "implicitFunction.H" -#include "mathematicalConstants.H" - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace implicitFunctions -{ - -/*---------------------------------------------------------------------------*\ - Class planeImplicitFunction Declaration -\*---------------------------------------------------------------------------*/ - -class planeImplicitFunction -: - public implicitFunction -{ -private: - - // Private Member Data - - //- ax^2 + bx*y + cy^2 - //- Reference point - vector origin_; - - //- Normal vector - vector normal_; - - - // Private Member Functions - - //- No copy construct - planeImplicitFunction(const planeImplicitFunction&); - - //- No assignment - void operator=(const planeImplicitFunction&); - - -public: - - //- Runtime type information - TypeName("plane"); - - - // Constructors - - //- Construct from components - planeImplicitFunction(const vector& origin, const vector& normal); - - //- Construct from dictionary (used by implicitFunctions) - planeImplicitFunction(const dictionary& dict); - - - //- Destructor - virtual ~planeImplicitFunction() = default; - - - virtual scalar value(const vector& p) const - { - return -normal_ & (origin_ - p); - } - - virtual vector grad(const vector& p) const - { - // normal_ has the length of one - return normal_; - } - - virtual scalar distanceToSurfaces(const vector& p) const - { - // normal_ has the length of one - return mag((p - origin_) & -normal_); - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace implicitFunctions -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/VoF/implicitFunctions/sin/sinImplicitFunction.C b/src/VoF/implicitFunctions/sin/sinImplicitFunction.C deleted file mode 100644 index 425ded51..00000000 --- a/src/VoF/implicitFunctions/sin/sinImplicitFunction.C +++ /dev/null @@ -1,86 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019 DLR -------------------------------------------------------------------------------- - -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 . - -\*---------------------------------------------------------------------------*/ - -#include "sinImplicitFunction.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace implicitFunctions - { - defineTypeNameAndDebug(sinImplicitFunction, 0); - addToRunTimeSelectionTable - ( - implicitFunction, - sinImplicitFunction, - dict - ); - } -} - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::implicitFunctions::sinImplicitFunction::sinImplicitFunction -( - const scalar period, - const scalar phase, - const scalar amplitude, - const vector& direction, - const vector& up, - const vector& origin -) -: - period_(period), - phase_(phase), - amplitude_(amplitude), - up_(up), - direction_(direction), - origin_(origin) -{} - - -Foam::implicitFunctions::sinImplicitFunction::sinImplicitFunction -( - const dictionary& dict -) -: - period_(dict.get("period")), - phase_(dict.lookupOrDefault("phase",0.0)), - amplitude_(dict.get("amplitude")), - up_(dict.get("up")), - direction_(dict.get("direction")), - origin_(dict.get("origin")) -{ - direction_.normalise(); - up_.normalise(); -} - - -// ************************************************************************* // diff --git a/src/VoF/implicitFunctions/sin/sinImplicitFunction.H b/src/VoF/implicitFunctions/sin/sinImplicitFunction.H deleted file mode 100644 index 977aa1e7..00000000 --- a/src/VoF/implicitFunctions/sin/sinImplicitFunction.H +++ /dev/null @@ -1,148 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019 DLR -------------------------------------------------------------------------------- - -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::implicitFunctions::sinImplicitFunction - -Description - - Original code supplied by Henning Scheufler, DLR (2019) - -SourceFiles - sinImplicitFunction.C - -\*---------------------------------------------------------------------------*/ - -#ifndef implicitFunction_sinImplicitFunction_H -#define implicitFunction_sinImplicitFunction_H - -#include "implicitFunction.H" -#include "mathematicalConstants.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace implicitFunctions -{ - -/*---------------------------------------------------------------------------*\ - Class sinImplicitFunction Declaration -\*---------------------------------------------------------------------------*/ - -class sinImplicitFunction -: - public implicitFunction -{ -private: - - // Private Member Data - - //- origin point - const scalar period_; - - //- Radius - const scalar phase_; - - const scalar amplitude_; - - vector up_; - - vector direction_; - - vector origin_; - - - // Private Member Functions - - //- No copy construct - sinImplicitFunction(const sinImplicitFunction&) = delete; - - //- No bitwise assignment - void operator=(const sinImplicitFunction&) = delete; - - -public: - - //- Runtime type information - TypeName("sin"); - - - // Constructors - - //- Construct from components - sinImplicitFunction - ( - const scalar period, - const scalar phase, - const scalar amplitude, - const vector& direction, - const vector& up, - const vector& origin - ); - - //- Construct from dictionary (used by implicitFunctions) - sinImplicitFunction(const dictionary& dict); - - - //- Destructor - virtual ~sinImplicitFunction() = default; - - virtual scalar value(const vector& p) const - { - const scalar x = (p - origin_) & direction_; - const scalar z = (p - origin_) & -up_; - - return - z - - amplitude_ - *Foam::sin(2*constant::mathematical::pi*x/period_ + phase_); - } - - virtual vector grad(const vector& p) const - { - NotImplemented; - return vector::zero; - } - - virtual scalar distanceToSurfaces(const vector& p) const - { - NotImplemented; - return 0; - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace implicitFunctions -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/VoF/implicitFunctions/sphere/sphereImplicitFunction.C b/src/VoF/implicitFunctions/sphere/sphereImplicitFunction.C deleted file mode 100644 index 05d63e46..00000000 --- a/src/VoF/implicitFunctions/sphere/sphereImplicitFunction.C +++ /dev/null @@ -1,74 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019 DLR -------------------------------------------------------------------------------- - -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 . - -\*---------------------------------------------------------------------------*/ - -#include "sphereImplicitFunction.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace implicitFunctions - { - defineTypeNameAndDebug(sphereImplicitFunction, 0); - addToRunTimeSelectionTable - ( - implicitFunction, - sphereImplicitFunction, - dict - ); - } -} - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::implicitFunctions::sphereImplicitFunction::sphereImplicitFunction -( - const point& origin, - const scalar radius, - const scalar scale -) -: - origin_(origin), - radius_(radius), - scale_(scale) -{} - - -Foam::implicitFunctions::sphereImplicitFunction::sphereImplicitFunction -( - const dictionary& dict -) -: - origin_(dict.get("origin")), - radius_(dict.get("radius")), - scale_(dict.lookupOrDefault("scale" ,1)) -{} - - -// ************************************************************************* // diff --git a/src/VoF/implicitFunctions/sphere/sphereImplicitFunction.H b/src/VoF/implicitFunctions/sphere/sphereImplicitFunction.H deleted file mode 100644 index 964d2fba..00000000 --- a/src/VoF/implicitFunctions/sphere/sphereImplicitFunction.H +++ /dev/null @@ -1,132 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019 DLR -------------------------------------------------------------------------------- - -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::implicitFunctions::sphereImplicitFunction - -Description - Creates a sphere - - Original code supplied by Henning Scheufler, DLR (2019) - -SourceFiles - sphereImplicitFunction.C - -\*---------------------------------------------------------------------------*/ - -#ifndef implicitFunction_sphereImplicitFunction_H -#define implicitFunction_sphereImplicitFunction_H - -#include "implicitFunction.H" -#include "point.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace implicitFunctions -{ - -/*---------------------------------------------------------------------------*\ - Class sphereImplicitFunction Declaration -\*---------------------------------------------------------------------------*/ - -class sphereImplicitFunction -: - public implicitFunction -{ - // Private Member Data - - //- Origin point - const point origin_; - - //- Radius - const scalar radius_; - - const scalar scale_; - - - // Private Member Functions - - //- No copy construct - sphereImplicitFunction(const sphereImplicitFunction&); - - //- No copy assignment - void operator=(const sphereImplicitFunction&) = delete; - - -public: - - //- Runtime type information - TypeName("sphere"); - - - // Constructors - - //- Construct from components - sphereImplicitFunction - ( - const point&, - const scalar radius, - const scalar scale - ); - - //- Construct from dictionary - sphereImplicitFunction(const dictionary& dict); - - //- Destructor - virtual ~sphereImplicitFunction() = default; - - - // Member Functions - - virtual scalar value(const vector& p) const - { - return (-mag(p - origin_) + radius_)*scale_; - } - - virtual vector grad(const vector& p) const - { - return (origin_ - p)*scale_; - } - - virtual scalar distanceToSurfaces(const vector& p) const - { - return mag(mag(p-origin_) - radius_)*scale_; - } -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace implicitFunctions -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/VoF/multiDimPolyFitter/leastSquareGrad.C b/src/VoF/multiDimPolyFitter/leastSquareGrad.C deleted file mode 100644 index cb4a1116..00000000 --- a/src/VoF/multiDimPolyFitter/leastSquareGrad.C +++ /dev/null @@ -1,178 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2019-2019 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- - | Copyright (C) 2019-2019 DLR -------------------------------------------------------------------------------- - -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 . - -\*---------------------------------------------------------------------------*/ - -#include "leastSquareGrad.H" - -#include "emptyPolyPatch.H" -#include "processorPolyPatch.H" -#include "wedgePolyPatch.H" - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::leastSquareGrad::leastSquareGrad -( - word functionName, - Vector