CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [Other] Multi species mass transport library [update] (https://www.cfd-online.com/Forums/openfoam-community-contributions/103227-multi-species-mass-transport-library-update.html)

wyldckat June 21, 2015 17:43

Quote:

Originally Posted by Alish1984 (Post 551349)
Dear Bruno and Athanassios
Do you have any comment about my post regarding source terms in energy equation?
Regards, Ali

Quick answer: Sorry, but I'm not familiar enough with this code and its contents are beyond my level of expertise.

khalifa August 26, 2015 10:47

Hello People,

I am trying to compile the diffusivityModels library(code version of 2.1.x ) and I am getting this error

In file included from diffusivityModel/diffusivityModel.C:27:0:
diffusivityModel/diffusivityModel.H:40:25: fatal error: porousZones.H: No such file or directory
compilation terminated.
make: *** [Make/linuxGccDPOpt/diffusivityModel.o] Error 1


from where shall I bring this file porousZones.H ?

Thanks
Ali

khalifa August 26, 2015 14:46

Quote:

Originally Posted by Athanassios (Post 532351)
Hello guys,

I found out that for some reason entries in the files thermo.compressibleGas that you can find in both of our testcases for the original and modified MultispeciesMassTransportLibrary got messed up. Please check that files in my previous uploaded file (last post) or just download the corrected testcases for 2.1.x and 2.3.x (attached).

Thanks!

Thank you for your efforts. for version 2.3.x, I successfully compiled the libraries, however, when compiling the solver modifiedreactingFoam , this error shows up :

fatal error: multiSpeciesTransportModel.H: No such file or directory

any suggestions ?

thank you
Ali

khalifa September 10, 2015 19:27

1 Attachment(s)
Dear Foamers, Thank you so much for your contributions in producing these libraries and developing them to be working with openFoam 2.3.1.

I am trying now to add dynamicMeshing feature to the solver , to combine between multispecies transport and dynamic meshing in one solver.

I have a version of reactingFoam with dynamic meshing edits and it works, and I tried to copy the the codes I found related to dynamic meshing to the modifiedReactingFoam solver and compiled successfully, yet no dynamic mesh is created even though the iteration goes on without errors and the criteria for dynamic meshing was achieved!

I am attaching the solver which have the dynamic meshing working , and I wish if someone can help to combine it with the modifiedReactingFoam !

regards

khalifa October 13, 2015 12:37

Quote:

Originally Posted by Alish1984 (Post 551402)
Dear Athanassios

I've seen another strange formulation in both 1.7.x and 2.3.x versions. Maybe I'm wrong and I would be very happy if you correct me.

In version 2.3 in multiSpeciesTransportModel.C in updateMolarFractions() function.

To update molar fractions you've used the below formulation:

xCells[cellI] = yCells[cellI] * psiCells[cellI] * TCells[cellI]
* R / W(i);
(I)

In my opinion it has a problem. since
psi=1/(Ri*T) Ri is gas constant for specie i
Ri=Ru/Wi Ru is universal gas const.
and Wi is molecular weight of specie i
here in your formulation R is universal gas const. namely Ru.
So in your formulation we have:
xi=yi*1/(Ri*T)*T*Ru/Wi=yi*Ru/(Ri*Wi)=yi*Wi/Wi=yi !!! here xi and yi refer to molar and mass fraction of specie i in a cell

It seems to me that this is a bug the eq. (I) should be:

xCells[cellI] = yCells[cellI] * Wmix / W(i); with Wmix is mixture molecular weight
we can use
1/Wmix[cellI]=sum(yi/Wi)

Is this really a bug or I've made a mistake?
Regards,
Ali

Dear Ali ,

any news regarding this or the energy equation ?

I have tested the solver for 2.3.1 and I would say there is clearly a problem related with the energy equation.

did you conclude to any fixes or so ?

Thanks

wayne14 February 19, 2016 03:19

Anyone know if this multi species transport library has any update? Or anyone has done some work based on it?

Thanks,
Yan

freuenwwt May 15, 2016 14:48

I think the molar fraction update is no problem.

psi = rho/P; not "psi=1/(Ri*T) Ri " is gas constant for specie i

based on the code of psiThermo.C

93 Foam::tmp<Foam::volScalarField> Foam::psiThermo::rho() const
94 {
95 return p_*psi_;
96 }

The energy equation has some problem because of Enthalpy Diffusion. We need to include the Enthalpy Diffusion term in the equation. If we change all the species Cp are the same. The temperature solution would be OK.

The energy equation should be:

fvScalarMatrix EEqn
(
fvm::ddt(rho, e) + fvm::div(phi, e)
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ fvc::div(fvc::absolute(phi/fvc::interpolate(rho), U), p, ”div(phiv,p)”)
- fvm::laplacian(turbulence->alphaEff(), e) +sum[fvm::laplacian(hj*Di,m, Yi)]
==
fvOptions(rho, e)
);

hj is the specific heat of ith species. I don't how to implement the term into the energy equation: sum[fvm::laplacian(hj*Di,m, Yi)]

If someone know how to do it please let us know.

Wang Wei June 21, 2016 06:05

diffusion flux calculation
 
Hi, I have a question about mass diffusion flux per specie Ji.

I found the code in multiSpeciesTransportModel.C
Code:

Foam::surfaceScalarField Foam::multiSpeciesTransportModel::j
(
    const Foam::label i
)
{
    return n(i) -
        fvc::interpolate(thermo_.composition().Y(i)) * turbulence_.phi();
}

and Fick.C
Code:

ni = yEqn().flux();
If I use this line to calculate the mass diffusion flux per specie
Code:

J[i]=fvc::interpolate(-rho*Dim[i])*(fvc::interpolate(fvc::grad(Yi)) & mesh.Sf());
are this two methods equivalent?

Wang Wei June 21, 2016 07:10

Quote:

Originally Posted by freuenwwt (Post 600149)
I think the molar fraction update is no problem.

psi = rho/P; not "psi=1/(Ri*T) Ri " is gas constant for specie i

based on the code of psiThermo.C

93 Foam::tmp<Foam::volScalarField> Foam::psiThermo::rho() const
94 {
95 return p_*psi_;
96 }

The energy equation has some problem because of Enthalpy Diffusion. We need to include the Enthalpy Diffusion term in the equation. If we change all the species Cp are the same. The temperature solution would be OK.

The energy equation should be:

fvScalarMatrix EEqn
(
fvm::ddt(rho, e) + fvm::div(phi, e)
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ fvc::div(fvc::absolute(phi/fvc::interpolate(rho), U), p, ”div(phiv,p)”)
- fvm::laplacian(turbulence->alphaEff(), e) +sum[fvm::laplacian(hj*Di,m, Yi)]
==
fvOptions(rho, e)
);

hj is the specific heat of ith species. I don't how to implement the term into the energy equation: sum[fvm::laplacian(hj*Di,m, Yi)]

If someone know how to do it please let us know.

Hi, Alan! you can use a loop like this
Code:

forAll(Y,i)
{
EEqn+=fvm::laplacian(hj*Dim,Y[i]);
}

By the way, how do you get the hj?

Wang Wei June 21, 2016 07:16

Quote:

Originally Posted by wayne14 (Post 585959)
Anyone know if this multi species transport library has any update? Or anyone has done some work based on it?

Thanks,
Yan

Hi, Wang Yan, I am using version3.0 openfoam, and I am working on modifing the existing reactingFoam with adding mass diffusion model. It is hard for me to update the library.

freuenwwt June 21, 2016 11:42

Hi Wang Wei,

For Hj calcualtion, you can use the function in basicSpecieMixture.H:
scalar Hs
(
const label speciei,
const scalar p,
const scalar T
) const = 0;

Wang Wei June 21, 2016 12:36

Alan, thank you for your reply. I am working on hydrogen /air combustion simulation inside a tube. Since I use version3.0 openfoam, I can't use the library post here. So I added some codes into reactingFoam solver referring to Champan-Enskog model and Fick's model. But temperature is always out of range during calculation. Which mass transport model do you use and do you have similar problem?

demsomme August 30, 2016 18:59

Quote:

Originally Posted by Wang Wei (Post 605947)
Alan, thank you for your reply. I am working on hydrogen /air combustion simulation inside a tube. Since I use version3.0 openfoam, I can't use the library post here. So I added some codes into reactingFoam solver referring to Champan-Enskog model and Fick's model. But temperature is always out of range during calculation. Which mass transport model do you use and do you have similar problem?

Hi Wang Wei (and any others still working on diffusion modelling),

I'm working on a very similar application looking at high temperature reforming and combustion. I am working to implement a Fickian model and a Stefan-Maxwell diffusion model that can be used with reactingFoam and/or reactingParcelFoam. I'm using Novaresio et al.'s library, with the updates from this forum, as a starting point.

I am also encountering temperature issues. I find that even if remove the MSTM source terms from the heat equation that I still get extremely high temperature fluctuations even in an 'isothermal' simulation. I'm working on creating a simple "Stefan Tube" test case and associated boundary conditions to give an easy, analytically tractable, case for debugging and validation.

Feel free to private message me if you would like to collaborate on this, or I will post my progress here if I start to figure out the issues.

Thanks,
- Dave

sahmed October 3, 2016 14:10

Quote:

Originally Posted by Athanassios (Post 532038)
Hi peeps,

as promissed, with this post, I'm uploading the modified MultispeciesMassTransport library now for OpenFOAM 2.3.x, ready to use (file attached). A smoothly running testcase has been included. The same testcase for 2.1.x has also been included for comparisons.

Hi Athanassois
First of all, thanks for your work and contributing the community. I am trying to use reactingFoam to simulate one of my combustion models using OF 2.3.1. I think the test case that you provided with the multidimensional mass transport library should work excellent for my case.
Since I am a new one in this business (but learning quickly ;) ) I need your help here. I downloaded the zip that you provided. Could you tell me how can I install that new modifiedReactingFoam version with the multi library in my existing OF.
The question might be silly, but please explain me in brief the procedures.
Thanks a lot in advance.

