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

[swak4Foam] how to access a variable from "sources" for writing a SWAK-EXPRESSION

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 1, 2016, 03:28
Default how to access a variable from "sources" for writing a SWAK-EXPRESSION
  #1
Member
 
a
Join Date: Oct 2014
Posts: 49
Rep Power: 11
cfd@kgp is on a distinguished road
Dear FoAMERs'

There is a variable named as alpha1_ in one of the derived sources named as "solidificationMeltingSource" defined in "solidificationMeltingSource.H
Quote:
volScalarField alpha1_;
also in "solidificationMeltingSource.C" it is defined as IOobject

Quote:
alpha1_
(
IOobject
(
name_ + ":alpha1",
mesh.time().timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("alpha1", dimless, 0.0),
zeroGradientFvPatchScalarField::typeName
),
when I am using the source through "buoyantPimpleFoam" solver/application,

the swakexpression cannot recognize alpha1 variable.

But as alpha1 is a IO object in output files the field of alpha1 is written as output, here it name is printed as "sMS1:alpha1" ( sMs1 is a name provided to the set of input variables in contant directory in fvOptions file)

by any way swak4Fom/functions/coding please guide me so that I can calculate some derived quantities using this field of alpha1 for every time step.

I am not a expert in C language so please instruct me in detail.

Anxiously waiting for a any kind of help

Regards.
cfd@kgp is offline   Reply With Quote

Old   December 1, 2016, 06:49
Default How to define a global variable in application--globalfor src/ utilities?
  #2
Member
 
a
Join Date: Oct 2014
Posts: 49
Rep Power: 11
cfd@kgp is on a distinguished road
How to define a global variable in application such that the src/....../derived sources can update it

Any new scalar created in application or meltingandsolidificationsources they are not global and we cannot transfer the information from one (application or src ) to other (src or application ).


I am very new to C++ and openfoam programming kindly help...
cfd@kgp 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
[swak4Foam] is it possible to exclude some faces in calculating an expression on a patch in SWAK? immortality OpenFOAM Community Contributions 12 August 14, 2013 22:52
Error: access: unbound variable Shriram Main CFD Forum 0 June 22, 2007 08:31
Error : access : Unknown variable & Phase-domain MKP FLUENT 0 August 28, 2006 03:40
Error: access: unbound variable vivek FLUENT 0 June 6, 2005 06:05
Error: access: unbound variable cfd-novice FLUENT 0 April 3, 2003 04:53


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