44 int main(
int argc,
char *argv[])
46 timeSelector::addOptions(
false,
false);
52 "name of the velocity field, default is \"U\"" 59 "name of the volume fraction field, default is \"alpha\"" 68 #include "readGravitationalAcceleration.H" 74 runTime.setTime(timeDirs[timeI], timeI);
75 const scalar t =
runTime.value();
155 const bool isWave = isA<waveAlphaFvPatchScalarField>(alphap);
157 if (isA<waveVelocityFvPatchVectorField>(Up) != isWave)
160 <<
"The alpha condition on patch " << Up.patch().name()
161 <<
" is " << alphap.type() <<
" and the velocity condition" 162 <<
" is " << Up.type() <<
". Wave boundary conditions must" 163 <<
" be set in pairs. If the alpha condition is " 164 << waveAlphaFvPatchScalarField::typeName
165 <<
" then the velocity condition must be " 166 << waveVelocityFvPatchVectorField::typeName
175 Info<<
"Adding waves from patch " << Up.patch().name() <<
endl;
177 const waveSuperposition& waves =
178 refCast<waveVelocityFvPatchVectorField>(Up).waves();
181 refCast<waveAlphaFvPatchScalarField>(alphap).liquid();
182 if (nWaves > 0 && liquidp != liquid)
185 <<
"All " << waveAlphaFvPatchScalarField::typeName
186 <<
"patch fields must be configured for the same phase," 187 <<
" i.e., the liquid switch must have the same value." 196 h.primitiveFieldRef() += waves.height(t, ccs);
197 hp.primitiveFieldRef() += waves.height(t, pts);
198 uGas.primitiveFieldRef() += waves.UGas(t, ccs) - waves.UMean(t);
199 uGasp.primitiveFieldRef() += waves.UGas(t, pts) - waves.UMean(t);
200 uLiq.primitiveFieldRef() += waves.ULiquid(t, ccs) - waves.UMean(t);
201 uLiqp.primitiveFieldRef() += waves.ULiquid(t, pts) - waves.UMean(t);
207 h.boundaryFieldRef()[patchj] += waves.height(t, fcs);
208 uGas.boundaryFieldRef()[patchj] +=
209 waves.UGas(t, fcs) - waves.UMean(t);
210 uLiq.boundaryFieldRef()[patchj] +=
211 waves.ULiquid(t, fcs) - waves.UMean(t);
229 <<
"No " << waveAlphaFvPatchScalarField::typeName <<
" or " 230 << waveVelocityFvPatchVectorField::typeName <<
" patch fields " 231 <<
"were found. No waves have been set." <<
endl;
235 else if (nWaves == 1)
241 if (!isA<waveVelocityFvPatchVectorField>(Up))
246 const waveSuperposition& waves =
247 refCast<const waveVelocityFvPatchVectorField>(Up).waves();
275 if (!isA<waveVelocityFvPatchVectorField>(Up))
280 const waveSuperposition& waves =
281 refCast<const waveVelocityFvPatchVectorField>(Up).waves();
298 UMean = weightUMean/weight;
310 if (isA<waveAlphaFvPatchScalarField>(alphap))
312 alphap == refCast<waveAlphaFvPatchScalarField>(alphap).
alpha();
313 Up == refCast<waveVelocityFvPatchVectorField>(Up).
U();
GeometricField< scalar, pointPatchField, pointMesh > pointScalarField
List< instant > instantList
List of instants.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
fvPatchField< vector > fvPatchVectorField
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< scalarField > levelSetFraction(const fvMesh &mesh, const scalarField &levelC, const scalarField &levelP, const bool above)
Calculate the volume-fraction that a level set occupies. This gives the.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
volVectorField UMean(UMeanHeader, mesh)
GeometricField< vector, fvPatchField, volMesh > volVectorField
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
vectorField pointField
pointField is a vectorField.
fvPatchField< scalar > fvPatchScalarField
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
List< label > labelList
A List of labels.
tmp< Field< Type > > levelSetAverage(const fvMesh &mesh, const scalarField &levelC, const scalarField &levelP, const Field< Type > &positiveC, const Field< Type > &positiveP, const Field< Type > &negativeC, const Field< Type > &negativeP)
Calculate the average value of two fields, one on each side of a level set.
const word & name() const
Return const reference to name.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
volScalarField & h
Planck constant.
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Foam::argList args(argc, argv)
const dimensionSet dimVelocity