Function1: Added squarePulse

This function gives a value of one during a user-specified duration, and
zero at all other times. It is useful for defining the time range in
which an injection or ignition heat source or similar operates.

Example usage, scaling a value:

    <name>
    {
        type        scale;
        scale       squarePulse;
        start       0;
        duration    1;
        value       100;
    }

This function has been utilised in a number of tutorial fvOption
configurations to provide a specific window in which the fvOption is
applied. This was previously achieved by "timeStart" and "duration"
controls hard coded into the fvOptions themselves.
This commit is contained in:
Will Bainbridge
2021-02-09 16:16:37 +00:00
parent e7f746652b
commit aa4151d649
17 changed files with 361 additions and 42 deletions

View File

@ -21,9 +21,8 @@ options
{
type semiImplicitSource;
timeStart 0;
duration 1e6;
selectionMode all;
volumeMode specific;
sources

View File

@ -15,6 +15,32 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ignition
{
type semiImplicitSource;
selectionMode cellSet;
cellSet ignition;
volumeMode specific;
sources
{
h
{
explicit
{
type scale;
scale squarePulse;
start 0;
duration 1;
value 5e7; // kg/m/s^3
}
implicit 0;
}
}
}
radiation
{
type radiation;

View File

@ -19,8 +19,6 @@ momentumSource
{
type semiImplicitSource;
timeStart 0.0;
duration 1000;
selectionMode all;
volumeMode specific;

View File

@ -48,8 +48,6 @@ massSource
{
type semiImplicitSource;
timeStart 0.2;
duration 2.0;
selectionMode points;
points
(
@ -58,29 +56,53 @@ massSource
volumeMode absolute;
squarePulse
{
type scale;
scale squarePulse;
start 0.2;
duration 2;
}
sources
{
rho
{
explicit 1e-4; // kg/s
explicit
{
$squarePulse;
value 1e-4; // kg/s
}
implicit 0;
}
U
{
explicit (0 0.005 0);
explicit
{
$squarePulse;
value (0 0.005 0);
}
implicit 0;
}
h
{
explicit 10;
explicit
{
$squarePulse;
value 10;
}
implicit 0;
}
H2O
{
explicit 1e-4; // kg/s
explicit
{
$squarePulse;
value 1e-4; // kg/s
}
implicit 0;
}
}

View File

@ -21,10 +21,12 @@ source1
timeStart 0.1;
duration 0.4;
selectionMode cellSet;
cellSet ignitionCells;
mode uniform;
temperature 2000;
}

View File

@ -32,9 +32,6 @@ option1
value (2 0 0);
lambda 0.5;
timeStart 0;
duration 1e6;
}

View File

@ -31,9 +31,6 @@ option1
}
lambda 0.5;
timeStart 0;
duration 1e6;
}

View File

@ -21,9 +21,6 @@ options
{
type massSource;
timeStart 0.1;
duration 5;
selectionMode points;
points
(

View File

@ -21,9 +21,6 @@ options
{
type massSource;
timeStart 1;
duration 500;
selectionMode points;
points
(