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

viscoelastic flow with free surface

Register Blogs Community New Posts Updated Threads Search

Like Tree25Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 24, 2015, 04:09
Default
  #21
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Quote:
Originally Posted by arash.heidarian View Post
thanks Mr mahmoudi it was really helpfull....
Dear Arash,

Did the solver work for you successfully?
I have some problem with compiling the both solver and the two phase mixture model.

Regards,
Mostafa
Mahmoud_aboukhedr likes this.
adambarfi is offline   Reply With Quote

Old   May 11, 2015, 01:18
Default
  #22
New Member
 
Sasa Goran
Join Date: Feb 2015
Location: Japan
Posts: 23
Rep Power: 11
Supersale is on a distinguished road
Thanks vigges, i am trying to make the solver work for this case file http://sourceforge.net/projects/viscoelasticof/
mr Favero (I think) and Jasak had a paper with this model. I'll keep you guys updated on results and what to do.
Thanks adambarfi for the input, i had no idea what dimensions to use. Do you have any definition of the "parameters for solvent shear-thinning viscosity"? (mu0 muInf...) I am grinding literature about this now but it's rather hard to look for dimensions lile 'a' and 'b'

Last edited by Supersale; May 11, 2015 at 04:24.
Supersale is offline   Reply With Quote

Old   May 11, 2015, 07:41
Default
  #23
New Member
 
heidi
Join Date: Mar 2015
Posts: 6
Rep Power: 11
wendy987 is on a distinguished road
hi SuperScale
can you share your files of system with me, for example , fvSchemes, fvSolution?
wendy987 is offline   Reply With Quote

Old   May 11, 2015, 22:09
Default
  #24
New Member
 
Sasa Goran
Join Date: Feb 2015
Location: Japan
Posts: 23
Rep Power: 11
Supersale is on a distinguished road
Quote:
Originally Posted by wendy987 View Post
hi SuperScale
can you share your files of system with me, for example , fvSchemes, fvSolution?
I can, but keep in mind i'm still working on it. It is far from the ideal setup but I do get some kind of results with it...

Anyway, here it is...

fvSchemes:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.1                                   |
|   \\  /    A nd           | Web:      http://www.openfoam.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version         2.0;
    format          ascii;

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

    class           dictionary;
    object          fvSchemes;
}

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

ddtSchemes
{
    default Euler;
}

gradSchemes
{
    default         Gauss linear;
    grad(U)         Gauss linear;
    //grad(gamma)     Gauss linear; // - in the original. old naming for alpha
    grad(alpha)     Gauss linear;
}

divSchemes
{
    div(rho*phi,U)           Gauss limitedLinearV 1;
    div(phi,alpha)           Gauss vanLeer;
    div(phirb,alpha)      Gauss linear;
    div(phi,taufirst)        Gauss upwind;
    div(phi,tau)             Gauss upwind;
    div(tau)                 Gauss linear;
}

laplacianSchemes
{
    default                    Gauss linear corrected;
    laplacian(etaPEff,U)       Gauss linear corrected;
    laplacian(etaPEff+etaS,U)  Gauss linear corrected;
    laplacian((1|A(U)),p)      Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

fluxRequired
{
    default         no;
    p_rgh;
    pcorr;
    alpha;
}


// ************************************************************************* //
Mahmoud_aboukhedr likes this.
Supersale is offline   Reply With Quote

Old   May 11, 2015, 22:13
Default
  #25
New Member
 
Sasa Goran
Join Date: Feb 2015
Location: Japan
Posts: 23
Rep Power: 11
Supersale is on a distinguished road
sorry, i'll post the rest later today...
Supersale is offline   Reply With Quote

Old   May 12, 2015, 04:10
Default
  #26
New Member
 
Sasa Goran
Join Date: Feb 2015
Location: Japan
Posts: 23
Rep Power: 11
Supersale is on a distinguished road
adambarfi, may i ask you why you defined CrossPowerLaw and the BirdCarreau thing? i can't find it in the solver and it is not asked when i run the simulation without it
Supersale is offline   Reply With Quote

Old   May 12, 2015, 11:51
Default
  #27
New Member
 
Sasa Goran
Join Date: Feb 2015
Location: Japan
Posts: 23
Rep Power: 11
Supersale is on a distinguished road
fvSolution:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.1                                   |
|   \\  /    A nd           | Web:      http://www.openfoam.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version         2.0;
    format          ascii;

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

    class           dictionary;
    object          fvSolution;
}

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

