CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

TwoLiquidMixingFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 12, 2010, 13:31
Default
  #21
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
This one should work and run.
Attached Files
File Type: gz twoStream.tar.gz (3.1 KB, 252 views)
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   July 12, 2010, 22:01
Default
  #22
Member
 
Maolong LIU
Join Date: Apr 2010
Location: USA
Posts: 31
Rep Power: 15
maolongliu is on a distinguished road
This is the p_rgh file now I use
//================================================== ==============
FoamFile
{
version 2.0;
format ascii;

root "";
case "";
instance "";
local "";

class volScalarField;
object p_rgh;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


dimensions [1 -1 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
bottomInlet
{
type zeroGradient;
}
topInlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
pipe
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
}


// ************************************************** *********************** //

Take care of the object name is "p_rgh", not "p", and also the dimension is different to simpleFoam.

Quote:
Originally Posted by vrosaless View Post
Hello

Can you explain more on how to fix the error "p_rgh at line 0"

I get the same error for a case to run a wave Tank. I downloaded the file twoStream.tar.gz and but I got an error like the file is corrupted

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Exiting with failure status due to previous errors
vrosaless@ubuntu:~/Downloads$ gunzip twoStream.tar.g

Any help is wellcome

Thanks

Victor
maolongliu is offline   Reply With Quote

Old   July 13, 2010, 10:33
Default p_rgh
  #23
New Member
 
victor
Join Date: Jul 2010
Posts: 5
Rep Power: 15
vrosaless is on a distinguished road
The last file it´s OK.

I' m actually using p_rgh for a wave tank in interFoam. I used your case to update the wave tank files where I found the p_rgh missing.

Thanks for your help

Victor
vrosaless is offline   Reply With Quote

Old   August 2, 2010, 11:01
Default
  #24
New Member
 
Join Date: Jul 2010
Posts: 11
Rep Power: 15
phinallydone is on a distinguished road
Hi, I'm also having the same problem trying to extract "twoStream.tar.gz". Would someone be willing to post a working version for v1.7 or as Victor requested provide some additional detail on how to fix the error "p_rgh at line 0"?

Thanks in advance!
phinallydone is offline   Reply With Quote

Old   August 2, 2010, 11:06
Default
  #25
Member
 
Maolong LIU
Join Date: Apr 2010
Location: USA
Posts: 31
Rep Power: 15
maolongliu is on a distinguished road
Try this
//================================================== ==============
FoamFile
{
version 2.0;
format ascii;

root "";
case "";
instance "";
local "";

class volScalarField;
object p_rgh;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


dimensions [1 -1 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
bottomInlet
{
type zeroGradient;
}
topInlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
pipe
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
}

Quote:
Originally Posted by phinallydone View Post
Hi, I'm also having the same problem trying to extract "twoStream.tar.gz". Would someone be willing to post a working version for v1.7 or as Victor requested provide some additional detail on how to fix the error "p_rgh at line 0"?

Thanks in advance!
maolongliu is offline   Reply With Quote

Old   August 2, 2010, 20:53
Default
  #26
New Member
 
Join Date: Jul 2010
Posts: 11
Rep Power: 15
phinallydone is on a distinguished road
Thanks Maolong LIU!

When I use the your suggestion I get the following

=======================
DILUPBiCG: Solving for alpha1, Initial residual = 0.00755434, Final residual = 2.4898e-08, No Iterations 2
Phase 1 volume fraction = 0.501191 Min(alpha1) = 0 Max(alpha1) = 1
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 2.74871e-12, No Iterations 3
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 9.82467e-12, No Iterations 3


--> FOAM FATAL IO ERROR:
keyword p_rgh is undefined in dictionary "/home/hunts/Desktop/twoStream/system/fvSolution::solvers"

file: /home/hunts/Desktop/twoStream/system/fvSolution::solvers from line 22 to line 73.

From function dictionary::subDict(const word& keyword) const
in file db/dictionary/dictionary.C at line 456.

FOAM exiting
=======================

Any ideas? My apologies. I'm relatively new to OpenFOAM.

Thanks
phinallydone is offline   Reply With Quote

Old   August 2, 2010, 21:14
Default
  #27
Member
 
Maolong LIU
Join Date: Apr 2010
Location: USA
Posts: 31
Rep Power: 15
maolongliu is on a distinguished road
In the fvSoluction file, and also fvSchems file, because now you solve p_rgh equation in stead of p equation, so you need change p to p_rgh.
So just change all the word "p" to "p_rgh" in both those files.

Quote:
Originally Posted by phinallydone View Post
Thanks Maolong LIU!

When I use the your suggestion I get the following

=======================
DILUPBiCG: Solving for alpha1, Initial residual = 0.00755434, Final residual = 2.4898e-08, No Iterations 2
Phase 1 volume fraction = 0.501191 Min(alpha1) = 0 Max(alpha1) = 1
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 2.74871e-12, No Iterations 3
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 9.82467e-12, No Iterations 3


--> FOAM FATAL IO ERROR:
keyword p_rgh is undefined in dictionary "/home/hunts/Desktop/twoStream/system/fvSolution::solvers"

file: /home/hunts/Desktop/twoStream/system/fvSolution::solvers from line 22 to line 73.

From function dictionary::subDict(const word& keyword) const
in file db/dictionary/dictionary.C at line 456.

FOAM exiting
=======================

Any ideas? My apologies. I'm relatively new to OpenFOAM.

Thanks
maolongliu is offline   Reply With Quote

Old   August 2, 2010, 21:20
Default
  #28
Member
 
Maolong LIU
Join Date: Apr 2010
Location: USA
Posts: 31
Rep Power: 15
maolongliu is on a distinguished road
This is my fvSolution file

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{

p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-8;
relTol 0;
}
p_rghFinal
{
solver PCG;
preconditioner DIC;
tolerance 1e-8;
relTol 0;
}

alpha1
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0;
}

U
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-08;
relTol 0;
}

