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

To achieve moving boundary

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 9, 2019, 04:45
Default To achieve moving boundary
  #1
ewz
New Member
 
ewz
Join Date: May 2019
Posts: 3
Rep Power: 6
ewz is on a distinguished road
Hi,Foamers,
I have tried to revise oscillatingDisplacement to achieve moving boundary which the motion of the boundary was a function of spatial position and time(such as f(x,t)). After I compiled the new oscillatingDynamic, there were some errors. The new oscillatingDynamic and the error were as follows:
Code:
void oscillatingDynamicPointPatchVectorField::updateCoeffs()
{
    if (this->updated())
    {
        return;
    }

    const pointPatch& p = this->patch();
    const polyMesh& mesh = this->internalField().mesh()();
    const Time& t = mesh.time();
    
       scalar x = p.x();
    
       Field<vector>::operator=(amplitude_*cos(omega_*t.value()))*sin((x-0.1)*6.28/0.1));
    
    fixedValuePointPatchField<vector>::updateCoeffs();
}
Code:
pointPatchFields/derived/oscillatingDynamic/oscillatingDynamicPointPatchVectorField.C: In member function ‘virtual void Foam::oscillatingDynamicPointPatchVectorField::updateCoeffs()’:
pointPatchFields/derived/oscillatingDynamic/oscillatingDynamicPointPatchVectorField.C:112:21: error: ‘const class Foam::pointPatch’ has no member named ‘x’
        scalar x = p.x();
                     ^
pointPatchFields/derived/oscillatingDynamic/oscillatingDynamicPointPatchVectorField.C:114:87: error: invalid operands of types ‘void’ and ‘Foam::doubleScalar {aka double}’ to binary ‘operator*’
 ld<vector>::operator=(amplitude_*cos(omega_*t.value()))*sin((x-0.1)*6.28/0.1));
                                                                             ^
And I really hope that someone can tell me how to define spatial position to achieve the motion of boundary above-mentioned. Thanks a lot.
ewz is offline   Reply With Quote

Old   September 20, 2019, 06:54
Default patch field does not correspond to the meshPoints
  #2
ewz
New Member
 
ewz
Join Date: May 2019
Posts: 3
Rep Power: 6
ewz is on a distinguished road
After times trying,the new pointdisplacement has been successfully compiled, but when I try to do simulation of moving boundary,there are errors as follows:

Code:
given patch field does not correspond to the meshPoints. Field size: 0 meshPoints size: 4221

    From function void Foam::pointPatchField<Type>::setInInternalField(Foam::Field<Type2>&, const Foam::Field<Type2>&, const labelList&) const [with Type1 = Foam::Vector<double>; Type = Foam::Vector<double>; Foam::labelList = Foam::List<int>]

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  void Foam::pointPatchField<Foam::Vector<double> >::setInInternalField<Foam::Vector<double> >(Foam::Field<Foam::Vector<double> >&, Foam::Field<Foam::Vector<double> > const&) const at ??:?
#3  Foam::oscillatingDynamicPointPatchVectorField::updateCoeffs() at ??:?
#4  Foam::displacementLaplacianFvMotionSolver::solve() at ??:?
#5  Foam::motionSolver::newPoints() at ??:?
#6  Foam::dynamicMotionSolverFvMesh::update() at ??:?
#7  ? at ??:?
#8  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#9  ? at ??:?
It seems like the patch field have no meshpoints;
And I don't know how to solve the problem;
I really appreciate it if someone could give me your advices. Thanks a lot.

Last edited by ewz; September 20, 2019 at 08:07.
ewz is offline   Reply With Quote

Old   September 24, 2019, 05:35
Default new problem
  #3
ewz
New Member
 
ewz
Join Date: May 2019
Posts: 3
Rep Power: 6
ewz is on a distinguished road
The error that patch field don't correspond to meshpoints had been solved.
But a new problem was coming as follows:
Code:
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2  ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::GAMGSolver::scale(Foam::Field<double>&, Foam::Field<double>&, Foam::lduMatrix const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, Foam::Field<double> const&, unsigned char) const at ??:?
#4  Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMatrix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const at ??:?
#5  Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
#6  Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) at ??:?
#7  Foam::fvMatrix<double>::solve(Foam::dictionary const&) at ??:?
#8  ? at ??:?
#9  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#10  ? at ??:?
ewz is offline   Reply With Quote

Old   April 5, 2023, 05:43
Default
  #4
New Member
 
Grp
Join Date: Feb 2023
Posts: 14
Rep Power: 3
GrpOne123 is on a distinguished road
Hello, have you solved this problem? I'm having the same issue now.
GrpOne123 is offline   Reply With Quote

Reply

Tags
moving boundary


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
Domain Imbalance HMR CFX 5 October 10, 2016 05:57
Velocity vector in impeller passage ngoc_tran_bao CFX 24 May 3, 2016 21:16
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 08:44
Problem in setting Boundary Condition Madhatter92 CFX 12 January 12, 2016 04:39
Low torque values on Screw Turbine Shaun Waters CFX 34 July 23, 2015 08:16


All times are GMT -4. The time now is 05:49.