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

Mass source for simpleFoam-style solvers

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 15, 2017, 01:05
Default Mass source for simpleFoam-style solvers
  #1
New Member
 
Join Date: Jun 2011
Posts: 18
Rep Power: 10
timbojones is on a distinguished road
Hello everyone,

I've implemented a mass source term and an associated momentum source term in simpleFoam to simulate a nozzle injection that I don't want to resolve on the grid. The mass source is implemented as a source in pEqn and the momentum source in UEqn. The sources are set via custom fields and explicit source terms in these equations.

I'd like to accomplish the same task using fvOptions. For the momentum source, implementation is very straightforward. However, to my understanding, the mass source should show up in pEqn, but it's not a pressure source. That is it's not a semiImplicitScalarSource on field(p).

My question is this. Has anyone implemented a mass source in simpleFoam using fvOptions? Alternatively, if you've done it as custom solver with source in pEqn, is there a trick to getting this to work smoothly? Any help or sharing would be greatly appreciated!

TimboJones

Last edited by timbojones; December 15, 2017 at 01:07. Reason: Fixed minor grammatical errors
timbojones is offline   Reply With Quote

Old   April 13, 2018, 05:52
Default
  #2
New Member
 
Benjamin
Join Date: Oct 2016
Posts: 2
Rep Power: 0
benjamintu is on a distinguished road
hey timbo, trying more or less the same stuff. In my case I can't use a constant source term, therefore I'm dependent on fvOptions coded source.

As you said, to remove mass one has to add a source term in pEqn, because continuity equations is included in there...

I have seen stable running and validated code using specific mass flow (kg/m3/s) as source term on RHS of pEqn (pEqn was similar to the one used in rhoReactingFoam), but this was not implemented with fvOptions...

My problem is that coded source seems not to know the field p (in contrary to rho, Yi-name, h). Looking in the sourcecode of rhoReactingFoam fvOptions is called like that:

fvOptions(psi, p_rgh, rho.name())

in pEqn.H compared to that:

fvOptions(rho, Yi)

in YIEqn.H, might this be the diffrence causing trouble? Anyways would appreciate any help
benjamintu is offline   Reply With Quote

Old   November 28, 2019, 15:32
Default
  #3
New Member
 
Carl Birger Jenssen
Join Date: Feb 2017
Location: Trondheim, Norway
Posts: 1
Rep Power: 0
carlbirger is on a distinguished road
Hi,

I have exactly the same problem as timbojones. I want to add a mass source to simpleFoam using fvOptions. Did anybody succeed in doing this? I understand that there is a bit of programming involved to enable a source term to the P equation.

Alternatively, what is the simplest way of simulating a nozzle injection with a source term?

I would think that a mass source is one of the most basic things you woud want to include in a simulation, so this should be a question of general interest.

Any help or suggestion would be appreciated.

Carl Birger

PS. There is also this thread:

Add a mass source/sink to simpleFoam

But they point at a solution for fireFoam which from what I understand is a density based solver, for which the problem is much simpler.
carlbirger is offline   Reply With Quote

Reply

Tags
fvoptions, mass source, momentum source, simplefoam

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
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 tlcoons OpenFOAM Installation 13 April 20, 2016 18:34
Problem compiling a custom Lagrangian library brbbhatti OpenFOAM Programming & Development 2 July 7, 2014 12:32
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 14:59
pisoFoam compiling error with OF 1.7.1 on MAC OSX Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 18:18
Problem with Mass source, Momentum source theory diffo Fluent UDF and Scheme Programming 0 August 20, 2009 07:10


All times are GMT -4. The time now is 15:46.