Junyu |
April 29, 2024 10:34 |
How to obtain initial condition in codedFixedValue boundary condition
Hi, everyone. I want to achieve a particular dynamic boundary that is coupled with fluid pressure and dependent on initial geometry.
In a brief form, the boundary displacement satisfies the equation + =-p,where is the displacement along the initial normal direction of the wall(here it is a cylinder), and p is the fluid pressure.
I use the dynamicMotionSolverFvMesh as dynamicFvMesh and displacementLaplacian solver. In the pointDisplacement dictionary, I set the moving boundary as the codedFixedValue type and try to solve the above equation.
Now I need to obtain the normal direction at the initial time. I don't know which patch I should use.
By the way, I found a 'points0' in the displacementLaplacian that seems to be the initial position, but it seems not accesible directly.
I have the following codes to obtain pressure on the boundary at present Time:
Code:
const fvMesh& mesh = this->patch().boundaryMesh().mesh();
label cylinderID = mesh.boundaryMesh().findPatchID("cylinder");
volScalarField& tempP = mesh.lookupObjectRef<volScalarField>("p");
const fvPatchScalarField& cylinderP = tempP.boundaryField()[cylinderID];
Any suggestion will be appreciated. Thanks in advance!
|