solvers
{
           
pcorr
    {
        solver          PCG;
        preconditioner
        {
            preconditioner  DIC;

            tolerance       1e-13;
            relTol          0;
            smoother        DICGaussSeidel;
            nPreSweeps      2;
            nPostSweeps     2;
            nFinestSweeps   2;
            cacheAgglomeration false;
            nCellsInCoarsestLevel 10;
            agglomerator    faceAreaPair;
            mergeLevels     1;
        }
        tolerance       1e-10;
        relTol          0;
        maxIter         1000;
    }

p_rgh
    {
        solver          GAMG;
        tolerance       1e-13;
        relTol          0.01;
        smoother        DIC;
        nPreSweeps      2;
        nPostSweeps     2;
        nFinestSweeps   2;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator    faceAreaPair;
        mergeLevels     1;
    }

p_rghFinal
    {
        solver          PCG;
        preconditioner
        {
            preconditioner  DIC;

            tolerance       1e-13;
            relTol          0;
            nVcycles        2;
            smoother        DICGaussSeidel;
            nPreSweeps      2;
            nPostSweeps     2;
            nFinestSweeps   2;
            cacheAgglomeration true;
            nCellsInCoarsestLevel 10;
            agglomerator    faceAreaPair;
            mergeLevels     1;
        }
        tolerance       1e-13;
        relTol          0;
        maxIter         20;
    }

    U PBiCG
    {
        preconditioner
        {
            type         DILU;
        }

        minIter          0;
        maxIter          1000;
        tolerance        1e-08;
        relTol           0;
    };
    taufirst PBiCG
    {
        preconditioner
        {
            type          Cholesky;
        }

        minIter           0;
        maxIter           1000;
        tolerance         1e-8;
        relTol            0.0;

    };
    tau PBiCG
    {
        solver          PBiCG;
        preconditioner
        {
            preconditioner  DILU;

            tolerance       1e-13;
            relTol          0;
            nVcycles        2;
            smoother        DICGaussSeidel;
            nPreSweeps      2;
            nPostSweeps     2;
            nFinestSweeps   2;
            cacheAgglomeration true;
            nCellsInCoarsestLevel 10;
            agglomerator    faceAreaPair;
            mergeLevels     1;
        }
        tolerance       1e-13;
        relTol          0;
        maxIter         20;
    };

    alphaphase1
    {
        nAlphaCorr      1;
        nAlphaSubCycles 1;
        cAlpha          1;
    };

}

PIMPLE
{
    momentumPredictor no;
    nCorrectors     3;
    nNonOrthogonalCorrectors 1;
    nAlphaCorr      1;
    nAlphaSubCycles 4;
    cAlpha          2;

    pdRefCell        0;
    pdRefValue       0.0;
}


relaxationFactors
{
//    p               0.97;
//    U               0.9;
//    taufirst        0.3;
}

// ************************************************************************* //
setFieldsDict:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.1                                   |
|   \\  /    A nd           | Web:      http://www.openfoam.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version         2.0;
    format          ascii;

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

    class           dictionary;
    object          setFieldsDict;
}

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

defaultFieldValues
(
//    volScalarFieldValue gamma 0
    volScalarFieldValue alpha.phase1 0
//    volVectorFieldValue U (0 0 0)
    volSymmTensorFieldValue taufirst (0 0 0 0 0 0)
);

regions
(
    boxToCell
    {
    box (-1 0.015 -1) (1 1 1);
   
    fieldValues
    (
//        volScalarFieldValue gamma 1
        volScalarFieldValue alpha.phase1 1
    );
    }
);

// ************************************************************************* //
controlDict:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.4                                   |
|   \\  /    A nd           | Web:      http://www.openfoam.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version         2.0;
    format          ascii;

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

    class           dictionary;
    object          controlDict;
}

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

application viscoelasticInterFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         10;

deltaT          1e-8;

writeControl    adjustableRunTime;

writeInterval   0.01;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression uncompressed;

timeFormat      general;

timePrecision   6;

runTimeModifiable yes;

adjustTimeStep  yes;

maxCo           0.01;
maxAlphaCo      0.2;

maxDeltaT       0.01;



// ************************************************************************* //
i am running now a different setup since Favero's paper suggested some solvers and preconditioners. Gonna try those and give some feedback.
Mahmoud_aboukhedr likes this.
Supersale is offline   Reply With Quote

Old   May 14, 2015, 04:48
Default
  #28
New Member
 
