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/)
-   -   [openFuelCell] pemfcSinglePhaseModel-4.0 on OpenFOAM (https://www.cfd-online.com/Forums/openfoam-community-contributions/206727-pemfcsinglephasemodel-4-0-openfoam.html)

ramakant September 12, 2018 00:37

pemfcSinglePhaseModel-4.0 on OpenFOAM
 
1 Attachment(s)
Dear All

I need your comments on compiling the above PEM fuel cell Single Phase model. When I am compiling ./Allwmake its shows fatal error. Please, any can give me solution for this.


Thank you

Ramakant

AmBeWo September 18, 2018 11:00

pemfc Model OFv4.0
 
Hey everyone,

I am currently on working with the pemfc-Model for OFv4.0 which is based on openFuelcell.

http://www.mdpi.com/2079-3197/6/2/38

and

http://dx.doi.org/10.17632/3gz7pxznzn.1


Does anyone have already experience with it?


When I try to compile the model I get the following error:

Quote:

/OpenFOAM/OpenFOAMv4.0/OpenFOAM-4.0/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt64Opt/pemfcSinglephaseNonIsothermalSolver.o' failedmake: *** [Make/linux64GccDPInt64Opt/pemfcSinglephaseNonIsothermalSolver.o] Error 1
Can someone help?
Thanks in advance

ramakant September 18, 2018 12:00

Quote:

Originally Posted by AmBeWo (Post 706715)
Hey everyone,

I am currently on working with the pemfc-Model for OFv4.0 which is based on openFuelcell.

http://www.mdpi.com/2079-3197/6/2/38

and

http://dx.doi.org/10.17632/3gz7pxznzn.1


Does anyone have already experience with it?


When I try to compile the model I get the following error:

Can someone help?
Thanks in advance

Dear
I am also working/using on the same openfuelcell code and getting the same kind of the compilation (./Allwmake) error.

Amalryk September 19, 2018 10:04

Quote:

Originally Posted by ramakant (Post 706718)
Dear
I am also working/using on the same openfuelcell code and getting the same kind of the compilation (./Allwmake) error.

Hello!

Same here, I contacted the main author of the paper, unfortunately he could not assist me with the issue. I think that the uploaded code lacks an important detail (it is unfinished, perhaps?). For example, during compilation (before the crash) the first (from many) error is given with the following message:

Quote:

In file included from pemfcSinglephaseNonIsothermalSolver.C:104:0: ../src/patch/createPatchToPatchInterpolation.H: In function ‘int main(int, char**)’:
../src/patch/createPatchToPatchInterpolation.H:10:5: error: ‘mypatchToPatchInterpolation’ was not declared in this scope
mypatchToPatchInterpolation anodeToCathode
^
This can be "repaired" by changing "mypatchToPatchInterpolation" phrase to "myPatchToPatchInterpolation" in the createPatchToPatchInterpolation.H file. When you replace the phrases, the error is gone but the following occur:
Quote:

In file included from pemfcSinglephaseNonIsothermalSolver.C:104:0: ../src/patch/createPatchToPatchInterpolation.H: In function ‘int main(int, char**)’:
../src/patch/createPatchToPatchInterpolation.H:10:33: error: missing template arguments before ‘anodeToCathode’
myPatchToPatchInterpolation anodeToCathode
_______________________^
../src/patch/createPatchToPatchInterpolation.H:12:33: error: missing template arguments before ‘cathodeToAnode’
myPatchToPatchInterpolation cathodeToAnode
_______________________^
[...]
and so on, ending with:
Quote:

/opt/openfoam4/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/pemfcSinglephaseNonIsothermalSolver.o' failed
make: *** [Make/linux64GccDPInt32Opt/pemfcSinglephaseNonIsothermalSolver.o] Error 1
I tried to look at the code more carefully but its structure stays unclear to me . Any suggestions would be appreciated :)

ramakant September 23, 2018 01:02

pemfcSinglePhaseModel-4.0 with OpenFOAM
 
1 Attachment(s)
I have installed on my computer the OF4.0 (Ubuntu 16.04 on OS) as per the author instructions and try to compile the pemfcSinglePhaseModel-4.0.While compiling (./Allwclean & ./Allwmake ) the following error is showing on the screen. Please give some comments on the error.

Thank you
Ramakant

wyldckat September 26, 2018 17:50

Greetings to all,

I've split off from the OpenFuelCell thread, the posts that are referring to the package provided here: http://dx.doi.org/10.17632/3gz7pxznzn.1

Apparently that ZIP file was somehow corrupted by someone in the middle... what I mean is that the file "lib/myPatchToPatchInterpolation/mypatchToPatchInterpolation.H" was replaced by the content from "lib/myPatchToPatchInterpolation/myPatchToPatchInterpolation.H", which is why this problem is occurring. It's possible to recover the broken file, by using the original code "patchToPatchInterpolation.H" from OpenFOAM 4.0 as a basis.