UFinal
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-08;
relTol 0;
}
}


PIMPLE
{
nOuterCorrectors 2;
nCorrectors 2;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}

Quote:
Originally Posted by phinallydone View Post
Thanks Maolong LIU!

When I use the your suggestion I get the following

=======================
DILUPBiCG: Solving for alpha1, Initial residual = 0.00755434, Final residual = 2.4898e-08, No Iterations 2
Phase 1 volume fraction = 0.501191 Min(alpha1) = 0 Max(alpha1) = 1
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 2.74871e-12, No Iterations 3
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 9.82467e-12, No Iterations 3


--> FOAM FATAL IO ERROR:
keyword p_rgh is undefined in dictionary "/home/hunts/Desktop/twoStream/system/fvSolution::solvers"

file: /home/hunts/Desktop/twoStream/system/fvSolution::solvers from line 22 to line 73.

From function dictionary::subDict(const word& keyword) const
in file db/dictionary/dictionary.C at line 456.

FOAM exiting
=======================

Any ideas? My apologies. I'm relatively new to OpenFOAM.

Thanks
maolongliu is offline   Reply With Quote

Old   August 3, 2010, 01:09
Default
  #29
New Member
 
Join Date: Jul 2010
Posts: 11
Rep Power: 15
phinallydone is on a distinguished road
Thank you!
phinallydone is offline   Reply With Quote

Old   December 10, 2010, 11:51
Default
  #30
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
what does alphatab stand for ?
balkrishna is offline   Reply With Quote

Old   January 10, 2011, 12:15
Default
  #31
New Member
 
mehdoo
Join Date: Dec 2010
Posts: 3
Rep Power: 15
mehdoo is on a distinguished road
Quote:
Originally Posted by alberto View Post
This one should work and run.
I am looking for folder 0.org for this solver. Does anyone have it ?
please help me with this
Regards
mehdoo is offline   Reply With Quote

Old   January 10, 2011, 12:44
Default
  #32
Senior Member
 
