CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums

access field in BC condition

Register Blogs Community New Posts Updated Threads Search

Rate this Entry

access field in BC condition

Posted May 11, 2017 at 10:26 by kindle
Updated June 7, 2017 at 13:13 by kindle

Two other links may be interesting

value of previous time step

objectRegistry::lookupObject<scalar>

Quote:
Originally Posted by alberto View Post
How can a field defined in the solver code be accessed from within the code of a boundary condition?

As explained here http://www.cfd-online.com/OpenFOAM_D...tml?1133622442, I'm trying to add Johnson and Jackson's BCs to the twoPhaseEulerFoam solver, but I can't have access to the solver fields. I get the error:

/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.2 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/


Exec : twoPhaseEulerFoam . Rhodes2D
Date : Dec 05 2005
Time : 21:06:15
Host : dimension4400
PID : 13204
Root : /home/alberto/OpenFOAM/alberto-1.2/run/FluidBeds
Case : Rhodes2D
Nprocs : 1
Create time

Create mesh for time = 0


Reading environmentalProperties
Reading transportProperties



--> FOAM FATAL ERROR :
request for volScalarField alpha from objectRegistry region0 failed
available objects of type volScalarField are

0
(
)


From function objectRegistry::lookupObject<type>(const word&) const
in file /home/dm2/henry/OpenFOAM/OpenFOAM-1.2/src/OpenFOAM/lnInclude/objectRegistryTempl ates.C at line 122.

FOAM aborting

I try to read the alpha field as follows:

const fvPatchField<scalar>& alpha = lookupPatchField<volScalarField,
scalar >
(
"alpha"
);

Also, how can I have access to the kineticTheoryProperties dictionary from the BC code? I get an error message which tells me the dictionary can't be found if I try to read from it.

Thanks in advance,
Alberto
Posted in programming
Views 770 Comments 0 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 0

Comments

 

All times are GMT -4. The time now is 12:44.