After downloading the ZIP file, I've ran the following commands, in order to be able to compile the code with OpenFOAM 4.0, along with the necessary corrections:
Code:

unzip pemfcSinglePhaseModel-4.0.zip
cd pemfcSinglePhaseModel-4.0
cd pemfcSinglePhaseNonIsothermalSolver
find -name "All*" | xargs chmod +x
cp $FOAM_SRC/OpenFOAM/interpolations/patchToPatchInterpolation/patchToPatchInterpolation.H lib/myPatchToPatchInterpolation/mypatchToPatchInterpolation.H
sed -i -e 's=patchToPatchInterpolation=mypatchToPatchInterpolation=g'  -e 's=PatchToPatchInterpolation=myPatchToPatchInterpolation=g' lib/myPatchToPatchInterpolation/mypatchToPatchInterpolation.H
./Allwmake > log.make 2>&1
./Allwmake > log.make2 2>&1

The last 2 commands will create 2 log files: "log.make" and "log.make2", where the second file should have something like this inside:
Code:

...
..../libSinglephasePEMFC.so' is up to date.
...
.../pemfcSinglephaseNonIsothermalSolver' is up to date.


Best regards,
Bruno

AmBeWo September 27, 2018 03:20

Hey Bruno,

worked out really well in my case too.
Many thanks for your support!

Best,
Amadeus

ramakant September 27, 2018 04:38

Quote:

Originally Posted by AmBeWo (Post 707838)
Hey Bruno,

worked out really well in my case too.
Many thanks for your support!

Best,
Amadeus

worked out really well in my case too.
Many thanks for your support!

thnak you
Ramakant

Amalryk September 27, 2018 04:45

Hi!

The model works fine now. Thank you!

Best regards,
Michal

ramakant September 27, 2018 10:13

Quote:

Originally Posted by Amalryk (Post 707855)
Hi!

The model works fine now. Thank you!

Best regards,
Michal

Please tell me any one of you. How to calculate in inlet velocity of fuel and Air.

Thank you

ramakant October 1, 2018 12:27

How to plot graph between Cell Voltage Vs Current Density
 
Quote:

Originally Posted by ramakant (Post 707960)
Please tell me any one of you. How to calculate in inlet velocity of fuel and Air.

Thank you

Dear All

I need your help regarding the graph. After the simulation is over how to plot a graph between Cell voltage Vs current density.

Thank you

AmBeWo January 31, 2019 08:05

Modification of the pemFC -Model
 
1 Attachment(s)
Hey Everyone,


recently I modified the "pemfcSinglePhaseNonIsothermal" - Model.
New geometry (length, width and hight of the fuel cell, channel number, channel area, thickness of the functional layers), new reaction kinetic parameters (transfer coefficent, exchange current density) and mass transport parameters (effective diffusivity, porosity) have been changed in the test case.

According to checkMesh the mesh is OK.

No modification of the source code (yet)!

However, simulating these new test cases is not successful. Error is always the same. (log.file is attached).

By studying the log.file I come to the conclusion, that the O2 concentration tends to zero (1e-15) which causes floating point errors in current density calculation. Increasing the O2 concentration at the inlet does not lead to any improvement.

Is there anybody who is familiar with this model and can help me?
I would appreciate any kind of recommendation :-)

Greeting,
Amadeus

hansihans March 29, 2019 12:16

I do not have a solution for this problem, but I am working on the multiphase model of it and tried the singlephase model before.

But what I noticed in your logfile is that in line 271 (Solving air flow) and line 280 (solving fuel flow) you do not get any FOAM Warning like I get

Code:

Solving air flow
--> FOAM Warning :
    From function Foam::fv::gaussConvectionScheme<Type>::gaussConvectionScheme(const Foam::fvMesh&, const surfaceScalarField&, Foam::Istream&) [with Type = Foam::Vector<double>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]
    in file finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H at line 124
    Reading "/home/hans/OpenFOAM/hans-4.1/run/cases_runned/Kone_PEM-FC_cases/singlephase/case_0/system/air/fvSchemes.divSchemes.div(phi,U)" at line 32
    Unbounded 'Gauss' div scheme used in steady-state solver, use 'bounded Gauss' to ensure boundedness.
    To remove this warning switch off 'warnUnboundedGauss' in "/opt/openfoam4/etc/controlDict"