Mieszko Młody
Join Date: Mar 2009
Location: POLAND, USA
Posts: 145
Rep Power: 17
ziemowitzima is on a distinguished road
0.zip
here you have.
ziemowitzima is offline   Reply With Quote

Old   January 25, 2011, 06:46
Default
  #33
Member
 
Join Date: Mar 2009
Posts: 36
Rep Power: 17
Amiga500 is on a distinguished road
Quote:
Originally Posted by balkrishna View Post
what does alphatab stand for ?
+1?


Dab is the diffusivity, as would be calculated using Chapman-Enskog for 2 gases...


Is alphatab some kind of multiplier on that?
Amiga500 is offline   Reply With Quote

Old   January 25, 2011, 07:34
Default
  #34
Member
 
Maolong LIU
Join Date: Apr 2010
Location: USA
Posts: 31
Rep Power: 15
maolongliu is on a distinguished road
alphatab = 1/Sct (the turbulent Schmidt number)

Quote:
Originally Posted by Amiga500 View Post
+1?


Dab is the diffusivity, as would be calculated using Chapman-Enskog for 2 gases...


Is alphatab some kind of multiplier on that?
maolongliu is offline   Reply With Quote

Old   January 25, 2011, 07:36
Default
  #35
Member
 
Join Date: Mar 2009
Posts: 36
Rep Power: 17
Amiga500 is on a distinguished road
Quote:
Originally Posted by maolongliu View Post
alphatab = 1/Sct (the turbulent Schmidt number)
Ah. Thank you.
Amiga500 is offline   Reply With Quote

Old   January 25, 2011, 09:57
Default
  #36
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
FYI, it is written in the code (createFields.H)

Code:
// Read the reciprocal of the turbulent Schmidt number
    dimensionedScalar alphatab(twoPhaseProperties.lookup("alphatab"));
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   July 8, 2011, 04:49
Default
  #37
New Member
 
Tanay Deshpande
Join Date: Aug 2010
Posts: 20
Rep Power: 15
Tanay is on a distinguished road
I'm trying to write a separate case for using twoLiquidMixingFoam in a customized form. First, I removed the variables 'p' and 'g' and 'gh' and instead operated everything in 'p_rgh'. Next, I removed 'alphatab' and now the diffusivity works solely on Dab.

In pEqn.H
{
volScalarField rAU = 1.0/UEqn.A();
surfaceScalarField rAUf = fvc::interpolate(rAU);

U = rAU*UEqn.H();
surfaceScalarField phiU
(
"phiU",
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
);

adjustPhi(phiU, U, p_rgh);

phi = phiU ;//- ghf*fvc::snGrad(rho)*rAUf*mesh.magSf()

for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix p_rghEqn
(
fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
);

p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));

p_rghEqn.solve
(
mesh.solver
(
p_rgh.select
(
finalIter
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
);

if (nonOrth == nNonOrthCorr)
{
phi -= p_rghEqn.flux();
}
}


U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
U.correctBoundaryConditions();

#include "continuityErrs.H"


The problem is in the line-
fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)

And the output reads-

--> FOAM FATAL IO ERROR:
keyword laplacian(interpolate((1|A(U))),p_rgh) is undefined in dictionary "/home/tanay/OpenFOAM/tanay-1.7.1/run/roughMix/system/fvSchemes::laplacianSchemes"

file: /home/tanay/OpenFOAM/tanay-1.7.1/run/roughMix/system/fvSchemes::laplacianSchemes from line 54 to line 63.

So, I tried adding this line to fvSchemes but it didn't work. Any suggestions on what's missing in fvSchemes?

Here's the fvSchemes file if anyone wishes to view it-
ddtSchemes
{
default Euler;
}

gradSchemes
{
default Gauss linear;
grad(U) Gauss linear;
grad(muEff) Gauss linear;
grad(p_rgh) Gauss linear;
}

snGradSchemes
{
default corrected;
}

