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)

idjibb May 5, 2013 00:05

Never mind, I got it done otherwise.
thanks anyways

jiatangwang January 23, 2014 05:24

met some blooks when compile the SOFC solver
 
Hi ,


I tried to compile the the SOFC packages you released on the above website, but i met some blocks. The details are as follows,

I have installed OpenFOAM 2.2.1 on my ubuntu 12.04 version, and can work smoothly. So I started from downloaded the package called aekb_v1_0.tar.gz, extracted it, then I coped the files in the corresponding position you listed in the paper named "An Open-Source Library for the Numerical Modeling of Mass-Transfer in Solid-Oxide Fuel Cells".

>> cp -r ~/temp-install/mstm/lib/*
>> ~/OpenFOAM/$USER-2.2.1/lib
>> cp -r ~/temp-install/mstm/applications/*
>> ~/OpenFOAM/$USER-2.2.1/applications
>> cp -r ~/temp-install/mstm/run/*
>> ~/OpenFOAM/$USER-2.2.1/run

I tried to compile the solver,

>> ~/OpenFOAM/$USER-2.2.1/application/Allwmake-mstm

But I met some errors like this,

sofcFoam.C:36:34: fatal error: regionPropertiesSOFC.H: No such file or directory
compilation terminated.
make: *** [Make/linux64GccDPOpt/sofcFoam.o] Error 1


Then I tried to compile it in the application,


>> ~/OpenFOAM/$USER-1.6-ext/libs/Allwmake-mstm

But also resulted some errors like this,

In file included from components/solidComponent/solidComponent.H:40:0,
from components/solidComponent/solidComponent.C:27:
lnInclude/component.H:44:35: fatal error: fixedFluxFvPatchField.H: No such file or directory
compilation terminated.
In file included from lnInclude/fluidComponent.H:39:0,
from components/channel/channel.H:39,
from components/channel/channel.C:27:
lnInclude/component.H:44:35: fatal error: fixedFluxFvPatchField.H: No such file or directory
compilation terminated.
In file included from components/fluidComponent/fluidComponent.H:39:0,
from components/fluidComponent/fluidComponent.C:27:
lnInclude/component.H:44:35: fatal error: fixedFluxFvPatchField.H: No such file or directory
compilation terminated.
In file included from components/component/component.C:27:0:
components/component/component.H:44:35: fatal error: fixedFluxFvPatchField.H: No such file or directory
compilation terminated.
make: *** [Make/linux64GccDPOpt/solidComponent.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Make/linux64GccDPOpt/fluidComponent.o] Error 1
make: *** [Make/linux64GccDPOpt/channel.o] Error 1
make: *** [Make/linux64GccDPOpt/component.o] Error 1



Who can tell me what is the problem on my ubuntu ? The paper you said the OpenFOAM version is 1.6-ext, but mine is 2.2.1, so is this the reason I could not compile the solver on my ubuntu ? or i need to pre-install some packages on my computer ?

I am looking forward to your reply. Thank you.

Best wishes,

Jiatang Wang

wyldckat January 23, 2014 17:58

Greetings Jiatang Wang and welcome to the forum!

Quote:

Originally Posted by jiatangwang (Post 471371)
The paper you said the OpenFOAM version is 1.6-ext, but mine is 2.2.1, so is this the reason I could not compile the solver on my ubuntu ? or i need to pre-install some packages on my computer ?

1.6-ext is a variant of OpenFOAM and is mostly compatible with OpenFOAM 1.6.x and 1.7.x. Therefore, OpenFOAM 2.2.1 is far too different for that source code to work as intended.

You can find installation instructions for 1.6-ext for Ubuntu here: http://openfoamwiki.net/index.php/In...1.6-ext/Ubuntu

Best regards,
Bruno

jiatangwang January 26, 2014 18:33

Hi ,Thanks for your kind help, I should modify the 1.6-ext case code that can be used in OpenFOAM 2.2.1, right ?

elvis January 28, 2014 04:56

Hi,
it is far easier to install OpenFOAM-1.6-ext and
modify your ./bashrc
to switch between both installations (alias -command is the key here)
once you have successfully compiled with 1.6-ext
you might try to modify the code to compile on OF 2.2.1 but this does not always go straight!

jiatangwang January 28, 2014 09:53

Quote:

Originally Posted by elvis (Post 472103)
Hi,
it is far easier to install OpenFOAM-1.6-ext and
modify your ./bashrc
to switch between both installations (alias -command is the key here)
once you have successfully compiled with 1.6-ext
you might try to modify the code to compile on OF 2.2.1 but this does not always go straight!

OK. I see , I am a new learner on OpenFOAM. Sometimes I am feeling it is difficult to understand the different between the version of OpenFOAM 1.6-ext and OpenFOAM 2.2.1.Thanks for your tips.

carowjp October 27, 2014 20:18

Hello,

I have been working on a 2.3.x version of the multispecies mass transport library using the 2.1.x version as a starting point. Has anyone done this already?

I am looking to compare or, better yet, find someone who is willing to review what I have done and check it.

If it is correct I will share it with the community. If I am not mistaken this code for 2.3.x should also be backwards compatible to 2.2.1.

regards,

Jim

wenxu November 4, 2014 21:05

Quote:

Originally Posted by ldeng (Post 423764)
Hi everyone,

as a conclusion to my previous diffusion flux problem:

The diffusion flux at inlet is a common issue. To avoid that we have two options:

1. specify the total flux( diffusion + convection) equals to a fixed value. it is a kind of mixture boundary condition, but difficult(my opinion) to implement into OpenFOAM.

2. close the diffusion flux(set neumann bc to zeroGradient at inlet), this is not elegant but the easiest.

because i also simulated a 1-D burner stabilized flame in Cantera. In order to obtain a better results specially near the inlet, I specified a fixed value to all species as an initial condition based on the simulated results. After the combustion proceeded, i change the BC of intermediate species back to zero. Anyway, by such approach, i got a nearly perfect results (see attachment) compared to Cantera.

regards,

lei


Dear,LeiDeng,
IF coal and air as the inlet, then how to set the specie bc. ?
thank you !!!
regards,
wen

Athanassios November 29, 2014 07:51

Quote:

Originally Posted by carowjp (Post 516244)
Hello,

I have been working on a 2.3.x version of the multispecies mass transport library using the 2.1.x version as a starting point. Has anyone done this already?

I am looking to compare or, better yet, find someone who is willing to review what I have done and check it.

If it is correct I will share it with the community. If I am not mistaken this code for 2.3.x should also be backwards compatible to 2.2.1.

regards,

Jim


Hi,

I'm a complete beginner to OpenFOAM but I'm steeply increasing my knowledge since October... Soon, I should be able to transfer the Multispecies Library from 2.1.x to 2.3.x. Since you seem to be already working on this, I'd appreciate to get in touch with you. I might not be able to help you that much in the beginning, but probably a little bit later I will be able to contribute some part to this task.

I would like to give you my e-mail so that you can contact me. Is that ok for you?

Best regards

carowjp December 1, 2014 21:11

Multispecies Library from 2.1.x to 2.3.x.
 
Quote:

Originally Posted by Athanassios (Post 521653)
Hi,

I'm a complete beginner to OpenFOAM but I'm steeply increasing my knowledge since October... Soon, I should be able to transfer the Multispecies Library from 2.1.x to 2.3.x. Since you seem to be already working on this, I'd appreciate to get in touch with you. I might not be able to help you that much in the beginning, but probably a little bit later I will be able to contribute some part to this task.

I would like to give you my e-mail so that you can contact me. Is that ok for you?

Best regards

Athanassios,

Sure. Go ahead and send me a private message on this forum and provide your email address.

cheers,

Jim

JMDag2004 January 20, 2015 14:51

Question
 
I hope everyone is having a great day! Sorry to push an old thread. Currently I am using OF230 and I'm trying to simulate hydrogen/air detonation combustion within an ejector augmented PDR. Having some issues working with reactingFoam, cant seem to reproduce experimental data my university has accumulated with their test facility. Using NASA CEA, the peak temp of burnt gas should be north of 3800 and I can't seem to get the temp close to that. The simulation crashes due to the "dQ" term in the YEqn file. I feel like it may have something to do with the diffusion model. I'm not an advanced programmer, consequently I currently don't have the tools to really dig into source code to find the issue...although I am feverishly trying!

Questions:
1. Is this modifiedReactingFoam compatible with OF 230?
2. I noticed there weren't any options to include fvOptions. For example, I'm pathing in an energy source to initiate ignition using fvOptions. Do those options exist with the modified solver? This certainly could be an oversight on my part.

Athanassios January 29, 2015 07:25

It's done....
 
Hi

As far as I can say right now, I was able to modify the code of the MultispeciesTransform Lib and the ModifiedReactingFoam Solver so that it runs with OpenFOAM 2.3 now.

I already had one successful run with a random test-case, but I want to run another case for comparison with OpenFOAM 2.1 before I will make the complete modified code available to the community.

If there are any questions, you are welcome to answer to my post or contact me directly.

Best regards

JMDag2004 January 30, 2015 14:27

Hello Athanassios, I hope your day is going well! I would be very interested in how you made the adjustments. I am still learning, consequently I don't have the skills necessary to add the library to OF230. I could acquire OF21x and use the existing modifiedreactingFoam but I would like to take this learning opportunity to rebuild the solver in OF230.

JMDag2004 February 10, 2015 16:11

Kinetic energy question
 
Hello everyone, really sorry for posting to an old thread but I have a question about the formulation of the modifiedreactingFoam hsEqn. The mean kinetic energy seems to have been removed from the sensible enthalpy equation. I may have overlooked something no question. This term may have been implicitly absorbed by the sensible enthalpy term "hs". I tried tracking the term through the various function calls and I couldn't find anything that would tell me the kinetic energy is included. I don't have enough experience to know whether or not this has a significant impact on the solution. I also tried to reinstate the kinetic energy terms but the library wouldn't compile, this could be entirely due to my beginner programming skills. Would anyone be able to enlighten me on whether or not it is absorbed by another term or if it was intentionally removed the reasoning behind the omission? I would greatly appreciate it! :confused:

Athanassios February 16, 2015 10:08

MultispeciesMassTransportLibrary OF 2.3.x
 
1 Attachment(s)
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.

Sorry, that I was absent for a while, but since I had to move to a new apartment, I was quite busy the past days.

Please feel free to test the library yourself and let me know if you find bugs.

Thanks guys...

Athanassios February 18, 2015 11:34

2 Attachment(s)
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!

klingen April 20, 2015 04:36

Hi Athanassios,

thank you for porting the library to OF 2.3.*. I tried building it against OF 2.3.1 an noticed that there is still a relic from your local installation. The final line in

multiSpeciesMassTransportLibrary_2.3.x/modifiedReactingFoam/Make/options

is

-L/home/thanos/repos/of2-3/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64GccDPDebug/lib/dummy -lPstream \

This leads to linker errors on foreign machines. The quick and dirty solution for me was to remove the entire line. The solver builds fine then and the testcase runs and gives reasonable results as far as I can tell.

Regards,
Markus

Alish1984 June 18, 2015 16:37

Energy Source Term
 
Hello guys

in the pdf guide and in the multiSpeciesTransportModel.C
we can see 2 terms that forms the source term in the LHS of hsEqn.H

div(alpha*sum(hsk*grad(Yk)))+div(sum(Jk*hsk))


what are these terms? we know that Jk=-rho*Dk*grad(Yk) but this eq. is not used in the code to calculate the source term. We have:

Loop over species
{....

volScalarField alphaMinusRhoDHsi = (turbulence_.alphaEff()) * (hsi - hsN);

volScalarField laplacianAlpHsi =
fvc::laplacian(alphaMinusRhoDHsi, thermo_.composition().Y(i));

volScalarField deltahs = hsi-hsN;
laplacianAlpHsi += fvc::div(j(i),deltahs, "div(ji,hi)");

}


here J is calculated from the total fluxes. Jk=nk-Yk*phi ; nk=YEqn.flux().

the known source term in the LHS of energy eq. due to species diffusion is (Theoretical and numerical combustion by Poinsot and Veynate) :

div(rho*sum[hsk*Yk*Vki]) where Vk=-Dk/Xk*grad(Xk)
with some math work we finally have:

div(rho*sum[hsk*Yk*Vki])= - div(sum[hsk*Dk*grad(Yk)])

to implement this we can use laplacian of the Yk as below:

div(rho*sum[hsk*Yk*Vki])= - sum[ hsk*(laplacian(Dk,Yk))]

So what are the two terms in the code? div(alpha*sum(hsk*grad(Yk)))+div(sum(Jk*hsk))

Does anyone know where "alpha" comes from in the source term? or why the code implement the source term like this?

Regards,

Ali

Alish1984 June 20, 2015 17:56

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!

Quote:

Originally Posted by wyldckat (Post 471525)
Greetings Jiatang Wang and welcome to the forum!


1.6-ext is a variant of OpenFOAM and is mostly compatible with OpenFOAM 1.6.x and 1.7.x. Therefore, OpenFOAM 2.2.1 is far too different for that source code to work as intended.

You can find installation instructions for 1.6-ext for Ubuntu here: http://openfoamwiki.net/index.php/In...1.6-ext/Ubuntu

Best regards,
Bruno

Quote:

Originally Posted by Alish1984 (Post 551044)
Hello guys

in the pdf guide and in the multiSpeciesTransportModel.C
we can see 2 terms that forms the source term in the LHS of hsEqn.H

div(alpha*sum(hsk*grad(Yk)))+div(sum(Jk*hsk))


what are these terms? we know that Jk=-rho*Dk*grad(Yk) but this eq. is not used in the code to calculate the source term. We have:

Loop over species
{....

volScalarField alphaMinusRhoDHsi = (turbulence_.alphaEff()) * (hsi - hsN);

volScalarField laplacianAlpHsi =
fvc::laplacian(alphaMinusRhoDHsi, thermo_.composition().Y(i));

volScalarField deltahs = hsi-hsN;
laplacianAlpHsi += fvc::div(j(i),deltahs, "div(ji,hi)");

}


here J is calculated from the total fluxes. Jk=nk-Yk*phi ; nk=YEqn.flux().

the known source term in the LHS of energy eq. due to species diffusion is (Theoretical and numerical combustion by Poinsot and Veynate) :

div(rho*sum[hsk*Yk*Vki]) where Vk=-Dk/Xk*grad(Xk)
with some math work we finally have:

div(rho*sum[hsk*Yk*Vki])= - div(sum[hsk*Dk*grad(Yk)])

to implement this we can use laplacian of the Yk as below:

div(rho*sum[hsk*Yk*Vki])= - sum[ hsk*(laplacian(Dk,Yk))]

So what are the two terms in the code? div(alpha*sum(hsk*grad(Yk)))+div(sum(Jk*hsk))

Does anyone know where "alpha" comes from in the source term? or why the code implement the source term like this?

Regards,

Ali


Dear Bruno and Athanassios
Do you have any comment about my post regarding source terms in energy equation?
Regards, Ali

Alish1984 June 21, 2015 10:35

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!


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


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