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

setting momentum source with fieldSources

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 14, 2012, 10:51
Question setting momentum source with fieldSources
  #1
Senior Member
 
Eelco van Vliet
Join Date: Mar 2009
Location: The Netherlands
Posts: 124
Rep Power: 19
eelcovv is on a distinguished road
Hello all,

I am trying to run the channel simulation channelFoam from the tutorials with the pressure gradient set by using the new featurei in OF 2.1: fieldSources. I seems that it should be possible to use this in stead of adding the momentum source in the solver code, as is done channelFoam. However, I got problems with getting it running.

In the channel channel395 simulation I have added in the fvSolution the PIMPLE properties and UFinal properties. This allow to run the case with pimpleFoam. In the pimpleFoam solver there is now a momentum source at the right hand side of the U-equation: sources(U).

I want to define the pressuregradient, so I have added to following file sourceProperties to the constant directory with the folling contents

Code:
presGradient
{
    type            pressureGradientExplicitSource;
    active          off;            //on/off switch
    timeStart       0.0;           //start time
    duration        1e10;        //duration
    selectionMode   all;       //cellSet // points //cellZone

    pressureGradientExplicitSourceCoeffs
    {
         fieldNames  (U);
         Ubar        (0.1335 0 0 );                // set Re=64,000
//       flowDir     (1.0 0 0 );                // set Re=64,000
         gradPini    gradPini [0 2 -2 0 0] 0;   // initial pressure gradient
    }
}
This source is read by the solver, however, I got the following error message when runnig, before even the first iteration
Code:
 FOAM FATAL ERROR: 

    request for volScalarField (1|A(U)) from objectRegistry region0 failed
    available objects of type volScalarField are

2
(
nu
p
)


    From function objectRegistry::lookupObject<Type>(const word&) const
    in file /apps/OpenFOAM/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 131.
It seems that the rAU matrix is not available. Is there somebody who has an working example of adding the source term to set the velocity using the sourceProrertiesDict ?

Any hints appreciated

Regards
Eelco
eelcovv is offline   Reply With Quote

Old   May 15, 2012, 07:45
Smile problem solved
  #2
Senior Member
 
Eelco van Vliet
Join Date: Mar 2009
Location: The Netherlands
Posts: 124
Rep Power: 19
eelcovv is on a distinguished road
For those interested: it appeared to be a bug in the pimpleFoam of 2.1.0, which is already fixed in pimpeFoam 2.1.x, where the call to the sources(U) term UEqn.H was moved below the declaration of rAU.

I tested the source term on the channelFoam tutorial case by adding the file sourceProperties to the constant directory and run pimpleFoam. Indeed the same results as using channelFoam is obtained.


Code:
presGradient
{
    type            pressureGradientExplicitSource;
    active          on;            //on/off switch
    timeStart       0.0;           //start time
    duration        1e10;        //duration
    selectionMode   all;       //cellSet // points //cellZone

    pressureGradientExplicitSourceCoeffs
    {
         fieldNames  (U);
         Ubar        (0.1335 0 0 );                // set Re=64,000
         flowDir     (1.0 0 0 );                // set Re=64,000
         gradPini    gradPini [0 1 -2 0 0] 0;   // initial pressure gradient
    }
}
eelcovv is offline   Reply With Quote

Old   July 14, 2013, 16:57
Default
  #3
Member
 
Jack
Join Date: Aug 2012
Posts: 47
Rep Power: 13
JackW is on a distinguished road
Hi,

I noticed this thread, even though it is a bit old - I have a question!

When I run pimpleFoam with a pressure source as you describe above, my results seem ok, except for the pressure field.

When I observe them in paraview the pressure gradient isn't apparent (I have a PG of 20, but my results don't indicate this). Everything else seems fine!

Any help on this would be really appreciated!

Best wishes,

Jack
JackW 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
Momentum source coefficient, cylindrical coordinates, circumferential component? polakse CFX 15 January 18, 2016 03:40
pisoFoam compiling error with OF 1.7.1 on MAC OSX Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 18:18
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 11:23
no enthalpy change across the momentum source Atit Koonsrisuk CFX 2 December 19, 2005 03:33
Warning 097- AB Siemens 6 November 15, 2004 05:41


All times are GMT -4. The time now is 08:54.