CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   coupled source term in 3 transport equations (http://www.cfd-online.com/Forums/openfoam-solving/85465-coupled-source-term-3-transport-equations.html)

 mhassani February 26, 2011 05:14

coupled source term in 3 transport equations

Dear Foamers
I want to revise icoFoam to include three transport equations solving for C1, C2, and C3. the problem is that they are coupled in their source term. I have included "CEqn.H" in my transportFoam (revised icoFoam).
I have a constant depending on C3 (third species concentration) which is used in C1, and C2. There are also source term in C2, and C3 equations depending on C1. I faced some questions regarding this:

1st question: Is it correct to use "fvm:Sp(kpa,C1)" in transport equation of C2? or I can simply use "...+ kpa*C1" so it is accounted explicitly? (in the equations kpa and landJ are constants which are calculated and given in transportProperties, respectively)

2nd question: shall I have a loop to converge (solving equations sequentially)? If I do, I have to calculate the difference between each iteration results. Shall I declare a new variable to save each iteration results so I can have comparison in each iteration.

3rd Question:Is it correct to declare and initialize some constants (e.g. omega, kpa in the code below) in the "CEqn.H"? they are to be calculated after C3 equation is solved.

//CEqn.H
double kpa; // constant calculated after C3 is calculated
double omega; //constant calculated after C3 is calculated
double C3Crit=2; //a constant
solve(
fvm::ddt(C3)
+fvm::div(phi,C3)
-fvm::laplacian(Dm3,C3)
-fvm::Sp(landJ,C1)
);
omega= C3/C3Crit;
if(omega >=1)
kpa=omega;
else
kpa=0;

solve
(
fvm::ddt(C1)
+fvm::div(phi,C1)
-fvm::laplacian(Dm1,C1)
+fvm::SuSp(kpa,C1)
);
//.................
solve
(
fvm::ddt(C2)
+fvm::div(phi,C2)
-fvm::laplacian(Dm2,C2)
+fvm:Sp(kpa,C1)
)
//...........
I would appreciate your help. thanks in forward.
Best regards

 All times are GMT -4. The time now is 08:29.