|
[Sponsors] |
October 10, 2018, 04:46 |
How to access endTime in codedFixedValue
|
#1 |
Senior Member
Abe
Join Date: May 2016
Posts: 119
Rep Power: 10 |
Hey everyone,
this is pretty simple, but I can't seem to figure it out! I am just trying to access "endTime" in my codestream so that I can set the flow direction to move through a 90 degree angle from startTime to endTime. I have made various wild guesses, but no luck - the below breaks at the line: scalar tend = this->db().time().endTime(); Code:
"in.*" { type codedFixedValue; value uniform (0 0 0); redirectType timeDepWind; code #{ scalar U_0 = 3; const fvPatch& boundaryPatch = patch(); const vectorField& Cf = boundaryPatch.Cf(); vectorField& field = *this; scalar t = this->db().time().value(); scalar tend = this->db().time().endTime(); forAll(Cf, faceI) { field[faceI] = vector(tend,0,0); } #}; codeOptions #{ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude #}; codeInclude #{ #include "fvCFD.H" #include <cmath> #include <iostream> #}; } Any ideas? |
|
October 16, 2018, 05:00 |
|
#2 |
Senior Member
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14 |
Hi!
You try to pass a dimensionedScalar to a scalar. Try with this->db().time().endTime().value() Maybe you just need "this->db().endTime().value()", i'm not sure which is the correct, but that .value() is missing. |
|
October 16, 2018, 05:52 |
|
#3 |
Senior Member
Abe
Join Date: May 2016
Posts: 119
Rep Power: 10 |
Thanks! It is working with:
this->db().time().endTime().value() I need to spend more time learning C++... |
|
|
|
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 16:13 |
codedFixedValue: accessing other patch causes crash in parallel | RL-S | OpenFOAM Running, Solving & CFD | 2 | December 24, 2019 22:20 |
cannot set exact 'endtime' in controlDict when using a steady state solver | minecraftgp | OpenFOAM Running, Solving & CFD | 4 | July 24, 2018 06:13 |
codedFixedValue BC access to boundary patch face nodes instead of centers? | Svenja | OpenFOAM Pre-Processing | 0 | April 10, 2018 04:56 |
Is there a way to access the gradient limiter in Fluent ? | CFDYourself | FLUENT | 1 | February 16, 2016 06:49 |