|
[Sponsors] |
How to access p and U within rotatingMotion.C/H |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 30, 2016, 18:24 |
How to access p and U within rotatingMotion.C/H
|
#1 |
Member
Join Date: Nov 2009
Posts: 65
Rep Power: 16 |
Hi all,
I try to modify "rotatingMotion.C/H" of solidBodyMotionFunctions as those can calculate moment vector from p(pressure) and U(viscousity). Thus, I hope to obtain p and U from previous timestep results. I'd like to know the way to access such results if available. Another question. rotatingMotion class has a constructer as below. It uses runTime as time_, and runTime is a objectRegistory. I can access to p and U via runTime(i.e.,time_) ? Thanks in advance, waku2005 Code:
//- Construct from components rotatingMotion ( const dictionary& SBMFCoeffs, const Time& runTime ); //- Construct and return a clone virtual autoPtr<solidBodyMotionFunction> clone() const { return autoPtr<solidBodyMotionFunction> ( new rotatingMotion ( SBMFCoeffs_, time_ ) ); } |
|
December 2, 2016, 03:51 |
|
#2 | |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24 |
you can use following structure to read U or p from solver:
Quote:
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
||
December 4, 2016, 19:43 |
|
#3 |
Member
Join Date: Nov 2009
Posts: 65
Rep Power: 16 |
Hi, nimasam
Thank you for your reply. I added "#include "volFields.H"" and the line you mentioned. Code:
#include "DDrotatingMotion.H" #include "addToRunTimeSelectionTable.H" #include "mathematicalConstants.H" #include "volFields.H" //<-- added Code:
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // Foam::septernion Foam::directDrivenMotionFunctions::DDrotatingMotion::transformation() const { scalar t = time_.value(); // Rotation around axis scalar angle = omega_->integrate(0, t); const volVectorField& U = db().lookupObject<volVectorField>("U"); //<-- added quaternion R(axis_, angle); septernion TR(septernion(-origin_)*R*septernion(origin_)); DebugInFunction << "Time = " << t << " transformation: " << TR << endl; return TR; } Code:
directDrivenMotionFunctions/DDrotatingMotion/DDrotatingMotion.C: In member function ‘virtual Foam::septernion Foam::directDrivenMotionFunctions::DDrotatingMotion::transformation() const’: directDrivenMotionFunctions/DDrotatingMotion/DDrotatingMotion.C:82:34: error: ‘db’ was not declared in this scope const volVectorField& U = db().lookupObject<volVectorField>("U"); ^ directDrivenMotionFunctions/DDrotatingMotion/DDrotatingMotion.C:82:63: error: expected primary-expression before ‘>’ token const volVectorField& U = db().lookupObject<volVectorField>("U"); How do I access to db() ? Best regards waku2005 |
|
December 5, 2016, 01:34 |
|
#4 |
Member
Join Date: Nov 2009
Posts: 65
Rep Power: 16 |
Hi
I changed the line to: Code:
const volVectorField& U = time_.db().lookupObject<volVectorField>("U"); Code:
--> FOAM FATAL ERROR: request for volVectorField U from objectRegistry mixerVesselAMI2D failed available objects of type volVectorField are 0() waku2005 |
|
January 18, 2017, 04:13 |
|
#5 |
Member
Alexander Nekris
Join Date: Feb 2015
Location: France
Posts: 32
Rep Power: 11 |
Hi waku2005,
I'm struggling with a similar Problem. I have to define an additional function in the class multiComponentMixture and for this new function I need to access the volScalarField rho at each time step. Did you succeed to resolve this issue? Best regards Neka |
|
January 26, 2017, 12:03 |
|
#6 |
Member
Alexander Nekris
Join Date: Feb 2015
Location: France
Posts: 32
Rep Power: 11 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[DesignModeler] DesignModeler Scripting: How to get Full Command Access | ANT | ANSYS Meshing & Geometry | 53 | February 16, 2020 15:13 |
DPM, access particle data - number of tries | wsaac | Fluent UDF and Scheme Programming | 1 | July 31, 2018 02:40 |
Is there a way to access the gradient limiter in Fluent ? | CFDYourself | FLUENT | 1 | February 16, 2016 05:49 |
Online libraries - with access to Journals | momentum_waves | Main CFD Forum | 2 | December 12, 2007 10:08 |
Error: access: unbound variable,HELP | sudhakar | FLUENT | 0 | January 15, 2007 23:21 |