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

OpenFOAM-12 (.org) showing only 2 viscosity models

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By Wesley
  • 1 Post By Wesley
  • 1 Post By Wesley
  • 1 Post By Nicholas_Langbein

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 10, 2024, 19:47
Post OpenFOAM-12 (.org) showing only 2 viscosity models
  #1
New Member
 
Nicholas Langbein
Join Date: Nov 2024
Posts: 14
Rep Power: 2
Nicholas_Langbein is on a distinguished road
I want to apply BirdCarreau model with foamRun, but it shows the following error for Openfoam.org 12 version
How do i access all rheology models. Please help its really confusing in latest version 12 of foam due to major code base changes

--> FOAM FATAL ERROR:
Unknown viscosity model BirdCarreau

Valid viscosity models are :

2
(
Newtonian
constant
)


From function static Foam::autoPtr<Foam::viscosityModel> Foam::viscosityModel::New(const Foam::fvMesh&, const Foam::word&)
in file viscosityModels/viscosityModel/viscosityModelNew.C at line 58.
Nicholas_Langbein is offline   Reply With Quote

Old   November 11, 2024, 14:40
Default
  #2
New Member
 
Wesley T.
Join Date: Apr 2009
Posts: 28
Rep Power: 17
Wesley is on a distinguished road
The file structure for OpenFOAM 12 has been a challenge for me to use.

The offsetCylinder tutorial (tutorials/incompressibleFluid/offsetCylinder) shows how to implement the CrossPowerLaw model.

The physicalProperties file includes:


viscosityModel constant;

nu 0.01;


the "constant" is important, the value for nu may not be important, but it needs to be present.

"constant" tells OpenFOAM to look for different viscosity model in a momentumTransport file. The momentumTransport file includes these lines:

simulationType laminar;

laminar
{
model generalisedNewtonian;

viscosityModel CrossPowerLaw;

nuInf 10;
m 0.4;
n 3;
}

I have been able to run powerLaw models based on this. I do run into problems again when I am running incompressibleMultiphaseVoF models - I have not successfully implemented non-Newtonian models with that solver. p, li { white-space: pre-wrap; }

Please let me know if this helps you,

Wesley
Wesley is offline   Reply With Quote

Old   November 11, 2024, 18:48
Default
  #3
New Member
 
Nicholas Langbein
Join Date: Nov 2024
Posts: 14
Rep Power: 2
Nicholas_Langbein is on a distinguished road
Quote:
Originally Posted by Wesley View Post
The file structure for OpenFOAM 12 has been a challenge for me to use.

The offsetCylinder tutorial (tutorials/incompressibleFluid/offsetCylinder) shows how to implement the CrossPowerLaw model.

The physicalProperties file includes:


viscosityModel constant;

nu 0.01;


the "constant" is important, the value for nu may not be important, but it needs to be present.

"constant" tells OpenFOAM to look for different viscosity model in a momentumTransport file. The momentumTransport file includes these lines:

simulationType laminar;

laminar
{
model generalisedNewtonian;

viscosityModel CrossPowerLaw;

nuInf 10;
m 0.4;
n 3;
}

I have been able to run powerLaw models based on this. I do run into problems again when I am running incompressibleMultiphaseVoF models - I have not successfully implemented non-Newtonian models with that solver. p, li { white-space: pre-wrap; }

Please let me know if this helps you,

Wesley
Hey, thanks for prompt response.
Yes Now it runs without error for incompressibleFluid solver,

But as you said still i am facing problem for using in incompressibleVOF solver.

is there any guide for using newly implemented library/modules solvers for OpenFOAM12. the navigation and usage is very challenging.
Nicholas_Langbein is offline   Reply With Quote

Old   November 11, 2024, 21:13
Default
  #4
New Member
 
Wesley T.
Join Date: Apr 2009
Posts: 28
Rep Power: 17
Wesley is on a distinguished road
Quote:
Originally Posted by Nicholas_Langbein View Post
Hey, thanks for prompt response.
Yes Now it runs without error for incompressibleFluid solver,

But as you said still i am facing problem for using in incompressibleVOF solver.

is there any guide for using newly implemented library/modules solvers for OpenFOAM12. the navigation and usage is very challenging.
I believe I have the incompressibleVoF solver working.

I have been using OpenFOAM to simulation materials used in extrusion, so my file names tend to focus on extrudates.

The structure of the directory of the simulation is shown below:

Code:
├── 0
│   ├── alpha.ExtrudateA
│   ├── p_rgh
│   └── U
├── BasicCoExPipe.unv
├── constant
│   ├── g
│   ├── momentumTransport
│   ├── momentumTransport.ExtrudateA
│   ├── momentumTransport.ExtrudateB
│   ├── phaseProperties
│   ├── physicalProperties.ExtrudateA
│   ├── physicalProperties.ExtrudateB
│   └── polyMesh
│       ├── boundary
│       ├── faces
│       ├── neighbour
│       ├── owner
│       └── points
├── files.txt
└── system
    ├── controlDict
    ├── fvSchemes
    └── fvSolution
