what suggestion about distinguishing two parts of the same kind of fluid
Hi all
I wondering is there a way to track two parts of flow without need to use two phase solvers or combustion solvers or particle solvers. its simply " I have a inflow patch and need a lot to know if the inflowing fluid has reached to outflow patch or not. something like a color! maybe alpha in multi phase solvers(but not that approach preferably by compressible solvers like rhoPimpleFoam) to give more information if is important to answer the case is a rectangular tube with one inflow and one outflow patch) can it be done simply? I don't know what search for if there is this subject somewhere in internet.I can't obtain anything.  to dear Bruno : if this question is sufficiently high rated then give me a rep power( I know it as reply power ;)):D 
Hi Ehsan,
It took me a while to find this thread: http://www.cfdonline.com/Forums/ope...ggasgas.html I vaguely knew/remembered what I was looking for... ended up finding it with the following string in Google: Code:
site:cfdonline.com openfoam track fluid The following thread I found by searching by "age of air openfoam", because I remember reading about it as well: http://www.cfdonline.com/Forums/ope...nageair.html Best regards, Bruno 
as Bruno suggested, adding the scalar transport in the solver and initializing the solution with a certain value of the scalar at the inlet should definitely do what you are looking for.
I would reccomand using the setFields tool to put the scalar where you want it at time 0. 
(excuse me for repeating from another thread hoping get help more quickly)
Its the first time I modify a solver to solve for a new equation. then could you please guide me through. I've added this in createFields: Code:
volScalarField age in the folder of solver I have to add this: Code:
//  Scalar Transport and what should be assign for DT?also change nut to mut(since my case is compressible,unsteady) correct? (does it work if I switch to a turbulent case too?) thanks. 
1 Attachment(s)
hello again
I run the case but gas(scalar transport value) is not between 0 and 1 as the snapshot. how to resolve? thanks. my gasEquation.H is: Code:
//  Scalar Transport 
scalar variable that i named it "gas" varies since minus values till about 400 and beyond that.while i have set boundary conditions 0 and 1 in inlets.
Why no guidance is there? 
Ehsan,
Without an example case and instructions to reproduce what you are getting, all I can say is this  Study the scalarTransportFoam tutorial: http://openfoamwiki.net/index.php/ScalarTransportFoam Best regards, Bruno 
hi.this is the equation I put there.the case is like shock tube.
Code:
tmp<fvScalarMatrix> gasEqn thanks. 
Seriously? :confused:
I guess I should have been clearer :rolleyes:: I need a complete example case where I simply need to compile the solver or utility, including a preprepared example case. Then I just have to figure out what could be wrong. 
:D I had tried to send the modified solver but it exceeds from 97.7KB limit.
could you please give me your email to send it? 
Quote:
This way the final tarball/zip will be reduced to 3060 kB, since it will only contain the source code files. 
2 Attachment(s)
ok .these are new solver and the sample case.
thank you for helping. 
Hi Ehsan,
I had a quick look on your case (without running it, as I do not have groovyBC), and is it correct that you are trying to fill a box? As I see it, you only have one open boundary and you are imposing a velocity, which is in the same direction for all boundary faces on this boundary? Kind regards, Niels 
Hi dear Niels
where were you?! are you fine? yes.its a simple backward step as you has seen.my real case is unsteady and I wanted to test a situation when the inlet width is constant. early times were important to me to see why velocity values are high in the corner of backward step and also to examine the groovyBC boundary conditions correctness. could you please have a look into it if I send you a like case without groovyBC to see why velocities should be so high in the corner? thanks.;) 
1 Attachment(s)
Its a totalPressure,totalTemperature case(the same case without groovyBC) if you could look into it.
a shock originates and moves to right when it reaches to right wall it reflects back and therefore no problem occurs if we continue running in time. and another thing I remembered to say. does anyone know an experimental or DNS run for a backward step(sharp corner) case with subsonic inlet gas(compressible)? thanks. 
Quote:
If it were me, I would do the following steps:

whats your opinion about deleting convection or diffusion terms?or emit rho from gas equation?

I have changed the formula to be calculated incompressible.
Code:
tmp<fvScalarMatrix> gasEqn Code:
lfiniteVolume lfluidThermophysicalModels lspecie lrhoCentralFoam lcompressibleTurbulenceModel lcompressibleRASModels lcompressibleLESModels lmeshTools lOpenFOAM ldl lm o /home/ehsan/OpenFOAM/root2.2.0/platforms/linux64GccDPOpt/bin/rhoCentralFoamModified 
transport scalar is not between 0 and 1 that expected.
2 Attachment(s)
Hi all
I wondering is there a way to track two parts of flow without need to use two phase solvers or combustion solvers or particle solvers. its simply " I have a inflow patch and need a lot to know if the inflowing fluid has reached to outflow patch or not. something like a color! maybe alpha in multi phase solvers(but not that approach preferably by compressible solvers like rhoPimpleFoam) to give more information if is important to answer the case is a rectangular tube with one inflow and one outflow patch) I tried this code but scalar(I named it gas) isn't between 0 and 1 while internalField of gas is 0 in initial time and inlet boundary condition is fixedValue1. the case is unsteady and compressible as its clear Code:
tmp<fvScalarMatrix> gasEqn ( fvm::ddt(rho,gas) + fvm::div(phi, gas) fvm::Sp(fvc::div(phi), gas)  fvm::laplacian(turbulence>muEff(), gas) ); gasEqn().relax(); 
Hi Ehsan,
From what I saw yesterday, the "rho" field seemed to travel too fast. It's possibly due to a shock wave travelling faster than the fluid. Therefore, simply dividing "phi" by "rho" could possibly be catastrophic... This is why I suggested starting from an incompressible solver and then evolving gradually towards a compressible solver, always taking into account an analytical solution, in order to validate the decisions made in the implementation of said passive scalar. As for "div" complaining about "phi/rho": I don't know if OpenFOAM allows certain calculations to be done directly inside the "div" operator. And the error you got seems to be related to the result of "phi/rho" not being a standard field. Best regards, Bruno 
All times are GMT 4. The time now is 13:16. 