waves: Moved mean velocity specification back into the wave models

With the inclusion of boundary layer modelling in the gas, the
separation of wave perturbation from and mean flow became less useful,
and potentially prevents further extension to support similar boundary
layer modelling in the liquid.

The mean velocity entry, UMean, is now needed in the
constant/waveProperties file rather than in the waveVelocity boundary
condition.
This commit is contained in:
Will Bainbridge
2018-12-18 10:20:28 +00:00
parent e033aca111
commit 5925868fb7
17 changed files with 106 additions and 151 deletions

View File

@ -91,12 +91,6 @@ int main(int argc, char *argv[])
const word alphaName = setWavesDict.lookupOrDefault<word>("alpha", "alpha");
const word UName = setWavesDict.lookupOrDefault<word>("U", "U");
const bool liquid = setWavesDict.lookupOrDefault<bool>("liquid", true);
const dimensionedVector UMean
(
"UMean",
dimVelocity,
setWavesDict.lookup("UMean")
);
// Get the wave models
const waveSuperposition& waves = waveSuperposition::New(mesh);
@ -172,33 +166,30 @@ int main(int argc, char *argv[])
dimensionedVector("0", dimVelocity, vector::zero)
);
// Offset
const vector offset = UMean.value()*t;
// Cell centres and points
const pointField& ccs = mesh.cellCentres();
const pointField& pts = mesh.points();
// Internal field
h.primitiveFieldRef() = waves.height(t, ccs + offset);
hp.primitiveFieldRef() = waves.height(t, pts + offset);
uGas.primitiveFieldRef() = waves.UGas(t, ccs + offset);
uGasp.primitiveFieldRef() = waves.UGas(t, pts + offset);
uLiq.primitiveFieldRef() = waves.ULiquid(t, ccs + offset);
uLiqp.primitiveFieldRef() = waves.ULiquid(t, pts + offset);
h.primitiveFieldRef() = waves.height(t, ccs);
hp.primitiveFieldRef() = waves.height(t, pts);
uGas.primitiveFieldRef() = waves.UGas(t, ccs);
uGasp.primitiveFieldRef() = waves.UGas(t, pts);
uLiq.primitiveFieldRef() = waves.ULiquid(t, ccs);
uLiqp.primitiveFieldRef() = waves.ULiquid(t, pts);
// Boundary fields
forAll(mesh.boundary(), patchj)
{
const pointField& fcs = mesh.boundary()[patchj].Cf();
h.boundaryFieldRef()[patchj] = waves.height(t, fcs + offset);
uGas.boundaryFieldRef()[patchj] = waves.UGas(t, fcs + offset);
uLiq.boundaryFieldRef()[patchj] = waves.ULiquid(t, fcs + offset);
h.boundaryFieldRef()[patchj] = waves.height(t, fcs);
uGas.boundaryFieldRef()[patchj] = waves.UGas(t, fcs);
uLiq.boundaryFieldRef()[patchj] = waves.ULiquid(t, fcs);
}
// Set the fields
alpha == levelSetFraction(h, hp, !liquid);
U == UMean + levelSetAverage(h, hp, uGas, uGasp, uLiq, uLiqp);
U == levelSetAverage(h, hp, uGas, uGasp, uLiq, uLiqp);
// Set the boundary fields
forAll(mesh.boundary(), patchi)