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

Time-varying boundary condition

Register Blogs Community New Posts Updated Threads Search

Like Tree17Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 9, 2014, 17:38
Lightbulb
  #21
New Member
 
Charlie
Join Date: May 2014
Posts: 9
Rep Power: 11
mechem is on a distinguished road
Thanks a lot Maysam and Bruno for your public discussion on this issue.

I was searching a lot for such boundary condition to calculate minimum fluidization velocity. and it is good news to see it works.

How can I use time varying boundary condition in U.air?

I need a gradually increase from zaero to a maximum air velocity.

Theanks
mechem is offline   Reply With Quote

Old   December 9, 2014, 17:46
Smile
  #22
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 17
maysmech is on a distinguished road
Hi Bruno,
You are a kind expert in fluid mechanics and C++ programming and I and other cfd-online users have learned a lot from you. Thanks

Hi Charlie,
Use something like this:
Code:
    {
        type            uniformInterstitialInletVelocity;
        uniformInletVelocity   table
(
(0 (0 0 0.1))
(10 (0 0 1.5))
)
;
        inletVelocity   uniform (0 0 1.5);
        value           uniform (0 0 1.5);
        phi             phi.air;
        alpha           alpha.air;
    }
wyldckat likes this.
maysmech is offline   Reply With Quote

Old   March 11, 2015, 09:19
Default
  #23
Member
 
Alexander Bartel
Join Date: Feb 2015
Location: Germany
Posts: 97
Rep Power: 11
alexB is on a distinguished road
Hi maysam, Bruno, or someone with a bit experience on this issue,

I have got a (hopefully) rather simple question.

the table isn't fully explained on the official website. ( http://www.openfoam.org/version2.1.0...conditions.php )
I think because it seems to clear.
Quote:
uniformValue table
(
( 0 0.0)
(100 10.0)
);
I suppose the first entry is the time in seconds and the second entry is the value to be set at the time (first entry).
So in this example the boundary condition is set to 0.0 from 0s to 100s, and set to 10.0 from 100s until the end of the computation.

Is that right?
I hope it isn't, because it behaves a bit different on my computer.

kind regards
Alex
alexB is offline   Reply With Quote

Old   April 30, 2015, 11:55
Default
  #24
Member
 
Alexander Bartel
Join Date: Feb 2015
Location: Germany
Posts: 97
Rep Power: 11
alexB is on a distinguished road
At least I am at the point to make my problem more clearly.
But fortunately I solved the problem myself, while I tried to write a simple testcase.
Now I want to share not only the problem but also the solution.

I am using OF 2.3.1 and 2.3.0 and tried to move a mesh with pimpleDyMFoam(just for the mesh motion(like in the tutorial pimpleDyMFoam/movingCone) and InterPhaseChangeFoam (for a study of cavitation in moved diesel Injectors).

for this problem I defined a little list in the pointmotionU file:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |

...
snip
...

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    moving
    {
        type            uniformFixedValue;
        //uniformValue    constant 0.25;
        uniformValue     table
        (
            (0.000     0)
            (0.0005     0.25)
            (0.001     0)
            (0.0015     -0.25)
            (0.002     0)
        ); 
    }
    walls
    {
        type            uniformFixedValue;
        uniformValue    constant 0;
    }

...
snip
...

}

// ************************************************************************* //
The output was not as I wanted, motion between 0.0005 and 0.001 with 0.25, motion between 0.0015 and 0.002 with -0.25 and no motion from 0 to 0.0005, 0.001 to 0.0015 and 0.002 to 0.003.

Instead the mesh moved from the beginning to approx 0.001 up and from 0.001 to 0.002 down.

I don't know why, but with this adjustment the output was perfect.
Code:
...
snip
...

        type            uniformFixedValue;
        //uniformValue    constant 0.25;
        uniformValue     table
        (
            (0 0)
            (0.0005 0)
            (0.000501 0.25)
            (0.001 0.25)
            (0.001001 0)
            (0.0015 0)
            (0.001501 -0.25)
            (0.002 -0.25)
            (0.002001 0)
            (0.003 0)
        );

...
snip
...
perhaps OF averaged over two entries or something like that...
if someone with more experience has a good explanation.... feel free to share it.

If anyone likes to test my code snippets... just copy them in the pointmotionUx file in pimpleDyMFoam/movingCone/0, modify the velocity to 5 and run it.

best regards
Alex
alexB is offline   Reply With Quote