divSchemes
{
default none;
div(phi,U) Gauss limitedLinearV 1;
div(phi,k) Gauss limitedLinear 1;
div(phi,epsilon) Gauss limitedLinear 1;
div(phi,R) Gauss limitedLinear 1;
div(R) Gauss linear;
div(phi,nuTilda) Gauss limitedLinear 1;
div((nuEff*dev(grad(U).T()))) Gauss linear;
div(phi,alpha1) Gauss limitedLinear 1;
div(phi) Gauss limitedLinear 1;
div(rhoPhi,U) Gauss limitedLinear 1;
div(rho*phi,U) Gauss limitedLinear 1;
}

laplacianSchemes
{
default none;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p_rgh) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
laplacian(DREff,R) Gauss linear corrected;
laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
laplacian(Dab,alpha1) Gauss linear corrected;
laplacian(rAUf,p_rgh) Gauss linear corrected;
laplacian(muEff,U) Gauss linear corrected;
}

interpolationSchemes
{
default linear;
interpolate(U) linear;
}

fluxRequired
{
default no;
p_rgh ;
alpha1 yes;
}
Tanay is offline   Reply With Quote

Old   July 10, 2011, 12:03
Default
  #38
Senior Member
 
Mieszko Młody
Join Date: Mar 2009
Location: POLAND, USA
Posts: 145
Rep Power: 17
ziemowitzima is on a distinguished road
Hi Tanay,

I think that you can have a problem with an extra "bracket". An error says:
laplacian(interpolate((1|A(U))),p_rgh)
so here u have : ...U))) -- triple closing )

but in your
laplacianSchemes you have :
....
laplacian((1|A(U)),p_rgh) Gauss linear corrected;
....

and: A(U)) double closing )

so it seems that you have some typo in your code.

Cheers
ZMM
ziemowitzima is offline   Reply With Quote

Old   July 11, 2011, 02:14
Default
  #39
New Member
 
Tanay Deshpande
Join Date: Aug 2010
Posts: 20
Rep Power: 15
Tanay is on a distinguished road
Yeah, thanks. That was a simple typo. Now, I'm getting a Courant number blow-up.

Courant Number mean: 21.0277 max: 258.938
deltaT = 3.37996e-06
Time = 0.0145817

#0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/opt/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::PBiCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so"
#4 Foam::GAMGSolver::solveCoarsestLevel(Foam::Field<d ouble>&, Foam::Field<double> const&) const in "/opt/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so"
#5 Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMa trix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const in "/opt/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so"
#6 Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/openfoam171/lib/linuxGccDPOpt/libOpenFOAM.so"
#7 Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/opt/openfoam171/lib/linuxGccDPOpt/libfiniteVolume.so"
#8
in "/home/tanay/OpenFOAM/tanay-1.7.1/applications/bin/linuxGccDPOpt/customizedTwoLiquidMixingFoam"
#9 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#10
in "/home/tanay/OpenFOAM/tanay-1.7.1/applications/bin/linuxGccDPOpt/customizedTwoLiquidMixingFoam"
Floating point exception

Lowering the time step just prolongs the blow-up. All the fvSchemes (printed above) I've used correspond to a pimpleFoam tutorial and so they can't be too problematic. Where may be the error?
Tanay is offline   Reply With Quote

Old   July 15, 2011, 02:01
Default
  #40
New Member
 
Tanay Deshpande
Join Date: Aug 2010
Posts: 20
Rep Power: 15
Tanay is on a distinguished road
Well, ziemowit, I've given up trying to make the blowing up case converge since I tried everything from reducing the time step to decreasing the velocity and increasing laminar viscosity etc. So, now I'm trying to build a new solver based on PIMPLE to simulate twoLiquidMixing. In this, I've included a file called customTwoLiquid.H for laminar mixing. It reads as-

surfaceScalarField muEff ("muEff", (alpha1*mu1 + (scalar(1)-alpha1)*mu2));
volScalarField rho ("rho", (alpha1*rho1 + (scalar(1)-alpha1)*rho2));
surfaceScalarField rhoIntoPhi ("rhoIntoPhi", rho*phi);

Now this produces a compilation error. Can you please tell me what's wrong?
Tanay is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 05:09.