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

How can I get mole fraction on boundary condition instead of mass fraction?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 4, 2022, 09:18
Default How can I get mole fraction on boundary condition instead of mass fraction?
  #1
New Member
 
Alper
Join Date: Jan 2022
Posts: 5
Rep Power: 4
alpercftc is on a distinguished road
This is my N2 initial conditions. But it's mass fraction. How can I get mole fraction on boundary condition instead of mass fraction?

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  9
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0";
    object      N2;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField  uniform 0.76162;

boundaryField
{
    inletfuel
    {
        type            fixedValue;
        value           uniform 0.74819;
    }
    inletair
    {
        type            fixedValue;
        value           uniform 0.76162;
    }
    outlet
    {
        type            inletOutlet;
        inletValue      uniform 0.76162;
        value           uniform 0.76162;
    }
    axis
    {
        type            empty;
    }
    leftside
    {
        type            zeroGradient;
    }
    burnerwall
    {
        type            zeroGradient;
    }
    burnertip
    {
        type            zeroGradient;
    }
    front
    {
        type            wedge;
    }
    back
    {
        type            wedge;
    }
}


// ************************************************************************* //
alpercftc is offline   Reply With Quote

Old   July 6, 2022, 13:04
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14
Tobermory will become famous soon enough
When you say "how can I get" what do you mean? Do you want to:
- set the value on the fixedValue boundary as a mole fraction, rather than a mass fraction;
- or do you want to plot the value on another type of boundary, say an outlet, as a mole fraction?

If it's the first, then the short answer is that you cannot. You must supply the boundary conditions for the variables that the solver uses, and the solvers all work with mass fractions. Actually, if you were really set on using mole fraction, you COULD do it, but you'd have to write your own version of the solver, and add coding to do the input/output of the scalar fields as mole fraction, with the calculation still being done on a mass fraction basis. Doable, but messy.

If it's the latter, then that's just post-processing (ie converting mass to mole fractions).
alpercftc likes this.
Tobermory is offline   Reply With Quote

Old   July 7, 2022, 14:36
Default
  #3
New Member
 
Alper
Join Date: Jan 2022
Posts: 5
Rep Power: 4
alpercftc is on a distinguished road
Quote:
If it's the first, then the short answer is that you cannot. You must supply the boundary conditions for the variables that the solver uses, and the solvers all work with mass fractions.
Dear Tobermory,
Thank your reply sir. I meant the first situation that setting the value on the fixedValue boundary as a mole fraction and got my answer.
Good day sir.
alpercftc 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
Setting the height of the stream in the free channel kevinmccartin CFX 12 October 13, 2022 22:43
Table bounds warnings at: END OF TIME STEP CFXer CFX 4 July 17, 2020 00:44
Match Pressure Inlet/Outlet Boundary Condition Mass Flow Rate MSchneid Fluent UDF and Scheme Programming 3 February 23, 2019 07:00
Conversion of mass fraction to mole fraction in FLUENT prince_pahariaa FLUENT 0 August 26, 2014 09:08
Overflow Error in Multiphase Modelling with Two Continuous Fluids ashtonJ CFX 6 August 11, 2014 15:32


All times are GMT -4. The time now is 02:35.