calculate surface area
Deal OpenFOAM User,
I am implementing PLIC in interFOAM. Then I need to find the way to calculate the volume of each liquid occupied in each cell. I found in the primitiveMesh class two functions that can help me:
void Foam: primitiveMesh::makeFaceCentresAndAreas ( const pointField& p, vectorField& fCtrs, vectorField& fAreas )
void Foam: primitiveMesh::makeCellCentresAndVols ( const vectorField& fCtrs, const vectorField& fAreas, vectorField& cellCtrs, scalarField& cellVols )
However, I have a problem with construct pointField p in function makeFaceCentresAndAreas. Let's say we have four points:
(1 0 0)
(2 0 0)
(2 1 0)
(1 2 0)
Does anyone have ideas about how to construct variable p from these four points for the input of this function?
Hi Duong, what about doing,
or something like this.
Thanks for the suggestion. However, since I want to construct the interface which has a form n.x+const = 0 (n is the normal vector and x is the point), I should find value of the constant to ensure the conservation of volume fraction. Then, I must find a way to use those function.
Btw, I found how to construct this pointField p. What you can do is:
p = point(1,0,0);
p = point(2,1,0);
That's how we define pointField in OpenFOAM.
Aha, I see. My answer was related to "then I need to find the way to calculate the volume of each liquid occupied in each cell". I understand that you need to calculate a plane within a cell such as the sub-volumes would be equal to those are calculated by the formulas I exposed before...
|All times are GMT -4. The time now is 05:56.|