Skip to content

Commit

Permalink
Merge pull request #3 from pzimbrod/marangoni-bugfix
Browse files Browse the repository at this point in the history
include interfaceProperties
  • Loading branch information
pzimbrod authored Jun 27, 2022
2 parents 20f3a85 + b8bb7b1 commit 84e78d2
Show file tree
Hide file tree
Showing 27 changed files with 1,866 additions and 38 deletions.
1 change: 1 addition & 0 deletions Allwclean
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------

wclean libso laserDTRM
wclean libso interfaceProperties
wclean libso phasesSystem
./WENOEXT/Allwclean
wclean
Expand Down
1 change: 1 addition & 0 deletions Allwmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ echo "Building external libraries"
./WENOEXT/Allwmake

echo "Building application"
wmake $targetType interfaceProperties
wmake $targetType laserDTRM
wmake $targetType phasesSystem
wmake $targetType
Expand Down
2 changes: 1 addition & 1 deletion Make/options
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I./interfaceProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
Expand Down
2 changes: 1 addition & 1 deletion UEqn.H
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (pimple.momentumPredictor())
) * mesh.magSf()
)
-
fluid.divCapillaryStress()
fluid.divCapillaryStress(T)
);

fvOptions.correct(U);
Expand Down
14 changes: 14 additions & 0 deletions createFields.H
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,17 @@

Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

Info<< "Creating field divCapillaryStress\n" <<endl;
volVectorField divCapillaryStress
(
IOobject
(
"divCapillaryStress",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
fluid.divCapillaryStress(T)
);
11 changes: 11 additions & 0 deletions interfaceProperties/Make/files
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
interfaceProperties.C
interfaceCompression/interfaceCompression.C

alphaContactAngle/alphaContactAngleTwoPhaseFvPatchScalarField.C

surfaceTensionModels/surfaceTensionModel/surfaceTensionModel.C
surfaceTensionModels/surfaceTensionModel/surfaceTensionModelNew.C
surfaceTensionModels/constant/constantSurfaceTension.C
surfaceTensionModels/temperatureDependent/temperatureDependentSurfaceTension.C

LIB = $(FOAM_LIBBIN)/libinterfaceProperties
8 changes: 8 additions & 0 deletions interfaceProperties/Make/options
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
EXE_INC = \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle \
-I$(LIB_SRC)/finiteVolume/lnInclude

LIB_LIBS = \
-ltwoPhaseMixture \
-lfiniteVolume
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/

#include "alphaContactAngleTwoPhaseFvPatchScalarField.H"
#include "fvPatchFieldMapper.H"
#include "volMesh.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

const Foam::Enum
<
Foam::alphaContactAngleTwoPhaseFvPatchScalarField::limitControls
>
Foam::alphaContactAngleTwoPhaseFvPatchScalarField::limitControlNames_
({
{ limitControls::lcNone, "none" },
{ limitControls::lcGradient, "gradient" },
{ limitControls::lcZeroGradient, "zeroGradient" },
{ limitControls::lcAlpha, "alpha" },
});


// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

Foam::alphaContactAngleTwoPhaseFvPatchScalarField::
alphaContactAngleTwoPhaseFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(p, iF),
limit_(lcZeroGradient)
{}


Foam::alphaContactAngleTwoPhaseFvPatchScalarField::
alphaContactAngleTwoPhaseFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
fixedGradientFvPatchScalarField(p, iF),
limit_(limitControlNames_.get("limit", dict))
{
if (dict.found("gradient"))
{
gradient() = scalarField("gradient", dict, p.size());
fixedGradientFvPatchScalarField::updateCoeffs();
fixedGradientFvPatchScalarField::evaluate();
}
else
{
fvPatchField<scalar>::operator=(patchInternalField());
gradient() = 0.0;
}
}


Foam::alphaContactAngleTwoPhaseFvPatchScalarField::
alphaContactAngleTwoPhaseFvPatchScalarField
(
const alphaContactAngleTwoPhaseFvPatchScalarField& acpsf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedGradientFvPatchScalarField(acpsf, p, iF, mapper),
limit_(acpsf.limit_)
{}


Foam::alphaContactAngleTwoPhaseFvPatchScalarField::
alphaContactAngleTwoPhaseFvPatchScalarField
(
const alphaContactAngleTwoPhaseFvPatchScalarField& acpsf
)
:
fixedGradientFvPatchScalarField(acpsf),
limit_(acpsf.limit_)
{}


Foam::alphaContactAngleTwoPhaseFvPatchScalarField::
alphaContactAngleTwoPhaseFvPatchScalarField
(
const alphaContactAngleTwoPhaseFvPatchScalarField& acpsf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(acpsf, iF),
limit_(acpsf.limit_)
{}


// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

void Foam::alphaContactAngleTwoPhaseFvPatchScalarField::evaluate
(
const Pstream::commsTypes
)
{
if (limit_ == lcGradient)
{
gradient() =
patch().deltaCoeffs()
*(
max(min
(
*this + gradient()/patch().deltaCoeffs(),
scalar(1)), scalar(0)
) - *this
);
}
else if (limit_ == lcZeroGradient)
{
gradient() = 0.0;
}

fixedGradientFvPatchScalarField::evaluate();

if (limit_ == lcAlpha)
{
scalarField::operator=(max(min(*this, scalar(1)), scalar(0)));
}
}


void Foam::alphaContactAngleTwoPhaseFvPatchScalarField::write
(
Ostream& os
) const
{
fixedGradientFvPatchScalarField::write(os);
os.writeEntry("limit", limitControlNames_[limit_]);
}


// ************************************************************************* //
Loading

0 comments on commit 84e78d2

Please sign in to comment.