Old   May 3, 2015, 14:07
Default
  #25
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Alex,

Sorry for the late reply, but only today did I manage to answer to your questions here.

If you take a look at the tutorial "incompressible/pimpleFoam/TJunction" and run it, you should be able to see that this table that is in the file "0/p":
Code:
    inlet
    {
        type            uniformTotalPressure;
        pressure        table
        (
            (0 10)
            (1 40)
        );
        p0              40; // only used for restarts
        U               U;
        phi             phi;
        rho             none;
        psi             none;
        gamma           1;
        value           uniform 40;
    }
is in fact an interpolation table. In other words, for this example, the values change linearly between the 0.0 and 1.0 second markers:
Code:
p_i = 10 + (40-10)*t/(1-0)
As for your problem, the "pointmotionU" field file refers to point motion velocity, it does not refer to point motion position; the one for that is "pointMotionDisplacement", if I remember correctly.
That is why your solution sort-of worked, since you restrained the interpolation mechanism that this specific table system uses.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   May 5, 2015, 17:39
Default
  #26
Member
 
Alexander Bartel
Join Date: Feb 2015
Location: Germany
Posts: 97
Rep Power: 11
alexB is on a distinguished road
Thanks for the explanation Bruno,

now everything is clear

And you don't have to apologize... you're doing enough here and my question from the eleventh of March was a bit tooo general to insist on a fast reply.

br
Alex
alexB is offline   Reply With Quote

Old   September 28, 2015, 12:34
Default Maximum time value for table entries
  #27
New Member
 
James Montague
Join Date: Jan 2014
Location: Vermont, United States
Posts: 7
Rep Power: 12
Montague is on a distinguished road
I have a general question on time-varying boundary conditions. Is there a maximum time (in seconds) that can be used in a table?

I am using flowRateInletVelocity in which I switch flow on and off over the course of two months. This means that my table looks like this:

Code:
type            flowRateInletVelocity;
volumetricFlowRate  table
(
       	 (0 1.66666667e-6)
       	 (5400 1.66666667e-6)
       	 (5401 0)
       	 (1891800 0)
       	 (1891801 1.66666667e-6)
	 (1897200 1.66666667e-6)
         (1897201 0)
	 (3094200 0)
	 (3094201 1.66666667e-6)
	 (3099600 1.66666667e-6)
	 (3099601 0)
	 (4554000 0)
	 (4554001 1.66666667e-6)
	 (4559400 1.66666667e-6)
	 (4559401 0)
	 (6100200 0)
	 (6100201 1.66666667e-6)
	 (6105600 1.66666667e-6)
	 (6105601 0)
);
When running the code with only the first 3 table entries I get no errors, but when running the code using the full table I get:

Code:
Reading field U

[1] 
[1] 
[1] --> FOAM FATAL ERROR: 
[1] out-of-order value: 1.8918e+06 at index 4
[1] 
[1]     From function Foam::TableBase<Type>::check() const
[1]     in file lnInclude/TableBase.C at line 203.
[1] 
FOAM parallel run exiting
This error implies that my time points used in the table are not increasing, which is incorrect. My only thought right now is that there is a maximum value that can be used in the table. As a side note, I have tried changing the notation from 1891800->1.8918e6 with the same error resulting.

Thanks,
Jim

Last edited by Montague; September 29, 2015 at 09:50.
Montague is offline   Reply With Quote

Old   September 29, 2015, 11:00
Default
  #28
New Member
 
James Montague
Join Date: Jan 2014
Location: Vermont, United States
Posts: 7
Rep Power: 12
Montague is on a distinguished road
After some experimentation, I have found that the increase in each time step at large values should be at least the time step used. I was using a time step of 60 s, so my new table has time increments of at least 60 s rather than my previous table that used timesteps of 1 s.

Code:
type            flowRateInletVelocity;
volumetricFlowRate  table
(
       	 (0 1.66666667e-6)
       	 (5400 1.66666667e-6)
       	 (5460 0)
       	 (1891800 0)
       	 (1891860 1.66666667e-6)
	 (1897200 1.66666667e-6)
         (1897260 0)
	 (3094200 0)
	 (3094260 1.66666667e-6)
	 (3099600 1.66666667e-6)
	 (3099660 0)
	 (4554000 0)
	 (4554060 1.66666667e-6)
	 (4559400 1.66666667e-6)
	 (4559460 0)
	 (6100200 0)
	 (6100260 1.66666667e-6)
	 (6105600 1.66666667e-6)
	 (6105660 0)
);
So far this solution seems to be working, or at least is still running. I have tried looking through the source code for TableBase and found no indication of why this error would occur with a step of 1 s and not occur with a step of 60 s (my timestep in controlDict). If anyone has insight I'd be happy to hear it.

