https://linen.dev logo
I am trying to subtract some momentum from the mom...
# programming
m
I am trying to subtract some momentum from the momentum equation for specific cells. You can think of this as being similar to the effects of porosity. The force has the following form:
f = Coeff * U
To implement this, I am using fvm::Sp(Coeff, U) to subtract the force term from the momentum equation. This part seems to work fine. Now, for the sake of analysis, I want to calculate and write out the force being applied. To do this, I’m using the following code:
Copy code
forAll(selectedCells, cellI)
{
    forceValue += Coeff[cellI] * U[cellI] * mesh_.V()[cellI];
}
However, the values I’m getting don’t match my reference solution—they are twice as large as the force predicted in the reference solution. Am I missing something here? Could there be an issue with how I’m calculating or interpreting the applied force?