|
[Sponsors] |
April 21, 2015, 04:51 |
variable rho in interFoam
|
#1 |
Member
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14 |
Hello Foamers
I'm implementing a varibale phase density in interFoam I declare the density in createFields.H then have a seperate file rhof.H where i write the whole formula then i include it to my solver. The library incompressibleTwoPhaseMixture uses lookup command to fetch the value of rhof and i replaced all rho1 inside nuf, muf, mu methods with rhof I then had to add a boundary condition for rhof (zeroGradient) my problem now, when i execute a case i have the following error alkebsi@itd14:~/OpenFOAM/alkebsi-2.3.1/run/heatingwater4$ #0 Foam::error:rintStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::mag<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>(Foam::GeometricField<Foam::Vect or<double>, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:? #4 Foam::interfaceProperties::calculateK() at ??:? #5 at ~/OpenFOAM/alkebsi-2.3.1/applications/solvers/interPolyFoam/alphaEqn.H:98 #6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #7 at ??:? that i dont understand in file alphaEqn.H the line 98 contains original untouched code 80 for (int aCorr=0; aCorr<nAlphaCorr; aCorr++) 81 { 82 surfaceScalarField phir(phic*interface.nHatf()); 83 84 tmp<surfaceScalarField> tphiAlphaUn 85 ( 86 fvc::flux 87 ( 88 phi, 89 alpha1, 90 alphaScheme 91 ) 92 + fvc::flux 93 ( 94 -fvc::flux(-phir, alpha2, alpharScheme), 95 alpha1, 96 alpharScheme 97 ) 98 ); Please help, any suggestions are heartfully wellcome |
|
April 22, 2015, 03:25 |
|
#2 |
Member
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14 |
please dear foamers
does anyone have any idea what this error message means: #0 Foam::error:rintStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::mag<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>(Foam::GeometricField<Foam::Vect or<double>, Foam::fvsPatchField, Foam::surfaceMesh> const&) at ??:? #4 Foam::interfaceProperties::calculateK() at ??:? #5 at ~/OpenFOAM/alkebsi-2.3.1/applications/solvers/interPolyFoam/alphaEqn.H:98 #6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #7 at ??:? is it a problem of division by zero? or a bad unexpected variable type? please i need your help |
|
April 26, 2015, 09:50 |
|
#3 |
New Member
Nicolas Thiers
Join Date: Mar 2015
Posts: 17
Rep Power: 11 |
Hello ali, one question, did you compile the library before compile the solver?
|
|
April 26, 2015, 11:12 |
|
#4 |
Member
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14 |
Dear Nicolas,
Yes. library, then solver both are compiled good with no error message appearing. when i complie the case however, that error message appears I have checked the file interfaceProperties.C or .H in the library but it doesnt use rho1 or rho2. The calculateK() method is as defined below: and this is a default file void Foam::interfaceProperties::calculateK() { const fvMesh& mesh = alpha1_.mesh(); const surfaceVectorField& Sf = mesh.Sf(); // Cell gradient of alpha const volVectorField gradAlpha(fvc::grad(alpha1_)); // Interpolated face-gradient of alpha surfaceVectorField gradAlphaf(fvc::interpolate(gradAlpha)); //gradAlphaf -= // (mesh.Sf()/mesh.magSf()) // *(fvc::snGrad(alpha1_) - (mesh.Sf() & gradAlphaf)/mesh.magSf()); // Face unit interface normal surfaceVectorField nHatfv(gradAlphaf/(mag(gradAlphaf) + deltaN_)); correctContactAngle(nHatfv.boundaryField(), gradAlphaf.boundaryField()); // Face unit interface normal flux nHatf_ = nHatfv & Sf; // Simple expression for curvature K_ = -fvc::div(nHatf_); // Complex expression for curvature. // Correction is formally zero but numerically non-zero. /* volVectorField nHat(gradAlpha/(mag(gradAlpha) + deltaN_)); forAll(nHat.boundaryField(), patchi) { nHat.boundaryField()[patchi] = nHatfv.boundaryField()[patchi]; } K_ = -fvc::div(nHatf_) + (nHat & fvc::grad(nHatfv) & nHat); */ } and the file alphaEqn.H is as defined in the post |
|
April 26, 2015, 11:27 |
|
#5 |
New Member
Nicolas Thiers
Join Date: Mar 2015
Posts: 17
Rep Power: 11 |
Could you please show me your solver/Make files, also are you compiling the library in your FOAM_USER_LIBBIN folder??
|
|
April 27, 2015, 06:31 |
|
#6 |
Member
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14 |
make
interPolyFoam.C EXE = $(FOAM_USER_APPBIN)/interPolyFoam options LIB_USER_SRC= $(WM_PROJECT_USER_DIR)/src EXE_INC = -ggdb3 \ -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_USER_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_USER_SRC)/transportModels/myImmiscibleIncompressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/fvOptions/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ -ItwoPhaseMixtureThermo EXE_LIBS = \ -ltwoPhaseMixture \ -linterfaceProperties \ -ltwoPhaseProperties \ -L$(FOAM_USER_LIBBIN) \ -lmyImmiscibleIncompressibleTwoPhaseMixture \ -lmyIncompressibleTransportModels \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lfiniteVolume \ -lmeshTools \ -lfvOptions \ -lsampling \ -ltwoPhaseMixtureThermo \ -lfluidThermophysicalModels \ -lspecie |
|
April 27, 2015, 06:34 |
|
#7 |
Member
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14 |
the solver is in home/OpenFOAM/User.OFversion/applications/solvers as normal
the library is in home/OpenFOAM/User.OFversion/src as normal the library make file is as following viscosityModels/viscosityModel/viscosityModel.C viscosityModels/viscosityModel/viscosityModelNew.C viscosityModels/Newtonian/Newtonian.C viscosityModels/powerLaw/powerLaw.C viscosityModels/rheoLaw/rheoLaw.C viscosityModels/CrossPowerLaw/CrossPowerLaw.C viscosityModels/BirdCarreau/BirdCarreau.C viscosityModels/HerschelBulkley/HerschelBulkley.C transportModel/transportModel.C singlePhaseTransportModel/singlePhaseTransportModel.C myIncompressibleTwoPhaseMixture/myIncompressibleTwoPhaseMixture.C LIB = $(FOAM_USER_LIBBIN)/libmyIncompressibleTransportModels |
|
May 29, 2015, 09:11 |
|
#8 |
Senior Member
Saideep
Join Date: Apr 2015
Location: INDIA
Posts: 203
Rep Power: 12 |
Hi all!
I was actually interested to know what does rhoPhi in interFOAM solver's alphaEqn.H mean and where is it really used. I know this is an old post but just to share my little knowledge regarding this, any corrections are welcome; surfaceScalarField phic(mixture.cAlpha()*mag(phi/mesh.magSf())); /*indicates the velocity at the cell face*/ phic is the relative velocity taken as min(cAlpha*phic, max(phic)) phir is the corrected relative velocity at face : by multiplying with the nHat(). Then the for loop states: flux calculated from the mean velocity (U)*alpha. (second term in the advective transport of interface function.) + flux calculated for the artificial compression term. (U_r*(1-alpha)*alpha). and the nCorrAlpha is just a term to get more precise information regarding your advective transport of the interface. Saideep |
|
June 2, 2015, 10:33 |
|
#9 |
Member
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14 |
dear friend,
this is not an old post, I'm still suffering looking for the problem. so rhoPhi as i answered you in another post is used in UEqn |
|
June 8, 2015, 07:16 |
|
#10 |
Senior Member
|
Dear All,
I have a query regarding "rhoPhi" term in the interFoam solver v.2.1.. If you look at the "createField.H" file you will find that, the term is written as: Code:
surfaceScalarField rhoPhi ( IOobject ( "rho*phi", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), rho1*phi ); Code:
rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2; - Thanks in Advance! |
|
June 8, 2015, 07:21 |
|
#11 |
Member
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14 |
Hello
Based on my basic knowledge (not sure) this is just an initiation (declare of dimensions). the value of rhoPhi that will be used in the solver will be the one defined in the alphaEqn.H the difficulty is that alpha is not accessible from the solver itself ( you can not interpolate alpha from the cell centers to the faces) since the function interpolate is overloaded and will return a value of 1 if you interpolate alpha thus when needing to define the full formula for rhoPhi in createfield you will have this problem of unavailability |
|
June 13, 2015, 02:56 |
|
#13 |
Senior Member
|
Hi all,
I hope the following post might be useful: http://www.cfd-online.com/Forums/ope...tml#post550201 - |
|
October 14, 2015, 05:12 |
|
#14 |
Member
David GISEN
Join Date: Jul 2009
Location: Germany
Posts: 70
Rep Power: 17 |
Thank you so much kebsiali for sharing your code above:
it helped me to find a missing library entry I was searching for hours! For future reference: Code:
undefined reference to `Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&)' Code:
EXE_LIBS = \ -L$(FOAM_LIBBIN) \ -lOpenFOAM \ -lfiniteVolume \ -lfvOptions |
|
March 10, 2017, 01:18 |
OpenFOAM-3.0.1 (interFoam solver) adding energy equation
|
#15 |
New Member
Sarath Raj
Join Date: Nov 2016
Posts: 3
Rep Power: 10 |
Friends,
For adding energy equation using OpenFOAM 3.0.1 I followed the steps mentioned in the pdf (pdf is available in the below mentioned link)..but doing all the editing process and compiling process the following error is showing.Pls help me email id:- srsnit2013@gmail.com http://www.tfd.chalmers.se/~hani/kur...gLIU-final.pdf dmee16241@cfd17:..OpenFOAM-Old/sarathraj-3.0.1$ cd applications/ dmee16241@cfd17:..sarathraj-3.0.1/applications$ cd myTempinterFoam/ dmee16241@cfd17:..applications/myTempinterFoam$ wclean dmee16241@cfd17:..applications/myTempinterFoam$ wmake Making dependency list for source file myTempinterFoam.C g++ -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 -I/home/dmee16241/OpenFOAM/OpenFOAM-3.0.1/src/transportModels/twoPhaseMixture/lnInclude -I/home/dmee16241/OpenFOAM/OpenFOAM-3.0.1/src/transportModels -I/home/dmee16241/OpenFOAM/dmee16241-3.0.1/src/transportModels/incompressible/lnInclude -I/home/dmee16241/OpenFOAM/OpenFOAM-3.0.1/src/transportModels/incompressible/lnInclude -I/home/dmee16241/OpenFOAM/OpenFOAM-3.0.1/src/transportModels/interfaceProperties/lnInclude -I/home/dmee16241/OpenFOAM/OpenFOAM-3.0.1/src/TurbulenceModels/turbulenceModels/lnInclude -I/home/dmee16241/OpenFOAM/OpenFOAM-3.0.1/src/TurbulenceModels/incompressible/lnInclude -I/home/dmee16241/OpenFOAM/OpenFOAM-3.0.1/src/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude -I/home/dmee16241/OpenFOAM/OpenFOAM-3.0.1/src/finiteVolume/lnInclude -I/home/dmee16241/OpenFOAM/OpenFOAM-3.0.1/src/fvOptions/lnInclude -I/home/dmee16241/OpenFOAM/OpenFOAM-3.0.1/src/meshTools/lnInclude -I/home/dmee16241/OpenFOAM/OpenFOAM-3.0.1/src/sampling/lnInclude -IlnInclude -I. -I/home/dmee16241/OpenFOAM/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude -I/home/dmee16241/OpenFOAM/OpenFOAM-3.0.1/src/OSspecific/POSIX/lnInclude -fPIC -c myTempinterFoam.C -o Make/linux64GccDPInt32Opt/myTempinterFoam.o In file included from myTempinterFoam.C:68:0: createFields.H: In function ‘int main(int, char**)’: createFields.H:62:41: error: ‘class Foam::immiscibleIncompressibleTwoPhaseMixture’ has no member named ‘cp1’ const dimensionedScalar& cp1 = mixture.cp1(); ^ createFields.H:63:42: error: ‘class Foam::immiscibleIncompressibleTwoPhaseMixture’ has no member named ‘cp2’ const dimensionedScalar& cp2 = mixture .cp2(); ^ In file included from myTempinterFoam.C:125:0: TEqn.H:1:37: error: ‘class Foam::immiscibleIncompressibleTwoPhaseMixture’ has no member named ‘kappaf’ surfaceScalarField kappaf = mixture.kappaf(); ^ /home/dmee16241/OpenFOAM/OpenFOAM-3.0.1/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/myTempinterFoam.o' failed make: *** [Make/linux64GccDPInt32Opt/myTempinterFoam.o] Error 1 |
|
March 10, 2017, 09:00 |
|
#16 |
New Member
Hasan Shetabivash
Join Date: Jan 2017
Location: Montreal
Posts: 17
Rep Power: 12 |
Dear Aadithya.
It seems that you've not implemented the energy equation correctly. As I can understand from the errors you're using immiscibleIncompressibleTwoPhaseMixture which is inherited from incompressibleTwoPhaseMixture and interfaceProperties where kappaf, cp1, and cp2 are not defined. One of your options is defining another class (e. g. immiscibleIncompressibleNewTwoPhaseMixture ) instead of immiscibleIncompressibleTwoPhaseMixture which inherits from the newly implemented two phase mixture (e. g. incompressibleNewTwoPhaseMixture ). In case you couldn't resolve the problem you can post your code so that I can tell you more details. Cheers, |
|
March 15, 2017, 01:42 |
|
#17 |
New Member
Sarath Raj
Join Date: Nov 2016
Posts: 3
Rep Power: 10 |
Sir,
I have followed the steps as such mentioned in the pdf given in this link http://www.tfd.chalmers.se/~hani/kur...gLIU-final.pdf.. Sir can i have your mail id??? |
|
July 19, 2022, 05:07 |
|
#18 | |
Member
sadra mahmoudi
Join Date: Feb 2021
Location: Austria
Posts: 39
Rep Power: 5 |
Dear Hasan Shetabivash,
I would have a question about the same topic. I would be appreciative if you help me. Its really important for my PhD. I am simulating a bubbly flow in a solution of water and sugar. Sugar is dissolved in water and it is a passive scalar in my simulations. I would like to make the density of liquid as a function of sugar concentration (C). I have done it but the results are not correct. I would like to ask whether I need to change rho1 to rho1(C) in the immiscibleIncompressibleTwoPhaseMixture or not? In the current version of my solver, I introduced the rho1(C) in the time loop of my solver which is after the #include immiscibleIncompressibleTwoPhaseMixture in the main body of the solver. Best regrds, Sadra Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
rho Constructor interFoam for creating a varying rho field | kebsiali | OpenFOAM Programming & Development | 4 | April 16, 2016 21:28 |
pisoFoam with k-epsilon turb blows up - Some questions | Heroic | OpenFOAM Running, Solving & CFD | 26 | December 17, 2012 04:34 |
emag beta feature: charge density | charlotte | CFX | 4 | March 22, 2011 10:14 |
error in COMSOL:'ERROR:6164 Duplicate Variable' | bhushas | COMSOL | 1 | May 30, 2008 05:35 |
Replace periodic by inlet-outlet pair | lego | CFX | 3 | November 5, 2002 21:09 |