|
[Sponsors] |
December 2, 2017, 05:12 |
scalarTransportFoam not conservative ?
|
#1 |
New Member
Nicolas Reiminger
Join Date: Dec 2017
Posts: 3
Rep Power: 9 |
Hi everyone,
I'm working for my PhD on a PIMPLE based solver to modelisea concentration dispersion in the air. I've merged pimpleFoam and scalarTransportFoam on OpenFOAM 4.1 to have the transport caculation at every time steps. In fact I modified a little the transport equation to include the turbulent diffusion, my transport equation is : (fvm::ddt(s) + fvm::div(phi, s) - fvm::laplacian(turbulence->nut()/Sct+Ds, s) including the nut/Sct term correspondid to the turbulent diffusion. At the end of a converged simulation I saved 10 time step (900s, 901s, 902s...) in order to verify if the mass conservation is ok. I wanted to check that on Paraview so I integrated my scalar s over the full volume of the intermal mesh for every time step in order to have the "stock" in the model. I also calculated the mass at the inlets and outlet : first i calculated s*U*dt with U normal to the surfaces and then I integrated that over the surfaces to have the mass. I also made that for the diffusion therm with (Ds+nut/Sct)*grad(S).n. When I saw my results I have for the mass at the inlet : 2700 and for the outlet 3000. My stock is around 680 000. I have a difference of -300 between inlet and outlet but my stock vary only by 20 between time steps. So the mass conservation is not verified ! In fact (Finlet - Foutlet).dt=stock(dt) is not verified and I have no source or sink terms. For my simulation I modelised an tunnel-like model : inlet on one side, outlet in face, wall for the soil and batiments and symmetry all around (roof, dans right and left sides). I also have an inlet at the soil which is a road for my polluant injection. My BC are pretty standard, juste the outlet BC is a little not standard : freeStream condition. Dear all, what have I done wrong ? I'm pretty sure that the transport equation is conservative, so my calculs are wrong ? Please accept my thanks for your time. Have a nice weekend. |
|
December 3, 2017, 01:41 |
|
#2 |
Senior Member
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15 |
I recommend to establish the model in a way that *you* ensure the mass conservation. In reaction simulation, there is usually a reacting surface, where your model your mass transfer. At another point you have some inflow of mass, and this is usually at a point far away from your reaction plane. Make the amount of masses equal by your b.c.
__________________
Uwe Pilz -- Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950) |
|
December 5, 2017, 02:58 |
|
#3 |
New Member
Nicolas Reiminger
Join Date: Dec 2017
Posts: 3
Rep Power: 9 |
Hi,
I've found my problem. In fact I used Paraview to calculate the mass at inlet, outlet and inside the domain. But I think Paraview give not the real values at surfaces and it must interpolate theses values to the center cells. I asked openfoam to calculate inflow, outflow and internal mass every time step by adding functions in the controlDict. Then, when I compare the results, I have less than 0.01% error relatively to the inlet mass. Hope my explanation will help some other people. |
|
December 6, 2017, 03:22 |
|
#4 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
to give the correct answer. ParaView will interpolate the cellCenter to the points which will result in errors if one does not take that into account. In general, people just apply some filters without thinking. To get the correct results you always have to use the cell data field. Thats based on the fact that FOAM calculates everything on the cell centers which are the true values in ParaView too. However, this is well known and should be described in a few threads here Well done. You figured it out yourself. By the way I moved you thread because it is not related to validation and verification (please read the sticked threads)
__________________
Keep foaming, Tobias Holzmann |
|
December 6, 2017, 03:32 |
|
#5 |
New Member
Nicolas Reiminger
Join Date: Dec 2017
Posts: 3
Rep Power: 9 |
Hi Tobi,
Thank you for your explanation. It's true that I've same results for internal mass on Paraview with cell data. However, for surfaces I can only choose point data which seems logical because surfaces are 2d. Is there a possibility to have real values at surfaces with Paraview ? |
|
December 6, 2017, 03:48 |
|
#6 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
yes. You select the patch (or activate it - how you do it is up to you; e.g. extractBlock or just activate the patch of interested in the mesh regions box only). Then you have the face center values and the point / interpolated ones. However, I suggest you to use FOAM based functions.
__________________
Keep foaming, Tobias Holzmann |
|
Tags |
not conservative, scalartransportfoam, transport |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Radiation in semi-transparent media with surface-to-surface model? | mpeppels | CFX | 11 | August 22, 2019 08:30 |
My radial inflow turbine | Abo Anas | CFX | 27 | May 11, 2018 02:44 |
conservative or non conservative, Is there a big difference? | sharonyue | OpenFOAM Running, Solving & CFD | 1 | April 10, 2015 05:19 |
Replace periodic by inlet-outlet pair | lego | CFX | 3 | November 5, 2002 21:09 |