Merge branch 'bugfix/UCMModel' Authoer: Miguel Nobrega etal. Merge: Hrvoje Jasak.

This commit is contained in:
Hrvoje Jasak 2017-02-10 14:24:57 +00:00
commit 4fad65ce7c
13 changed files with 598 additions and 9 deletions

View file

@ -60,13 +60,16 @@ Foam::UCM::UCM
), ),
rho_(dict.lookup("rho")), rho_(dict.lookup("rho")),
etaP_(dict.lookup("etaP")), etaP_(dict.lookup("etaP")),
lambda_(dict.lookup("lambda")) lambda_(dict.lookup("lambda")),
etaStab_(dimensionedScalar::lookupOrDefault("etaStab", dict, 0.0, dimMass/(dimLength*dimTime)))
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::fvVectorMatrix> Foam::UCM::divTau(volVectorField& U) const Foam::tmp<Foam::fvVectorMatrix> Foam::UCM::divTau(volVectorField& U) const
{
if(etaStab_.value() < SMALL)
{ {
dimensionedScalar etaPEff = etaP_; dimensionedScalar etaPEff = etaP_;
@ -77,6 +80,16 @@ Foam::tmp<Foam::fvVectorMatrix> Foam::UCM::divTau(volVectorField& U) const
+ fvm::laplacian( (etaPEff)/rho_, U, "laplacian(etaPEff+etaS,U)") + fvm::laplacian( (etaPEff)/rho_, U, "laplacian(etaPEff+etaS,U)")
); );
} }
else
{
return
(
fvc::div(tau_/rho_, "div(tau)")
- fvc::div((etaStab_/rho_)*fvc::grad(U), "div(tau)")
+ fvm::laplacian( (etaStab_)/rho_, U, "laplacian(etaPEff+etaS,U)")
);
}
}
void Foam::UCM::correct() void Foam::UCM::correct()

View file

@ -28,7 +28,8 @@ Description
UCM non linear viscoelastic fluid model (BIRD et al., 1987). UCM non linear viscoelastic fluid model (BIRD et al., 1987).
Author Author
Jovani L. Favero. All rights reserved Miguel Nóbrega, Silvino Araújo, Célio Fernandes, Luís Ferrás.
All rights reserved
SourceFiles SourceFiles
UCM.C UCM.C
@ -70,6 +71,9 @@ class UCM
//- Relaxation time //- Relaxation time
dimensionedScalar lambda_; dimensionedScalar lambda_;
//- Stabilization viscosity
dimensionedScalar etaStab_;
// Private Member Functions // Private Member Functions

