CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

DU/DT value?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   June 1, 2011, 02:40
Lightbulb DU/DT value?
  #1
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 8
maysmech is on a distinguished road
Hi,

I need DU/Dt values for all grids.

How can i calculate and write this parameter.

Any suggestion will be appreciated.
maysmech is offline   Reply With Quote

Old   June 3, 2011, 16:46
Default
  #2
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
look in UEqn, something like
volVectorField DuDt= fvc::ddt(U) +fvc::div(phi,U)
nimasam is offline   Reply With Quote

Old   June 4, 2011, 04:27
Default
  #3
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 8
maysmech is on a distinguished road
Thanks Nima,

When i switch from Euler to CrancNicholson in fvScheme, ddt0(U) and ddt0(phi) are Written in time folders.

Now, my questions are:

1- is this value equal to D/DT(U)? if no How it can be calculated.

2- Is it any way to write it with Euler ddt scheme?

Regards.
maysmech is offline   Reply With Quote

Old   June 4, 2011, 09:53
Default
  #4
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
Here it is:

Code:
DDtU =
          fvc::ddt(U)
  + fvc::div(phi, U)
  - fvc::div(phi)*U;
To write the field, simply declare it with the appropriate IOobject.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   June 4, 2011, 10:59
Default
  #5
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 8
maysmech is on a distinguished road
Dear Alberto,
Thanks for your answer.
Is it possible to describe more.
Where should i write this code?
What is steps for writing process in time folders?
Is it need to define DDT in folder 0?
I am running LES with pisoFoam.
Regards.
maysmech is offline   Reply With Quote

Old   June 4, 2011, 11:32
Default
  #6
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by maysmech View Post
Dear Alberto,
Thanks for your answer.
Is it possible to describe more.
Where should i write this code?
What is steps for writing process in time folders?
Is it need to define DDT in folder 0?
I am running LES with pisoFoam.
Regards.
This questions sounds a bit like "please do my homework", since this stuff is standard.

Take a look at createFields.H, where other fields are created, and do something similar for DDtU. Then update the field at the end of the iteration, before runTime.write().

You do not need to do anything in 0 if you specify NO_READ in the IOobject.

Best,
maysmech likes this.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   June 6, 2011, 01:44
Lightbulb
  #7
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 8
maysmech is on a distinguished road
Quote:
Originally Posted by alberto View Post
This questions sounds a bit like "please do my homework", since this stuff is standard.

Take a look at createFields.H, where other fields are created, and do something similar for DDtU. Then update the field at the end of the iteration, before runTime.write().

You do not need to do anything in 0 if you specify NO_READ in the IOobject.

Best,
Thanks
it is my first openFoam programming and it was the cause of my silly questions.
Now i have a scientific question. first i describe my works:

1- Copying pisoFoam to new folder pisoFoam2.

2-Adding below code next of U and P IOobject of creatFields.H:
Code:
    volVectorField DDtU
    (
        IOobject
        (
            "DDtU",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );
3-Adding below code to before of runTime.write(); of pisoFoam.C:

Code:
    DDtU =
               fvc::ddt(U)
             + fvc::div(phi, U)
         - fvc::div(phi)*U;
4- Changing pisoFoam2/Make/files with:

Code:
EXE = $(FOAM_APPBIN)/pisoFoam2
5-wmake.

After this steps and running a case with pisoFoam2 this error is displayed:

HTML Code:
Reading field p

Reading field U



--> FOAM FATAL ERROR: 
NO_READ specified for read-constructor of object DDtU of class IOobject

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 46.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) in "/home/maysam/OpenFOAM/OpenFOAM-1.7.0/lib/linux64GccDPOpt/libOpenFOAM.so"
#1  Foam::error::abort() in "/home/maysam/OpenFOAM/OpenFOAM-1.7.0/lib/linux64GccDPOpt/libOpenFOAM.so"
#2  Foam::regIOobject::readStream() in "/home/maysam/OpenFOAM/OpenFOAM-1.7.0/lib/linux64GccDPOpt/libOpenFOAM.so"
#3  Foam::regIOobject::readStream(Foam::word const&) in "/home/maysam/OpenFOAM/OpenFOAM-1.7.0/lib/linux64GccDPOpt/libOpenFOAM.so"
#4  Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::fvMesh const&) in "/home/maysam/OpenFOAM/OpenFOAM-1.7.0/applications/bin/linux64GccDPOpt/pisoFoam2"
#5  
 in "/home/maysam/OpenFOAM/OpenFOAM-1.7.0/applications/bin/linux64GccDPOpt/pisoFoam2"
#6  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7  
 in "/home/maysam/OpenFOAM/OpenFOAM-1.7.0/applications/bin/linux64GccDPOpt/pisoFoam2"
Aborted
Switching NO-READ to MUST-READ and defining DDtU in 0 folder solves this error but the problem is i don't know boundary values for this variable.

Regards.
maysmech is offline   Reply With Quote

Old   June 6, 2011, 04:05
Default
  #8
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 78
Rep Power: 8
gregor is on a distinguished road
sorry double post

Last edited by gregor; June 6, 2011 at 05:45.
gregor is offline   Reply With Quote

Old   June 6, 2011, 04:06
Default
  #9
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 78
Rep Power: 8
gregor is on a distinguished road
hi its because you are using the wrong constructor

look for example at the createfields.H from the coalChemistryFoam Solver


