Files
phasicFlow/src/Integration/AdamsBashforth2/AdamsBashforth2.hpp

141 lines
3.0 KiB
C++
Raw Normal View History

2022-09-05 01:56:29 +04:30
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
2022-12-10 01:32:54 +03:30
#ifndef __AdamsBashforth2_hpp__
#define __AdamsBashforth2_hpp__
2022-09-05 01:56:29 +04:30
2022-12-10 01:32:54 +03:30
#include "integration.hpp"
#include "pointFields.hpp"
2024-10-18 23:13:20 +03:30
#include "boundaryIntegrationList.hpp"
2022-09-05 01:56:29 +04:30
namespace pFlow
{
2023-04-23 12:47:12 -07:00
/**
* Second order Adams-Bashforth integration method for solving ODE
*
* This is a one-step integration method and does not have prediction step.
*
*/
2022-09-05 01:56:29 +04:30
class AdamsBashforth2
:
2024-01-21 13:26:23 -08:00
public integration,
public realx3PointField_D
2022-09-05 01:56:29 +04:30
{
2024-01-21 13:26:23 -08:00
private:
2022-09-05 01:56:29 +04:30
const realx3Field_D& initialValField_;
2024-10-18 23:13:20 +03:30
boundaryIntegrationList boundaryList_;
friend class processorAB2BoundaryIntegration;
2025-01-20 14:55:12 +03:30
protected:
2024-10-18 23:13:20 +03:30
const auto& dy1()const
{
return static_cast<const realx3PointField_D&>(*this);
}
2024-01-21 13:26:23 -08:00
auto& dy1()
{
return static_cast<realx3PointField_D&>(*this);
}
2025-01-20 14:55:12 +03:30
auto& initialValField()
{
return initialValField_;
}
2025-01-20 14:55:12 +03:30
boundaryIntegrationList& boundaryList()
{
return boundaryList_;
}
2022-09-05 01:56:29 +04:30
public:
/// Class info
ClassInfo("AdamsBashforth2");
2022-09-05 01:56:29 +04:30
2023-04-23 12:47:12 -07:00
// - Constructors
/// Construct from components
2022-09-05 01:56:29 +04:30
AdamsBashforth2(
const word& baseName,
2024-01-21 13:26:23 -08:00
pointStructure& pStruct,
const word& method,
const realx3Field_D& initialValField,
bool keepHistory);
2023-04-23 12:47:12 -07:00
/// Destructor
2025-01-20 14:55:12 +03:30
~AdamsBashforth2()override = default;
2022-09-05 01:56:29 +04:30
2023-04-23 12:47:12 -07:00
/// Add this to the virtual constructor table
2022-09-05 01:56:29 +04:30
add_vCtor(
integration,
AdamsBashforth2,
word);
2023-04-23 12:47:12 -07:00
// - Methods
2024-10-18 23:13:20 +03:30
void updateBoundariesSlaveToMasterIfRequested()override;
2024-01-21 13:26:23 -08:00
/// return integration method
word method()const override
{
return "AdamsBashforth2";
}
2022-09-05 01:56:29 +04:30
2023-04-23 12:47:12 -07:00
bool predict(
real UNUSED(dt),
2024-01-21 13:26:23 -08:00
realx3PointField_D& UNUSED(y),
realx3PointField_D& UNUSED(dy)) final;
bool predict(
real dt,
realx3Field_D& y,
realx3PointField_D& dy) final;
2023-04-23 12:47:12 -07:00
bool correct(
real dt,
2024-01-21 13:26:23 -08:00
realx3PointField_D& y,
2025-01-20 21:02:50 +03:30
realx3PointField_D& dy,
real damping = 1.0) override;
2022-09-05 01:56:29 +04:30
2024-10-18 23:13:20 +03:30
bool correctPStruct(
real dt,
2024-10-18 23:13:20 +03:30
pointStructure& pStruct,
2025-01-20 14:55:12 +03:30
realx3PointField_D& vel) override;
/*bool hearChanges
(
const timeInfo& ti,
const message& msg,
const anyList& varList
) override;*/
2022-09-05 01:56:29 +04:30
};
} // pFlow
2022-12-10 01:32:54 +03:30
#endif //__integration_hpp__