Best,
Jim
Montague is offline   Reply With Quote

Old   October 4, 2015, 15:46
Default
  #29
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer @Jim: I don't have time to test this myself, but I suspect the problem has to do with the time precision option in "system/controlDict":
Code:
timePrecision   6;
6 digits is the common value used in OpenFOAM's tutorial cases. Your time rows have 7 digits.
Montague likes this.
wyldckat is offline   Reply With Quote

Old   October 5, 2015, 15:06
Default
  #30
New Member
 
James Montague
Join Date: Jan 2014
Location: Vermont, United States
Posts: 7
Rep Power: 12
Montague is on a distinguished road
Thanks Bruno!

That seems to have been the issue. The writePrecission option should also be changed to match the timePrecision.

-Jim
Montague is offline   Reply With Quote

Old   January 28, 2016, 16:05
Default
  #31
Member
 
Ali
Join Date: Aug 2011
Location: Milwaukee
Posts: 34
Rep Power: 14
alib022 is on a distinguished road
Hello everyone,

I am trying to do the same thing (time varying boundary condition) and I am getting the same error but I cant find the reason. I highly appreciate any helps.
Here is my boundary condition:

Code:
type            flowRateInletVelocity;
      volumetricFlowRate           table

	8
	(
	(0 0.2747e-6)
	(0.025 0.2961e-6)
	(0.05 0.3654e-6)
	(0.075 0.4168e-6)
	(0.1 0.3889e-6)
	(0.125 0.3847e-6)
	(0.15 0.4157e-6)
	(0.175 0.4474e-6)
	)
	;
and here is the error:

Code:
--> FOAM FATAL ERROR: 
out-of-order value: 0.1 at index 5

    From function Foam::TableBase<Type>::check() const
    in file lnInclude/TableBase.C at line 203.
Thank you in advance
alib022 is offline   Reply With Quote

Old   January 28, 2016, 17:31
Default
  #32
New Member
 
James Montague
Join Date: Jan 2014
Location: Vermont, United States
Posts: 7
Rep Power: 12
Montague is on a distinguished road
Hi Ali,

I tried running a simple case using your boundary condition and the only way I can get an error is by changing the writePrecision in the controlDict to a smaller value (<=4). I would recommend looking at these values first to make sure they are large enough to capture the precision you need. Additionally, the error I get refers to index 4 rather than index 5 as the out of order value.

I hope this helps

Best,
Jim
Montague is offline   Reply With Quote

Old   January 28, 2016, 22:29
Default
  #33
Member
 
Ali
Join Date: Aug 2011
Location: Milwaukee
Posts: 34
Rep Power: 14
alib022 is on a distinguished road
Hey Jim,

Thanks for the reply. I actually solved the problem by defining my table in a file. As soon as I put the table inside a separate file the problem solved! Also my writePrecision is on 6.

But thanks again.

Cheers
Ali
alib022 is offline   Reply With Quote

Old   October 18, 2019, 02:24
Default
  #34
Member
 
George Pichurov
Join Date: Jul 2010
Posts: 52
Rep Power: 15
jorkolino is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Velocity is a vector so table should contain vectors (1 0 0). You put there scalars, and it is the reason for OpenFOAM to complain.

Table should be something like:

{type uniformFixedValue;
uniformValue table
(
(0 (0 0 0))
(2.0 (1.0 0 0))
)
}
Is this a ramp boundary condition? How can I make it stepwise, i.e. from 0 to 2 sec. have velocity 0, from 2 to 3 sec. velocity 1 etc. What pops in mind is something like
Code:
(0 (0 0 0))
 (2.0 (0 0 0))