DILUPBiCG:  Solving for Ux, Initial residual = 0.9999968, Final residual = 1.5478e-10, No Iterations 4
DILUPBiCG:  Solving for Uy, Initial residual = 0.999979, Final residual = 4.87157e-12, No Iterations 5
DILUPBiCG:  Solving for Uz, Initial residual = 1, Final residual = 2.371463e-10, No Iterations 4
DICPCG:  Solving for p, Initial residual = 1, Final residual = 7.897306e-10, No Iterations 238
time step continuity errors : sum local = 2.027143e-06, global = -3.367083e-08
DICPCG:  Solving for p, Initial residual = 0.0403882, Final residual = 8.410109e-10, No Iterations 215
time step continuity errors : sum local = 2.235446e-06, global = -6.680733e-08

Solving fuel flow
--> FOAM Warning :
    From function Foam::fv::gaussConvectionScheme<Type>::gaussConvectionScheme(const Foam::fvMesh&, const surfaceScalarField&, Foam::Istream&) [with Type = Foam::Vector<double>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]
    in file finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H at line 124
    Reading "/home/hans/OpenFOAM/hans-4.1/run/cases_runned/Kone_PEM-FC_cases/singlephase/case_0/system/fuel/fvSchemes.divSchemes.div(phi,U)" at line 32
    Unbounded 'Gauss' div scheme used in steady-state solver, use 'bounded Gauss' to ensure boundedness.
    To remove this warning switch off 'warnUnboundedGauss' in "/opt/openfoam4/etc/controlDict"
DILUPBiCG:  Solving for Ux, Initial residual = 0.9999968, Final residual = 1.317541e-11, No Iterations 3
DILUPBiCG:  Solving for Uy, Initial residual = 0.9997891, Final residual = 7.226337e-10, No Iterations 3
DILUPBiCG:  Solving for Uz, Initial residual = 1, Final residual = 2.37403e-10, No Iterations 4
DICPCG:  Solving for p, Initial residual = 1, Final residual = 6.313857e-10, No Iterations 231
time step continuity errors : sum local = 9.173014e-07, global = 2.219646e-10
DICPCG:  Solving for p, Initial residual = 0.04314282, Final residual = 8.862404e-10, No Iterations 208
time step continuity errors : sum local = 8.865e-07, global = 1.06748e-08
ReFuel = 23.95892
ReAir  = 144.5844

So my question is: Did you follow the same instructions like shown in this thread before or do you have another workaround for that? You are also using OpenFOAM 4.0 but I did not manage to get it. When I try to install OF 4.0 - like described on the official web page - it will always installs OF 4.1 (maybe thats why I get this warning). Where did you get OF 4.0 from ?


Like I mentioned before I am working on the multiphase model and also changed some parameter of the MEA and changed the geometry (one Inlet & outlet) but I am stuck in another error which may could be solved with that here.

AmBeWo March 31, 2019 17:51

Hey Hans,

you can change unbounded Gauss div scheme to bounded Gauss in ../system/air/fvSchemes and ../system/fuel/fvSchemes.

A detailed OF4.0 installation can be found here:

https://openfoamwiki.net/index.php/I...OAM-4.0/Ubuntu

Best Regards,
Amadeus

hansihans April 4, 2019 03:49

Thanks Amadeus,

the information of the installation of OpenFOAM 4.0 helped me.
But the thing with bounded Gauss in the fvSchemes did not work in my test cases. Cases that worked before do not work now (they only get to Time = 4 and then abort, there are also differences noticable on the residuals). So maybe you have some problems with it, too.

Kind regards,
Hans

AmBeWo April 4, 2019 07:55

Hey Hans,

yeah the model is quite delicate when changing parameters. Same often happened to me. Check fvSolution and may increase the maxIt or the tolerance.

Do you recalculated the inlet velocity for your customized case with the attached formula?

In my case I also changed the fuel mass fractions of hydrogen and water.

Best regards,
Amadeus

hansihans April 8, 2019 10:51

Hi Amadeus,

I tried it with the attached formula (in the single phase paper it is formula 8) but I did not get the same value out of it like in the author´s case.

I mean R, T, p and F are known, stoichiometric flow ratio is given, too. For n=2, I=6000A/m2, A_mea= 22*22mm2 and A_ch= 1,5*2mm2 I get completely other values. To get the same result as the author, A_mea would only be 45% of A_ch, which could not be true.
So either I used wrong values or my calculator is broken :confused:

In my test cases I changed the mass fractions, too, but currently I am trying to change my geometry that it may somehow works. And then I will change other variables.


Kind regards,
Hans

AmBeWo April 8, 2019 12:27

Hey Hans,

check out this paper, where the formula actually comes from:
https://www.sciencedirect.com/scienc...17931004004685

I also got confused by calculating the velocity using this formula. In your case you have to consider, that in the default test case the fuel cell comprises of 7 channels (your case 2 channels?!). So you can't match because a different flow rate is necessary to achieve the prescribed stoichiometric ratio...

Best Regards,
Amadeus

muhammadlr95 April 19, 2019 22:37