View file

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (0.00125 0 0);
}
fixedWalls
{
type fixedValue;
value uniform (0 0 0);
}
outlet
{
type zeroGradient;
}
simetry
{
type symmetryPlane;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View file

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type zeroGradient;
}
fixedWalls
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 0;
}
simetry
{
type symmetryPlane;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View file

@ -0,0 +1,45 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volSymmTensorField;
object tau;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform (0 0 0 0 0 0);
boundaryField
{
inlet
{
type zeroGradient;
}
fixedWalls
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
simetry
{
type symmetryPlane;
}
frontAndBack
{
type empty;
}
}
// ************************************************************************* //

View file

@ -0,0 +1,6 @@
#!/bin/sh
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase

View file

@ -0,0 +1,10 @@
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get application name
application=`getApplication`
runApplication blockMesh
runApplication $application

View file

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
#
#+TITLE: UCM model stabilization
#+AUTHORS: Fernandes, C., De Araujo, M.S.B., Ferrás, L.L., Nóbrega, J.M.
This tutorial was prepared to illustrate the new stabilization approach for viscoelastic constitutive models proposed in:
Fernandes, C., De Araujo, M.S.B., Ferras, L.L., Nobrega, J.M.,
Improvements in the OpenFOAM numerical code for simulation of
steady-state differential viscoelastic flows, 11th OpenFOAM Workshop
Guimarães, Portugal, June 26 - 30, 2016
and
De Araujo, M.S.B., Ferras, L.L.,Fernandes, C.,Nobrega, J.M.,
Improvements ans assessment of the integral viscoelastic solver in OpenFOAM, 11th OpenFOAM Workshop
Guimarães, Portugal, June 26 - 30, 2016
It comprises 2 case studies for the flow in a 4:1 abrupt contraction of an UCM viscoelastic fluid, for De=1
- UCM_Orig - employs the original formulation that diverges before reaching the endtime
- UCM_Stab - employs the new stabilized formulation that allows to achieve convergence for all time steps
######
Notes
######
(1) To use the new stabilized formulation the value of etaStab should be provided in "constant/viscoelasticProperties". If ommited the solver uses the original formulation
(2) Based on several studies performed, the value of etaStab should be similar to etaP

View file

@ -0,0 +1,129 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.001;
vertices
(
(0 0 0)
(100 0 0)
(0 5 0)
(100 5 0)
(0 15 0)
(100 15 0)
(0 20 0)
(100 20 0)
(150 0 0)
(150 5 0)
(350 0 0)
(350 5 0)
(0 0 0.1)
(100 0 0.1)
(0 5 0.1)
(100 5 0.1)
(0 15 0.1)
(100 15 0.1)
(0 20 0.1)
(100 20 0.1)
(150 0 0.1)
(150 5 0.1)
(350 0 0.1)
(350 5 0.1)
);
blocks
(
hex (0 1 3 2 12 13 15 14) (24 10 1) simpleGrading (0.01116279506 0.2052504667 1)
hex (2 3 5 4 14 15 17 16) (24 13 1) simpleGrading (0.01116279506 9.315264895 1)
hex (4 5 7 6 16 17 19 18) (24 5 1) simpleGrading (0.01116279506 0.2171245102 1)
hex (1 8 9 3 13 20 21 15) (20 10 1) simpleGrading (46.57661513 0.2052504667 1)
hex (8 10 11 9 20 22 23 21) (7 10 1) simpleGrading (6.476978227 0.2052504667 1)
);
edges
(
);
boundary
(
inlet
{
type patch;
faces
(
(0 12 14 2)
(2 14 16 4)
(4 16 18 6)
);
}
fixedWalls
{
type wall;
faces
(
(6 18 19 7)
(5 7 19 17)
(3 5 17 15)
(3 15 21 9)
(9 21 23 11)
);
}
outlet
{
type patch;
faces
(
(10 11 23 22)
);
}
simetry
{
type symmetryPlane;
faces
(
(0 1 13 12)
(1 8 20 13)
(8 10 22 20)
);
}
frontAndBack
{
type empty;
faces
(
(0 2 3 1)
(2 4 5 3)
(4 6 7 5)
(1 3 9 8)
(8 9 11 10)
(12 13 15 14)
(14 15 17 16)
(16 17 19 18)
(13 20 21 15)
(20 22 23 21)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View file

@ -0,0 +1,43 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object viscoelasticProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
/*
From:
Fernandes, C., De Araujo, M.S.B., Ferrás, L.L., Nóbrega, J.M.,
Improvements in the OpenFOAM numerical code for simulation of
steady-state differential viscoelastic flows, 11th OpenFOAM Workshop
Guimarães, Portugal, June 26 - 30, 2016
and
De Araujo, M.S.B., Ferras, L.L.,Fernandes, C.,Nobrega, J.M.,
Improvements ans assessment of the integral viscoelastic solver in OpenFOAM, 11th OpenFOAM Workshop
Guimarães, Portugal, June 26 - 30, 2016
*/
rheology
{
type UCM;
rho rho [1 -3 0 0 0 0 0] 100;
etaP etaP [1 -1 -1 0 0 0 0] 0.25;
lambda lambda [0 0 1 0 0 0 0] 1;
etaStab 0.25;
}
// ************************************************************************* //

View file

@ -0,0 +1,60 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
libs
(
"liblduSolvers.so"
)
application viscoelasticFluidFoam;
startFrom startTime;
startTime 0.0;
stopAt endTime;
endTime 15;
deltaT 1e-4;
writeControl adjustableRunTime;
writeInterval 1;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
graphFormat raw;
runTimeModifiable yes;
adjustTimeStep no;
maxCo 0.35;
maxDeltaT 0.01;
// ************************************************************************* //

View file

@ -0,0 +1,64 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(p) fourth;
grad(U) fourth;
}
divSchemes
{
default none;
div(phi,U) Gauss Minmod;
div(phi,tau) Gauss Minmod;
div(tau) Gauss linear;
}
laplacianSchemes
{
default none;
laplacian(etaPEff,U) Gauss linear corrected;
laplacian(etaPEff+etaS,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
interpolate(HbyA) linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View file

@ -0,0 +1,76 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver CG;
preconditioner Cholesky;
tolerance 1e-09;
relTol 0;
minIter 0;
maxIter 800;
}
U
{
solver BiCGStab;
preconditioner ILU0;
tolerance 1e-09;
relTol 0;
minIter 0;
maxIter 1000;
}
tau
{
solver BiCGStab;
preconditioner ILU0;
tolerance 1e-09;
relTol 0;
minIter 0;
maxIter 1000;
};
}
PISO
{
nCorrectors 4;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}
relaxationFactors
{
p 0.3;
U 0.7;
tau 0.3;
}
// ************************************************************************* //