View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004229 | OpenFOAM | Bug | public | 2025-04-12 10:50 | 2025-04-12 20:39 |
Reporter | michael_h | Assigned To | henry | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | x86_64 | OS | openSUSE | OS Version | Leap 15.6 |
Product Version | dev | ||||
Fixed in Version | dev | ||||
Summary | 0004229: waveSurfacePressure applies pRef twice | ||||
Description | If a pRef object is defined and the waveSurfacePressure boundary condition is used then the calculated pressure has twice the value it should be. A possible solution is attached. A different possibility would be to add a new parameter for the ambient pressure at the patch field instead of using pRef for this. | ||||
Steps To Reproduce | Copy the file tutorials/fluid/buoyantCavity/constant/pRef to tutorials/isothermalFluid/potentialFreeSurfaceOscillatingBox/constant/ and run the potentialFreeSurfaceOscillatingBox tutorial. Expected is that the pressure is 1e5. In the result the pressure at the water surface is 1.9e5, however. | ||||
Additional Information | This issue applies to dev as well as to OpenFOAM 12. | ||||
Tags | No tags attached. | ||||
|
waveSurfacePressure.diff (2,135 bytes)
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C index 1656d3b67a..2d804a6513 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C @@ -212,10 +212,7 @@ void Foam::waveSurfacePressureFvPatchScalarField::updateCoeffs() const uniformDimensionedVectorField& g = db().lookupObject<uniformDimensionedVectorField>("g"); - const uniformDimensionedScalarField& pRef = - this->db().template lookupObject<uniformDimensionedScalarField>("pRef"); - - operator==(pRef.value() - rhop*(g.value() & zetap)); + operator==(- rhop * (g.value() & zetap)); fixedValueFvPatchScalarField::updateCoeffs(); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H index 1e9e30dbb1..65e9c005a4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H @@ -29,7 +29,7 @@ Description the hydrostatic pressure based on a given displacement: \f[ - p_rgh = pref - \rho*g*\zeta + p_rgh = - \rho*g*\zeta \f] \vartable @@ -64,6 +64,11 @@ Usage The density field is only required if the flux is mass-based as opposed to volumetric-based. + It is possible to set the ambient pressure by specifying a pRef object in + the constant folder. The patch field with this boundary condition must be + oriented perpendicular to gravity and should be in the same plane as the + origin of the coordinate system. + See also Foam::fixedValueFvPatchField |
|
Resolved by commit 53941b20e3a4f56237b48787acfc5cbc8ce7d0a7 |
Date Modified | Username | Field | Change |
---|---|---|---|
2025-04-12 10:50 | michael_h | New Issue | |
2025-04-12 10:50 | michael_h | File Added: waveSurfacePressure.diff | |
2025-04-12 20:39 | henry | Assigned To | => henry |
2025-04-12 20:39 | henry | Status | new => resolved |
2025-04-12 20:39 | henry | Resolution | open => fixed |
2025-04-12 20:39 | henry | Fixed in Version | => dev |
2025-04-12 20:39 | henry | Note Added: 0013555 |