Sasa Goran
Join Date: Feb 2015
Location: Japan
Posts: 23
Rep Power: 11
Supersale is on a distinguished road
OK i think i figured out what these parameters are (mu0, muInf...)
It's to model the shear-thinning behaviour, and the equation can be found in viscoelasticTwoPhaseMixture.C at the top. The equation is:

Code:
if (viscosityType_ == "ShearThinning")
    {
        volScalarField shearRate_ = sqrt(2.0)*mag(symm(fvc::grad(U_)));
        volScalarField etaL_      = muInf_ + 
                                    (
                                        (mu0_ - muInf_)
                                        /
                                        pow((scalar(1) + pow((k_*shearRate_),b_)),a_)
                                    );
        
        etaS_ = limitedAlpha1_*etaL_ + (scalar(1) - limitedAlpha1_)*etaS2_;
    }
now this is either the Cross model or the Carreau model. The Cross model looks like:

(eta - eta_inf) / (eta_0 - eta_inf) = 1 / (1 + (K * kappa) ^ m)

while the Carreau model looks like:

(eta - eta_inf) / (eta_0 - eta_inf) = 1 / (1 + (K * kappa) ^ 2) ^ m/2

now;
etaL is eta
mu0 is eta_0 [Pa.s]
muInf is eta_inf [Pa.s]
k is K (a constant with the dimensions of time) [s]
kappa is the shear-rate
m is a dimensionless constant

Regarding 'a' and 'b', depending on the model used, 'a' is either m/2 or 1 and 'b' is either 2 or m.

I also found some values for it. For polyarylamide: eta_0=1.82Pa.s, eta_inf=2.6mPa.s, K=1.5s and m=0.6.

I copied the Giesekus model into viscoelasticTwoPhaseMixture.C from the extend version, recompiled it and running it now. if it works i'll upload the case file and solver.

Anyone has more info about 'a' and 'b'?

i kept the transport model 'Newtonian'
Supersale is offline   Reply With Quote

Old   May 17, 2015, 05:51
Default
  #29
New Member
 
arash
Join Date: Jan 2015
Posts: 14
Rep Power: 11
arash.heidarian is on a distinguished road
Does any one have a test case for this solver?
arash.heidarian is offline   Reply With Quote

Old   May 17, 2015, 09:20
Default
  #30
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
the case I ran it just one time is attached.
hope it helps you all viscoelastic FOAMers

Regsrds,
Mostafa
Attached Files
File Type: zip case.zip (10.7 KB, 87 views)
adambarfi is offline   Reply With Quote

Old   May 18, 2015, 15:37
Default
  #31
New Member
 
arash
Join Date: Jan 2015
Posts: 14
Rep Power: 11
arash.heidarian is on a distinguished road
Reading g
Calculating field g.h

time step continuity errors : sum local = 0, global = 0, cumulative = 0
DICPCG: Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0, global = 0, cumulative = 0
Courant Number mean: 0 max: 0

Starting time loop

Courant Number mean: 0 max: 0
Interface Courant Number mean: 0 max: 0
deltaT = 1.19048e-05
Time = 1.19048e-05

MULES: Solving for alphawater
Phase-1 volume fraction = 0.825498 Min(alpha1) = 0 Max(alpha1) = 1
MULES: Solving for alphawater
Phase-1 volume fraction = 0.825498 Min(alpha1) = 0 Max(alpha1) = 1


--> FOAM FATAL ERROR:
updateCoeffs(const scalarField& snGradp) MUST be called before updateCoeffs() or evaluate() to set the boundary gradient.

From function fixedFluxPressureFvPatchScalarField::updateCoeffs( )
in file fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C at line 151.

FOAM exiting




I have this error when i run the solver
can any one help?
arash.heidarian is offline   Reply With Quote

Old   May 18, 2015, 15:41
Default
  #32
New Member
 
arash
Join Date: Jan 2015
Posts: 14
Rep Power: 11
arash.heidarian is on a distinguished road
Quote:
Originally Posted by adambarfi View Post
the case I ran it just one time is attached.
hope it helps you all viscoelastic FOAMers

Regsrds,
Mostafa
Dear Mr mahmoudi.
thank you.It was helpful.
arash.heidarian is offline   Reply With Quote

Old   May 18, 2015, 16:05
Default
  #33
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Dear Arash,

Can you attach your solver, I think there're some problems with the solver.
adambarfi is offline   Reply With Quote

Old   May 19, 2015, 06:24
Default
  #34
New Member
 
