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

vectorCodedSource problems

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By IC01

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 22, 2020, 18:07
Default vectorCodedSource problems
  #1
New Member
 
Illia
Join Date: Aug 2020
Posts: 10
Rep Power: 5
IC01 is on a distinguished road
Hi
I have the problem with vectorCodedSource; in fvOption file
I'm modifying incompressible/simpleFoam/rotorDisk tutorial. The target is to have either polynomial or tabular velocity in the RotatingZone. Please let me know if there is a simpler way
Right now I'm trying to put velocity in the y-direction that corresponds to the y coordinate of cell. It gives me not feasible values

Thank you


Code:
{
 

    type            vectorCodedSource;
    active          true;
    selectionMode   cellZone;
    cellZone        rotatingZone;

    fields          (U);
    name            codedSource;
    codeAddSup
    #{
        const Time& time = mesh().time();
	const scalarField& V = mesh_.V();
        vectorField& USource = eqn.source();
       // const scalarField& cellx = mesh_.C().component(0) ; 
        const scalarField& celly = mesh_.C().component(1) ;
      //  const scalarField& cellz = mesh_.C().component(2) ;
      

        // Start time
        const scalar startTime = 20.0;  

 	if (time.value() > startTime)

    
        forAll(celly, i)
        {
            scalar v1 = 0 ;
	    scalar v2 = celly[i] ;
	    scalar v3 = 0 ;


            USource[i][0] +=celly[i]; //celly[i];
        }
    #};

}
Mahmoud Abbaszadeh likes this.
IC01 is offline   Reply With Quote

Old   May 31, 2022, 08:08
Default
  #2
Member
 
Mahmoud
Join Date: Nov 2020
Location: United Kingdom
Posts: 43
Rep Power: 5
Mahmoud Abbaszadeh is on a distinguished road
Quote:
Originally Posted by IC01 View Post
Hi
I have the problem with vectorCodedSource; in fvOption file
I'm modifying incompressible/simpleFoam/rotorDisk tutorial. The target is to have either polynomial or tabular velocity in the RotatingZone. Please let me know if there is a simpler way
Right now I'm trying to put velocity in the y-direction that corresponds to the y coordinate of cell. It gives me not feasible values

Thank you


Code:
{
 

    type            vectorCodedSource;
    active          true;
    selectionMode   cellZone;
    cellZone        rotatingZone;

    fields          (U);
    name            codedSource;
    codeAddSup
    #{
        const Time& time = mesh().time();
	const scalarField& V = mesh_.V();
        vectorField& USource = eqn.source();
       // const scalarField& cellx = mesh_.C().component(0) ; 
        const scalarField& celly = mesh_.C().component(1) ;
      //  const scalarField& cellz = mesh_.C().component(2) ;
      

        // Start time
        const scalar startTime = 20.0;  

 	if (time.value() > startTime)

    
        forAll(celly, i)
        {
            scalar v1 = 0 ;
	    scalar v2 = celly[i] ;
	    scalar v3 = 0 ;


            USource[i][0] +=celly[i]; //celly[i];
        }
    #};

}

Hi,

Did you manage to resolve this issue?
Mahmoud Abbaszadeh is offline   Reply With Quote

Old   December 11, 2022, 21:01
Default the cell volume is missed
  #3
New Member
 
Haitham Osman
Join Date: Jan 2020
Posts: 6
Rep Power: 6
Haitham Osman CFD is on a distinguished road
I hope your issue was solved.

If NOT, I think you should multiply your equation by the cell volume. So, the equation should be like

USource[i][0] +=celly[i] *V[i]

Best wishes
Haitham Osman CFD 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
[ICEM] Problems with coedge curves and surfaces tommymoose ANSYS Meshing & Geometry 6 December 1, 2020 11:12
[mesh manipulation] Problems with rotational cyclic boundaries TReviol OpenFOAM Meshing & Mesh Conversion 8 July 11, 2014 03:45
[ICEM] Flow channel meshing problems StefanG ANSYS Meshing & Geometry 19 May 15, 2012 06:44
Two-phase air water flow problems by activating Wall Lubrication Force challenger85 CFX 5 November 5, 2009 05:44
Help required to solve Hydraulic related problems aero CFX 0 October 30, 2006 11:00


All times are GMT -4. The time now is 15:13.