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

OpenFOAM time units - CFDEM Coupling

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By RussellHolt

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 9, 2022, 15:42
Default OpenFOAM time units - CFDEM Coupling
  #1
New Member
 
Russell
Join Date: Feb 2022
Location: Melbourne
Posts: 3
Rep Power: 4
RussellHolt is on a distinguished road
Hi everyone

I am new to this forum so if this post belongs somewhere else my apologies!

I am running simulations of a pressure driven suspension flow through a micro channel, investigating particles sized of 1 micron and below in diameter. Because of the size of the particles I am required to use the 'micro' unit system within LIGGGHTS (micrometers, microseconds, picograms).

In order to get the correct units within OpenFOAM I have adjusted the units in the constant '0' folder and modified the controlDict file in a similar fashion to one of the tutorials provided with the CFDEM software (see control dict file below).

This appears to give me the correct results when compared to analytical results of Poiseuille flow through a rectangular channel, so I believe in that regard everything is correct.

Where my confusion lies currently is in the coupling of the time/deltaT, where LIGGGHTS is in microseconds and OpenFOAM is in seconds. The CFDEM coupling software will couple the results every x amount of time, if the two solvers are using different time units then the coupling will be wrong (my understanding).

I've had a look the forums and seen that some people have enquired on changing the time units before, but I haven't seen any indication on how to actually do this. Is it possible? What modifications have to be made?

I am using the PISO solver, ideally I would solve for a steady state simulation first and use this as initial conditions, then start the CFDEM simulation using microseconds for both solvers. This incorrect coupling may not be a problem for dilute suspensions as the CFD will be at a more steady state, but at concentrated suspensions, or with a channel obstruction introduced I think it may become an issue.

Thank you all for any help or feedback you can provide!


ControlDict File
Code:
FoamFile
{
    class    dictionary;
    format    ascii;
    location    system;
    object    controlDict;
    version    2.0;
}
application    cfdemSolverPiso;
deltaT    1e-03;
endTime    400;
purgeWrite    50;
startFrom    startTime;
startTime    0;
stopAt    endTime;
timeFormat    general;
timePrecision    5;
writeControl    adjustableRunTime;
writeInterval    10;
writePrecision    7;
runTimeModifiable    yes;
compression    uncompressed;
writeFormat    ascii;

DimensionedConstants
{
    //unitSet             CGS; // SI; // USCS; // 
    microCoeffs
    {
        universal
            {
            c c [ 0 1 -1 0 0 0 0 ] 2.99792e+8; // speed of light in vacuum (µm/µs)
            G G [ -1 3 -2 0 0 0 0 ] 6.67429e-20; // gravitational constant (µm^3/(pgµs^2))
            h h [ 1 2 -1 0 0 0 0 ] 6.62607e-13; // Planck's constant (pgµm^2/µs)
            }
        electromagnetic
            {
            e e [ 0 0 1 0 0 1 0 ] 4.803204e-4; // elementary charge (pC)
            }
        atomic
            {
            me me [ 1 0 0 0 0 0 0 ] 9.10938e-16; // electron mass (pg)
            mp mp [ 1 0 0 0 0 0 0 ] 1.67262e-12; // proton mass (pg)
            }
        physicoChemical
            {
            mu mu [ 1 0 0 0 0 0 0 ] 1.66054e-12; // atomic mass unit (pg)
            k k [ 1 2 -2 -1 0 0 0 ] 1.38065e-8; // Boltzman constant (pgµm^2/µs^2K)
            }
            
        standard
        {
        //- Standard pressure [pg/µmµs^2 ]
        Pstd Pstd [ 1 -1 -2 0 0 0 0 ] 1e-2; // 1 pg/µmµs^2
        //- Standard temperature [degK]
        Tstd Tstd [ 0 0 0 1 0 0 0 ] 298.15; // should be same as in SI unit system
        }
    }
 }
UPDATE
I realised a much more simple solution was to instead just change the couple algorithm to adjust and couple the two different time steps so I can now run OpenFOAM using seconds and LIGGGHTs using microseconds.

For anyone interested in this solution, the only change required is in the "twoWayMPI.C" file located in the folder ~\CFDEMcoupling-PUBLIC-5.x\src\lagrangian\cfdemParticle\subModels\dataExc hangeModel\twoWayMPI

Modification below, just a simple division by 1e6 to correspond to seconds to match up with OpenFOAM to allow for correct time coupling.

Code:
// get DEM time step size
    DEMts_ = (lmp->update->dt)/1e6;
    checkTSsize();
SurajGangani likes this.

Last edited by RussellHolt; February 10, 2022 at 05:42. Reason: Update - Resolution found
RussellHolt is offline   Reply With Quote

Old   June 17, 2023, 05:21
Post A steady state simulation as initial conditions, or start CFD first.
  #2
New Member
 
zhenyu.zhu
Join Date: Jul 2017
Posts: 1
Rep Power: 0
Jhony_Drew is on a distinguished road
Dear Russell,
I am currently using the CFDEM coupling, and trying to figure out how to solve a steady state simulation first and use it as initial conditions, or if there is another way to solve the CFD first, and then start the coupling.
I tried the 'mapfield' command, but the Ksl and other initial files of the particle may lead to an error. I don't know what to do now.
Jhony_Drew is offline   Reply With Quote

Reply

Tags
cfdem, openfoam, timestep, units


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
bash script for pseudo-parallel usage of reconstructPar kwardle OpenFOAM Post-Processing 41 August 23, 2023 02:48
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 02:36
laplacianFoam with source term Herwig OpenFOAM Running, Solving & CFD 17 November 19, 2019 13:47
pimpleDyMFoam computation randomly stops babapeti OpenFOAM Running, Solving & CFD 5 January 24, 2018 05:28
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 11:08


All times are GMT -4. The time now is 15:56.