arash
Join Date: Jan 2015
Posts: 14
Rep Power: 11
arash.heidarian is on a distinguished road
sure...
my solver is the solver which have been posted in previous posts by Mr Bruno santos...
sorry but I can't run your test case by this solver.
Thank you very much for your reply.
Attached Files
File Type: gz viscoelasticInterFoam.tar.gz (4.5 KB, 40 views)
File Type: gz viscoelasticTwoPhaseMixture.tar.gz (3.5 KB, 34 views)
arash.heidarian is offline   Reply With Quote

Old   May 21, 2015, 21:12
Default
  #35
New Member
 
Sasa Goran
Join Date: Feb 2015
Location: Japan
Posts: 23
Rep Power: 11
Supersale is on a distinguished road
OK, what i noticed while running this solver is that when I make use of the viscoelastic parameters (rho, etaS, etaP, lambda and aplha) i.e. i assign them a value that is bigger than 0, i have huge pressure fluctuations in the results. for example, i set p_rgh to be 1e5, and it shouldn't change much from that value, but when i check the results, in some time-steps the pressure range goes from -3e7 to 1e6 then from 2.48e5 to -1.2e5 (the same spots in the previous timesteps now have a different sign/foretoken). it fluctuates heavily. did anyone experience this in OpenFOAM before? Any solution recommended?
Supersale is offline   Reply With Quote

Old   May 28, 2015, 00:41
Default
  #36
New Member
 
Sasa Goran
Join Date: Feb 2015
Location: Japan
Posts: 23
Rep Power: 11
Supersale is on a distinguished road
adambarfi, the case file you uploaded is not correct. the boundary conditions in 0/ do not agree with the geometry and mesh (which is from the dam break case)
for example in U you have walls, axiss, tray, inlet, outlet and frontAndBackPlanes which you don't have in the boundary file.
also, may i ask you which version of openfoam you are using?
thanks
Supersale is offline   Reply With Quote

Old   May 28, 2015, 01:56
Default
  #37
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Quote:
Originally Posted by Supersale View Post
adambarfi, the case file you uploaded is not correct. the boundary conditions in 0/ do not agree with the geometry and mesh (which is from the dam break case)
for example in U you have walls, axiss, tray, inlet, outlet and frontAndBackPlanes which you don't have in the boundary file.
also, may i ask you which version of openfoam you are using?
thanks
Dear Sasa,

The mesh was compiled before and the geometry is not as the same as the dam break case. you can run whatever geometry you want. just you need to change the boundary conditions.
For example you can use the geometry and boundary conditions of dam break case.

Regards,
Mostafa
Supersale likes this.
adambarfi is offline   Reply With Quote

Old   May 31, 2015, 21:15
Default
  #38
New Member
 
Sasa Goran
Join Date: Feb 2015
Location: Japan
Posts: 23
Rep Power: 11
Supersale is on a distinguished road
ok, i did set it up and run it. works. it's ridiculous how much faster your case works than mine (the setup of fvSolusions and fvSchemes was very different) just shows how much more i need to learn about the program. Anyway, thank you again. i'll continue to work on this
Supersale is offline   Reply With Quote

Old   June 1, 2015, 00:47
Default
  #39
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 322
Rep Power: 15
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Quote:
Originally Posted by Supersale View Post
ok, i did set it up and run it. works. it's ridiculous how much faster your case works than mine (the setup of fvSolusions and fvSchemes was very different) just shows how much more i need to learn about the program. Anyway, thank you again. i'll continue to work on this
I'm happy my case was useful and helped you.

good luck,
Mostafa
adambarfi is offline   Reply With Quote

Old   June 1, 2015, 09:00
Default question
  #40
New Member
 
arash
Join Date: Jan 2015
Posts: 14
Rep Power: 11
arash.heidarian is on a distinguished road
Hi Mr Mahmoudi
which version of openfoam you have used for this test case?
and is your solver same as the solver which i have been attached in my last post?
arash.heidarian 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Free surface flow over a bump qtian OpenFOAM Running, Solving & CFD 17 August 10, 2010 10:15
Scaling up a wave energy converter - free surface flow mark_l CFX 3 February 17, 2010 16:57
free surface flow same as FSI??? Ken CFX 1 February 18, 2008 19:43
How to determine delta t for free surface flow phsieh2005 Main CFD Forum 0 September 14, 2005 11:52
incompressible free surface flow past cylinder vineet FLUENT 2 April 1, 2002 05:56


All times are GMT -4. The time now is 18:52.