sahmed October 4, 2016 11:23

Any update
 
Quote:

Originally Posted by freuenwwt (Post 600149)
The energy equation has some problem because of Enthalpy Diffusion. We need to include the Enthalpy Diffusion term in the equation. If we change all the species Cp are the same. The temperature solution would be OK.

The energy equation should be:

fvScalarMatrix EEqn
(
fvm::ddt(rho, e) + fvm::div(phi, e)
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ fvc::div(fvc::absolute(phi/fvc::interpolate(rho), U), p, ”div(phiv,p)”)
- fvm::laplacian(turbulence->alphaEff(), e) +sum[fvm::laplacian(hj*Di,m, Yi)]
==
fvOptions(rho, e)
);

hj is the specific heat of ith species. I don't how to implement the term into the energy equation: sum[fvm::laplacian(hj*Di,m, Yi)]

If someone know how to do it please let us know.

Hi Alan
Could you (or anyone) solve the energy equation problem in the library for OF version 2.3.x? Could you please share that if you are done. It would be very much helpful for the community.

sahmed October 5, 2016 01:47

Help needed to install the multicomponent library
 
Quote:

Originally Posted by khalifa (Post 561216)
Thank you for your efforts. for version 2.3.x, I successfully compiled the libraries

Hi Ali
I tried to link the multispeciesTransport library for OF 2.3.1 and ran the ./install in that zip file. Everything looks fine but I guess my library is not linked to the solver. I checked that by removing the transportProperties file from the constant folder and still the simulation runs. I also added the libs (libdiffusivityModels.so libmultispeciesTransportModels.so) in the system/controlDict.
I am really confused where I messed up.
Could you PLEASE help me solving it.

