Implement source term in rhoSimpleFoam
Greetings!
Recently I'm working on adding source term to rhoSimpleFoam. I read through the source code and did some test, but still I have some problems unsolved. Please if someone could help: 1. Is it correct to add source term, i.e., mySource (volVectorField, constant but updated at every iteration) to the three locations? a. In UEqn.H: Code:
solve(UEqn == -fvc::grad(p)+mySource); Code:
fvScalarMatrix pEqn Code:
U = HbyA - rAU*fvc::grad(p) + mySource; HTML Code:
https://www.cfd-online.com/Forums/openfoam/65293-add-source-term-simplefoam.html 2. Why in pEqn.H phiHbyA is interpolated like this Code:
surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(rho)*fvc::flux(HbyA)); Code:
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA)); 3. Why rho*HbyA is interpolated to the cell surface in the first place? may be it is more of a algorithm question but I just cant figure it out. |
I think I know the answer to question 3 if I'm correct
post here if anyone is interested: for any volVectorField V Code:
fvc::div(fvc::flux(V)) equals to fvc::div(V) |
All times are GMT -4. The time now is 15:56. |