There are comments (lines starting with //) in my files to help me recreate the files in the future, you can ignore those lines. I am not certain the comments I have made are correct.


These are some of the files I think were least obvious to me.


Please let me know if it would be helpful paste more of the file contents.



alpha.ExtrudateA:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  11
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
// File was originally alpha.water.orig in incompressibleVoF/damBreak/damBreakLaminar

FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0";
    object      alpha.ExtrudateA;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 1;

//  This statement defines all fluid in the volume as this material (Extrudate1)

boundaryField
{
    Inlet1
    {
        type            fixedValue;
        value           uniform 1;
    }
// No inlets werew defined in the damBreakLaminar tutorial,the /incompressibleVoF/waterChannel/0 alpha.water.orig for inlet example
// type     fixedValue: is based on the inlet in the waterChannel tutorial
// value   uniform 1: appears to say the fluid entering is 100% this material (Extrudate1)

    Inlet2
    {
        type            fixedValue;
        value           uniform 0;
    }
// No inlets werew defined in the damBreakLaminar tutorial,the /incompressibleVoF/waterChannel/0 alpha.water.orig for inlet example
// type     fixedValue: is based on the inlet in the waterChannel tutorial
// value   uniform 0: appears to say the fluid entering is NOT this material (0% Extrudate1), so would be the other material (Extrudate2)

    Outlet
    {
        type            zeroGradient;
    }

// type is zeroGradient based on /incompressibleVoF/waterChannel/0 alpha.water.
// No "value" is defined, the simulation seems to run without issue, maybe test adding that in the future

    Walls
    {
        type            zeroGradient;
    }
// Walls was based on the wall boundaries in the damBreakLaminar tutorial

}


// ************************************************************************* //
physcalProperties.ExtrudateA
Code:
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "constant";
    object      physicalProperties.ExtrudateA;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

viscosityModel  constant;
nu              1.64e-3;
rho             1250;

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

// The viscosityModel is defined as "constant".  The flow model and the values in the momentumTransport file define the rheology for the simulation
// nu is arbitrary - it may not matter what value is used.
// rho is the density of the fluid in kg/m^3
phaseProperies:
Code:
oamFile
{
    format      ascii;
    class       dictionary;
    location    "constant";
    object      phaseProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

phases          (ExtrudateA ExtrudateB);

sigma           0.07;

//  "sigma is the surface tension coefficient"  from: https://www.openfoam.com/documentation/guides/latest/api/classFoam_1_1surfaceTensionModel.html#ae7d6922bdebcdf8394d369b7eb0c76e3
//  More information would be needed to set a suitable sigma for the surface tension between two food extrudates

// ************************************************************************* //
momentumTransport.ExtrudateA


Code:
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "constant";
    object      momentumTransport.ExtrudateA;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

simulationType  laminar;

laminar
{
    model        generalisedNewtonian;

    viscosityModel powerLaw;

    nuMax           1000000;
    nuMin              0.1;
    k               3000;
    n               0.4;
}

// The above lines define the simulation as laminar and defines the rheology - in this case as a power law fluid.
//nuMax and nuMin are arbitrary numbers that are likely well beyond any values that will be seen in extrusion of food materials.
//k is the consistency index, the value for k is a rough approximation of the consistency index for many food extrudates
//n is the shear-thinning index.  The initial value used for this simulation is Newtonian (n=1) to ensure convergence.  After an initial result is reached, the simulation is rerun with the output of the Newtonian simulation is copied as the 0 directory for the shear-thinning simulation where n is changed to be 0.4, a typical value for the shear-thinning index of extruded food materials.

// ************************************************************************* //
I have not yet found a way to get the incompressibleMultiphaseVoF solver to work with non-Newtonian fluids yet. If I am trying to simulate more than 2 phases with non-Newtonian viscosity models, I am using OpenFOAM 9. I hope the above is helpful, Wesleyp, li { white-space: pre-wrap; }
Nicholas_Langbein likes this.

Last edited by Wesley; November 11, 2024 at 21:15. Reason: Trying to get the tree showing file structure to display better
Wesley is offline   Reply With Quote

Old   November 14, 2024, 10:21
Default
  #5
New Member
 
Nicholas Langbein
Join Date: Nov 2024
Posts: 14
Rep Power: 2
Nicholas_Langbein is on a distinguished road
@Wesley, Thanks a bunch for your detailed explanation.. you are a life-saver.

Unfortunately, I am still not able to get incompressibleVoF solver to work with 2 phases with non newtonian models.
I followed the same folder structure. Still it simulates with nu constant value we provide.

If possible could you share content of constant/momentumTransport file... because its the only variable i think.

Else if its not too much and possible could you share your tar for case file for reference.

Thanks in advance
Nicholas_Langbein is offline   Reply With Quote

Old   November 14, 2024, 21:16
Default
  #6
New Member
 
Wesley T.
Join Date: Apr 2009
Posts: 28
Rep Power: 17
Wesley is on a distinguished road
Quote:
Originally Posted by Nicholas_Langbein View Post
@Wesley, Thanks a bunch for your detailed explanation.. you are a life-saver.

Unfortunately, I am still not able to get incompressibleVoF solver to work with 2 phases with non newtonian models.
I followed the same folder structure. Still it simulates with nu constant value we provide.

If possible could you share content of constant/momentumTransport file... because its the only variable i think.

Else if its not too much and possible could you share your tar for case file for reference.

Thanks in advance

Contents of momentumTransport:
Code:
// This file started as momentumTransport from the OpenFOAM 11 tutorial in incompressibleVoF/damBreakLaminar/damBreak tutorial
// The momentumTransport properties are found in the momentumTransport.XXX files (2 of them in this case)

FoamFile
{
    format      ascii;
    class       dictionary;
    location    "constant";
    object      momentumTransport;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

simulationType  twoPhaseTransport;

// twoPhaseTransport tells the system to look for the rheology models in the two momentumTransport.XXX files


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


I tend to put comments (lines starting with //) to remind me of what I may have had issues with and which tutorials the base files in my simulations came from.


In this case, it looks like I may have had issues with not having twoPhaseTransport as the simulationType.

Hopefully this gets your simulation working.

Please let me know if this works, if not I will try to put the directory up as a .zip file.

Wesley
Nicholas_Langbein likes this.
Wesley is offline   Reply With Quote

Old   November 15, 2024, 08:12
Default
  #7
New Member
 
Wesley T.
Join Date: Apr 2009
Posts: 28
Rep Power: 17
Wesley is on a distinguished road
Quote:
Originally Posted by Nicholas_Langbein View Post
@Wesley, Thanks a bunch for your detailed explanation.. you are a life-saver.

Unfortunately, I am still not able to get incompressibleVoF solver to work with 2 phases with non newtonian models.
I followed the same folder structure. Still it simulates with nu constant value we provide.

If possible could you share content of constant/momentumTransport file... because its the only variable i think.

Else if its not too much and possible could you share your tar for case file for reference.

Thanks in advance
I am attaching a directory with the files I am using for incompressibleVoF solver.

NOTE: I am not able to include the geometry - the zipped file is too large. I will try to create a more coarse mesh at another time that I could upload. The basic geometry is a simple T, with the two inlets being at the top of the T (flowing toward each other), and the outlet is at the bottom.

NOTE2: I am attaching a very coarse mesh, which may not show the results as well, but should run. You will need to apply the mesh to the simulation (ideasUnvToFoam).

The simulation takes about 5 minutes to solve the more refined mesh (that I can't attach due to file size) on one core on my computer.

I have the Newtonian viscosity set in both physicalProperties files as:


Code:
viscosityModel  constant;
nu              1.64e-3;
rho             1250;
The momentumTransport files have k values that differ by a factor of 10.

If you look at the last time in paraFoam after your run the simulation, you will see ExtrudateA (the fluid with the higher k) takes up most of the cross-section of the flow at the exit of the simulation. If the viscosity model in momentumTransport had not been read/used in the solution, then the cross section of the two flows would be equal because the viscosities were equal in the physicalProperties file.

Please let me know if this is helpful.

Wesley
Attached Files
File Type: gz Example2Phase.tar.gz (2.2 KB, 0 views)
File Type: gz VERYSimpleTPipe.unv.tar.gz (84.0 KB, 0 views)
Nicholas_Langbein likes this.

Last edited by Wesley; November 15, 2024 at 09:01. Reason: Forgot to attach file
Wesley is offline   Reply With Quote

Old   November 21, 2024, 19:25
Default
  #8
New Member
 
Nicholas Langbein
Join Date: Nov 2024
Posts: 14
Rep Power: 2
Nicholas_Langbein is on a distinguished road
Apologies for late reply. Yes simulationType twoPhaseTransport; works, without this solver considers newtonian model. Thanks a bunch for your guidance.
Wesley likes this.
Nicholas_Langbein 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
Film phase Change models in OpenFOAM 11 Yassin-K OpenFOAM Running, Solving & CFD 6 September 16, 2024 12:49
OpenFOAM v11 Released CFDFoundation OpenFOAM Announcements from OpenFOAM Foundation 0 July 11, 2023 06:34
how to call viscosity in openfoam Solver development rishik686 OpenFOAM Running, Solving & CFD 0 March 22, 2023 04:23
Research on the implementations of the subgrid scale models in OpenFOAM fumiya OpenFOAM 9 December 30, 2016 05:22
OpenFOAM v3.0+ ?? SBusch OpenFOAM 22 December 26, 2016 15:24


All times are GMT -4. The time now is 07:26.