pemfcSinglePhaseModel-4.0 on OpenFOAM
 
1 Attachment(s)
Hi everyone. I've ran the following commands but still I didn't get the same code as in the log.make2 file.

Quote:

Originally Posted by wyldckat (Post 707740)
After downloading the ZIP file, I've ran the following commands, in order to be able to compile the code with OpenFOAM 4.0, along with the necessary corrections:
Code:

unzip pemfcSinglePhaseModel-4.0.zip
cd pemfcSinglePhaseModel-4.0
cd pemfcSinglePhaseNonIsothermalSolver
find -name "All*" | xargs chmod +x
cp $FOAM_SRC/OpenFOAM/interpolations/patchToPatchInterpolation/patchToPatchInterpolation.H lib/myPatchToPatchInterpolation/mypatchToPatchInterpolation.H
sed -i -e 's=patchToPatchInterpolation=mypatchToPatchInterpolation=g'  -e 's=PatchToPatchInterpolation=myPatchToPatchInterpolation=g' lib/myPatchToPatchInterpolation/mypatchToPatchInterpolation.H
./Allwmake > log.make 2>&1
./Allwmake > log.make2 2>&1

The last 2 commands will create 2 log files: "log.make" and "log.make2", where the second file should have something like this inside:
Code:

...
..../libSinglephasePEMFC.so' is up to date.
...
.../pemfcSinglephaseNonIsothermalSolver' is up to date.


Best regards,
Bruno

Instead I got like in the image below. How do I fix this? I already ran this on OpenFOAM 4.0.

Thanks.
Attachment 69507

hansihans April 21, 2019 18:14

Hi Muhammad,

looks like you are running OpenFOAM 6 and this model only works with OpenFOAM 4. If you have multiple OpenFOAM versions installed you have to use aliases in the bashrc to activate the desired version. But in my case I could not install OF4 on windows so I had to install Ubuntu parallel to windows.

Kind regards
Hans

muhammadlr95 April 25, 2019 03:10

Thanks Hans, it worked!

swsyoon May 19, 2020 08:31

Hello

It seems the last post about this model is almost a year ago. I recently tried to use this pemfc model in openfoam4 and was able to compile it according to the earlier post. However when I tried to run the main script by typing ' make run' in run directory, I got this error.
I ran blockMesh command to generate mesh file but I cannot see the 'cellRegionAddressing' file that the error message is referring to.

Can you help to fix this issue ?
Thanks,


( pemfcSinglephaseNonIsothermalSolver | tee log.run );
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 4.0
Exec : pemfcSinglephaseNonIsothermalSolver
Date : May 19 2020
Time : 08:22:14
Host : "ws-Satellite-L655"
PID : 6511
Case : /home/ws/OpenFOAM/ws-4.0/run/pemfcSinglePhaseModel-4.0/run
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading cell properties

galvanostatic run
V = V [1 2 -3 0 0 -1 0] 0.6
Ibar0 = Ibar0 [0 -2 0 0 0 1 0] 7000
Rhat = Rhat [1 4 -3 0 0 -2 0] 1e-05
Rhat0 = Rhat0 [1 4 -3 0 0 -2 0] 1e-05
CL electronic conductivity(kappaCl) = kappaCl [-1 -2 3 0 0 2 0] 1000
GDL electronic conductivity(kappaGdl) = kappaGdl [-1 -2 3 0 0 2 0] 5000
GDL - BP Contact resistance (rContact)= rContact [1 4 -3 0 0 -2 0] 2e-06
BP electronic conductivity(kappaBp) = kappaBp [-1 -2 3 0 0 2 0] 83000
CL thickness (tCl) = tCl [0 1 0 0 0 0 0] 3.7e-06
GDL thickness (tGdl) = tGdl [0 1 0 0 0 0 0] 0.00041
BP thickness (tBp) = tBp [0 1 0 0 0 0 0] 0.003
concentration overpotential constant = etaConCaConstant [0 0 0 0 0 0 0] 0.25

Tinit = Tinit [0 0 0 1 0 0 0] 353

anodeName = fuel_to_electrolyte
fuelInletName = fuelInlet
fuelOutletName = fuelOutlet
fuelAbpName = fuel_to_abp
cathodeName = air_to_electrolyte
airInletName = airInlet
airOutletName = airOutlet
airCbpName = air_to_cbp
electrolyteAnodeName = electrolyte_to_fuel
electrolyteCathodeName = electrolyte_to_air
abpFuelName = abp_to_fuel
cbpAirName = cbp_to_air

Reading cell field T

Reading cell field k



--> FOAM FATAL IO ERROR:
cannot find file

file: /home/ws/OpenFOAM/ws-4.0/run/pemfcSinglePhaseModel-4.0/run/constant/abp/polyMesh/cellRegionAddressing at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 72.

