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 __AdamsBashforth3_hpp__
|
|
|
|
#define __AdamsBashforth3_hpp__
|
2022-09-05 01:56:29 +04:30
|
|
|
|
|
|
|
|
2025-01-20 14:55:12 +03:30
|
|
|
#include "AdamsBashforth2.hpp"
|
2022-12-10 01:32:54 +03:30
|
|
|
#include "pointFields.hpp"
|
2025-01-20 14:55:12 +03:30
|
|
|
#include "boundaryIntegrationList.hpp"
|
2022-09-05 01:56:29 +04:30
|
|
|
|
|
|
|
|
2025-01-20 14:55:12 +03:30
|
|
|
namespace pFlow
|
2022-09-05 01:56:29 +04:30
|
|
|
{
|
|
|
|
|
|
|
|
|
2023-04-23 12:47:12 -07:00
|
|
|
/**
|
|
|
|
* Third 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 AdamsBashforth3
|
|
|
|
:
|
2025-01-20 14:55:12 +03:30
|
|
|
public AdamsBashforth2
|
2022-09-05 01:56:29 +04:30
|
|
|
{
|
2025-01-20 14:55:12 +03:30
|
|
|
private:
|
2023-04-23 12:47:12 -07:00
|
|
|
|
2025-01-20 14:55:12 +03:30
|
|
|
friend class processorAB3BoundaryIntegration;
|
|
|
|
|
|
|
|
realx3PointField_D dy2_;
|
|
|
|
|
|
|
|
protected:
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2025-01-20 14:55:12 +03:30
|
|
|
const auto& dy2()const
|
|
|
|
{
|
|
|
|
return dy2_;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto& dy2()
|
|
|
|
{
|
|
|
|
return dy2_;
|
|
|
|
}
|
|
|
|
|
2022-09-05 01:56:29 +04:30
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
// type info
|
2022-12-10 01:32:54 +03:30
|
|
|
TypeInfo("AdamsBashforth3");
|
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
|
|
|
AdamsBashforth3(
|
|
|
|
const word& baseName,
|
2025-01-20 14:55:12 +03:30
|
|
|
pointStructure& pStruct,
|
|
|
|
const word& method,
|
|
|
|
const realx3Field_D& initialValField);
|
2023-04-23 12:47:12 -07:00
|
|
|
|
2022-09-05 01:56:29 +04:30
|
|
|
|
2023-04-23 12:47:12 -07:00
|
|
|
/// Destructor
|
2025-01-20 14:55:12 +03:30
|
|
|
~AdamsBashforth3() 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,
|
|
|
|
AdamsBashforth3,
|
|
|
|
word);
|
|
|
|
|
|
|
|
|
2023-04-23 12:47:12 -07:00
|
|
|
// - Methods
|
|
|
|
|
2025-01-20 14:55:12 +03:30
|
|
|
void updateBoundariesSlaveToMasterIfRequested()override;
|
|
|
|
|
|
|
|
/// return integration method
|
|
|
|
word method()const override
|
|
|
|
{
|
|
|
|
return "AdamsBashforth3";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool correct(
|
|
|
|
real dt,
|
|
|
|
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
|
|
|
|
2025-01-20 14:55:12 +03:30
|
|
|
bool correctPStruct(
|
|
|
|
real dt,
|
|
|
|
pointStructure& pStruct,
|
|
|
|
realx3PointField_D& vel) override;
|
|
|
|
|
|
|
|
|
2025-02-08 18:06:30 +03:30
|
|
|
/*bool hearChanges
|
2025-01-20 14:55:12 +03:30
|
|
|
(
|
2025-02-06 11:04:30 +03:30
|
|
|
const timeInfo& ti,
|
2025-01-20 14:55:12 +03:30
|
|
|
const message& msg,
|
|
|
|
const anyList& varList
|
2025-02-08 18:06:30 +03:30
|
|
|
) override;*/
|
2022-10-25 19:30:57 +03:30
|
|
|
|
2022-09-05 01:56:29 +04:30
|
|
|
};
|
|
|
|
|
|
|
|
|
2025-01-20 14:55:12 +03:30
|
|
|
/*template<typename activeFunctor>
|
2022-09-05 01:56:29 +04:30
|
|
|
bool pFlow::AdamsBashforth3::intRange(
|
|
|
|
real dt,
|
|
|
|
realx3Vector_D& y,
|
|
|
|
realx3Vector_D& dy,
|
|
|
|
activeFunctor activeP )
|
|
|
|
{
|
2024-01-29 07:57:19 -08:00
|
|
|
auto d_dy = dy.deviceViewAll();
|
|
|
|
auto d_y = y.deviceViewAll();
|
|
|
|
auto d_history = history_.deviceViewAll();
|
2022-09-05 01:56:29 +04:30
|
|
|
auto activeRng = activeP.activeRange();
|
|
|
|
|
|
|
|
Kokkos::parallel_for(
|
|
|
|
"AdamsBashforth3::correct",
|
|
|
|
rpIntegration (activeRng.first, activeRng.second),
|
|
|
|
LAMBDA_HD(int32 i){
|
|
|
|
if( activeP(i))
|
|
|
|
{
|
|
|
|
auto ldy = d_dy[i];
|
|
|
|
d_y[i] += dt*( static_cast<real>(23.0 / 12.0) * ldy
|
|
|
|
- static_cast<real>(16.0 / 12.0) * d_history[i].dy1_
|
|
|
|
+ static_cast<real>(5.0 / 12.0) * d_history[i].dy2_);
|
|
|
|
d_history[i] = {ldy ,d_history[i].dy1_};
|
|
|
|
}
|
|
|
|
});
|
|
|
|
Kokkos::fence();
|
|
|
|
|
|
|
|
return true;
|
2025-01-20 14:55:12 +03:30
|
|
|
}*/
|
2022-09-05 01:56:29 +04:30
|
|
|
|
|
|
|
} // pFlow
|
|
|
|
|
2022-12-10 01:32:54 +03:30
|
|
|
#endif //__integration_hpp__
|