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

setting momentum source with fieldSources

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 14, 2012, 09:51
Question setting momentum source with fieldSources
  #1
Senior Member
 
Eelco van Vliet
Join Date: Mar 2009
Location: The Netherlands
Posts: 122
Rep Power: 9
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, 06:45
Smile problem solved
  #2
Senior Member
 
Eelco van Vliet
Join Date: Mar 2009
Location: The Netherlands
Posts: 122
Rep Power: 9
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, 15:57
Default
  #3
Member
 
Jack
Join Date: Aug 2012
Posts: 42
Rep Power: 5
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
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
Momentum source coefficient, cylindrical coordinates, circumferential component? polakse CFX 14 April 17, 2015 05:56
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 120 December 2, 2009 11:23
no enthalpy change across the momentum source Atit Koonsrisuk CFX 2 December 19, 2005 03:33
Warning 097- AB CD-adapco 6 November 15, 2004 05:41


All times are GMT -4. The time now is 19:28.