FOAM exiting

ramakant May 20, 2020 01:58

Quote:

Originally Posted by swsyoon (Post 771090)
Hello

It seems the last post about this model is almost a year ago. I recently tried to use this pemfc model in openfoam4 and was able to compile it according to the earlier post. However when I tried to run the main script by typing ' make run' in run directory, I got this error.
I ran blockMesh command to generate mesh file but I cannot see the 'cellRegionAddressing' file that the error message is referring to.

Can you help to fix this issue ?
Thanks,


( pemfcSinglephaseNonIsothermalSolver | tee log.run );
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 4.0
Exec : pemfcSinglephaseNonIsothermalSolver
Date : May 19 2020
Time : 08:22:14
Host : "ws-Satellite-L655"
PID : 6511
Case : /home/ws/OpenFOAM/ws-4.0/run/pemfcSinglePhaseModel-4.0/run
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading cell properties

galvanostatic run
V = V [1 2 -3 0 0 -1 0] 0.6
Ibar0 = Ibar0 [0 -2 0 0 0 1 0] 7000
Rhat = Rhat [1 4 -3 0 0 -2 0] 1e-05
Rhat0 = Rhat0 [1 4 -3 0 0 -2 0] 1e-05
CL electronic conductivity(kappaCl) = kappaCl [-1 -2 3 0 0 2 0] 1000
GDL electronic conductivity(kappaGdl) = kappaGdl [-1 -2 3 0 0 2 0] 5000
GDL - BP Contact resistance (rContact)= rContact [1 4 -3 0 0 -2 0] 2e-06
BP electronic conductivity(kappaBp) = kappaBp [-1 -2 3 0 0 2 0] 83000
CL thickness (tCl) = tCl [0 1 0 0 0 0 0] 3.7e-06
GDL thickness (tGdl) = tGdl [0 1 0 0 0 0 0] 0.00041
BP thickness (tBp) = tBp [0 1 0 0 0 0 0] 0.003
concentration overpotential constant = etaConCaConstant [0 0 0 0 0 0 0] 0.25

Tinit = Tinit [0 0 0 1 0 0 0] 353

anodeName = fuel_to_electrolyte
fuelInletName = fuelInlet
fuelOutletName = fuelOutlet
fuelAbpName = fuel_to_abp
cathodeName = air_to_electrolyte
airInletName = airInlet
airOutletName = airOutlet
airCbpName = air_to_cbp
electrolyteAnodeName = electrolyte_to_fuel
electrolyteCathodeName = electrolyte_to_air
abpFuelName = abp_to_fuel
cbpAirName = cbp_to_air

Reading cell field T

Reading cell field k



--> FOAM FATAL IO ERROR:
cannot find file

file: /home/ws/OpenFOAM/ws-4.0/run/pemfcSinglePhaseModel-4.0/run/constant/abp/polyMesh/cellRegionAddressing at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 72.

FOAM exiting

Yes...I can help you
please follow the steps to run the program and it is working fine for me.
My email id:ramakantgadhewal@gmail.com

mariduake November 10, 2020 02:27

I'm also checking this code. I'm new to OpenFoam, I used the Fluent module, but I wanted to check this open source software. My question is, do you upload a geometry? because I can't find it in the files. I am reading about meshing here https://www.cfd.at/downloads/FoamTut...ExampleTwo.pdf
So, if I want to run this code, d I have to make my own geometry? Sorry I was accustomed with Fluent. Thank you in advance with your response.

ramakant November 10, 2020 04:28

Quote:

Originally Posted by mariduake (Post 787285)
I'm also checking this code. I'm new to OpenFoam, I used the Fluent module, but I wanted to check this open source software. My question is, do you upload a geometry? because I can't find it in the files. I am reading about meshing here https://www.cfd.at/downloads/FoamTut...ExampleTwo.pdf
So, if I want to run this code, d I have to make my own geometry? Sorry I was accustomed with Fluent. Thank you in advance with your response.

Please check it Geometry is already there.

mat16 December 2, 2020 04:11

Quote:

Originally Posted by wyldckat (Post 707740)
Greetings to all,

I've split off from the OpenFuelCell thread, the posts that are referring to the package provided here: http://dx.doi.org/10.17632/3gz7pxznzn.1

Apparently that ZIP file was somehow corrupted by someone in the middle... what I mean is that the file "lib/myPatchToPatchInterpolation/mypatchToPatchInterpolation.H" was replaced by the content from "lib/myPatchToPatchInterpolation/myPatchToPatchInterpolation.H", which is why this problem is occurring. It's possible to recover the broken file, by using the original code "patchToPatchInterpolation.H" from OpenFOAM 4.0 as a basis.

After downloading the ZIP file, I've ran the following commands, in order to be able to compile the code with OpenFOAM 4.0, along with the necessary corrections:
Code:

