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

Add mass source term to simpleFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 5, 2022, 12:45
Default Add mass source term to simpleFoam
  #1
New Member
 
Join Date: Dec 2021
Posts: 23
Rep Power: 4
MamboJambo is on a distinguished road
Hello,

I would like to add a mass source term to simpleFOAM but do not know how to do it.

Can I just create a field called mass term:

Code:
volScalarField massSource
(
    IOobject
    (
        "massSource",
        runTime.timeName(),
        mesh,
        IOobject::MUST_READ,
        IOobject::AUTO_WRITE
    ),
    mesh
);
And add it to pEqn.H line 28 as:


Code:
        fvScalarMatrix pEqn
        (
            fvm::laplacian(rAtU(), p) == fvc::div(phiHbyA) - massSource 
        );
Is this correct?

I was going to set the values of massSource from `setExprFields`.


Is this the correct procedure? Does the momentum equation need to changed?

Last edited by MamboJambo; February 6, 2022 at 14:40.
MamboJambo is offline   Reply With Quote

Old   May 10, 2023, 04:56
Default
  #2
New Member
 
DuanYabo
Join Date: Jul 2022
Posts: 16
Rep Power: 3
DuanYB is on a distinguished road
Hello, I encountered the same problem as you, and I corrected it in the same way as you, but the program reported an error. Have you solved it now?
DuanYB is offline   Reply With Quote

Reply


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
How to add Source term (2) for PYROLYSIS - reactingOneDim Kummi OpenFOAM 10 April 12, 2021 21:11
Add a mass source/sink to simpleFoam palarcon OpenFOAM Programming & Development 4 May 15, 2019 02:33
Problem compiling a custom Lagrangian library brbbhatti OpenFOAM Programming & Development 2 July 7, 2014 11:32
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 01:41
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 11:44


All times are GMT -4. The time now is 11:16.