CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Issue with codedFixedValue: oldTime()

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By anthonygay1812

LinkBack Thread Tools Search this Thread Display Modes
Old   May 3, 2020, 00:55
Default Issue with codedFixedValue: oldTime()
New Member
Anthony Gay
Join Date: Oct 2019
Posts: 17
Rep Power: 6
anthonygay1812 is on a distinguished road

I'm trying to implement the following BC

        type               codedFixedValue; 
        value              $internalField;
        redirectType       hybridParticleContinuim; 

            const fvMesh& fluidMeshRef = patch().boundaryMesh().mesh();
            const volScalarField& pFluid = db().lookupObject<volScalarField>("p"); 
            const volScalarField& pParticle = db().lookupObject<volScalarField>("p_Mean");
            const volScalarField& pFluidOld=pFluid.oldTime();
            Info<< "code accessed";

            //const scalar t = this->db().time().value();
            const label fluidIdx=fluidMeshRef.nCells();
            const label particleIdx=1;
            const scalar w=0.75; 

Unfortunately the
is triggering the following error

/p.boundaryField.fluidBound:43:28: error: invalid operands of types ‘void’ and ‘const double’ to binary ‘operator*’
/opt/openfoam7/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/fixedValueFvPatchFieldTemplate.o' failed
make: *** [Make/linux64GccDPInt32Opt/fixedValueFvPatchFieldTemplate.o] Error 1

I can't quite figure out how to approach this. I have figured out that its pFluidOld[fluidIdx] thats returning a void value. Is there a better way to get the pressure from the previous timestep?

Any help is appreciated thank you!
anthonygay1812 is offline   Reply With Quote

Old   May 3, 2020, 01:58
Default Resolved Sort of
New Member
Anthony Gay
Join Date: Oct 2019
Posts: 17
Rep Power: 6
anthonygay1812 is on a distinguished road
So it turns out my initial guess was way off and I simply had a syntax error in the operator statement, the correct line is
Notice the parenthesis. Unfortunately now my code is crashing when it tries to access the BC

/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Create mesh for time = 0

Meshes created
Reading thermophysical properties

Selecting thermodynamics package 
    type            hePsiThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleInternalEnergy;

Using dynamicCode for patch fluidBound on field p at line 30 in "/home/anthonygay1812/OpenFOAM/Working/finalShockTube/0/fluid/p.boundaryField.fluidBound"
I have run into this sort of issue before and it happened when I had not properly initialized with the setFields command. So my guess is that something within the BC code may not accessible.
ruloz likes this.
anthonygay1812 is offline   Reply With Quote


boundary condition, codedfixedvalue, time average problem

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Issue on zeroGradient BC for system rotation magnushaese OpenFOAM Running, Solving & CFD 2 January 28, 2022 13:43
rhoCentralFoam inviscid airfoil issue (Foam::error::printStack(Foam::Ostream&) at ??) kmkb21 OpenFOAM Running, Solving & CFD 1 March 1, 2018 01:07
Prism Layer - Core Mesh Boundary Issue InfernoxCJC STAR-CCM+ 7 November 21, 2017 15:46
foamToTecplot360 issue with multiregion solvers manuc OpenFOAM Post-Processing 2 November 21, 2016 13:51
Pressure boundary condition issue Vijay FLUENT 0 April 6, 2012 13:35

All times are GMT -4. The time now is 23:58.