unzip pemfcSinglePhaseModel-4.0.zip
cd pemfcSinglePhaseModel-4.0
cd pemfcSinglePhaseNonIsothermalSolver
find -name "All*" | xargs chmod +x
cp $FOAM_SRC/OpenFOAM/interpolations/patchToPatchInterpolation/patchToPatchInterpolation.H lib/myPatchToPatchInterpolation/mypatchToPatchInterpolation.H
sed -i -e 's=patchToPatchInterpolation=mypatchToPatchInterpolation=g'  -e 's=PatchToPatchInterpolation=myPatchToPatchInterpolation=g' lib/myPatchToPatchInterpolation/mypatchToPatchInterpolation.H
./Allwmake > log.make 2>&1
./Allwmake > log.make2 2>&1

The last 2 commands will create 2 log files: "log.make" and "log.make2", where the second file should have something like this inside:
Code:

...
..../libSinglephasePEMFC.so' is up to date.
...
.../pemfcSinglephaseNonIsothermalSolver' is up to date.

Best regards,
Bruno


Hey everyone,

I downloaded the version of OpenFoam 4.0 on ubuntu 16.04.

https://openfoamwiki.net/index.php/I...OAM-4.0/Ubuntu

I have followed this procedure but it gives me the same error.

https://imagizer.imageshack.com/v2/8...922/IvwsdQ.png

https://imagizer.imageshack.com/v2/8...924/jgIPFy.png

Also during the unzip of the file it asks me:

https://imagizer.imageshack.com/v2/8...924/6Z82Qv.png

I do yes and it opens correctly.

Someone help me?

Thanks in advance

mariduake December 2, 2020 06:20

I installed the same and i didn't have any problem compiling. I copied wyldckat instructions line by line and it worked out fine. I got the logs correctly. This is what I did:


1. After instalation I ran mkdir -p $FOAM_RUN
2. I copied the zip to the user4.0/run folder
3. I ran the commands line by line and it compiled just fine.

mariduake December 2, 2020 06:23

Error after compiling on the abp
 
Do you have any idea why i have this error. I followed instructions, I even installed OF4.0 instead of 4.1 but I got the same error.


Quote:

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 4.0
Exec : pemfcSinglephaseNonIsothermalSolver
Date : Dec 02 2020
Time : 05:01:29
Host : "fat-HP-625"
PID : 23372
Case : /home/fat/OpenFOAM/fat-4.0/run/pemfcSinglePhaseModel-4.0/run
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading cell properties

galvanostatic run
V = V [1 2 -3 0 0 -1 0] 0.6
Ibar0 = Ibar0 [0 -2 0 0 0 1 0] 7000
Rhat = Rhat [1 4 -3 0 0 -2 0] 1e-05
Rhat0 = Rhat0 [1 4 -3 0 0 -2 0] 1e-05
CL electronic conductivity(kappaCl) = kappaCl [-1 -2 3 0 0 2 0] 1000
GDL electronic conductivity(kappaGdl) = kappaGdl [-1 -2 3 0 0 2 0] 5000
GDL - BP Contact resistance (rContact)= rContact [1 4 -3 0 0 -2 0] 2e-06
BP electronic conductivity(kappaBp) = kappaBp [-1 -2 3 0 0 2 0] 83000
CL thickness (tCl) = tCl [0 1 0 0 0 0 0] 3.7e-06
GDL thickness (tGdl) = tGdl [0 1 0 0 0 0 0] 0.00041
BP thickness (tBp) = tBp [0 1 0 0 0 0 0] 0.003
concentration overpotential constant = etaConCaConstant [0 0 0 0 0 0 0] 0.25

Tinit = Tinit [0 0 0 1 0 0 0] 353

anodeName = fuel_to_electrolyte
fuelInletName = fuelInlet
fuelOutletName = fuelOutlet
fuelAbpName = fuel_to_abp
cathodeName = air_to_electrolyte
airInletName = airInlet
airOutletName = airOutlet
airCbpName = air_to_cbp
electrolyteAnodeName = electrolyte_to_fuel
electrolyteCathodeName = electrolyte_to_air
abpFuelName = abp_to_fuel
cbpAirName = cbp_to_air

Reading cell field T

Reading cell field k



--> FOAM FATAL ERROR:
Cannot find file "points" in directory "abp/polyMesh" in times 0 down to constant

From function Foam::word Foam::Time::findInstance(const Foam::fileName&, const Foam::word&, Foam::IOobject::readOption, const Foam::word&) const
in file db/Time/findInstance.C at line 182.

FOAM exiting

mat16 December 2, 2020 10:34

Hi Maricarmen,

It worked!

Many thanks for your support!

Best regards

mariduake December 16, 2020 18:14

Modification
 
