passive scalar increases
3 Attachment(s)
I have written a passive scalar equation that should be used in a compressible solver like rhoCentralFoam but in each test case i use that the passive scalar (gas) itself and also its residuals increases during the run.
i thought its because of included rho but don't know how to remove rho from the equation because at least phi includes rho in it and the code doesn't accept dividing by rho. how to overcome the situation of issue? 
2 Attachment(s)
Quote:
Hi, as we wrote the last weeks via PM I 'll share everything now with the other peoples. I am not sure if its working with the "rhoCentralFoam" couse in the describtion there is a line that this solver works with central schemes. So I am not sure if that is working with my suggestions. Here are the steps building a new solver with a conserved scalar: Create a new solver (example is a compressible sovler)  1. go into your $FOAM_RUN dictionary 2. go one folder back (cd ..) 3. create a folder Code:
mkdir p applications/solvers/compressible 5. copy existing solver to that one Code:
cp r $FOAM_SOLVERS/compressible/rhoSimpleFoam scalarRhoSimpleFoam Rename and rebuild the new solver  1. wclean 2. rename the rhoSimpleFoam.C into scalarRhoSimpleFoam.C 3. change the file Make/files Code:
scalarRhoSimpleFoam.C 5. wclean Add new conserved scalar  1. create a new file (e.g. scalarEqn.H; here its ZEqn.H) 2. insert the following lines: Code:
// Solving equation of conserved scalar (Z) Code:
volScalarField Z Code:
// Pressurevelocity SIMPLE corrector 6. finished Congratulations   a friend used my solver for prediction of a mixture of methan  air  gives very good results, only weakness is the constant density. For that I build a new one with two different densitys (not tested). In the attachment are pictures of my test case (laminar + turbulent). The conserved scalar is between 0 and 1. Hope that helps. 
Hi Tobias
could you please have a look into rhoCentralFoamModified I have put in the above post? Code:
tmp<fvScalarMatrix> gasEqn Code:
fvm::Sp(fvc::div(phi), gas) Code:
#include "gasEqn.H" thanks. 
Hi,
the term for stabilisation dont have to be removed. In OF2.2.x you can activate that term in the fvSchemes file :) Code:
bounded In my opinion the problem depends on the centralFoam. I have no idea how that algo is working. So you should change to the rhoSimpleFoam. 
1 Attachment(s)
my case is treansient so rhoSimpleFoam may not be appropriate for my case.
I also have used rhoPimpleFoam with the same problem(not be scalar between 0 and 1) that term is necessarily have to be there? could you have a look into rhoPimpleFoamModified? 
3 Attachment(s)
Hi,
okay for a transient solver you have to use the following conserved equation: Code:
// Solving equation of variance of mixture fraction Seems that everything is working fine. Hope it helps :) Have fun Tobi 
thanks.I'm testing it now.but residuals of scalar still are higher than other equations. isn't it wrong?
and should I also add "bounded" in fvSchemes for all terms in 2.2.0 like Code:
ddt(rho, h) bounded Euler; 
Hi,
with that code above you do not have to use bounded schemes. If you do so, you ll do it twice! Thats wrong. The scalar must be between 01 or the value you use in the 0/Scalar file 
Thank you dear Tobias.Its exactly between 0 and 1 now.:D
I didn't grasp what did that openfoam.org page say. it says in line 8 that: Code:
For transient solutions, it is usually better to implement only the fvm::div(phi, h) term Code:
Compressible solvers for transient problems generally use the PIMPLE algorithm, which supports partial convergence of intermediate iterations. The solution may benefit from the use of the bounded form of convection but, in such cases, the corresponding bounded time derivative must also be included like the example: Code:
ddtSchemes what means at all! thank you for a bit clarification.:confused: 
2 Attachment(s)
and also I forgot to ask about its residual.only want to know does it has a specific reason or its ordinary and hasn't anything wrong.
the residuals of passive scalar are of order of .001 while others are lower,does it have any specific reason? 
since the problem is resolved now,I put this answer by dear Tobias in private(by his permission:D),here so that someone needs now or in future knows more about what I asked:
Quote:

Hi,
for clearness  please note that I meant the following: if you are using the bounded time derivation you are not allowed to set the d efault value to "bounded" couse the implemented scalar has this line explicit in the code. For that you have to use default as standard and modify the other values: Code:
Code:
fvScalarMatrix ZEqn :) 
thank you for summary.
and what I haven't understood yet is that when we have to use a bounded term in both steasy and unsteady,compressible and incompressible cases? some more clarification is good. 
2 Attachment(s)
Hi again before close the issue dossier!
when I used linear scheme for probably more accuracy it didn't get a good result(not good appearance and also higher than 1) Code:
div(phi,gas) Gauss linear; the question is:why its so?!;) 
Quote:
That depend on the schemes. On my Homepage you can find a summary about that Topic (unfortunatelly only in german). But the grapics show everything I think. http://www.holzmanncfd.de/index.php...rischeschemen 

thanks Tobias
related to vanLeer nothing has said but it has nice results,then what do you suggest for better accurate and physical results for passive scalar transport? 
Quote:
For the scalar I prefer Code:

thanks.
vanLeer isn't a second order scheme? what do 1 0 1 refer to respectively in the scheme? 
vanLeer is a second order scheme.
To prevent unphysical results (the only scheme which is not producing unphysical results is gauss upwind 1st order) you can use limited schemes and schemes that are bouding the values: Code:
Code:
limitedLimitedLinear 1 0 1  the second one is the lower bouding value  the third one is the upper bouding value As you set your scalar between 013.54 you should write: Code:
limitedLimitedLinear 1 0 13.54 
All times are GMT 4. The time now is 23:58. 