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

coded source term in fvOptions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 5, 2020, 22:19
Default coded source term in fvOptions
  #1
Senior Member
 
KGN
Join Date: Oct 2009
Location: Chennai, India
Posts: 121
Rep Power: 16
mecbe2002 is on a distinguished road
Hi all,


I am trying to implement local source based model to replace "effusion hole" in combustor liners with source and sink model. (details in the attached image)


I want to know how to get pressure value at a certain grid points to calculate the pressure drop across the hole and then calculate the discharge coefficient, to apply mass flow rate at hole center
Attached Images
File Type: png CodedSource.png (91.0 KB, 341 views)
mecbe2002 is offline   Reply With Quote

Old   July 10, 2020, 06:31
Default
  #2
Senior Member
 
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 355
Rep Power: 8
geth03 is on a distinguished road
you can define a little box at the area where you want to measure your pressure with topoSetDict. you need to create a cellZone. you can then access the cells and calculate a pressure average, i don't think that you will be able to create a box as little as a cell. so small enough with averaged pressure should be feasible.
geth03 is offline   Reply With Quote

Old   September 1, 2020, 04:51
Default
  #3
Senior Member
 
KGN
Join Date: Oct 2009
Location: Chennai, India
Posts: 121
Rep Power: 16
mecbe2002 is on a distinguished road
Code:
massSourceEffusionHole
{
    type    scalarCodedSource;
    name    sourceTime;
    active  true;
    
    scalarCodedSourceCoeffs
    {            
        
        fields          (rho); 
        selectionMode   points;
        points //sink location
        (
            (0.035 0.034 0.0)
        );  
        codeInclude
        #{
        
        #};
        
        codeCorrect
        #{
        #};
        
        codeAddSup
        #{
            const Time& time1 = mesh().time();
            const volScalarField& rhoJet = mesh_.lookupObject<volScalarField>("rho");
            const volVectorField& velJet = mesh_.lookupObject<volVectorField>("U");
            scalarField& massSource1 = eqn.source();
            const labelList& cellIDs = cells();
        
            forAll(cellIDs, i)
            {
                label cellI = cellIDs[i];                
                massSource1[cellI] = rhoJet[cellI]*mag(velJet[cellI])*6.28319*1e-6;  
            }             
        #};
        
        codeSetValue
        #{
        #}
        
        // Dummy entry. Make dependent on above to trigger recompilation code
        #{
            $codeInclude
            $codeCorrect
            $codeAddSup
            $codeSetValue
        #};
    }
    
    sourceTimeCoeffs
    {
        $scalarCodedSourceCoeffs;    
    }
}
In the selection mode I have used "points" and specified the sink location, then calculating the MFR by getting the "rho" and "vel" at that location. I have applied the same in the sink location.

I need help in applying the MFR calculated at "sink" location to "source" location i.e. (0.0385 0.0365 0.0)


FYI
sink location (0.035 0.034 0.0)
source location (0.0385 0.0365 0.0)


Thanks
KGN
mecbe2002 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
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 tlcoons OpenFOAM Installation 13 April 20, 2016 17:34
Using fvOptions to add a momentum source wallace OpenFOAM Programming & Development 9 December 9, 2015 10:41
[Other] How to use finite area method in official OpenFOAM 2.2.0? Detian Liu OpenFOAM Meshing & Mesh Conversion 4 November 3, 2015 03:04
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 06:42


All times are GMT -4. The time now is 18:17.