Has anyone tried to modify the fuel? What happens if I change H2 for CH3OH? I think for Methanol model the cathode remains the same, but the anode equations are modified. Has anyone tried to do so? :D

ramakant December 17, 2020 05:23

Quote:

Originally Posted by mariduake (Post 790874)
Has anyone tried to modify the fuel? What happens if I change H2 for CH3OH? I think for Methanol model the cathode remains the same, but the anode equations are modified. Has anyone tried to do so? :D

Are you writing code for DMFC in OpenFOAM? or trying to modify the PEM fuel cell code?

mariduake December 17, 2020 13:18

Quote:

Originally Posted by ramakant (Post 790908)
Are you writing code for DMFC in OpenFOAM? or trying to modify the PEM fuel cell code?


I'm trying to modify it. I know there are other phenomena but I just want to check how this can be done. I saw someone modified the Fluent pem fuel cell module but it didn't say how they did it.

ramakant December 17, 2020 13:36

Quote:

Originally Posted by mariduake (Post 790952)
I'm trying to modify it. I know there are other phenomena but I just want to check how this can be done. I saw someone modified the Fluent pem fuel cell module but it didn't say how they did it.

Could you please share the Fluent file?

mat16 December 19, 2020 11:35

Quote:

Originally Posted by mariduake (Post 789556)
Do you have any idea why i have this error. I followed instructions, I even installed OF4.0 instead of 4.1 but I got the same error.

Hi,
I changed the geometry and I have the same error as you.

https://imagizer.imageshack.com/v2/8...924/eVsfmq.png


Can someone help me?

Thank you.

jose.ceballos December 20, 2020 16:36

Compiling error pemfcSinglePhaseModel-4.0
 
Quote:

Originally Posted by wyldckat (Post 707740)
Greetings to all,

I've split off from the OpenFuelCell thread, the posts that are referring to the package provided here: http://dx.doi.org/10.17632/3gz7pxznzn.1

Apparently that ZIP file was somehow corrupted by someone in the middle... what I mean is that the file "lib/myPatchToPatchInterpolation/mypatchToPatchInterpolation.H" was replaced by the content from "lib/myPatchToPatchInterpolation/myPatchToPatchInterpolation.H", which is why this problem is occurring. It's possible to recover the broken file, by using the original code "patchToPatchInterpolation.H" from OpenFOAM 4.0 as a basis.

After downloading the ZIP file, I've ran the following commands, in order to be able to compile the code with OpenFOAM 4.0, along with the necessary corrections:
Code:

unzip pemfcSinglePhaseModel-4.0.zip
cd pemfcSinglePhaseModel-4.0
cd pemfcSinglePhaseNonIsothermalSolver
find -name "All*" | xargs chmod +x
cp $FOAM_SRC/OpenFOAM/interpolations/patchToPatchInterpolation/patchToPatchInterpolation.H lib/myPatchToPatchInterpolation/mypatchToPatchInterpolation.H
sed -i -e 's=patchToPatchInterpolation=mypatchToPatchInterpolation=g'  -e 's=PatchToPatchInterpolation=myPatchToPatchInterpolation=g' lib/myPatchToPatchInterpolation/mypatchToPatchInterpolation.H
./Allwmake > log.make 2>&1
./Allwmake > log.make2 2>&1

The last 2 commands will create 2 log files: "log.make" and "log.make2", where the second file should have something like this inside:
Code:

...
..../libSinglephasePEMFC.so' is up to date.
...
.../pemfcSinglephaseNonIsothermalSolver' is up to date.


Best regards,
Bruno

I've followed the instructions, and it seems the previous errror is fixed. But I can't obtaint the up date message, instead I got this message:

Code:

+ cd lib
+ ./Allwmake
+ wmake libso
'/home/cicy/OpenFOAM/cicy-4.x/platforms/linux64GccDPInt32Opt/lib/libSinglephasePEMFC.so' is up to date.
+ pwd
/home/cicy/OpenFOAM/cicy-4.x/run/pemfcSinglePhaseModel-4.0/pemfcSinglePhaseNonIsothermalSolver
+ cd applications
+ wmake
g++ -std=c++0x -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3  -DNoRepository -ftemplate-depth-100 -g -I../src/constants -I../src/createFields -I../src/createMesh -I../src/createSpecies -I../src/diffusivity -I../src/electrochemistry -I../src/energyTransport -I../src/mapping -I../src/momentumTransport -I../src/multiSpeciesTransport -I../src/patch -I../src/physicalProperties -I../src/readParameters -I../src/readProperties -I../src/tools/functions -I../src/tools/functionIntegration -I../src/tools/ReynoldsNumber -I../src/tools/RiddersRoot -I../src/tools/varInit -I../lib/lnInclude -I/home/cicy/OpenFOAM/OpenFOAM-4.x/src/finiteVolume/lnInclude -I/home/cicy/OpenFOAM/OpenFOAM-4.x/src/meshTools/lnInclude -I/home/cicy/OpenFOAM/OpenFOAM-4.x/src/thermophysicalModels/specie/lnInclude  -IlnInclude -I. -I/home/cicy/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude -I/home/cicy/OpenFOAM/OpenFOAM-4.x/src/OSspecific/POSIX/lnInclude  -fPIC -c pemfcSinglephaseNonIsothermalSolver.C -o Make/linux64GccDPInt32Opt/pemfcSinglephaseNonIsothermalSolver.o
In file included from pemfcSinglephaseNonIsothermalSolver.C:104:0:
../src/patch/createPatchToPatchInterpolation.H: In function ‘int main(int, char**)’:
../src/patch/createPatchToPatchInterpolation.H:10:33: error: missing template arguments before ‘anodeToCathode’
    myPatchToPatchInterpolation anodeToCathode
                                ^~~~~~~~~~~~~~
