|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Zeng
Join Date: Jul 2017
Location: London, UK
Posts: 16
Rep Power: 10 ![]() |
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
(
fvc::div(phiHbyA)
- fvm::laplacian(rhorAUf, p)
+ fvc::div(mySource*rAU)
==
fvOptions(psi, p, rho.name())
);
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. Last edited by Soll; January 7, 2020 at 19:39. Reason: typo |
|
|
|
|
|
|
|
|
#2 |
|
New Member
Zeng
Join Date: Jul 2017
Location: London, UK
Posts: 16
Rep Power: 10 ![]() |
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) |
|
|
|
|
|
![]() |
| Tags |
| openfaom-7, programing, rhosimplefoam, source terms |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using PengRobinsonGas EoS with sprayFoam | Jabo | OpenFOAM Running, Solving & CFD | 36 | July 16, 2024 04:52 |
| what is swap4foam ?? | AB08 | OpenFOAM | 28 | February 2, 2016 02:22 |
| [Other] How to use finite area method in official OpenFOAM 2.2.0? | Detian Liu | OpenFOAM Meshing & Mesh Conversion | 4 | November 3, 2015 04:04 |
| Problem compiling a custom Lagrangian library | brbbhatti | OpenFOAM Programming & Development | 2 | July 7, 2014 12:32 |
| implement a source term!! | stage81 | FLUENT | 4 | October 7, 2010 08:50 |