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

Access to field outside of base class

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 30, 2023, 13:31
Default Access to field outside of base class
  #1
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
Hello everyone,

I am working on a new boundary condition based on timeVaryingMappedFixedValue in OF-10. When I implemented it in OF231 (I know, long time between updates), the structure of that BC has changed. In my case, I'm basically reading in and mapping a scalarField from previous results and then multiplying the value of the fields like this inside the updateCoeffs function timeVaryingMappedFixedValueFvPatchField.C (in 2.3.1):

Code:
const Field<Type>& patchVal = *this;
this->operator==(patchVal*mappedScalarField)
In OF 6 and above I believe, the mapping and evaluation functions were separated so there is a timeVaryingMappedFvPatchField and a timeVaryingMappedFixedValueFvPatchField. updateCoeffs is in the latter, but I want to know if its possible to access the field values in the former in OF10, ie for timeVaryingMappedFvPatchField::map

Code:
Field<Type> fld; //temporary field holder, excluding some of the creation issues

Field<Type> curVals; // <-- Current patch values;

fld = (mappedScalarField*curVals);
The map function returns a tmp<Field<Type>> that is used in updateCoeffs:

Code:
this->operator==(fieldMapper_.map()) //fieldMapper is the timeVaryingFvPatchField that is part of timeVaryingFixedValueFvPatchField

fixedValueFvPatchField<Type>::updateCoeffs();
I can make an access function where mappedScalarField can be accessed and I can do the calculations there, but it seems like a lot of work, especially if (in the real situation) I am mapping multiple fields and accessing other members.

Thanks for any input you can provide!
mturcios777 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
Long output in terminal. ssa_cfd OpenFOAM Running, Solving & CFD 1 March 18, 2019 05:25
Access pointDisplacement field from within pimpleDyMFoam paul b OpenFOAM Programming & Development 0 December 2, 2016 03:16
Accessing field values with in a dynamic mesh motion class kcn OpenFOAM Programming & Development 2 July 21, 2015 00:52
Access to Domain Pressure Field or mesh ar_mofidi OpenFOAM 0 April 12, 2010 06:47
Access Field values at certain time andrea OpenFOAM Running, Solving & CFD 0 August 31, 2009 06:24


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