Code:
    DimensionedField<scalar, volMesh> kappa
    (
        IOobject
        (
            "kappa",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        mesh,
        dimensionedScalar("zero", dimless, 0.0)
    );
there dimensionedScalar("zero", dimless, 0.0) is the value you prescribe initially to your field. You have to prescribe a initial field value otherwise it has to be read from a bc file

gregor
gregor is offline   Reply With Quote

Old   June 6, 2011, 05:44
Default
  #10
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 8
maysmech is on a distinguished road
Hi and thanks Gregor
I didn't find its format for vevtor DDtU with dimension [0 1 -2 0 0 0]. Do you know it?
Another question for Alberto:
Quote:
DDtU =
fvc::ddt(U)
+ fvc::div(phi, U)
- fvc::div(phi)*U;
Are you mean DDt(rho*U)? because phi=rho*U and i think above relation is a material derivation of rho*U. Am i right?
maysmech is offline   Reply With Quote

Old   June 6, 2011, 05:58
Default
  #11
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 78
Rep Power: 8
gregor is on a distinguished road
try dimensionedScalar("ddtU", dimVelocity/dimTime/dimTime, 0.0)

edit: well obviously it has to be vector::zero instead of 0.0

Last edited by gregor; June 7, 2011 at 03:52.
gregor is offline   Reply With Quote

Old   June 6, 2011, 11:49
Default
  #12
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
volVectorField DDtU
(
IOobject
(
"DDtU",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector("DDtU",dimensionSet(0,1,-2,0,0,0),vector::zero)
);
)
nimasam is offline   Reply With Quote

Old   June 6, 2011, 15:58
Default
  #13
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 8
maysmech is on a distinguished road
Quote:
Originally Posted by nimasam View Post
volVectorField DDtU
(
IOobject
(
"DDtU",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector("DDtU",dimensionSet(0,1,-2,0,0,0),vector::zero)
);
)
Thanks Nima and Gregor
The problem is solved by:
Code:
    volVectorField DDtU
    (
        IOobject
        (
            "DDtU",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        mesh,
    dimensionedVector("DDtU",dimensionSet(0,1,-2,0,0,0,0),vector::zero)
    );
But i am in doubt about DDtU value

Quote:
DDtU = fvc::ddt(U) + fvc::div(phi, U) - fvc::div(phi)*U;
Is it DDt(rho.U)?
maysmech is offline   Reply With Quote

Old   June 6, 2011, 16:43
Default
  #14
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
no its not!!!!!! it is just DU/DT not D(rho U )/DT
nimasam is offline   Reply With Quote

Old   June 7, 2011, 03:17
Default
  #15
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 8
maysmech is on a distinguished road
DDtU = fvc::ddt(U) + fvc::div(phi, U) - fvc::div(phi)*U

As it is stated in User guide phi=rho*U
So it has problem in dimension.

DDtU=>m/s2

ddt(U)=>m/s2

div(phi,U)=div((rho*U)U)=> kg/(m2s2)

div(phi)*U=> kg/(m2s2)
maysmech is offline   Reply With Quote

Old   June 8, 2011, 14:45
Lightbulb
  #16
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 8
maysmech is on a distinguished road
Quote:
Originally Posted by maysmech View Post
DDtU = fvc::ddt(U) + fvc::div(phi, U) - fvc::div(phi)*U

As it is stated in User guide phi=rho*U
So it has problem in dimension.

DDtU=>m/s2

ddt(U)=>m/s2

div(phi,U)=div((rho*U)U)=> kg/(m2s2)

div(phi)*U=> kg/(m2s2)
i wrote above post because of:
http://www.openfoam.com/docs/user/fv...20-1120004.4.5

But phi which is written in time folders has this dimension: [0 3 -1 0 0 0 0]
And with this dimension it has dimension problem yet.

div(phi,U)=> m3/s2
maysmech is offline   Reply With Quote

Old   June 8, 2011, 16:05
Default
  #17
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
phi is not rho*U , it is U & sf()
sf() : surface vector
so
U (m/s) and sf (m^2) so phi is (m^3/s), ok?
nimasam is offline   Reply With Quote

Old   June 8, 2011, 16:21
Default
  #18
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 8
maysmech is on a distinguished road
Ok, you mean it is not equal to what user guide wrote for phi. Maybe this is another phi.

But what is your idea about dimensional problem of DDtU?
maysmech is offline   Reply With Quote

Old   June 8, 2011, 16:31
Default
  #19
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
whats wrong with m/s^2 ?
nimasam is offline   Reply With Quote

Old   June 9, 2011, 01:32
Default
  #20
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 8
maysmech is on a distinguished road
DDtU=>m/s2

ddt(U)=>m/s2

div(phi,U)=> m3/(s2)

div(phi)*U=> m3/(s2)

All of these four phrases should have same dimension, shouldn't they?
maysmech is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to solve in simpleFoam with a volumesourceterm implicity booz OpenFOAM Running, Solving & CFD 3 March 12, 2009 04:17
How to decide PDE type for 1st order scalar PDE's shantanu Main CFD Forum 28 June 23, 2008 12:48
Wave Amplitudes for Non-Reflective Boundaries Richard Wagner Main CFD Forum 8 April 20, 2006 15:35
how to get the particle relative acceleration? winnie FLUENT 6 June 2, 2003 22:08


All times are GMT -4. The time now is 01:50.