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

type expression with variables leads into error message

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 12, 2020, 02:15
Default type expression with variables leads into error message
  #1
Member
 
Join Date: Jun 2011
Location: Germany
Posts: 59
Rep Power: 14
Siassei is on a distinguished road
Hello,

in the phaseProperties dict I will set a temperatureDependent surfaceTension with expression value.
Variable Def
Expression usage

Quick example
Code:
surfaceTension
(
    (gas and liquid)
    {
        type            temperatureDependent;
        sigma
        {
            type        temperatureDependent;
            sigma
            {
                type expression;

                variables
                (
                    "B = 1"
                    "Tc = 2"
                );
                expression
                #{
                    arg() * Tc + B
                #};
            }
        }
    }
);
I get the followed error. (If I remove the variables definition and subsitute the variables into the expression than everything works)
Code:
running decomposePar on /data
[0] [3] 
[3] 
[3] --> FOAM FATAL IO ERROR: 
[3] Expected a '(' while reading Tuple2, found on line 0: error
[3] 
[3] 
[3] file: IOstream at line 0.
[3] 
[3]     From bool Foam::Istream::readBegin(const char*)
[3]     in file db/IOstreams/IOstreams/Istream.C at line 116.
[3] 
FOAM parallel run exiting
I use the solver
Code:
icoReactingMultiphaseInterFoam -version
Using: OpenFOAM-v2006 (2006) - visit www.openfoam.com
Build: 5dc04530d9-20200714
Siassei is offline   Reply With Quote

Old   August 12, 2020, 07:37
Default
  #2
Member
 
Join Date: Jun 2011
Location: Germany
Posts: 59
Rep Power: 14
Siassei is on a distinguished road
I had fixed.
Remove the first type qualif.
(remove line 5 of my short example)
Siassei is offline   Reply With Quote

Old   September 14, 2020, 06:31
Default Temperature Dependent Surface Tension
  #3
New Member
 
Bill
Join Date: Jun 2019
Posts: 29
Rep Power: 6
OPFO is on a distinguished road
Hi Thomas,

Thank you for sharing your code for temperature dependent surface tension!

Do you know how to call the solid volume fraction in the icoReactingMultiphaseInterFoam solver for use in an equation (e.g. TEqn)?

In Interfoam, it is simply alpha1 or alpha2, but due to the multiphase nature of the icoReactingMultiphaseInterFoam solver, everything is kind of confusing because of phase pairs and the entire fluid references.

Any help is appreciated!
OPFO is offline   Reply With Quote

Old   October 9, 2021, 03:04
Default
  #4
Member
 
Join Date: Apr 2019
Location: India
Posts: 81
Rep Power: 7
Pavithra is on a distinguished road
Quote:
Originally Posted by Siassei View Post
Hello,

in the phaseProperties dict I will set a temperatureDependent surfaceTension with expression value.
Variable Def
Expression usage

Quick example
Code:
surfaceTension
(
    (gas and liquid)
    {
        type            temperatureDependent;
        sigma
        {
            type        temperatureDependent;
            sigma
            {
                type expression;

                variables
                (
                    "B = 1"
                    "Tc = 2"
                );
                expression
                #{
                    arg() * Tc + B
                #};
            }
        }
    }
);
I get the followed error. (If I remove the variables definition and subsitute the variables into the expression than everything works)
Code:
running decomposePar on /data
[0] [3] 
[3] 
[3] --> FOAM FATAL IO ERROR: 
[3] Expected a '(' while reading Tuple2, found on line 0: error
[3] 
[3] 
[3] file: IOstream at line 0.
[3] 
[3]     From bool Foam::Istream::readBegin(const char*)
[3]     in file db/IOstreams/IOstreams/Istream.C at line 116.
[3] 
FOAM parallel run exiting
I use the solver
Code:
icoReactingMultiphaseInterFoam -version
Using: OpenFOAM-v2006 (2006) - visit www.openfoam.com
Build: 5dc04530d9-20200714
Hello,
Thanks for sharing ur expression.
Could you please explain what does arg() means in your expression ?
Thank you.
Pavithra is offline   Reply With Quote

Old   February 2, 2022, 11:12
Default
  #5
Senior Member
 
rupak504's Avatar
 
Lolita
Join Date: Aug 2016
Posts: 115
Rep Power: 9
rupak504 is on a distinguished road
Quote:
Originally Posted by Pavithra View Post
Hello,
Thanks for sharing ur expression.
Could you please explain what does arg() means in your expression ?
Thank you.

have you figured out what is that arg() for? my first guess would be temperature.
rupak504 is offline   Reply With Quote

Old   February 2, 2022, 12:04
Default
  #6
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,685
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by rupak504 View Post
have you figured out what is that arg() for? my first guess would be temperature.



The 'arg()' in the expression simply represents the argument 'x' passed into a Function1 value(const scalar x)


https://www.openfoam.com/documentati...Function1.html
olesen 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
Instability in buoyantSimpleFoam Avandri OpenFOAM Running, Solving & CFD 0 August 7, 2020 16:13
[Other] simulation of closing the gate using moving mesh simin_ds OpenFOAM Meshing & Mesh Conversion 8 April 12, 2019 05:49
rSF: p divergence in combustor (wt negative value) zonda OpenFOAM Pre-Processing 4 April 10, 2018 06:59
time step continuity problem in VAWT simulation lpz_michele OpenFOAM Running, Solving & CFD 5 February 22, 2018 19:50
Divergent temperature in chtMultiRegion(Simple)Foam akrasemann OpenFOAM Running, Solving & CFD 13 March 24, 2014 02:54


All times are GMT -4. The time now is 00:45.