../src/patch/createPatchToPatchInterpolation.H:16:33: error: missing template arguments before ‘cathodeToAnode’
    myPatchToPatchInterpolation cathodeToAnode
                                ^~~~~~~~~~~~~~
../src/patch/createPatchToPatchInterpolation.H:58:33: error: missing template arguments before ‘fuelAnodeToElectrolyteAnode’
    myPatchToPatchInterpolation fuelAnodeToElectrolyteAnode
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/patch/createPatchToPatchInterpolation.H:64:33: error: missing template arguments before ‘airCathodeToElectrolyteCathode’
    myPatchToPatchInterpolation airCathodeToElectrolyteCathode
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from pemfcSinglephaseNonIsothermalSolver.C:141:0:
../src/electrochemistry/solveElectrochemistry.H:75:18: error: ‘anodeToCathode’ was not declared in this scope
                  anodeToCathode.faceInterpolate
                  ^~~~~~~~~~~~~~
../src/electrochemistry/solveElectrochemistry.H:75:18: note: suggested alternative: ‘anodePatch’
                  anodeToCathode.faceInterpolate
                  ^~~~~~~~~~~~~~
                  anodePatch
In file included from ../src/electrochemistry/ASRfunction.H:8:0,
                from ../src/electrochemistry/solveElectrochemistry.H:158,
                from pemfcSinglephaseNonIsothermalSolver.C:141:
../src/electrochemistry/sigmaElectrolyte.H:78:17: error: ‘anodeToCathode’ was not declared in this scope
    wActivity = anodeToCathode.faceInterpolate(wActivityAnode) + wActivityCathode;
                ^~~~~~~~~~~~~~
../src/electrochemistry/sigmaElectrolyte.H:78:17: note: suggested alternative: ‘pSatCathode’
    wActivity = anodeToCathode.faceInterpolate(wActivityAnode) + wActivityCathode;
                ^~~~~~~~~~~~~~
                pSatCathode
In file included from pemfcSinglephaseNonIsothermalSolver.C:141:0:
../src/electrochemistry/solveElectrochemistry.H:251:18: error: ‘cathodeToAnode’ was not declared in this scope
                  cathodeToAnode.faceInterpolate(mflux[s])*(1.0 - YsBC);
                  ^~~~~~~~~~~~~~
../src/electrochemistry/solveElectrochemistry.H:251:18: note: suggested alternative: ‘cathodeZones’
                  cathodeToAnode.faceInterpolate(mflux[s])*(1.0 - YsBC);
                  ^~~~~~~~~~~~~~
                  cathodeZones
../src/electrochemistry/solveElectrochemistry.H:274:11: error: ‘cathodeToAnode’ was not declared in this scope
          -cathodeToAnode.faceInterpolate(mfluxSum)
          ^~~~~~~~~~~~~~
../src/electrochemistry/solveElectrochemistry.H:274:11: note: suggested alternative: ‘cathodeZones’
          -cathodeToAnode.faceInterpolate(mfluxSum)
          ^~~~~~~~~~~~~~
          cathodeZones
/home/cicy/OpenFOAM/OpenFOAM-4.x/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/pemfcSinglephaseNonIsothermalSolver.o' failed
make: *** [Make/linux64GccDPInt32Opt/pemfcSinglephaseNonIsothermalSolver.o] Error 1

I've now installed OF4.X in Ubuntu 18.04 Windows Bash....

jose.ceballos December 20, 2020 18:20

Request pemfcSinglePhaseModel-4.0.zip
 
Someone could upload the pemfcSinglePhaseModel-4.0 fixed to downloand it?

Pratik_21 December 14, 2022 03:17

parallel running
 
Did anyone try running this code in parallel ?


All times are GMT -4. The time now is 19:43.