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

How to use fvOption to define a constant source term?

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

Like Tree2Likes
  • 2 Post By student666

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 30, 2017, 12:50
Default How to use fvOption to define a constant source term?
  #1
New Member
 
fabrice
Join Date: Apr 2016
Posts: 13
Rep Power: 5
fabrice is on a distinguished road
Hi Foamers,
I am trying to define a constant source term with the solver pimpleFoam and I use channel395 case to test.
I modified the solver of pimpleFoam and add concentration equation to it:
fvScalarMatrix CEqn
(
fvm::ddt(C)+fvm::div(phi,C)+ fvm::laplacian(turbulence->nu()/Sc,C)
);
CEqn.solve();
then I want to define a constant source for concentration equation in certain area. How can I do this?
1,I try to use setFields but it only works on initial field
2,I found it can set in fvOption files
momentumSource
{
type meanVelocityForce;
active yes;

meanVelocityForceCoeffs
{
selectionMode all;

fields (U);
Ubar (0.1335 0 0);
relaxation 1.0;
}
}

In my case, I think openFoam dose not have concentration equation, what should I do, can you please give me some suggestions?
fabrice is offline   Reply With Quote

Old   November 30, 2017, 17:16
Default
  #2
Member
 
Anders Utnes
Join Date: May 2017
Location: Norway
Posts: 34
Rep Power: 4
Alasir is on a distinguished road
The meanVelocityForce in fvOptions seem to be quite videly used for these kinds of things. It will be applied for all timesteps.

Do you get any errors by simply trying to run it?
Alasir is offline   Reply With Quote

Old   December 1, 2017, 00:20
Default
  #3
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 12
student666 is on a distinguished road
Hi,

I successfully applied this source term for velocity field, maybe you can use as well.
Code:
velocitySource
{
    type            vectorFixedValueConstraint;
    active          true;


    vectorFixedValueConstraintCoeffs
    {

        selectionMode   cellZone;
        cellZone         heater;
        volumeMode absolute;
        fieldValues
        {
            U           (0 1 0);
        }
    }
}
you can have a quite complete overview of fvOptions at
http://www.geocities.jp/penguinitis2...fvOptions.html

(just use google translate)

Regards
Kummi and Ramzy1990 like this.
student666 is offline   Reply With Quote

Old   December 1, 2017, 09:06
Default
  #4
Senior Member
 
Robert
Join Date: May 2015
Location: Bremen, GER
Posts: 295
Rep Power: 7
RobertHB is on a distinguished road
Great link! Thank you sooo much!
RobertHB is offline   Reply With Quote

Old   December 1, 2017, 10:22
Default
  #5
New Member
 
fabrice
Join Date: Apr 2016
Posts: 13
Rep Power: 5
fabrice is on a distinguished road
Quote:
Originally Posted by Alasir View Post
The meanVelocityForce in fvOptions seem to be quite videly used for these kinds of things. It will be applied for all timesteps.

Do you get any errors by simply trying to run it?
Hi Alasir,
Sorry for my bad explanation, I mean people can use this method to define a source in momentum equation but in my case how can I add a constant source to concentration equation.
fabrice is offline   Reply With Quote

Old   December 1, 2017, 10:33
Default
  #6
New Member
 
fabrice
Join Date: Apr 2016
Posts: 13
Rep Power: 5
fabrice is on a distinguished road
Quote:
Originally Posted by student666 View Post
Hi,

I successfully applied this source term for velocity field, maybe you can use as well.
Code:
velocitySource
{
    type            vectorFixedValueConstraint;
    active          true;


    vectorFixedValueConstraintCoeffs
    {

        selectionMode   cellZone;
        cellZone         heater;
        volumeMode absolute;
        fieldValues
        {
            U           (0 1 0);
        }
    }
}
you can have a quite complete overview of fvOptions at
http://www.geocities.jp/penguinitis2...fvOptions.html

(just use google translate)

Regards
Thanks a lot for your link I will read it. By the way, in my case I add concentration equation myself as far as I know openfoam only have utility for
momentum or energy source. Should I define it myself in solver every time step?
fabrice is offline   Reply With Quote

Old   December 2, 2017, 03:29
Default
  #7
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 12
student666 is on a distinguished road
Hi,

sorry, I thought you needed a velocity field source term.
Are you meaning you have to add a constant scalar source for a species?

If that's the case,
https://www.researchgate.net/publica...ers%27_version

has some more tutorials.

If you give more informations about your needs and what you're doing, others on this forum could be of much more help.

Regards
student666 is offline   Reply With Quote

Old   December 2, 2017, 07:49
Default
  #8
New Member
 
fabrice
Join Date: Apr 2016
Posts: 13
Rep Power: 5
fabrice is on a distinguished road
Quote:
Originally Posted by student666 View Post
Hi,

sorry, I thought you needed a velocity field source term.
Are you meaning you have to add a constant scalar source for a species?

If that's the case,
https://www.researchgate.net/publica...ers%27_version

has some more tutorials.

If you give more informations about your needs and what you're doing, others on this forum could be of much more help.

Regards
M.C
Thank you for help. What I am doing now is add convection diffusion equation to the solver 'pimpleFoam'. I want to simulate a constant pollutant source dispersion, for instance, in a channel. I do not know what's the proper way to define the source in some certain of the area.
fabrice is offline   Reply With Quote

Reply

Tags
fvoption, source terms, toposetsource

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
[swak4Foam] swak4foam for OpenFOAM 4.0 mnikku OpenFOAM Community Contributions 74 October 11, 2018 05:30
[Other] Adding solvers from DensityBasedTurbo to foam-extend 3.0 Seroga OpenFOAM Community Contributions 9 June 12, 2015 18:18
Installing OF 1.6 on Mac OS X gschaider OpenFOAM Installation 129 June 19, 2010 10:23
Missing math.h header Travis FLUENT 4 January 15, 2009 12:48
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 02:24


All times are GMT -4. The time now is 21:06.