fvModels: Added volumeSource model

This fvModel applies a volume source to the continuity equation and to
all field equations. It can be applied to incompressible solvers, such
as incompressibleFluid and incompressibleVoF. For compressible solvers,
use the massSource model instead.

If the volumetric flow rate is positive then user-supplied fixed
property values are introduced to the field equations. If the volumetric
flow rate is negative then properties are removed at their current
value.

Example usage:

    volumeSource
    {
        type            volumeSource;

        select          cellSet;
        cellSet         volumeSource;

        volumetricFlowRate 1e-4;

        fieldValues
        {
            U               (10 0 0);
            k               0.375;
            epsilon         14.855;
        }
    }

If the volumetric flow rate is positive then values should be provided
for all solved for fields. Warnings will be issued if values are not
provided for fields for which transport equations are solved. Warnings
will also be issued if values are provided for fields which are not
solved for.
This commit is contained in:
Will Bainbridge
2023-09-26 15:47:43 +01:00
parent a5ea0b41f1
commit 9181a699f2
13 changed files with 781 additions and 34 deletions

View File

@ -20,4 +20,19 @@ volumeFraction
volumePhase volume;
}
volumeSource
{
type volumeSource;
cellZone volumeSource;
volumetricFlowRate 0.00064;
fieldValues
{
U (0 0 0);
tracer 1;
}
}
// ************************************************************************* //

View File

@ -31,6 +31,11 @@ vertices
(0 -56 -1) (256 -56 -1)
(0 -88 1) (256 -88 1)
(0 -56 1) (256 -56 1)
(0 -124 -1) (16 -124 -1) (256 -124 -1)
(0 -92 -1) (16 -92 -1) (256 -92 -1)
(0 -124 1) (16 -124 1) (256 -124 1)
(0 -92 1) (16 -92 1) (256 -92 1)
);
blocks
@ -44,6 +49,9 @@ blocks
hex (12 13 19 18 24 25 31 30) (64 32 1) simpleGrading (1 1 1)
hex (32 33 35 34 36 37 39 38) (256 32 1) simpleGrading (1 1 1)
hex (40 41 44 43 46 47 50 49) volumeSource (16 32 1) simpleGrading (1 1 1)
hex (41 42 45 44 47 48 51 50) (240 32 1) simpleGrading (1 1 1)
);
defaultPatch
@ -76,6 +84,8 @@ boundary
(13 19 31 25)
(33 35 39 37)
(42 45 51 48)
);
}
walls
@ -99,6 +109,12 @@ boundary
(32 33 37 36)
(34 35 39 38)
(40 43 49 46)
(40 41 47 46)
(41 42 48 47)
(43 44 50 49)
(44 45 51 50)
);
}
);

View File

@ -42,7 +42,7 @@ codeWrite
mesh().time().constant(),
mesh()
),
0.5*pos(y - (-0.088))*pos((-0.056) - y)*f
0.5*pos(y - (-0.124))*pos((-0.056) - y)*f
).write();
#};

View File

@ -0,0 +1,11 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanVoFCase && rm -rf 0 system
find constant -type f -not -name fvModels.injection -delete
#------------------------------------------------------------------------------

View File

@ -0,0 +1,18 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Copy the source case and add the volume source model
isTest "$@" && path=.. || path=$FOAM_TUTORIALS/incompressibleVoF
cp -rn $path/damBreak/0 $path/damBreak/constant $path/damBreak/system .
runApplication foamDictionary constant/fvModels \
-entry injection -dict -merge constant/fvModels.injection
# Run
runApplication blockMesh
runApplication setFields
runApplication $(getApplication)
#------------------------------------------------------------------------------

View File

@ -0,0 +1,36 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
location "constant";
object fvModels.injection;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
injection
{
type volumeSource;
points ((0.438 0.438 0.0073));
volumetricFlowRate 0.0003;
phase water;
fieldValues
{
U (-1 0 0);
k 0.1;
epsilon 0.1;
}
}
//************************************************************************* //