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

Using atmBoundaryLayerInletVelocity with a CSV file or table

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By HPE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 15, 2022, 16:50
Default Using atmBoundaryLayerInletVelocity with a CSV file or table
  #1
New Member
 
Join Date: Mar 2022
Posts: 1
Rep Power: 0
Hadi_ZK is on a distinguished road
Dear All,
I am using atmBoundaryLayerInletVelocity for my velocity inlet and one my variables needs to be time dependent (Uref).
I have CSV file of my Uref with time varying.

on this link, I found a solution but i have some errors:

https://www.openfoam.com/news/main-n...ary-conditions

my error is:

Code:
 FOAM FATAL ERROR: (openfoam-2112)
[9] unallocated autoPtr of type N4Foam9Function1INS_6VectorIdEEEE
[9] 
[9]     From T* Foam::autoPtr<T>::operator->() [with T = Foam::Function1<Foam::Vector<double> >]
[9]     in file /project/dsi/apps/easybuild/software/OpenFOAM/v2112-foss-2021b/OpenFOAM-v2112/src/OpenFOAM/lnInclude/autoPtrI.H at line 178.
[9] [0] [1] 
[1]

I tried to use table and my 0/U file is:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Uinlet          (-5 -5 0);

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

internalField   uniform (0 0 0);

boundaryField
{
	
Inlet
{
    type            atmBoundaryLayerInletVelocity;
    flowDir         table
    (
        (  0    (1 0 0))
        (  10   (1 0 0))
        (  20   (0 1 0))
        ( 100   (0 1 0))
    );

    zDir            (0 0 1);

    Uref            table
    (
        (  0    10)
        (  10   10)
        (  20   20)
        ( 100   20)
    );

    Zref            20;
    z0              uniform 0.1;
    zGround         uniform 935.0;
}
	
	
	

    outlet
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }

    wall
    {
        type            noSlip;
    }

    #includeEtc "caseDicts/setConstraintTypes"
}

// ************************************************************************* //
any suggestion about unallocated autoPtr error?

Bests,
Hadi
Hadi_ZK is offline   Reply With Quote

Old   March 29, 2022, 08:22
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
I think there is a bug being introduced recently. Apply the changes below and see if your case runs.



Code:
+++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C
+++ b/src/atmosphericModels/derivedFvPatchFields/atmBoundaryLayer/atmBoundaryLayer.C
@@ -115,10 +115,10 @@ atmBoundaryLayer::atmBoundaryLayer(const atmBoundaryLayer& abl)
     ppMin_(abl.ppMin_),
     time_(abl.time_),
     patch_(abl.patch_),
-    flowDir_(abl.flowDir_),
-    zDir_(abl.zDir_),
-    Uref_(abl.Uref_),
-    Zref_(abl.Zref_),
+    flowDir_(abl.flowDir_.clone()),
+    zDir_(abl.zDir_.clone()),
+    Uref_(abl.Uref_.clone()),
+    Zref_(abl.Zref_.clone()),
saladbowl likes this.
HPE is offline   Reply With Quote

Old   June 1, 2022, 13:25
Default
  #3
New Member
 
Juan Salazar
Join Date: Jun 2019
Posts: 19
Rep Power: 7
saladbowl is on a distinguished road
I also came across this bug, even when using a constant value for Uref. The issue arises when using a transient solver such as pimplefoam. Can confirm the patch works. Thanks!
saladbowl is online now   Reply With Quote

Reply

Tags
autoptr, csv, csvfile


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
[swak4Foam] Installation Problem with OF 6 version Aurel OpenFOAM Community Contributions 14 November 18, 2020 17:18
OpenFoam "Permission denied" and "command not found" problems. iyidaniel@yahoo.co.uk OpenFOAM Running, Solving & CFD 11 January 2, 2018 07:47
polynomial BC srv537 OpenFOAM Pre-Processing 4 December 3, 2016 10:07
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 04:23
[swak4Foam] funkySetFields compilation error tayo OpenFOAM Community Contributions 39 December 3, 2012 06:18


All times are GMT -4. The time now is 14:46.