(2.0 (1 0 0)
(3.0 (1 0 0)
but will it work and is there a better way?
jorkolino is offline   Reply With Quote

Old   February 2, 2021, 10:46
Default
  #35
Member
 
Vitor Monteiro
Join Date: Nov 2020
Posts: 32
Rep Power: 5
Vitor Monteiro is on a distinguished road
How can I do this interstitial varying velocity (today...rs) at OpenFOAM 8?

I've tried to copy those files but when wmake I've got:

Quote:
fatal error: DataEntry.H: File or directory not found.
Then I've replaced those files with Function1.H

Now, I'm having this kind of problem:

Quote:
/opt/openfoam8/src/OpenFOAM/lnInclude/spatialTransformI.H:288:13: note: candidate: void Foam::writeEntry(Foam::Ostream&, const Foam::spatialTransform&)
inline void writeEntry(Ostream& os, const spatialTransform& st)
^
/opt/openfoam8/src/OpenFOAM/lnInclude/spatialTransformI.H:288:13: note: no known conversion for argument 1 from ‘const char [6]’ to ‘Foam::Ostream&’
/opt/openfoam8/wmake/rules/General/transform:25: recipe for target '/opt/openfoam8/platforms/linux64GccDPInt32Opt/src/finiteVolume/fields/fvPatchFields/derived/uniformInterstitialInletVelocity/uniformInterstitialInletVelocityFvPatchVectorField .o' failed
make: *** [/opt/openfoam8/platforms/linux64GccDPInt32Opt/src/finiteVolume/fields/fvPatchFields/derived/uniformInterstitialInletVelocity/uniformInterstitialInletVelocityFvPatchVectorField .o] Error 1


Thanks if someone could help!

Last edited by Vitor Monteiro; February 2, 2021 at 12:48.
Vitor Monteiro is offline   Reply With Quote

Old   February 17, 2021, 07:35
Default
  #36
Member
 
Vitor Monteiro
Join Date: Nov 2020
Posts: 32
Rep Power: 5
Vitor Monteiro is on a distinguished road
Actually, I've solved the problem modifying uniformInterstitialInletVelocityFvPatchVectorField .C and uniformInterstitialInletVelocityFvPatchVectorField .H files:

Code:
/*---------------------------------------------------------------------------*\
=========                 |
\\      /  F ield         | Unsupported Contributions for OpenFOAM
 \\    /   O peration     |
  \\  /    A nd           | Copyright (C) 2013-2014 OpenFOAM Foundation
   \\/     M anipulation  |
-------------------------------------------------------------------------------
2014-11-30 Bruno Santos (wyldckat):
    Cross-over BC between interstitialInletVelocityFvPatchVectorField and
    uniformFixedValueFvPatchField, but oriented to interpolate data over time.

    Created for fulfilling the request on this thread:
      http://www.cfd-online.com/Forums/ope...g-development/
      121366-time-varying-boundary-condition.html
-------------------------------------------------------------------------------

License
    This file is a derivative work of OpenFOAM.

    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    You should have received a copy of the GNU General Public License
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.

Class
    Foam::uniformInterstitialInletVelocityFvPatchVectorField

\*---------------------------------------------------------------------------*/

#include "uniformInterstitialInletVelocityFvPatchVectorField.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "surfaceFields.H"

// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //


Foam::uniformInterstitialInletVelocityFvPatchVectorField::
uniformInterstitialInletVelocityFvPatchVectorField
(
    const fvPatch& p,
    const DimensionedField<vector, volMesh>& iF
)
:
    fixedValueFvPatchVectorField(p, iF),
    uniformInletVelocity_(),
    //inletVelocity_(p.size(), vector::zero),
    inletVelocity_(p.size(), Zero),
    alphaName_("alpha")
{}


Foam::uniformInterstitialInletVelocityFvPatchVectorField::
uniformInterstitialInletVelocityFvPatchVectorField
(
    const uniformInterstitialInletVelocityFvPatchVectorField& ptf,
    const fvPatch& p,
    const DimensionedField<vector, volMesh>& iF,
    const fvPatchFieldMapper& mapper
)
:
    fixedValueFvPatchVectorField(ptf, p, iF, mapper),
    uniformInletVelocity_(ptf.uniformInletVelocity_().clone().ptr()),
    //inletVelocity_(ptf.inletVelocity_, mapper),
    inletVelocity_(mapper(ptf.inletVelocity_)),
    alphaName_(ptf.alphaName_)
{}


Foam::uniformInterstitialInletVelocityFvPatchVectorField::
uniformInterstitialInletVelocityFvPatchVectorField
(
    const fvPatch& p,
    const DimensionedField<vector, volMesh>& iF,
    const dictionary& dict
)
:
    fixedValueFvPatchVectorField(p, iF, dict),
    uniformInletVelocity_(Function1<vector>::New("uniformInletVelocity", dict)),
    inletVelocity_("inletVelocity", dict, p.size()),
    alphaName_(dict.lookupOrDefault<word>("alpha", "alpha"))
{}


Foam::uniformInterstitialInletVelocityFvPatchVectorField::
uniformInterstitialInletVelocityFvPatchVectorField
(
    const uniformInterstitialInletVelocityFvPatchVectorField& ptf
)
:
    fixedValueFvPatchVectorField(ptf),
    uniformInletVelocity_
    (
        ptf.uniformInletVelocity_.valid()
      ? ptf.uniformInletVelocity_().clone().ptr()
      : NULL
    ),
    inletVelocity_(ptf.inletVelocity_),
    alphaName_(ptf.alphaName_)
{}


Foam::uniformInterstitialInletVelocityFvPatchVectorField::
uniformInterstitialInletVelocityFvPatchVectorField
(
    const uniformInterstitialInletVelocityFvPatchVectorField& ptf,
    const DimensionedField<vector, volMesh>& iF
)
:
    fixedValueFvPatchVectorField(ptf, iF),
    uniformInletVelocity_
    (
        ptf.uniformInletVelocity_.valid()
      ? ptf.uniformInletVelocity_().clone().ptr()
      : NULL
    ),
    inletVelocity_(ptf.inletVelocity_),
    alphaName_(ptf.alphaName_)
{}


// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //

void Foam::uniformInterstitialInletVelocityFvPatchVectorField::autoMap
(
    const fvPatchFieldMapper& m
)
{
    fixedValueFvPatchVectorField::autoMap(m);
    //inletVelocity_.autoMap(m);
    m(inletVelocity_, inletVelocity_);
}


void Foam::uniformInterstitialInletVelocityFvPatchVectorField::rmap
(
    const fvPatchVectorField& ptf,
    const labelList& addr
)
{
    fixedValueFvPatchVectorField::rmap(ptf, addr);

    const uniformInterstitialInletVelocityFvPatchVectorField& tiptf =
        refCast<const uniformInterstitialInletVelocityFvPatchVectorField>(ptf);

    inletVelocity_.rmap(tiptf.inletVelocity_, addr);
}


void Foam::uniformInterstitialInletVelocityFvPatchVectorField::updateCoeffs()
{
    if (updated())
    {
        return;
    }

    const fvPatchField<scalar>& alphap =
        patch().lookupPatchField<volScalarField, scalar>(alphaName_);
    const scalar t = this->db().time().timeOutputValue();
    
    inletVelocity_ = uniformInletVelocity_->value(t);
    operator==(inletVelocity_/alphap);
    fixedValueFvPatchVectorField::updateCoeffs();
}


void Foam::uniformInterstitialInletVelocityFvPatchVectorField::write
(
    Ostream& os
) const
{
    fvPatchField<vector>::write(os);
    writeEntryIfDifferent<word>(os, "alpha", "alpha", alphaName_);
    uniformInletVelocity_->writeData(os);
    //inletVelocity_.writeEntry("inletVelocity", os);
    writeEntry(os, "inletVelocity", inletVelocity_);
    //writeEntry("value", os);
    writeEntry(os, "value", *this);
}


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{
   makePatchTypeField
   (
       fvPatchVectorField,
       uniformInterstitialInletVelocityFvPatchVectorField
   );
}


// ************************************************************************* //

Code:
/*---------------------------------------------------------------------------*\
=========                 |
\\      /  F ield         | Unsupported Contributions for OpenFOAM
 \\    /   O peration     |
  \\  /    A nd           | Copyright (C) 2013-2014 OpenFOAM Foundation
   \\/     M anipulation  |
-------------------------------------------------------------------------------
2014-11-30 Bruno Santos (wyldckat):
    Cross-over BC between interstitialInletVelocityFvPatchVectorField and
    uniformFixedValueFvPatchField, but oriented to interpolate data over time.
 
    Created for fulfilling the request on this thread:
      http://www.cfd-online.com/Forums/ope...g-development/
      121366-time-varying-boundary-condition.html
-------------------------------------------------------------------------------

License
    This file is a derivative work of OpenFOAM.

    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    You should have received a copy of the GNU General Public License
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.

Class
    Foam::uniformInterstitialInletVelocityFvPatchVectorField

Description
    Time dependent inlet velocity in which the actual interstitial velocity is
    calculated by dividing the specified inletVelocity field with the local
    phase-fraction.

    \heading Patch usage

    \table
        Property             | Description             | Required    |
        uniformInletVelocity | Non-interstitial inlet velocity | yes |
        alpha                | Name of the phase-fraction field | yes |
        inletVelocity        | Current non-interstitial inlet velocity | yes |
    \endtable

    Example of the boundary condition specification:
    \verbatim
    inlet
    {
        type                     uniformInterstitialInletVelocity;
        uniformInletVelocity     constant (0 0.2 0);
        alpha                    alpha.particles;
        inletVelocity            uniform (0 0.2 0);
        value                    uniform (0 0 0);
    }
    \endverbatim

SourceFiles
    uniformInterstitialInletVelocityFvPatchVectorField.C

\*---------------------------------------------------------------------------*/

#ifndef uniformInterstitialInletVelocityFvPatchVectorField_H
#define uniformInterstitialInletVelocityFvPatchVectorField_H

#include "fixedValueFvPatchFields.H"
#include "Function1.H"
#include "fieldTypes.H"


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{
/*---------------------------------------------------------------------------*\
               Class uniformInterstitialInletVelocityFvPatch Declaration
\*---------------------------------------------------------------------------*/

class uniformInterstitialInletVelocityFvPatchVectorField
:
    public fixedValueFvPatchVectorField
{
    // Private data

        //- Time varying inlet velocity
        autoPtr<Function1<vector> > uniformInletVelocity_;

        //- Inlet velocity
        vectorField inletVelocity_;

        //- Name of the flux transporting the field
        word alphaName_;


public:

   //- Runtime type information
   TypeName("uniformInterstitialInletVelocity");


   // Constructors

        //- Construct from patch and internal field
        uniformInterstitialInletVelocityFvPatchVectorField
        (
            const fvPatch&,
            const DimensionedField<vector, volMesh>&
        );

        //- Construct from patch, internal field and dictionary
        uniformInterstitialInletVelocityFvPatchVectorField
        (
            const fvPatch&,
            const DimensionedField<vector, volMesh>&,
            const dictionary&
        );

        //- Construct by mapping given
        //  uniformInterstitialInletVelocityFvPatchVectorField
        //  onto a new patch
        uniformInterstitialInletVelocityFvPatchVectorField
        (
            const uniformInterstitialInletVelocityFvPatchVectorField&,
            const fvPatch&,
            const DimensionedField<vector, volMesh>&,
            const fvPatchFieldMapper&
        );

        //- Construct as copy
        uniformInterstitialInletVelocityFvPatchVectorField
        (
            const uniformInterstitialInletVelocityFvPatchVectorField&
        );

        //- Construct and return a clone
        virtual tmp<fvPatchVectorField> clone() const
        {
            return tmp<fvPatchVectorField>
            (
                new uniformInterstitialInletVelocityFvPatchVectorField
                    (*this)
            );
        }

        //- Construct as copy setting internal field reference
        uniformInterstitialInletVelocityFvPatchVectorField
        (
            const uniformInterstitialInletVelocityFvPatchVectorField&,
            const DimensionedField<vector, volMesh>&
        );

        //- Construct and return a clone setting internal field reference
        virtual tmp<fvPatchVectorField> clone
        (
            const DimensionedField<vector, volMesh>& iF
        ) const
        {
            return tmp<fvPatchVectorField>
            (
                new uniformInterstitialInletVelocityFvPatchVectorField
                    (*this, iF)
            );
        }


    // Member functions

        // Mapping functions

            //- Map (and resize as needed) from self given a mapping object
            virtual void autoMap
            (
                const fvPatchFieldMapper&
            );

            //- Reverse map the given fvPatchField onto this fvPatchField
            virtual void rmap
            (
                const fvPatchVectorField&,
                const labelList&
            );


        // Evaluation functions

            //- Update the coefficients associated with the patch field
            virtual void updateCoeffs();

        //- Write
        virtual void write(Ostream&) const;

};


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif

// ************************************************************************* //
Vitor Monteiro 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
Time dependant pressure boundary condition yosuke1984 OpenFOAM Verification & Validation 3 May 6, 2015 06:16
plot over time fferroni OpenFOAM Post-Processing 7 June 8, 2012 07:56
External Radiation Boundary Condition (Two sided wall), Grid Interface CFD XUE FLUENT 0 July 8, 2010 06:49
vorticity boundary condition bearcharge Main CFD Forum 0 May 14, 2010 11:32
Time Varying Boundary Conditon ashish CFX 3 February 15, 2005 06:21


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