Thanks in advance

yangdali09 October 13, 2016 23:46

Dear Valerio,
I canot open the pdf file after downloaded , could you send me a copy please, many thanks!
my email is 18628197569@163.com

sahmed December 5, 2016 13:05

Help requested
 
Quote:

Originally Posted by demsomme (Post 616021)
Hi Wang Wei (and any others still working on diffusion modelling),

I'm working on a very similar application looking at high temperature reforming and combustion. I am working to implement a Fickian model and a Stefan-Maxwell diffusion model that can be used with reactingFoam and/or reactingParcelFoam. I'm using Novaresio et al.'s library, with the updates from this forum, as a starting point.

I am also encountering temperature issues. I find that even if remove the MSTM source terms from the heat equation that I still get extremely high temperature fluctuations even in an 'isothermal' simulation. I'm working on creating a simple "Stefan Tube" test case and associated boundary conditions to give an easy, analytically tractable, case for debugging and validation.

Feel free to private message me if you would like to collaborate on this, or I will post my progress here if I start to figure out the issues.

Thanks,
- Dave

Hi Dave
I was wondering if you are still in touch of the multicomponent transport. I am trying to implement not a multicomponent, but a simpler 'mixture averaged' type of transport formulation. If you could successfully implement the MULT library in your work, I expect your kind help to give me some idea. I know there are some inherent flaws in the library.
Please let me know. Thanks

~Sheikh Ahmed

flyingmercury March 25, 2017 13:04

high-temperature-problem
 
Hi Dave,

Have you addressed this ''incorrectly high temperature" issue? I have also found this problem is not caused by the energy equation. If you already fixed this bug, please post here.

Regards,
Xin


Quote:

Originally Posted by demsomme (Post 616021)
Hi Wang Wei (and any others still working on diffusion modelling),

I'm working on a very similar application looking at high temperature reforming and combustion. I am working to implement a Fickian model and a Stefan-Maxwell diffusion model that can be used with reactingFoam and/or reactingParcelFoam. I'm using Novaresio et al.'s library, with the updates from this forum, as a starting point.

I am also encountering temperature issues. I find that even if remove the MSTM source terms from the heat equation that I still get extremely high temperature fluctuations even in an 'isothermal' simulation. I'm working on creating a simple "Stefan Tube" test case and associated boundary conditions to give an easy, analytically tractable, case for debugging and validation.

Feel free to private message me if you would like to collaborate on this, or I will post my progress here if I start to figure out the issues.

Thanks,
- Dave


reza_65 December 20, 2017 16:53

high-temperature-problem
 
Quote:

Originally Posted by flyingmercury (Post 642251)
Hi Dave,

Have you addressed this ''incorrectly high temperature" issue? I have also found this problem is not caused by the energy equation. If you already fixed this bug, please post here.

Regards,
Xin


I tried this solver, and as the other fellows mentioned, it shows extremely high temperature which is completely wrong and even it goes out of janaf! I tried another transport models, but still there is this problem. Even with different reaction mechanism still there is high temp problem.
So, I think the problem is coming from coupling energy equation with Yequation.


All times are GMT -4. The time now is 03:56.