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

Modifying rhoSimpleFoam to calculate ptot every iteration

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 13, 2010, 03:59
Default Modifying rhoSimpleFoam to calculate ptot every iteration
  #1
Member
 
Join Date: Jun 2010
Posts: 33
Rep Power: 15
RalphS is on a distinguished road
I want to modify rhoSimpleFoam so that it calculate ptot every time. I need ptot to calculate measuring total pressure with simpleFunctionObjects.

So, I have to change createFields.H and my_rhoSimpleFoam.C. I have tried it, but it didn't worked.

In createFields.H, i have add this:

Code:
 
    Info<< "Reading field ptot\n" << endl;
    volVectorField ptot
    (
        IOobject
        (
            "ptot",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::NO_WRITE
        )
        p + 0.5*rho*magSqr(U)
    );
In my_rhoSimpleFoam.C, i have add this:

Code:
 ptot = p + 0.5*rho*magSqr(U)
Can someone help me?
RalphS is offline   Reply With Quote

Old   October 13, 2010, 04:09
Default
  #2
Member
 
Sabin Ceuca
Join Date: Mar 2010
Location: Munich
Posts: 42
Rep Power: 16
sabin.ceuca is on a distinguished road
Code:
 
    Info<< "Reading field ptot\n" << endl;
    volScalarField ptot
    (
        IOobject
        (
            "ptot",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        )
        p + 0.5*rho*magSqr(U)
    );
Hi,
try it like this. The problem seemed be the declaration of ptot as volVectorField instead of volScalarField.
Ciao,
Sabin
sabin.ceuca is offline   Reply With Quote

Old   October 13, 2010, 04:25
Default
  #3
Member
 
Join Date: Jun 2010
Posts: 33
Rep Power: 15
RalphS is on a distinguished road
thanks for the fast reply.

I have tried volSalarField, but it doesn't solve the problem.

cpp: Internal error: Floating point exception (program cc1)
Please submit a full bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [linux64GccDPOpt/options] Error 1
cpp: Internal error: Floating point exception (program cc1)
Please submit a full bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [linux64GccDPOpt/files] Error 1
wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created
RalphS is offline   Reply With Quote

Old   October 13, 2010, 05:20
Default
  #4
Senior Member
 
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 17
herbert is on a distinguished road
This doesn't look like a standard compilation error. I think there is something wrong with you compiler itself or with you Make/options (if you changed anything there). Can you try compiling on another maschine?

Regards,
Stefan
herbert is offline   Reply With Quote

Old   October 13, 2010, 06:00
Default
  #5
Member
 
Join Date: Jun 2010
Posts: 33
Rep Power: 15
RalphS is on a distinguished road
You're right, thanks. I have to use another machine.

Now I can use my_rhoSimpleFoam to calculate ptot.

Here is my code (I have found two faults in it):

my_rhoSimpleFoam.C:

Code:
 
      turbulence->correct();
 
//BEGIN NEW
 ptot = p + 0.5*rho*magSqr(U);
//END NEW
 
        runTime.write();
createFields.H

Code:
 
        mesh
    );
 
//BEGIN  NEW
   Info<< " Reading field ptot\n" << endl;
   volScalarField ptot
    (
      IOobject
      (
        "ptot",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
      ),
        p + 0.5*rho*magSqr(U)       
   );
//END NEW
 
    #include "compressibleCreatePhi.H"
RalphS is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regarding Coefficient-of-Discharge of intake port LeelaPrasad Siemens 2 March 9, 2017 06:48
How to calculate the convergence rate of Gauss-Seidel line iteration? hadesmajesty Main CFD Forum 0 November 2, 2009 23:08
RhoSimpleFoam FoamX spv24 OpenFOAM Running, Solving & CFD 1 July 21, 2008 11:29
Parallel runs slower with MTU=9000 than MTU=1500 Javier Larrondo FLUENT 0 October 28, 2007 23:30
Heat exchanger problem chiseung FLUENT 16 October 20, 2001 05:36


All times are GMT -4. The time now is 04:03.