Added ramping functionality for multiphase simulations
The outletPhaseMeanVelocity and waveVelocity boundary conditions now
support a "ramp" keyword, for which a function can be supplied to
gradually increase the input velocity. The following is an example
specification for an outlet patch:
outlet
{
type outletPhaseMeanVelocity;
Umean 2;
ramp
{
type quarterSineRamp;
start 0;
duration 5;
}
alpha alpha.water;
}
There is also a new velocityRamping function object, which provides a
matching force within the volume of the domain, so that the entire flow
is smoothly accelerated up to the operating condition. An example
specification is as follows:
velocityRamping
{
type velocityRamping;
active on;
selectionMode all;
U U;
velocity (-2 0 0);
ramp
{
type quarterSineRamp;
start 0;
duration 5;
}
}
These additions have been designed to facilitate a smoother startup of
ship simulations by avoiding the slamming transients associated with
initialising a uniform velocity field.
This work was supported by Jan Kaufmann and Jan Oberhagemann at DNV GL.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -72,6 +72,7 @@ int main(int argc, char *argv[])
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
const scalar t = runTime.value();
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
@ -188,17 +189,16 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
liquid = liquidp;
|
||||
|
||||
const scalar t = runTime.value();
|
||||
const pointField& ccs = mesh.cellCentres();
|
||||
const pointField& pts = mesh.points();
|
||||
|
||||
// Internal field superposition
|
||||
h.primitiveFieldRef() += waves.height(t, ccs);
|
||||
hp.primitiveFieldRef() += waves.height(t, pts);
|
||||
uGas.primitiveFieldRef() += waves.UGas(t, ccs) - waves.UMean();
|
||||
uGasp.primitiveFieldRef() += waves.UGas(t, pts) - waves.UMean();
|
||||
uLiq.primitiveFieldRef() += waves.ULiquid(t, ccs) - waves.UMean();
|
||||
uLiqp.primitiveFieldRef() += waves.ULiquid(t, pts) - waves.UMean();
|
||||
uGas.primitiveFieldRef() += waves.UGas(t, ccs) - waves.UMean(t);
|
||||
uGasp.primitiveFieldRef() += waves.UGas(t, pts) - waves.UMean(t);
|
||||
uLiq.primitiveFieldRef() += waves.ULiquid(t, ccs) - waves.UMean(t);
|
||||
uLiqp.primitiveFieldRef() += waves.ULiquid(t, pts) - waves.UMean(t);
|
||||
|
||||
// Boundary field superposition
|
||||
forAll(mesh.boundary(), patchj)
|
||||
@ -206,9 +206,9 @@ int main(int argc, char *argv[])
|
||||
const pointField& fcs = mesh.boundary()[patchj].Cf();
|
||||
h.boundaryFieldRef()[patchj] += waves.height(t, fcs);
|
||||
uGas.boundaryFieldRef()[patchj] +=
|
||||
waves.UGas(t, fcs) - waves.UMean();
|
||||
waves.UGas(t, fcs) - waves.UMean(t);
|
||||
uLiq.boundaryFieldRef()[patchj] +=
|
||||
waves.ULiquid(t, fcs) - waves.UMean();
|
||||
waves.ULiquid(t, fcs) - waves.UMean(t);
|
||||
}
|
||||
|
||||
++ nWaves;
|
||||
@ -246,7 +246,8 @@ int main(int argc, char *argv[])
|
||||
const waveSuperposition& waves =
|
||||
refCast<const waveVelocityFvPatchVectorField>(Up).waves();
|
||||
|
||||
UMean == dimensionedVector("UMean", dimVelocity, waves.UMean());
|
||||
UMean ==
|
||||
dimensionedVector("UMean", dimVelocity, waves.UMean(t));
|
||||
}
|
||||
}
|
||||
else if (nWaves > 1)
|
||||
@ -290,7 +291,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
weight += w;
|
||||
weightUMean +=
|
||||
w*dimensionedVector("wUMean", dimVelocity, waves.UMean());
|
||||
w*dimensionedVector("wUMean", dimVelocity, waves.UMean(t));
|
||||
}
|
||||
|
||||
// Complete the average for the mean velocity
|
||||
|
||||
Reference in New Issue
Block a user